From 91fb8da5253ed84f8965ad95863cb98dc9e1cc87 Mon Sep 17 00:00:00 2001 From: bri <284789+b-@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:52:14 -0500 Subject: [PATCH] [bling/1password] add .desktop and icons to install script (#384) * [bling/1password] add .desktop and icons to install script Not sure if/how I missed this in the first place a long time ago, lol. just made a new image and couldn't find the menu item! * chore: Update icon cache when copying icons --------- Co-authored-by: fiftydinar <65243233+fiftydinar@users.noreply.github.com> --- modules/bling/installers/1password.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/bling/installers/1password.sh b/modules/bling/installers/1password.sh index 27161af..4973d92 100644 --- a/modules/bling/installers/1password.sh +++ b/modules/bling/installers/1password.sh @@ -83,6 +83,23 @@ chmod 4755 /usr/lib/1Password/chrome-sandbox # It only hardens it against environmental tampering. BROWSER_SUPPORT_PATH="/usr/lib/1Password/1Password-BrowserSupport" + +# Add .desktop file and icons +if [ -d /usr/share/applications ]; then + # xdg-desktop-menu will only be available if xdg-utils is installed, which is likely but not guaranteed + if [ -n "$(which xdg-desktop-menu)" ]; then + xdg-desktop-menu install --mode system --novendor /usr/lib/1Password/resources/1password.desktop + xdg-desktop-menu forceupdate + else + install -m0644 /usr/lib/1Password/resources/1password.desktop /usr/share/applications + fi +fi +if [ -d /usr/share/icons ]; then + cp -rf /usr/lib/1Password/resources/icons/* /usr/share/icons/ + # Update icon cache + gtk-update-icon-cache -f -t /usr/share/icons/hicolor/ +fi + chgrp "${GID_ONEPASSWORD}" "${BROWSER_SUPPORT_PATH}" chmod g+s "${BROWSER_SUPPORT_PATH}"