Skip to content

Commit

Permalink
#2197 add a 'xpra-client-gnome' package
Browse files Browse the repository at this point in the history
use a post-install script to enable the extension for active users
  • Loading branch information
totaam committed Sep 9, 2023
1 parent 6cdbb9f commit 8a5c240
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions packaging/rpm/xpra.spec
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,6 @@ Recommends: %{python3}-pyopengl
Recommends: %{python3}-pyu2f
Recommends: %{python3}-psutil
Suggests: sshpass
#without this, the system tray is unusable with gnome!
%if 0%{?el9}
Recommends: gnome-shell-extension-topicons-plus
%else
Suggests: gnome-shell-extension-appindicator
%endif
%if 0%{?run_tests}
%if 0%{?fedora}
BuildRequires: xclip
Expand All @@ -337,6 +331,22 @@ BuildRequires: zlib-devel
This package contains the GTK3 xpra client.


%package -n %{package_prefix}-client-gnome
Summary: Gnome integration for the xpra client
Requires: %{package_prefix}-client-gtk3 = %{version}-%{release}
%if 0%{?el8}
# sadly removed from Fedora and RHEL9
Requires: gnome-shell-extension-topicons-plus
Requires(post): gnome-shell
%else
Requires: gnome-shell-extension-appindicator
Requires(post): gnome-shell-extension-common
%endif
%description -n%{package_prefix}-client-gnome
This meta package installs the gnome shell extensions
that can help in restoring the system tray functionality.


%package -n %{package_prefix}-x11
Summary: X11 bindings
BuildRequires: pkgconfig(xkbfile)
Expand Down Expand Up @@ -523,6 +533,10 @@ rm -fr ${RPM_BUILD_ROOT}%{python3_sitearch}/UNKNOWN-*.egg-info
rm -rf $RPM_BUILD_ROOT

%files
#meta package

%files -n %{package_prefix}-client-gnome
#meta package without any files

%files -n xpra-filesystem
%defattr(-,root,root)
Expand Down Expand Up @@ -813,6 +827,22 @@ fi
/usr/bin/update-desktop-database &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%post -n %{package_prefix}-client-gnome
#try to enable it for active users:
for uid in `ls /run/user/`; do
if [ "$uid" == "0" ]; then
continue
fi
BUS="/run/user/$uid/bus"
if [ -S "${BUS}" ]; then
%if 0%{?el8}
sudo -i -u "#$uid" DBUS_SESSION_BUS_ADDRESS="unix:path=$BUS" gnome-shell-extension-tool -e TopIcons@phocean.net &>/dev/null || :
%else
sudo -i -u "#$uid" DBUS_SESSION_BUS_ADDRESS="unix:path=$BUS" gnome-extensions enable appindicatorsupport@rgcjonas.gmail.com &>/dev/null || :
%endif
fi
done

%posttrans -n %{package_prefix}-client-gtk3
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

Expand Down

0 comments on commit 8a5c240

Please sign in to comment.