Skip to content

Commit

Permalink
Merge pull request #779 from JakeStanger/refactor/tray-menu
Browse files Browse the repository at this point in the history
refactor(tray): switch over to `libdbusmenu-gtk3`
  • Loading branch information
JakeStanger authored Nov 16, 2024
2 parents ff3f541 + 30de23d commit 3f8afa9
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 446 deletions.
1 change: 1 addition & 0 deletions .github/scripts/ubuntu_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ $SUDO apt-get update && $SUDO apt-get install --assume-yes \
libssl-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \
libgtk-3-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \
libgtk-layer-shell-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \
libdbusmenu-gtk3-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \
libpulse-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \
libluajit-5.1-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH}
34 changes: 32 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ futures-signals = { version = "0.3.34", optional = true }
sysinfo = { version = "0.29.11", optional = true }

# tray
system-tray = { version = "0.3.0", optional = true }
system-tray = { version = "0.4.0", features = ["dbusmenu-gtk3"], optional = true }
png = { version = "0.17.14", optional = true }

# upower
Expand Down
6 changes: 6 additions & 0 deletions docs/Compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ You also need rust; only the latest stable version is supported.
pacman -S gtk3 gtk-layer-shell
# for http support
pacman -S openssl
# for tray support
pacman -S libdbusmenu-gtk3
# for volume support
pacman -S libpulse
# for lua/cairo support
Expand All @@ -34,6 +36,8 @@ pacman -S luajit lua51-lgi
apt install build-essential libgtk-3-dev libgtk-layer-shell-dev
# for http support
apt install libssl-dev
# for tray support
apt install libdbusmenu-gtk3-dev
# for volume support
apt install libpulse-dev
# for lua/cairo support
Expand All @@ -46,6 +50,8 @@ apt install luajit-dev lua-lgi
dnf install gtk3-devel gtk-layer-shell-devel
# for http support
dnf install openssl-devel
# for tray support
dnf install libdbusmenu-gtk3-devel
# for volume support
dnf install pulseaudio-libs-devel
# for lua/cairo support
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
hicolor-icon-theme
gsettings-desktop-schemas
libxkbcommon
libdbusmenu-gtk3
libpulseaudio
luajit
luajitPackages.lgi
Expand Down
12 changes: 7 additions & 5 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
gtk-layer-shell,
gnome,
libxkbcommon,
libdbusmenu-gtk3,
libpulseaudio,
openssl,
luajit,
Expand Down Expand Up @@ -54,9 +55,10 @@
hicolor-icon-theme
gsettings-desktop-schemas
libxkbcommon ]
++ (if hasFeature "http" then [ openssl ] else [])
++ (if hasFeature "volume" then [ libpulseaudio ] else [])
++ (if hasFeature "cairo" then [ luajit ] else []);
++ lib.optionals (hasFeature "http") [ openssl ]
++ lib.optionals (hasFeature "tray") [ libdbusmenu-gtk3 ]
++ lib.optionals (hasFeature "volume")[ libpulseaudio ]
++ lib.optionals (hasFeature "cairo") [ luajit ];

propagatedBuildInputs = [ gtk3 ];

Expand All @@ -72,10 +74,10 @@
# gtk-launch
--suffix PATH : "${lib.makeBinPath [ gtk3 ]}"
''
+ (if hasFeature "cairo" then ''
+ lib.optionalString (hasFeature "cairo") ''
--prefix LUA_PATH : "./?.lua;${lgi}/share/lua/5.1/?.lua;${lgi}/share/lua/5.1/?/init.lua;${luajit}/share/lua/5.1/\?.lua;${luajit}/share/lua/5.1/?/init.lua"
--prefix LUA_CPATH : "./?.so;${lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so"
'' else "");
'';

preFixup = ''
gappsWrapperArgs+=(
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pkgs.mkShell {
gtk-layer-shell
gcc
openssl
libdbusmenu-gtk3
libpulseaudio
luajit
luajitPackages.lgi
Expand Down
107 changes: 0 additions & 107 deletions src/modules/tray/diff.rs

This file was deleted.

Loading

0 comments on commit 3f8afa9

Please sign in to comment.