fix: register desktop icons for authentication and downloader windows

This commit is contained in:
Kevin Yue committed 2026-11-02 18:43:46 +08:00
1 parent 6ebffad3c8
commit a02dfd10ab
10 files changed
+64 -3

No files matched your search

+5 -1
View File
@@ -200,6 +200,8 @@ install-unix: install-gpclient-unix
install-linux: install-unix install-linux: install-unix
@echo "Installing Linux integration under $(PREFIX)..." @echo "Installing Linux integration under $(PREFIX)..."
set -e; for file in share/applications/gpgui.desktop \ set -e; for file in share/applications/gpgui.desktop \
share/applications/gpgui-helper.desktop \
share/applications/gpauth.desktop \
share/polkit-1/actions/com.yuezk.gpgui.policy \ share/polkit-1/actions/com.yuezk.gpgui.policy \
lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \ lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \
lib/NetworkManager/dispatcher.d/gpclient-nm-hook; do \ lib/NetworkManager/dispatcher.d/gpclient-nm-hook; do \
@@ -213,7 +215,7 @@ install-linux: install-unix
install-bsd: install-unix install-bsd: install-unix
@echo "Installing BSD integration under $(PREFIX)..." @echo "Installing BSD integration under $(PREFIX)..."
install -d "$(DESTDIR)$(PREFIX)/share/applications" "$(DESTDIR)$(PREFIX)/share/polkit-1/actions" install -d "$(DESTDIR)$(PREFIX)/share/applications" "$(DESTDIR)$(PREFIX)/share/polkit-1/actions"
install -m 644 packaging/bsd/gpgui.desktop "$(DESTDIR)$(PREFIX)/share/applications/" install -m 644 packaging/bsd/gpgui.desktop packaging/bsd/gpgui-helper.desktop packaging/bsd/gpauth.desktop "$(DESTDIR)$(PREFIX)/share/applications/"
install -m 644 packaging/bsd/com.yuezk.gpgui.policy "$(DESTDIR)$(PREFIX)/share/polkit-1/actions/" install -m 644 packaging/bsd/com.yuezk.gpgui.policy "$(DESTDIR)$(PREFIX)/share/polkit-1/actions/"
sh scripts/relocate-install-paths.sh "$(PREFIX)" /usr/local "$(DESTDIR)$(PREFIX)" sh scripts/relocate-install-paths.sh "$(PREFIX)" /usr/local "$(DESTDIR)$(PREFIX)"
@@ -319,6 +321,8 @@ uninstall-unix:
rm -f "$(DESTDIR)$(PREFIX)/$${file#packaging/files/usr/}"; \ rm -f "$(DESTDIR)$(PREFIX)/$${file#packaging/files/usr/}"; \
done done
rm -f "$(DESTDIR)$(PREFIX)/share/applications/gpgui.desktop" \ rm -f "$(DESTDIR)$(PREFIX)/share/applications/gpgui.desktop" \
"$(DESTDIR)$(PREFIX)/share/applications/gpgui-helper.desktop" \
"$(DESTDIR)$(PREFIX)/share/applications/gpauth.desktop" \
"$(DESTDIR)$(PREFIX)/share/polkit-1/actions/com.yuezk.gpgui.policy" "$(DESTDIR)$(PREFIX)/share/polkit-1/actions/com.yuezk.gpgui.policy"
rmdir "$(DESTDIR)$(PREFIX)/libexec/gpclient" 2>/dev/null || true rmdir "$(DESTDIR)$(PREFIX)/libexec/gpclient" 2>/dev/null || true
+4
View File
@@ -19,6 +19,8 @@ install:
install -Dm755 artifacts/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook install -Dm755 artifacts/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook
install -Dm644 artifacts/usr/share/applications/gpgui.desktop $(DESTDIR)/usr/share/applications/gpgui.desktop install -Dm644 artifacts/usr/share/applications/gpgui.desktop $(DESTDIR)/usr/share/applications/gpgui.desktop
install -Dm644 artifacts/usr/share/applications/gpgui-helper.desktop $(DESTDIR)/usr/share/applications/gpgui-helper.desktop
install -Dm644 artifacts/usr/share/applications/gpauth.desktop $(DESTDIR)/usr/share/applications/gpauth.desktop
install -Dm644 artifacts/usr/share/icons/hicolor/scalable/apps/gpgui.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg install -Dm644 artifacts/usr/share/icons/hicolor/scalable/apps/gpgui.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg
install -Dm644 artifacts/usr/share/icons/hicolor/32x32/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/gpgui.png install -Dm644 artifacts/usr/share/icons/hicolor/32x32/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/gpgui.png
install -Dm644 artifacts/usr/share/icons/hicolor/128x128/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/gpgui.png install -Dm644 artifacts/usr/share/icons/hicolor/128x128/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/gpgui.png
@@ -49,6 +51,8 @@ uninstall:
rm -f $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook rm -f $(DESTDIR)/usr/lib/NetworkManager/dispatcher.d/gpclient-nm-hook
rm -f $(DESTDIR)/usr/share/applications/gpgui.desktop rm -f $(DESTDIR)/usr/share/applications/gpgui.desktop
rm -f $(DESTDIR)/usr/share/applications/gpgui-helper.desktop
rm -f $(DESTDIR)/usr/share/applications/gpauth.desktop
rm -f $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg rm -f $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/gpgui.svg
rm -f $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/gpgui.png rm -f $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/gpgui.png
rm -f $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/gpgui.png rm -f $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/gpgui.png
+8
View File
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=GP Connect Login
Comment=Authenticate with your VPN server
Exec=/usr/local/bin/gpclient launch-gui
Icon=gpgui
NoDisplay=true
StartupWMClass=gpauth
+8
View File
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=GP Connect
Comment=Download the GP Connect interface
Exec=/usr/local/bin/gpclient launch-gui
Icon=gpgui
NoDisplay=true
StartupWMClass=gpgui-helper
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=GP Connect Login
Comment=Authenticate with your VPN server
Exec=/usr/bin/gpclient launch-gui
Icon=gpgui
NoDisplay=true
StartupWMClass=gpauth
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=GP Connect
Comment=Download the GP Connect interface
Exec=/usr/bin/gpclient launch-gui
Icon=gpgui
NoDisplay=true
StartupWMClass=gpgui-helper
@@ -75,6 +75,8 @@ make build
%{_libexecdir}/gpclient/gp-hip-script-installer %{_libexecdir}/gpclient/gp-hip-script-installer
%{_libexecdir}/gpclient/gp-vpnc-script-installer %{_libexecdir}/gpclient/gp-vpnc-script-installer
%{_datadir}/applications/gpgui.desktop %{_datadir}/applications/gpgui.desktop
%{_datadir}/applications/gpgui-helper.desktop
%{_datadir}/applications/gpauth.desktop
%{_datadir}/icons/hicolor/32x32/apps/gpgui.png %{_datadir}/icons/hicolor/32x32/apps/gpgui.png
%{_datadir}/icons/hicolor/128x128/apps/gpgui.png %{_datadir}/icons/hicolor/128x128/apps/gpgui.png
%{_datadir}/icons/hicolor/256x256/apps/gpgui.png %{_datadir}/icons/hicolor/256x256/apps/gpgui.png
+2
View File
@@ -21,6 +21,8 @@ xml_replacement=$(escape_replacement "$xml_prefix")
temporary=$(mktemp) temporary=$(mktemp)
trap 'rm -f "$temporary"' EXIT HUP INT TERM trap 'rm -f "$temporary"' EXIT HUP INT TERM
for file in share/applications/gpgui.desktop \ for file in share/applications/gpgui.desktop \
share/applications/gpgui-helper.desktop \
share/applications/gpauth.desktop \
share/polkit-1/actions/com.yuezk.gpgui.policy \ share/polkit-1/actions/com.yuezk.gpgui.policy \
lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \ lib/NetworkManager/dispatcher.d/pre-down.d/gpclient.down \
lib/NetworkManager/dispatcher.d/gpclient-nm-hook; do lib/NetworkManager/dispatcher.d/gpclient-nm-hook; do
+5
View File
@@ -23,6 +23,11 @@ for platform in linux bsd; do
CARGO_RELEASE_DIR="$temp/release" GPGUI_BINARY="$temp/release/gpgui" > "$temp/$platform.log" CARGO_RELEASE_DIR="$temp/release" GPGUI_BINARY="$temp/release/gpgui" > "$temp/$platform.log"
installed="$stage/custom/gp" installed="$stage/custom/gp"
test -x "$installed/bin/gpclient" test -x "$installed/bin/gpclient"
for app in gpgui-helper gpauth; do
grep -Fxq 'Exec=/custom/gp/bin/gpclient launch-gui' "$installed/share/applications/$app.desktop"
grep -Fxq 'Icon=gpgui' "$installed/share/applications/$app.desktop"
grep -Fxq 'NoDisplay=true' "$installed/share/applications/$app.desktop"
done
test -x "$installed/libexec/gpclient/gp-vpnc-script-installer" test -x "$installed/libexec/gpclient/gp-vpnc-script-installer"
grep -Fxq 'Exec=/custom/gp/bin/gpclient launch-gui %u' "$installed/share/applications/gpgui.desktop" grep -Fxq 'Exec=/custom/gp/bin/gpclient launch-gui %u' "$installed/share/applications/gpgui.desktop"
grep -q '>/custom/gp/bin/gpservice<' "$installed/share/polkit-1/actions/com.yuezk.gpgui.policy" grep -q '>/custom/gp/bin/gpservice<' "$installed/share/polkit-1/actions/com.yuezk.gpgui.policy"
+14 -2
View File
@@ -135,7 +135,19 @@ verify_contains \
"$GP_DIR/packaging/bsd/gpgui.desktop" \ "$GP_DIR/packaging/bsd/gpgui.desktop" \
"MimeType=x-scheme-handler/globalprotectcallback;" "MimeType=x-scheme-handler/globalprotectcallback;"
verify_absent "$GPGUI_APP_DIR/gpauth.desktop" verify_absent "$GPGUI_APP_DIR/gpauth.desktop"
verify_absent "$GP_DIR/packaging/files/usr/share/applications/gpauth.desktop" for app in gpgui-helper gpauth; do
verify_absent "$GP_DIR/packaging/bsd/gpauth.desktop" for directory in "$GP_DIR/packaging/files/usr/share/applications" "$GP_DIR/packaging/bsd"; do
desktop_file="$directory/$app.desktop"
verify_contains "$desktop_file" "Icon=gpgui"
verify_contains "$desktop_file" "NoDisplay=true"
verify_contains "$desktop_file" "StartupWMClass=$app"
if grep -q '^MimeType=' "$desktop_file"; then
echo "Hidden desktop identity must not register a URL handler: $desktop_file" >&2
exit 1
fi
done
verify_contains "$GP_DIR/packaging/files/usr/share/applications/$app.desktop" "Exec=/usr/bin/gpclient launch-gui"
verify_contains "$GP_DIR/packaging/bsd/$app.desktop" "Exec=/usr/local/bin/gpclient launch-gui"
done
echo "Linux desktop and tray assets are synchronized" echo "Linux desktop and tray assets are synchronized"