Commit Graph

402 Commits

Author SHA1 Message Date
emersion 90f7f1a0e6
Add minimal config subsystem 2017-12-05 10:40:55 +01:00
emersion 514c819ff9
Add exec and exec_always commands 2017-12-04 22:43:49 +01:00
Drew DeVault b379b40071 Invoke command handlers once parsed 2017-11-22 21:39:35 -05:00
Drew DeVault d7d21bb0f8 Add initial command subsystem (untested)
Need to spin up the IPC server to test this
2017-11-22 21:20:41 -05:00
Drew DeVault 733993a651 Move everything to sway/old/ 2017-11-18 11:22:02 -05:00
Drew DeVault 7c448b4081 Fire up the wlroots backend and run the event loop 2017-11-11 09:08:50 -05:00
lbonn b2d4caf6c3 commands: fail when criteria match nothing
For whatever command, this probably was not intended by the user
2017-10-08 11:54:46 +02:00
Mykyta Holubakha 7d8a84b587
Do not add empty policies
Policy allocation failure is non-fatal
2017-07-01 21:36:17 +03:00
nyorain 60fa626116 Add the 'clipboard' command to set the clipboard 2017-07-01 18:35:42 +02:00
Calvin Lee 843ad38b3c Implement Tray Icons
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-07 17:49:16 -07:00
johalun 7fef283044 FreeBSD fixes
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-06-06 09:45:50 +02:00
Drew DeVault 02812a2e4d Support specifying fewer than 5 colors
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-29 09:56:07 -04:00
Drew DeVault 51143a75af Implement no_focus
Ref #2
2017-04-26 15:29:42 -04:00
Jerzi Kaminsky cf5e764c7f Disambiguate get_*_policy() and get_*_policy_mask() 2017-04-16 17:09:53 +03:00
Calvin Lee 069d37f987 Improve criteria handling
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-05 22:07:23 -06:00
Calvin Lee 2445d27960 Impliment i3-style marks
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-04-03 11:48:37 -06:00
Zandr Martin b507462d1c
Merge branch 'master' of git://github.com/SirCmpwn/sway into new-command-aliases 2017-03-13 07:35:12 -04:00
Drew DeVault 9aed9d9359 UnGNUify the codebase 2017-03-10 23:41:24 -05:00
Zandr Martin 18450dd16a
deprecate new_window and new_float commands 2017-03-09 14:56:15 -05:00
Drew DeVault eabfb6c559 Add * policies and fix bug 2017-02-20 06:48:33 -05:00
Drew DeVault 7784f1a905 Handle allocation failures in security code
Note that such errors are generally going to be fatal
2016-12-15 19:01:41 -05:00
Drew DeVault 8cef81d6f2 Handle some more memory allocation failures 2016-12-15 19:01:41 -05:00
Drew DeVault 248df18c24 Handle allocation failure in commands 2016-12-15 19:01:40 -05:00
Drew DeVault e7a764fdf4 Disallow everything by default
And update config.d/security to configure sane defaults
2016-12-03 12:38:42 -05:00
Drew DeVault d353da248b Add ipc connection feature policy controls 2016-12-02 18:09:19 -05:00
Drew DeVault c8dc4925d1 Add IPC security policy command handlers 2016-12-02 17:34:26 -05:00
Drew DeVault 39cf9a82f7 Enforce command policies 2016-12-02 08:17:45 -05:00
Drew DeVault f23880b1fd Add support for command policies in config file 2016-12-02 08:10:03 -05:00
Drew DeVault 76cab04b4d Implement permit and reject commands 2016-12-01 21:36:43 -05:00
D.B 58eb7ac19f change bar colors from char[10] to *char
This commit removes has_* booleans from bar color struct. It also
generalizes of functions in commands/bar/colors.c.
2016-11-02 21:07:04 +01:00
D.B ad4d21d60b add bar colours for focused_(workspace|statusline|separator)
If these aren't defined in config, color settings without 'focused_'
prefix are used as a fallback.
2016-11-02 18:58:33 +01:00
Michał Winiarski e8d8abfbb5 Add left_handed support for input devices
Some users may want to switch buttons on their input devices, turns out
libinput already supports it. Let's add a support for it in our config.

Signed-off-by: Michał Winiarski <knr@hardline.pl>
2016-10-25 22:06:23 +02:00
D.B 746345e3b8 reorder cmd_handler arrays for bsearch 2016-10-08 11:12:45 +02:00
D.B d3f5ac8cbb add force_focus_wrapping option 2016-10-07 08:12:14 +02:00
Zandr Martin 511eed90cd
squash commits, move enum into resize.c 2016-09-07 06:48:41 -05:00
Zandr Martin 79ffea328c
Merge branch 'master' of git://github.com/SirCmpwn/sway into commands-refactor 2016-09-02 13:46:19 -05:00
Zandr Martin b374c35758
refactor commands.c 2016-09-01 21:39:08 -05:00
Drew DeVault 416417a54c Reorganize includes 2016-09-01 08:18:37 -04:00
Guillaume Brogi 6173c84117 Rerender after every split command 2016-08-12 00:12:56 +02:00
D.B 61781bbef0 Fix container move when workspace is focused
Fixes #819. If workspace is focused and command 'move container to
workspace/output' is issued, workspace child containers are wrapped in a
new container and moved according to command.
2016-08-07 17:07:30 +02:00
D.B 132017d242 Fix 'workspace back_and_forth' and workspace_auto_back_and_forth clash
When workspace_auto_back_and_forth is enabled, workspaces get switched
twice with previously mentioned command, which is not the expected
behavior.

Removes one redundant creation of previous workspace.
2016-08-04 21:31:46 +02:00
Drew DeVault 2d907ef1f6 Merge pull request #811 from acrisci/feature/focus-container
Implement focus handling for containers
2016-08-01 07:27:12 -04:00
Zandr Martin b18c169036
cache floating container size when fullscreening 2016-07-31 21:45:27 -05:00
Tony Crisci b39249508f Refactor functions to update container borders
Replace `update_view_border()` with `update_container_border()`. The latter
should handle both the case where the container is a view or if the container
has children.
2016-07-31 20:32:40 -04:00
D.B 9977b01928 Update container geometry on layout switch
Deeply nested containers which had their layouts changed didn't update
their actual_geometry, this messed up their child containers. Those got
width and height of 0, which was then decreased for stacked/tabbed
containers by title height. Underflow ensued, these containers suddenly
had height 4294967273. In short, not updating actual_geometry didn't
play nicely with nested containers.
2016-07-31 10:22:18 +02:00
Zandr Martin 98aa59fdda
implement solid color rendering for swaybg 2016-07-30 18:50:13 -05:00
Drew DeVault 11e7ca044c Update hidpi support to latest wlc API 2016-07-28 14:36:49 -04:00
Drew DeVault 6ea02f3064 Initial pass on HiDPI support 2016-07-28 14:36:49 -04:00
Drew DeVault ee67c5bee3 Merge pull request #791 from acrisci/feature/focus-child
Implement `focus child` command
2016-07-28 07:26:37 -04:00
D.B 33c1df38bd Close all focused container's child views on kill
Previously, cmd_kill only closed a focused view, while containers were
not affected. Now it closes all views that are children of the focused
container.
2016-07-28 10:31:18 +02:00