aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
Commit message (Collapse)AuthorAge
...
* | | Merge pull request #3343 from RedSoxFan/seat-cursor-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Improve mouse button parsing: seat cursor buttons
| * | | seat_cmd_cursor: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `seat_cmd_cursor` to utilize `get_mouse_button` when parsing mouse buttons for the `press` and `release` operations. All x11 buttons, button event names, and button event codes are supported. For x11 axis buttons, `dispatch_cursor_axis` is used instead of `dispatch_cursor_button`. However the `press`/`release` state is ignored and the either axis event is processed. This also removes support for `left` and `right` in favor of `BTN_LEFT` and `BTN_RIGHT`.
* | | Merge pull request #3342 from RedSoxFan/scroll-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Improve mouse button parsing: input scroll_button
| * | | input_cmd_scroll_button: utilize mouse btn helpersLibravatar Brian Ashworth2019-01-10
| |/ / | | | | | | | | | | | | | | | | | | | | | This modifies `input_cmd_scroll_button` to utilize the mouse button helper `get_mouse_button` when parsing the button. x11 axis buttons are not supported with this command and `CMD_INVALID` will be returned, but all other x11 buttons, button event names, and button event codes should be working
* | | Merge pull request #3398 from RedSoxFan/toggle-input-eventsLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | input events: toggle and ipc get_inputs
| * | | input_cmd_events: implement toggleLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements toggling input events during runtime. This will not attempt to toggle to a mode that is not supported by the device. When toggling the wildcard input, the device specific input configs are altered. Each device will cycle one supported mode.
* | | | 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.
* | | bind{code,sym}: utilize mouse button helpersLibravatar Brian Ashworth2019-01-09
|/ / | | | | | | | | | | | | | | | | This modifies `bindcode` and `bindsym` to use `get_mouse_bindcode` and `get_mouse_bindsym`, respectively, to parse mouse buttons. Additionally, the `BINDING_MOUSE` type has been split into `BINDING_MOUSECODE` and `BINDING_MOUSESYM` to match keys and allow for mouse bindcodes to be used. Between the two commands, all button syms and codes should be supported, including x11 axis buttons.
* | Reset container dimensions when moving into workspace from directionLibravatar Ryan Dwyer2019-01-09
| |
* | Simplify evdev includes on FreeBSD by relying on up-to-date packageLibravatar Jan Beich2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | evdev-proto is installed by a dependency, so some files have been missed: In file included from ../sway/input/cursor.c:3: /usr/local/include/libevdev-1.0/libevdev/libevdev.h:30:10: fatal error: 'linux/input.h' file not found #include <linux/input.h> ^~~~~~~~~~~~~~~ ../swaybar/i3bar.c:3:10: fatal error: 'linux/input-event-codes.h' file not found #include <linux/input-event-codes.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
* | Merge pull request #3386 from RedSoxFan/seat-reload-waitLibravatar emersion2019-01-09
|\ \ | | | | | | reload: apply seat cfgs after reading entire cfg
| * | reload: apply seat cfgs after reading entire cfgLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | | | | | | | Wait until all seat configs have been read before applying them on reload. This prevents unnecessary attachment/detachment of input devices and therefore creation/destruction of seat devices as individual lines are read.
* | | Merge pull request #3390 from RedSoxFan/execute-seatLibravatar emersion2019-01-09
|\ \ \ | | | | | | | | cmd_bind: pass the seat to execute_command
| * | | cmd_bind: pass the seat to execute_commandLibravatar Brian Ashworth2019-01-09
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | `seat_execute_command` was incorrectly setting `config->handler_context.seat` before calling `execute_command`. Since `execute_command` was being called with a `NULL` seat argument, `execute_command` was setting `config->handler_context.seat` to the default seat. This resulted in all bindings being executed on the default seat and causing undesired behavior for devices on other seats.
* / / cmd_swap: use handler context seatLibravatar Brian Ashworth2019-01-09
|/ / | | | | | | Use the handler context seat instead of the default seat
* | Merge pull request #3337 from RedSoxFan/fix-seat-cmd-cursorLibravatar emersion2019-01-08
|\ \ | | | | | | seat_cmd_cursor: work on seat name provided
| * | seat_cmd_cursor: work on seat name providedLibravatar Brian Ashworth2018-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of simulating events on the current seat, this makes it so seat_cmd_cursor respects the seat name provided by `seat <name> cursor <args>`. It also adds support for simulating events on all seats when the wildcard is given. This also defers the command when reading the config, which allows the user to set the initial position of the cursor when the command is included in the config file.
* | | Implement tiling_drag_thresholdLibravatar Brian Ashworth2019-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implements `tiling_drag_threshold <threshold>` to prevent accidental dragging of tiling containers. If a container (and all of its descendants) are unfocused and the tile bar is pressed, a threshold will be used before actually starting the drag. Once the threshold has been exceeded, the cursor will change to the grab icon and the operation will switch from `OP_MOVE_TILING_THRESHOLD` to `OP_MOVE_TILING`.
* | | swaybar: do not create tray if hiddenLibravatar Ian Fan2018-12-31
| | |
* | | 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.
* | swaybar: fix focused_statusline color parsing.Libravatar Rune Morling2018-12-29
| |
* | Implement hide_cursor <timeout> commandLibravatar Brian Ashworth2018-12-25
| | | | | | | | | | Allows the cursor to be hidden after a specified timeout in milliseconds
* | Change mouse buttons to x11 map and libevdev namesLibravatar Brian Ashworth2018-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies the way mouse bindings are parsed. Instead of adding to BTN_LEFT, which results in button numbers that may not be expected, buttons will be parsed in one of the following ways: 1. `button[1-9]` will now map to their x11 equivalents. This is already the case for bar bindings. This adds support for binding to axis events, which was not possible in the previous approach. 2. Anything that starts with `BTN_` will be parsed as an event code name using `libevdev_event_code_from_name`. This allows for any button to be mapped to instead of limiting usage to the ones near BTN_LEFT. This also adds a dependency on libevdev, but since libevdev is already a dependency of libinput, this should be fine. If needed, this option can have dependency guards added. Binding changes: - button1: BTN_LEFT -> BTN_LEFT - button2: BTN_RIGHT -> BTN_MIDDLE - button3: BTN_MIDDLE -> BTN_RIGHT - button4: BTN_SIDE -> SWAY_SCROLL_UP - button5: BTN_EXTRA -> SWAY_SCROLL_DOWN - button6: BTN_FORWARD -> SWAY_SCROLL_LEFT - button7: BTN_BACK -> SWAY_SCROLL_RIGHT - button8: BTN_TASK -> BTN_SIDE - button9: BTN_JOYSTICK -> BTN_EXTRA Since the axis events need to be mapped to an event code, this uses the following mappings to avoid any conflicts: - SWAY_SCROLL_UP: KEY_MAX + 1 - SWAY_SCROLL_DOWN: KEY_MAX + 2 - SWAY_SCROLL_LEFT: KEY_MAX + 3 - SWAY_SCROLL_RIGHT: KEY_MAX + 4
* | Combine output_by_name and output_by_identifierLibravatar Brian Ashworth2018-12-20
| | | | | | | | | | | | | | | | This combines `output_by_name` and `output_by_identifier` into a single function called `output_by_name_or_id`. This allows for output identifiers to be used in all commands, simplifies the logic of the callers, and is more efficient since worst case is a single pass through the output list.
* | Return success when renaming a workspace to itselfLibravatar Ryan Dwyer2018-12-18
| |
* | cmd_split: add null checks in do_splitLibravatar Brian Ashworth2018-12-17
| | | | | | | | Fixes a crash when running `split` commands with the workspace focused.
* | 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.
* | cmd_split: flatten when possibleLibravatar Brian Ashworth2018-12-05
| |
* | cmd_focus: show scratchpad if hiddenLibravatar Brian Ashworth2018-12-03
| | | | | | | | | | | | | | If a scratchpad container is hidden, it is still focusable using criteria and should be shown. This fixes a segfault when attempting to rebase the cursor since previously the scratchpad container would not be on any output.
* | Add option to bindsym/bindcode to suppress warning on overrideLibravatar Alex Maese2018-12-02
| |
* | Fix the error result of the fullscreen commandLibravatar mwenzkowski2018-11-29
| | | | | | | | | | | | Changes the error result from CMD_INVALID to CMD_FAILURE, since CMD_INVALID indicates an unknown command or parser error and neither occurs where CMD_INVALID was used.
* | Implement bar gapsLibravatar Brian Ashworth2018-11-28
| | | | | | | | | | | | | | | | | | Adds the bar subcommand `gaps <amount>|<horizontal> <vertical>|<top> <right> <bottom> <left>` to set gaps for swaybar. Due to restrictions on margins for a layer_surface, only the sides that are anchored to an edge of the screen can have gaps. Since there is support for per-side outer gaps for workspaces, those should be able to be used instead for the last side.
* | Merge pull request #3212 from martinetd/move_floatingLibravatar Brian Ashworth2018-11-28
|\ \ | | | | | | move to workspace: fix moving floating container to non-empty workspace
| * | move to workspace: fix moving floating container to non-empty workspaceLibravatar Dominique Martinet2018-11-29
| | | | | | | | | | | | | | | | | | moving a container to a non-empty workspace will find a container to move to in the destination workspace and call container_move_to_container, which must not just skip floating containers
* | | Introduce a way to show config warnings in swaynagLibravatar Brian Ashworth2018-11-28
|/ / | | | | | | | | | | | | | | | | | | Adds the function `config_add_swaynag_warning(char *fmt, ...)` so that handlers can add warnings to the swaynag config log in a uniform way. The formatting is identical to errors and include the line number, line, and config path. This also alters the background file access warning to use the function and introduces a warning for duplicate bindings.
* | Change execute_command to return a list of resultsLibravatar Brian Ashworth2018-11-27
| | | | | | | | | | | | This matches i3's behavior of returning a list of results that contain the result of each command that was executed. Additionally, the `parse_error` attribute has been added to the IPC JSON reply.
* | Merge pull request #3185 from emersion/remove-xopen-sourceLibravatar Ryan Dwyer2018-11-26
|\ \ | | | | | | Replace _XOPEN_SOURCE with _POSIX_C_SOURCE
| * | Replace _XOPEN_SOURCE with _POSIX_C_SOURCELibravatar emersion2018-11-25
| | | | | | | | | | | | And make sure we don't define both in the same source file.
* | | Implement title alignmentLibravatar Brian Ashworth2018-11-25
| | | | | | | | | | | | | | | | | | | | | | | | This adds support for `i3 4.16`'s ability to set the title alignment. The command is `title_align left|center|right`. When the title is on the right, marks are moved to the left. Otherwise, they are on the right.
* | | resize set: add assertion for an invalid unitLibravatar Konstantin Pospelov2018-11-25
| | |
* | | resize set: fix units for floating containersLibravatar Konstantin Pospelov2018-11-25
|/ / | | | | | | | | This commit fixes the default size units for floating containers, so that pixels are used if the units are not specified.
* | Adding commands for configuring titlebar borders and paddingLibravatar Florent de Lamotte2018-11-22
| |
* | 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
| |