aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
Commit message (Collapse)AuthorAge
* config: allow whitespaces in config pathLibravatar columbarius2021-03-25
|
* Log when config file is not foundLibravatar Simon Ser2021-01-17
| | | | | This happens when Sway is not installed on the system, so there's no default config in /etc.
* Raise verbosity of error message in load_main_configLibravatar Simon Ser2021-01-17
|
* Reload command now matches i3's implementationLibravatar Geoffrey Casper2020-07-07
|
* Remove code related to the security featuresLibravatar Érico Rolim2020-05-21
| | | | | | - Remove struct definitions - Remove struct members - Remove initializations and frees
* config: fix unfocused text colorLibravatar Thomas Hebb2020-04-04
| | | | | | This color, both in i3 and as described in sway(5), defaults to #888888. However, the actual default also has an alpha of 88 instead of FF, meaning it ends up significantly darker than intended.
* Change focus_on_window_activation default to urgentLibravatar Simon Ser2020-03-29
| | | | | | | | | | Before the default was "smart". This means a visible app could steal focus whenever it wanted to. This can be an issue since having focus allows for e.g. clipboard access. This commit changes the default to "urgent" instead. Closes: https://github.com/swaywm/sway/issues/5139
* config: fix validation exit code and log levelLibravatar Brian Ashworth2020-02-11
| | | | | | | | | This makes it so invalid configs will return the exit code 1 when the validation flag is given. This also reduces the log level to SWAY_ERROR, which makes it so only the errors are shown. If someone wants more verbose output, the can use the -V/--verbose or -d/--debug flags. Additionally, this also makes it so swaybg will not be spawned when validating the config.
* cmd_client_*: refactor duplicated codeLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | | This is the second in a series of commits to refactor the color handling in sway. This removes the duplicated color parsing code in sway/commands/client.c. Additionally, this combines the parsing of colors to float arrays with that in sway/config.c and introduces a color_to_rgba function in commom/util.c. As an added bonus, this also makes it so non of the colors in a border color class will be changed unless all of the colors specified are valid. This ensures that an invalid command does not get partially applied.
* config: apply input type configs on reloadLibravatar Brian Ashworth2019-12-04
| | | | | | When making the reload validation improvements, I forgot that input type configs are stored in a separate list. This makes it so input type configs are correctly applied on reload.
* config: improvements to the reload validationLibravatar Brian Ashworth2019-11-27
| | | | | | | | For the validation pass of reloading, there is no need to touch swaybg, swaynag, inputs, outputs, or seats. This drastically improves the speed of a reload by skipping over the expensive I/O configuration and handling of wayland clients. As long as the syntax is valid, the CMD_FAILURE's can be relayed during the actual reload.
* smart_borders: separate smartness from edge typesLibravatar Ronan Pigott2019-11-04
|
* Fix various memory leaksLibravatar lbonn2019-11-01
| | | | Found with clang-tidy
* Skip line continuation when it is a commentLibravatar Robert Günzler2019-10-31
| | | | | | | | | | | | | Currently commented lines ending in the backslash character will be concatenated with the following line. ``` # with this comment \ exec swaynag -m 'will not run' ``` This change modifies `getline_with_cont` to stop reading when the initial character is a '#'.
* cmd_xwayland: add force for immediate launchLibravatar Brian Ashworth2019-08-20
| | | | | | | This just adds a force option to cmd_xwayland that allows for xwayland to be immediately launched instead of lazily launched. This is useful for slower machines so it can be part of the startup time instead of when the user is actively trying to use it
* cmd_bindswitch: add option to execute on reloadLibravatar Brian Ashworth2019-07-09
| | | | | | | This adds a --reload flag to cmd_bindswitch that allows for the binding to be executed on reload. One possible use case for this is to allow users to disable outputs when the lid closes and enable them when the lid opens without having to open and re-close the lid after a reload.
* config/xwayland: retain xwayland status on reloadLibravatar Brian Ashworth2019-06-19
| | | | | | | | | | Since xwayland can only be enabled/disabled at launch, the xwayland status should be retained on reload. Having `xwayland enabled|disabled` in the config, should not cause `config->xwayland` to be invalid on reload. This also returns `CMD_FAILURE` with a message that xwayland can only be enabled/disabled on launch when trying to set the invalid status on reload. This allows swaynag to notify the user that the change will not take effect until sway is restarted.
* bindings: defer while initiailizingLibravatar Brian Ashworth2019-06-12
| | | | | | | | This adds the logic to defer binding execution while sway is still initializing. Without this, the binding command would be executed, but the command handler would return CMD_DEFER, which was being treated as a failure to run. To avoid partial executions, this will defer all bindings while config->active is false.
* Destroy swaybg client on reloadLibravatar Brian Ashworth2019-05-04
| | | | | | | | | | | | | When reloading, this destroys the old config's swaybg client before spawning the new config's swaybg. This fixes a race condition where the old config's swaybg client's destroy was being called after the new config's swaybg client was being spawned. This was causing the reference to the new swaybg client to be removed and never destroyed. This also modifies handle_swaybg_client_destroy to grab the config reference using wl_container_of on the listener since the swaybg client may be the old config swaybg client and should be used instead of the global config instance
* config: fix clang warningLibravatar Konstantin Pospelov2019-04-26
|
* bindsym: change xkb_rule_names initializationLibravatar Konstantin Pospelov2019-04-26
|
* bindsym: consider xkb_rule_names for --to-codeLibravatar Konstantin Pospelov2019-04-26
|
* bindsym: change default keymap for --to-codeLibravatar Konstantin Pospelov2019-04-26
| | | | Replace XKB_DEFAULT_LAYOUT with NULL as the default layout.
* config: simplify keysym translation fieldsLibravatar Konstantin Pospelov2019-04-26
| | | | Do not store `xkb_keymap` since it can be retrieved from `xkb_state`.
* Implement bindsym --to-codeLibravatar Konstantin Pospelov2019-04-26
| | | | | | | | | | | | * `bindsym --to-code` enables keysym to keycode translation. * If there are no `xkb_layout` commands in the config file, the translation uses the XKB_DEFAULT_LAYOUT value. * It there is one or more `xkb_layout` command, the translation uses the first one. * If the translation is unsuccessful, a message is logged and the binding is stored as BINDING_KEYSYM. * The binding keysyms are stored and re-translated when a change in the input configuration may affect the translated bindings.
* Implement input type configs (#3784)Libravatar Benjamin Cheng2019-04-14
| | | | | | | | | | | Add support for configurations that apply to a type of inputs (i.e. natural scrolling on all touchpads). A type config is differentiated by a `type:` prefix followed by the type it corresponds to. When new devices appear, the device config is merged on top of its type config (if it exists). New type configs are applied on top of existing configs.
* Spawn swaynag as a wayland clientLibravatar Brian Ashworth2019-04-14
| | | | | This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done
* swaybg: one instance for all outputsLibravatar Brian Ashworth2019-04-04
| | | | | | | | | This makes it so there will only be one swaybg instance running instead of one per output. swaybg's cli has been changed to a xrandr like interface, where you select an output and then change properties for that output and then select another output and repeat. This also makes it so swaybg is only killed and respawned when a background changes or when reloading.
* Support WLR_INPUT_DEVICE_SWITCH in swayLibravatar Ryan Walklin2019-03-19
| | | | | | | | | | | | | | | | | | | | | This commit adds support for laptop lid and tablet mode switches as provided by evdev/libinput and handled by wlroots. Adds a new bindswitch command with syntax: bindswitch <switch>:<state> <command> Where <switch> is one of: tablet for WLR_SWITCH_TYPE_TABLET_MODE lid for WLR_SWITCH_TYPE_LID <state> is one of: on for WLR_SWITCH_STATE_ON off for WLR_SWITCH_STATE_OFF toggle for WLR_SWITCH_STATE_TOGGLE (Note that WLR_SWITCH_STATE_TOGGLE doesn't map to libinput and will trigger at both on and off events)
* add --i3 flag to hide_edge_bordersLibravatar db2019-02-24
| | | | | | | Enables i3-compatible behavior regarding hiding the title bar on tabbed and stacked containers with one child. Related issues and merge requests: #3031, #3002, #2912, #2987.
* Make load_include_configs void. Fix some cases where WD would not be restored.Libravatar Connor E2019-02-24
|
* Fix reload freeze when not modsetting current modeLibravatar Brian Ashworth2019-02-16
| | | | | | | | | | | | | | | | | | | | | | This fixes the issue of the display freezing on reload with wlroots#1545. On master, all output configs are applied on reload. This may cause an output to have its config applied up to three times, instead of just once. The three cases are: output name, output identifier, and wildcard. Not only is this inefficient, but it can cause swaybg to be spawned and immediately killed. However, swaybg requires two roundtrips of wl_display (to obtain needed globals) before it enters its normal event loop. Modesetting will roundtrip the wl_display. Without modesetting, waitpid for killing swaybg could block infinitely due to swaybg being blocked by wl_display_roundtrip. This only configured an output once. It either uses the wildcard config or creates an empty wildcard config and applies that. This also fixes a bug where an output would not be reset when there is no output config to apply to it.
* fix misc memory leaksLibravatar Brian Ashworth2019-02-11
| | | | | | | | | This fixes a few misc memory leaks reported by asan: - Items of `config->config_chain` are now freed instead of just the list itself - `bar->swaybar_command` is now freed - The result returned by a seat subcommand is now returned instead of leaked
* Revert "Return false if config could not be loaded."Libravatar Drew DeVault2019-02-07
| | | | This reverts commit 855368b67e8b7d0b1dd035bde7f9119d37b35e5d.
* Revert "Restore CWD if returning early."Libravatar Drew DeVault2019-02-07
| | | | This reverts commit 921e42c6c06212a61d899d6335d95eb4c781e2e8.
* load_main_config: use given path, store realpathLibravatar Brian Ashworth2019-02-07
| | | | | | | | | | | Since `load_include_config` compares against the realpath of a config file when checking if a config has already been added, the main config's realpath has to be added to the config_chain. However, includes from the main config should be processed relative to the path given to allow for symbolic links. This stores the realpath in `config->config_chain`, but uses the given path for all other operations.
* Restore CWD if returning early.Libravatar Connor E2019-02-06
|
* Return false if config could not be loaded.Libravatar Connor E2019-02-06
|
* load_main_config: add realpath to config_chainLibravatar Brian Ashworth2019-02-06
| | | | | | Since `load_include_config` compares against the realpath of a config file when checking if a config has already been added, the main config's realpath has to be added to the config_chain.
* load_include_configs: fix wordexp fail conditionLibravatar Brian Ashworth2019-02-05
| | | | | | | This fixes the failure condition for the wordexp call in load_include_configs. The only success value is zero. Since the error codes are positive, having the check be less than zero was causing segfaults on failure when accessing the words.
* seat_cmd_cursor: do not create non-existing seatLibravatar Brian Ashworth2019-02-03
| | | | | | | | If a seat does not exist in seat_cmd_cursor, do not create it. A seat without any attachments is useless since it will have no capabilities. This changes `input_manager_get_seat` to have an additional argument that dictates whether or not to create the seat if it does not exist.
* Skip wildcard seat config in destroy_removed_seatsLibravatar vilhalmer2019-02-03
|
* Cleanup config reading failure error logsLibravatar Brian Ashworth2019-01-29
| | | | | | | | | | | | | | This cleans up the log when sway fails to read a config file. The following changes have been made: - A missing error message has been added to the log when the config file is a directory instead of a regular file - In main, `goto` statements have been added after the `sway_terminate` calls instead of wrapping every block in `if (!terminate_request)` - Unnecessary NULL-checks around calls to free in `main` have been removed - Deferred command execution has been extracted to a separate function and the `Running deferred commands` log message will not be shown when there are no deferred commands.
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* Remove 'input' field of IPC command return jsonLibravatar M Stoeckl2019-01-14
| | | | | | | | This field is not in i3 and provides imprecise and redundant information. (Specifically, when swaymsg is given a list of commands, the IPC return array already indicates precisely which number command failed; knowing the name of the command is not useful when multiple commands of the same type are provided.)
* Merge pull request #3144 from emersion/cmd-xwaylandLibravatar Drew DeVault2019-01-13
|\ | | | | Add xwayland command
| * Add xwayland commandLibravatar emersion2018-11-19
| |
* | Merge pull request #3388 from RedSoxFan/reset-inputs-on-reloadLibravatar Drew DeVault2019-01-13
|\ \ | | | | | | reload: reset input configs
| * | reload: reset input configsLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | This resets all input options to their defaults on reload. This also fixes some debug log typos in `input_manager_libinput_config_pointer`.
* | | config: fix line number with continued linesLibravatar Brian Ashworth2019-01-11
| | | | | | | | | | | | | | | | | | | | | When the config has continued lines, `get_line_with_cont` may read more than one line of the actual file. When displaying line numbers for error messages, they should be the line number in the file to make it easy to find and fix the issue.