aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
AgeCommit message (Collapse)Author
2017-06-07Implement Tray IconsCalvin Lee
This commit implements the StatusNotifierItem protocol, and enables swaybar to show tray icons. It also uses `xembedsniproxy` in order to communicate with xembed applications. The tray is completely optional, and can be disabled on compile time with the `enable-tray` option. Or on runtime with the bar config option `tray_output none`. Overview of changes: In swaybar very little is changed outside the tray subfolder except that all events are now polled in `event_loop.c`, this creates no functional difference. Six bar configuration options were added, these are detailed in sway-bar(5) The tray subfolder is where all protocol implementation takes place and is organised as follows: tray/sni_watcher.c: This file contains the StatusNotifierWatcher. It keeps track of items and hosts and reports when they come or go. tray/tray.c This file contains the StatusNotifierHost. It keeps track of sway's version of the items and represents the tray itself. tray/sni.c This file contains the StatusNotifierItem struct and all communication with individual items. tray/icon.c This file implements the icon theme protocol. It allows for finding icons by name, rather than by pixmap. tray/dbus.c This file allows for asynchronous DBus communication. See #986 #343
2017-06-06FreeBSD fixesjohalun
Increase _POSIX_SOURCE value where needed. Increase _XOPEN_SOURCE value where needed. Conditionally link to libcap (only on Linux). Possibly some trailing whitespace fixes (automatic).
2017-05-04Add mouse button bindingsJosip Janzic
Adds support for bindings like: bindsym button3 floating toggle bindsym $mod+button3 floating toggle
2017-04-29prevent crash when `layout auto` is missing argsZandr Martin
2017-04-29Set child border to background if not specifiedDrew DeVault
2017-04-29Support specifying fewer than 5 colorsDrew DeVault
This doesn't work, I'm not sure why. The color structs definitely get changed but if you specify fewer than 5, it renders with the defaults.
2017-04-26Implement no_focusDrew DeVault
Ref #2
2017-04-18Use i3's dimensions for initial scratchpad viewsVasilij Schneidermann
See https://github.com/i3/i3/blob/master/src/scratchpad.c#L196-L197
2017-04-18Implement and document `move [to] scratchpad`Vasilij Schneidermann
2017-04-16Handle symlinks as IPC security targetsJerzi Kaminsky
- When policies are allocated, the ipc target path goes through symlink resolution. The result is used as the canonical for matching pids to policies at runtime. In particular, this matches up with the target of the `/proc/<pid>/exe`. - There's a possible race condition if this isn't done correctly, read below. Originally, validate_ipc_target() always tried to resolve its argument for symlinks, and returned a parogram target string if it validates. This created a possible race condition with security implications. The problem is that get_feature_policy() first independently resolved the policy target in order to check whether a policy already exists. If it didn't find any, it called alloc_feature_policy() which called validate_ipc_target() which resolved the policy target again. In the time between the two checks, the symlink could be altered, and a lucky attacker could fool the program into thinking that a policy doesn't exist for a target, and then switch the symlink to point at another file. At the very least this could allow him to create two policies for the same program target, and possibly to bypass security by associating the permissions for one target with another, or force default permissions to apply to a target for which a more specific rule has been configured. So we don't that. Instead, the policy target is resolved once and that result is used for the rest of the lookup/creation process.
2017-04-16Move get_feature_policy to sway/security.cJerzi Kaminsky
2017-04-16Rename get_policy to get_feature_policyJerzi Kaminsky
2017-04-07Add `-t get_marks` and use more i3-like marksCalvin Lee
In i3 every mark is unique and one mark cannot be used in more than one window, sway behavior has been amended to match this. `swaymsg -t get_marks` will now return an array of all marks used in sway. See #98
2017-04-05Improve criteria handlingCalvin Lee
This commit changes how commands decide what container to act on. Commands get the current container though `current_container`, a global defined in sway/commands.c. If a criteria is given before a command, then the following command will be run once for every container the criteria matches with a reference to the matching container in 'current_container'. Commands should use this instead of `get_focused_container()` from now on. This commit also fixes a few (minor) mistakes made in implementing marks such as non-escaped arrows in sway(5) and calling the "mark" command "floating" by accident. It also cleans up `criteria.c` in a few places.
2017-04-03Impliment i3-style marksCalvin Lee
This commit adds three commands to sway: `show_marks`, `mark` and `unmark`. Marks are displayed right-aligned in the window border as i3 does. Marks may be found using criteria. Fixes #1007
2017-03-18remove unnecessary todo itemZandr Martin
As best I can tell this todo was intended to add workspace movement to the given output with the `workspace <ws> output <op>` command, but i3 does not behave this way.
2017-03-18Fix off-by-one error when checking workspace_layout argumentsJarkko Oranen
2017-03-13Merge branch 'master' of git://github.com/SirCmpwn/sway into new-command-aliasesZandr Martin
2017-03-10UnGNUify the codebaseDrew DeVault
2017-03-09deprecate new_window and new_float commandsZandr Martin
2017-03-08fix workspace output assignmentZandr Martin
2017-03-01Fix #1099: Allow spaces in worspace namesCalvin Lee
This commit allows unquoted spaces in worspace names in order to keep compatability with i3. The names _must not_ contain the string "output" which is documented in 'sway.5' because how sway detects the `move <workspace> output <output>` command. Also I documented that "number" may be used before the worspace name without affecting how the name is evaluated.
2017-03-01i3 feature support: Moving flotaing containersCalvin Lee
This commit lets the 'move' command apply to floating containers as well as tiled ones. The command may be appended with a number of pixels and then optionally the string `px` (like '10 px') in order to move the container more or fewer than the standard ten pixels.
2017-02-20Read configs from /etc/sway/security.d/*Drew DeVault
2017-02-20Add * policies and fix bugDrew DeVault
2017-02-20Enforce new IPC policiesDrew DeVault
2017-02-20Add initial support code for new IPC securityDrew DeVault
2017-01-14replaced "bot" with "bottom" in auto layout commandswil
2017-01-14Merge branch 'master' into masterwillakat
2017-01-12Implement hide_edge_borders smart (like in i3 4.13)Frantisek Fladung
2017-01-08reworked "layout auto*" star commandswil
- "layout auto_left|auto_xxx" are now "layout auto xxx" - "layout incmaster <n>" is now "layout auto master [set|inc] <n>" - "layout incncol <n>" is now "layout auto ncol [set|inc] <n>"
2017-01-08Indent cleanupswil
2017-01-07[fix] resize should now preserve surrounding container's dimensionswil
- prior to this modification, the requested pixels were added/removed to both edges of the modified container. To preserve sizes, only half the pixels should be added/removed to each edge.
2017-01-07Moved auto_* layout functions from resize.c to layout.cwil
2017-01-01[fix] cleanups suggested by Sway communitywil
2017-01-01changed "layout promote" command to "move first"wil
This is more consistent with other Sway semantics.
2016-12-31[fix] cycle auto layouts backwardswil
2016-12-29cleanup in auto layoutswil
- added L_AUTO_FIRST/LAST instead of using explicit layouts. - when switching between auto layout that don't share the same major axis, invert the width/height of their child views to preserve their relative proportions.
2016-12-29introduce next/prev as a direction for focus/move commands.wil
2016-12-29[fix] Handle auto layout resize with multiple slave groupswil
2016-12-29Added "layout incnmaster|incncol" commandswil
2016-12-29Handle resize in auto layoutswil
2016-12-29Added Awesome/Monad type "auto" layoutswil
2016-12-17Change how security config is loadedDrew DeVault
2016-12-15Fix indentation issuesDrew DeVault
2016-12-15Handle calloc failuresDrew DeVault
2016-12-15Handle allocation failures in security codeDrew DeVault
Note that such errors are generally going to be fatal
2016-12-15Handle allocation failure in commandsDrew DeVault
2016-12-04fix layout switching (was broken because of workspace_layout)D.B
For workspace containers, swayc_change_layout also changes ->layout alongside ->workspace_layout when it's a sensible thing to do. There is an additional test for 'layout toggle' command which ensures that containers will be tiled horizontally after toggling from tabbed or stacked.
2016-12-04add workspace_layout to containerD.B
Add swayc_change_layout function, which changes either layout or workspace_layout, depending on the container type.