diff options
author | Calvin Lee <cyrus296@gmail.com> | 2017-06-07 16:45:28 -0700 |
---|---|---|
committer | Calvin Lee <cyrus296@gmail.com> | 2017-06-07 17:49:16 -0700 |
commit | 843ad38b3c427adb0bf319e9613d9813c8d9246c (patch) | |
tree | e02a5b06e2b6923371fd53724791c147c18a1fa4 /CMakeLists.txt | |
parent | Merge pull request #1232 from johalun/master-freebsd (diff) | |
download | sway-843ad38b3c427adb0bf319e9613d9813c8d9246c.tar.gz sway-843ad38b3c427adb0bf319e9613d9813c8d9246c.tar.zst sway-843ad38b3c427adb0bf319e9613d9813c8d9246c.zip |
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index edf486ca..c80f6361 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -47,6 +47,7 @@ option(enable-swaybar "Enables the swaybar utility" YES) | |||
47 | option(enable-swaygrab "Enables the swaygrab utility" YES) | 47 | option(enable-swaygrab "Enables the swaygrab utility" YES) |
48 | option(enable-swaymsg "Enables the swaymsg utility" YES) | 48 | option(enable-swaymsg "Enables the swaymsg utility" YES) |
49 | option(enable-gdk-pixbuf "Use Pixbuf to support more image formats" YES) | 49 | option(enable-gdk-pixbuf "Use Pixbuf to support more image formats" YES) |
50 | option(enable-tray "Enables the swaybar tray" YES) | ||
50 | option(zsh-completions "Zsh shell completions" NO) | 51 | option(zsh-completions "Zsh shell completions" NO) |
51 | option(default-wallpaper "Installs the default wallpaper" YES) | 52 | option(default-wallpaper "Installs the default wallpaper" YES) |
52 | option(LD_LIBRARY_PATH "Configure sway's default LD_LIBRARY_PATH") | 53 | option(LD_LIBRARY_PATH "Configure sway's default LD_LIBRARY_PATH") |
@@ -64,6 +65,7 @@ find_package(Cairo REQUIRED) | |||
64 | find_package(Pango REQUIRED) | 65 | find_package(Pango REQUIRED) |
65 | find_package(GdkPixbuf) | 66 | find_package(GdkPixbuf) |
66 | find_package(PAM) | 67 | find_package(PAM) |
68 | find_package(DBus) | ||
67 | 69 | ||
68 | find_package(LibInput REQUIRED) | 70 | find_package(LibInput REQUIRED) |
69 | 71 | ||
@@ -90,6 +92,17 @@ else() | |||
90 | message(STATUS "Building without gdk-pixbuf, only png images supported.") | 92 | message(STATUS "Building without gdk-pixbuf, only png images supported.") |
91 | endif() | 93 | endif() |
92 | 94 | ||
95 | if (enable-tray) | ||
96 | if (DBUS_FOUND) | ||
97 | set(ENABLE_TRAY) | ||
98 | add_definitions(-DENABLE_TRAY) | ||
99 | else() | ||
100 | message(WARNING "Tray required but DBus was not found. Tray will not be included") | ||
101 | endif() | ||
102 | else() | ||
103 | message(STATUS "Building without the tray.") | ||
104 | endif() | ||
105 | |||
93 | include_directories(include) | 106 | include_directories(include) |
94 | 107 | ||
95 | add_subdirectory(protocols) | 108 | add_subdirectory(protocols) |