aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config
Commit message (Collapse)AuthorAge
* config/output: fix typo in merge_id_on_name1.1-rc2Libravatar Brian Ashworth2019-05-11
| | | | | | | | | This fixes a typo in `merge_id_on_name` for output configs that resulted in incorrect id-on-name output configs being generated. Instead of using the output that matched the name or identifier, the first output in the list was being used instead. This could cause merging across unrelated output configs and preventing output configs from being applied correctly
* Destroy swaybg client on reloadLibravatar Brian Ashworth2019-05-11
| | | | | | | | | | | | | 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
* bindsym: change xkb_rule_names initializationLibravatar Konstantin Pospelov2019-04-26
|
* bindsym: consider xkb_rule_names for --to-codeLibravatar Konstantin Pospelov2019-04-26
|
* 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
* config/output: unbreak on 32-bit architecturesLibravatar Jan Beich2019-04-08
| | | | | | | | | | sway/config/output.c:624:54: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] sway_log(SWAY_DEBUG, "spawn_swaybg cmd[%ld] = %s", k, cmd[k]); ~~~ ^ %zu include/log.h:40:74: note: expanded from macro 'sway_log' _sway_log(verb, "[%s:%d] " fmt, _sway_strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^~~~~~~~~~~
* 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.
* Add support for manually setting subpixel hinting on outputs.Libravatar Geoff Greer2019-03-24
| | | | | | Many laptop screens report unknown subpixel order. Allow users to manually set subpixel hinting to work around this. Addresses https://github.com/swaywm/sway/issues/3163
* config/output: handle wildcard in get_output_configLibravatar Brian Ashworth2019-03-17
| | | | | | | | | | | In #3916, I overlooked that `get_output_config` does not handle wildcards unless the config is reloading, which is a remnant of older iterations of the output config handling that went unnoticed due to `output_find_config` handling it. With the current version of the output config handling, having `get_output_config` handle wildcard configs is actually preferable. This fixes having only a wildcard output config in the config file or when connecting/enabling a new output with only a wildcard config existing.
* config/output: revamp identifier/name layeringLibravatar Brian Ashworth2019-03-16
| | | | | | | | | | | | | | | | | | | | | | This revamps the way that output configs are handled when referencing an output by both identifier and name. If an output is always referred to by name or by identifier, this should have no noticeable change. As soon as there is a name output config and an identifier output config that matches an output, an output config is generated that is named `<identifier> on <name>` that is generated with the identifier output config merged on top of the name output config and stored. When a change to either is stored, the delta is merged on top of that "id on name" output config, as well. If the "id on name" output config exists, it has the highest precedence and will be used when applying a config to the output. This fixes the following case: - `swaymsg output <name> bg /path/to/wallpaper1 fill` - `swaymsg output <identifier> bg /path/to/wallpaper2 fill` - `swaymsg output <name> dpms on` Without this, the wallpaper is changed to `/path/to/wallpaper1`. With this, the wallpaper remains `/path/to/wallpaper2`.
* Fix output config retrieval for new outputsLibravatar Brian Ashworth2019-03-16
| | | | | | | | | | | | | | | | | | | This removes `output_find_config`, which would take the first matching output config it found. This is fine if only a name output config, identifier output config, or even just wildcard exist, but if there is a name output config and identifier output config, they are not merged. Instead, this introduces find_output_config, which is just a wrapper for `get_output_config`. This ensures that both the name and identifier output configs are respected. This fixes the following case: - For simplicity in this example, remove all output configs from config - Run `swaymsg output <name> bg #ff0000 solid_color` - Run `swaymsg output <identifier> scale 2` - Disconnect and reconnect output Without this, the output will have the background, but not the scale. With this, the output will have both the background and scale
* Stop using wlr_output->{lx,ly}Libravatar emersion2019-03-11
| | | | | Also fixes sway_output->{lx,ly,width,height} not being updated. Also fixes output_get_in_direction adding buffer coords to layout coords.
* Fixes crash in spawn_swaybg (closes #3733)Libravatar Noam Preil2019-03-03
|
* config: remove double assignement to result in get_output_configLibravatar Rouven Czerwinski2019-02-27
|
* Don't use SOCK_CLOEXECLibravatar emersion2019-02-19
| | | | Manually set the CLOEXEC flag instead, since SOCK_CLOEXEC isn't POSIX.
* Disconnect swaybg instead of killing itLibravatar emersion2019-02-16
| | | | | This is much more reliable. This also fixes race conditions when killing swaybg while it's doing a wl_display_roundtrip.
* 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.
* apply_output_config: dpms on before modesetLibravatar Brian Ashworth2019-02-15
| | | | | | | | | | | | On the DRM backend, if an output is dpms'd off and a different output is hotplugged, the CRTC for the output is reclaimed. When modesetting an output without a CRTC, a CRTC will not be given to an output that is not desired to be enabled. This splits setting the dpms state in apply_output_config. If the output should be dpms on, the it is enabled before attempting to modeset. Otherwise, it is dpms'd off after setting everything else. This also adds DPMS_ON to the default output configs.
* 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 "More frees."Libravatar Connor E2019-02-01
| | | | This reverts commit eda1bf769f239a9e8d5a9907255a330e3113a649.
* Revert "Add some missing frees."Libravatar Connor E2019-02-01
| | | | This reverts commit b5d95f264d5b08f6228e05be680ee36fc06ca6d6.
* pointer_constraint: change to a seat subcommandLibravatar Brian Ashworth2019-01-31
| | | | | | | | | | | | This changes the `pointer_constraint` command to be a subcommand of seat to allow for per-seat settings. The current implementation that is not a seat subcommand will only operate on the current seat and will segfault in the config due to `config->handler_context.seat` only being set at runtime. This also allows for the wildcard identifier to be used to alter the pointer constraint settings on all seats and allows for the setting to be merged with the rest of the seat config.
* Add pointer_constraint commandLibravatar Drew DeVault2019-01-30
|
* Don't allow noop output to be configuredLibravatar Ryan Dwyer2019-01-22
|
* Move sway-specific functions in common/util.c into sway/Libravatar M Stoeckl2019-01-21
| | | | | | Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
* 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.
* apply_output_config: remove output_iLibravatar Brian Ashworth2019-01-19
| | | | | output_i was used in apply_output_config when swaybar used wl_output index numbers instead of xdg-output names. This is no longer needed.
* Better handle outputs without CRTCLibravatar emersion2019-01-18
| | | | | | | This happens if you plug in more outputs than supported by your GPU. This patch makes it so outputs without CRTCs appear as disabled. As soon as they get a CRTC (signalled via the mode event), we can enable them.
* Don't use sh when spawning swaybgLibravatar emersion2019-01-17
|
* swaybg: use output names instead of output indexesLibravatar emersion2019-01-17
|
* bar_cmd_tray_bind: Use mouse button helpersLibravatar Brian Ashworth2019-01-16
| | | | | | | | | | | | | | | | This modifies `bar_cmd_tray_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `bar_cmd_tray_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like with sway bindings, the two commands are encapsulated in a single file to maximize shared code. This also modifies tray bindings to work off of events codes rather than x11 buttons, which allows for any mouse buttons to be used. For `get_bar_config`, `event_code` has been added to the `tray_bindings` section and will include to event code for the button. If the event code can be mapped to a x11 button, `input_code` will still be the x11 button number. Otherwise, `input_code` will be `0`.
* Merge pull request #3397 from RedSoxFan/fix-swaybar-heightLibravatar Drew DeVault2019-01-13
|\ | | | | swaybar: obey height if given
| * swaybar: obey height if givenLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | If there is a bar height given, use that as the height rather than as a minimum height. This matches i3-gaps behavior.
* | swaybar: add status_edge_padding commandLibravatar Brian Ashworth2019-01-11
| | | | | | | | | | This adds the bar subcommand `status_edge_padding <padding>` to set the padding used when the status line is on the right edge of the bar.
* | swaybar: add status_padding commandLibravatar Brian Ashworth2019-01-11
|/ | | | | | Adds the bar subcommand `status_padding <padding>` which allows setting the padding used for swaybar. If `status_padding` is set to `0`, blocks will be able to take up the full height of the bar.
* swaybar: implement tray configLibravatar Ian Fan2018-12-31
|
* hide_cursor: change to a seat subcommandLibravatar Brian Ashworth2018-12-30
| | | | | This makes hide_cursor a seat subcommand, which allows for seat specific timeouts.
* Revamp seat configsLibravatar Brian Ashworth2018-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes seat configs work like output and input configs do. This also adds support for wildcard seat configs. A seat config is still created in the main seat command handler, but instead of creating a new one in the subcommands and destroying the main seat command's instance, the seat subcommands modify the main one. The seat config is then stored, where it is merged appropriately. The seat config returned from `store_seat_config` is then applied. When attempting to apply a wildcard seat config, a seat specific config is queried for and if found, that is used. Otherwise, the wildcard config is applied directly. Additionally, instead of adding input devices to the default seat directly when there is no seat configs, a seat config for the default seat is created with only fallback set to true, which is more explicit. It also fixes an issue where running a seat command at runtime (with no seat config in the sway config), would result in all input devices being removed from the default seat and leaving sway in an unusable state. Also, instead of checking for any seat config, the search is for a seat config with a fallback option seat. This makes it so if there are only seat configs with fallback set to -1, the default seat is still created since there is no explicit notion on what to do regarding fallbacks. However, if there is even a single fallback 0, then the default seat is not used as a fallback. This will be needed for seat subcommands like hide_cursor where the user may only want to set that property without effecting anything else.
* Terminate swaybg in output_disableLibravatar Brian Ashworth2018-12-19
| | | | | | | | Moves the call to `terminate_swaybg` from inside `apply_output_config` to `output_disable`. The former was only called when an output was being disabled. The latter is called when an output is being disabled and when an output becomes disconnected. Without this, disconnecting an enabled output would result in a defunct swaybg process.
* Rework default output configsLibravatar Brian Ashworth2018-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | Default output configs were generated on reload to reset an output to its default settings. The idea was that anything that was removed from the config or changed at runtime and not in the config should be reset on reload. Originally, they were created using the output name. Recently, they were changed to use the output identifier. It turns out that there are issues of shadowing with that solution as well. This should fix those issues. Instead of generating the default output configs on reload and storing them in the output config list to merge on top of, they are now only generated when retrieving the output config for an output during a reload. This means that the default output configs are never stored anywhere and just used as a base to merge unaltered user configs on top of during a reload. Starting with a blank output config, merges get applied in the following order: 1. Default output config (only during a reload) 2. Wildcard config (only if neither output name or output identifier exist) 3. Output name config 4. Output identifier config
* list.c: rename free_flat_list to list_free_items_and_destroyLibravatar Ian Fan2018-12-09
|
* Cleanup list codeLibravatar Ian Fan2018-12-09
|
* list.c: Remove list_foreachLibravatar Ian Fan2018-12-09
| | | | | Most occurrences have been replaced by `free_flat_list` which has been moved from stringop.c to list.c. The rest have been replaced by for loops.
* Fix identifier output configs on reloadLibravatar Brian Ashworth2018-12-03
| | | | | | | | | | | | | | | | | | | | | | When generating default output configs to reset the outputs to their default settings on reload, the output name was being used. Additionally when determining the output config to apply, if there was an output config with the output name, that was being used without checking for an identifier config. This caused sway to completely ignore the users specified output config. To fix this issue, the following changes have been made: 1. Default output configs as created for the identifier now instead of name. This actually makes more sense anyway since you could hotplug multiple different outputs to the same port. 2. In get_output_config, which is only used to determine which output config to apply, output configs for both the name and identifier are queried. If both are found, a new output config is generated with the identifier config merged on top of the name config. If just one is found, a copy of that config is returned. This change also requires that the result from get_output_config be freed after use to prevent memory leaks, which required some minor changes to logic in apply_output_config_to_outputs.
* Replace _XOPEN_SOURCE with _POSIX_C_SOURCELibravatar emersion2018-11-25
| | | | And make sure we don't define both in the same source file.
* Merge pull request #3083 from c-edw/feature/StripWorkspaceNameLibravatar emersion2018-11-19
|\ | | | | Implement strip_workspace_name.
| * Implement strip_workspace_name.Libravatar Connor E2018-11-17
| |
* | Add scroll factor config option.Libravatar Spencer Michaels2018-11-18
| |
* | More frees.Libravatar Connor E2018-11-13
| |