From 0f7730c2e38b853fb1211909d4e6809fb2a0c924 Mon Sep 17 00:00:00 2001 From: Wojciech Zygmunt Porczyk Date: Thu, 10 Jul 2014 16:28:05 +0200 Subject: [PATCH] appmenus: use new label icons --- appmenus-files/qubes-appmenu-select.desktop | 2 +- appmenus-files/qubes-dispvm-firefox.desktop | 2 +- appmenus-files/qubes-dispvm.directory | 2 +- appmenus-files/qubes-servicevm.directory.template | 2 +- appmenus-files/qubes-start.desktop | 2 +- appmenus-files/qubes-templatevm.directory.template | 2 +- appmenus-files/qubes-vm.directory.template | 2 +- appmenus-scripts/convert-apptemplate2vm.sh | 5 ++++- appmenus-scripts/convert-dirtemplate2vm.sh | 5 ++++- appmenus-scripts/create-apps-for-appvm.sh | 9 +++++---- appmenus-scripts/qubes-core-appmenus.py | 6 +++--- appmenus-scripts/qubes-receive-appmenus | 2 +- 12 files changed, 24 insertions(+), 17 deletions(-) diff --git a/appmenus-files/qubes-appmenu-select.desktop b/appmenus-files/qubes-appmenu-select.desktop index 29f3ee1..0f23f83 100644 --- a/appmenus-files/qubes-appmenu-select.desktop +++ b/appmenus-files/qubes-appmenu-select.desktop @@ -2,7 +2,7 @@ Version=1.0 Type=Application Exec=qubes-vm-settings %VMNAME% applications -Icon=/usr/share/qubes/icons/qubes.png +Icon=qubes-logo Terminal=false Name=%VMNAME%: Add more shortcuts... GenericName=%VMNAME%: Add more shortcuts... diff --git a/appmenus-files/qubes-dispvm-firefox.desktop b/appmenus-files/qubes-dispvm-firefox.desktop index 6e36ffd..449000c 100644 --- a/appmenus-files/qubes-dispvm-firefox.desktop +++ b/appmenus-files/qubes-dispvm-firefox.desktop @@ -2,7 +2,7 @@ Version=1.0 Type=Application Exec=sh -c 'echo firefox | /usr/lib/qubes/qfile-daemon-dvm qubes.VMShell dom0 DEFAULT red' -Icon=/usr/share/qubes/icons/dispvm-red.png +Icon=dispvm-red Terminal=false Name=DispVM: Firefox web browser GenericName=DispVM: Web browser diff --git a/appmenus-files/qubes-dispvm.directory b/appmenus-files/qubes-dispvm.directory index 9b5544d..9c6f43d 100644 --- a/appmenus-files/qubes-dispvm.directory +++ b/appmenus-files/qubes-dispvm.directory @@ -2,4 +2,4 @@ Encoding=UTF-8 Type=Directory Name=DisposableVM -Icon=/usr/share/qubes/icons/dispvm-red.png +Icon=dispvm-red diff --git a/appmenus-files/qubes-servicevm.directory.template b/appmenus-files/qubes-servicevm.directory.template index 74ce62f..18f26c2 100644 --- a/appmenus-files/qubes-servicevm.directory.template +++ b/appmenus-files/qubes-servicevm.directory.template @@ -2,4 +2,4 @@ Encoding=UTF-8 Type=Directory Name=ServiceVM: %VMNAME% -Icon=%VMDIR%/icon.png +Icon=%XDGICON% diff --git a/appmenus-files/qubes-start.desktop b/appmenus-files/qubes-start.desktop index 63db9f3..a30950b 100644 --- a/appmenus-files/qubes-start.desktop +++ b/appmenus-files/qubes-start.desktop @@ -2,7 +2,7 @@ Version=1.0 Type=Application Exec=qvm-start --quiet --tray %VMNAME% -Icon=%VMDIR%/icon.png +Icon=%XDGICON% Terminal=false Name=%VMNAME%: Start GenericName=%VMNAME%: Start diff --git a/appmenus-files/qubes-templatevm.directory.template b/appmenus-files/qubes-templatevm.directory.template index 596fffa..2e02230 100644 --- a/appmenus-files/qubes-templatevm.directory.template +++ b/appmenus-files/qubes-templatevm.directory.template @@ -2,4 +2,4 @@ Encoding=UTF-8 Type=Directory Name=Template: %VMNAME% -Icon=/usr/share/qubes/icons/template.png +Icon=qubes-logo diff --git a/appmenus-files/qubes-vm.directory.template b/appmenus-files/qubes-vm.directory.template index 6825d20..bc38338 100644 --- a/appmenus-files/qubes-vm.directory.template +++ b/appmenus-files/qubes-vm.directory.template @@ -2,4 +2,4 @@ Encoding=UTF-8 Type=Directory Name=Domain: %VMNAME% -Icon=%VMDIR%/icon.png +Icon=%XDGICON% diff --git a/appmenus-scripts/convert-apptemplate2vm.sh b/appmenus-scripts/convert-apptemplate2vm.sh index b5ab146..7cf4a73 100755 --- a/appmenus-scripts/convert-apptemplate2vm.sh +++ b/appmenus-scripts/convert-apptemplate2vm.sh @@ -3,11 +3,14 @@ SRC=$1 DSTDIR=$2 VMNAME=$3 VMDIR=$4 +XDGICON=$5 DST=$DSTDIR/$VMNAME-$(basename $SRC) -sed -e "s/%VMNAME%/$VMNAME/" \ +sed \ + -e "s/%VMNAME%/$VMNAME/" \ -e "s %VMDIR% $VMDIR " \ + -e "s/%XDGICON%/$XDGICON/" \ <$SRC >$DST diff --git a/appmenus-scripts/convert-dirtemplate2vm.sh b/appmenus-scripts/convert-dirtemplate2vm.sh index 9d1972b..c0cb5c8 100755 --- a/appmenus-scripts/convert-dirtemplate2vm.sh +++ b/appmenus-scripts/convert-dirtemplate2vm.sh @@ -3,9 +3,12 @@ SRC=$1 DST=$2 VMNAME=$3 VMDIR=$4 +XDGICON=$5 -sed -e "s/%VMNAME%/$VMNAME/" \ +sed \ + -e "s/%VMNAME%/$VMNAME/" \ -e "s %VMDIR% $VMDIR " \ + -e "s/%XDGICON%/$XDGICON/" \ <$SRC >$DST diff --git a/appmenus-scripts/create-apps-for-appvm.sh b/appmenus-scripts/create-apps-for-appvm.sh index 3c0c30a..a6801cb 100755 --- a/appmenus-scripts/create-apps-for-appvm.sh +++ b/appmenus-scripts/create-apps-for-appvm.sh @@ -26,6 +26,7 @@ VMTYPE=$3 if [ -z "$VMTYPE" ]; then VMTYPE=appvms fi +XDGICON=$4 VMDIR=/var/lib/qubes/$VMTYPE/$VMNAME APPSDIR=$VMDIR/apps @@ -38,11 +39,11 @@ mkdir -p $APPSDIR if [ "$SRCDIR" != "none" ]; then echo "--> Converting Appmenu Templates..." if [ -r "$VMDIR/whitelisted-appmenus.list" ]; then - cat $VMDIR/whitelisted-appmenus.list | xargs -I{} /usr/libexec/qubes-appmenus/convert-apptemplate2vm.sh $SRCDIR/{} $APPSDIR $VMNAME $VMDIR + cat $VMDIR/whitelisted-appmenus.list | xargs -I{} /usr/libexec/qubes-appmenus/convert-apptemplate2vm.sh $SRCDIR/{} $APPSDIR $VMNAME $VMDIR $XDGICON else - find $SRCDIR -name "*.desktop" $CHECK_WHITELISTED -exec /usr/libexec/qubes-appmenus/convert-apptemplate2vm.sh {} $APPSDIR $VMNAME $VMDIR \; + find $SRCDIR -name "*.desktop" $CHECK_WHITELISTED -exec /usr/libexec/qubes-appmenus/convert-apptemplate2vm.sh {} $APPSDIR $VMNAME $VMDIR $XDGICON \; fi - /usr/libexec/qubes-appmenus/convert-apptemplate2vm.sh /usr/share/qubes-appmenus/qubes-appmenu-select.desktop $APPSDIR $VMNAME $VMDIR + /usr/libexec/qubes-appmenus/convert-apptemplate2vm.sh /usr/share/qubes-appmenus/qubes-appmenu-select.desktop $APPSDIR $VMNAME $VMDIR $XDGICON if [ "$VMTYPE" = "vm-templates" ]; then DIR_TEMPLATE=/usr/share/qubes-appmenus/qubes-templatevm.directory.template @@ -51,7 +52,7 @@ if [ "$SRCDIR" != "none" ]; then else DIR_TEMPLATE=/usr/share/qubes-appmenus/qubes-vm.directory.template fi - /usr/libexec/qubes-appmenus/convert-dirtemplate2vm.sh $DIR_TEMPLATE $APPSDIR/$VMNAME-vm.directory $VMNAME $VMDIR + /usr/libexec/qubes-appmenus/convert-dirtemplate2vm.sh $DIR_TEMPLATE $APPSDIR/$VMNAME-vm.directory $VMNAME $VMDIR $XDGICON fi echo "--> Adding Apps to the Menu..." diff --git a/appmenus-scripts/qubes-core-appmenus.py b/appmenus-scripts/qubes-core-appmenus.py index 49e4ca7..75c4dcb 100644 --- a/appmenus-scripts/qubes-core-appmenus.py +++ b/appmenus-scripts/qubes-core-appmenus.py @@ -78,12 +78,12 @@ def QubesVm_appmenus_create(self, verbose=False, source_template = None): try: if source_template is not None: - subprocess.check_call ([system_path["appmenu_create_cmd"], source_template.appmenus_templates_dir, self.name, vmtype]) + subprocess.check_call ([system_path["appmenu_create_cmd"], source_template.appmenus_templates_dir, self.name, vmtype, self.label.icon]) elif self.appmenus_templates_dir is not None: - subprocess.check_call ([system_path["appmenu_create_cmd"], self.appmenus_templates_dir, self.name, vmtype]) + subprocess.check_call ([system_path["appmenu_create_cmd"], self.appmenus_templates_dir, self.name, vmtype, self.label.icon]) else: # Only add apps to menu - subprocess.check_call ([system_path["appmenu_create_cmd"], "none", self.name, vmtype]) + subprocess.check_call ([system_path["appmenu_create_cmd"], "none", self.name, vmtype, self.label.icon]) except subprocess.CalledProcessError: print >> sys.stderr, "Ooops, there was a problem creating appmenus for {0} VM!".format (self.name) diff --git a/appmenus-scripts/qubes-receive-appmenus b/appmenus-scripts/qubes-receive-appmenus index 94f1a29..22f1b3f 100755 --- a/appmenus-scripts/qubes-receive-appmenus +++ b/appmenus-scripts/qubes-receive-appmenus @@ -197,7 +197,7 @@ def create_template(path, values): desktop_file.write("Icon={0}\n".format(os.path.join( '%VMDIR%', vm_files['appmenus_icons_subdir'], icon_file))) else: - desktop_file.write("Icon=%VMDIR%/icon.png\n") + desktop_file.write("Icon=%XDGICON%\n") for key in ["Name", "GenericName" ]: if values.has_key(key):