This commit is contained in:
Joanna Rutkowska 2014-07-12 14:01:58 +02:00
commit df0db675f2
12 changed files with 24 additions and 17 deletions

View File

@ -2,7 +2,7 @@
Version=1.0 Version=1.0
Type=Application Type=Application
Exec=qubes-vm-settings %VMNAME% applications Exec=qubes-vm-settings %VMNAME% applications
Icon=/usr/share/qubes/icons/qubes.png Icon=qubes-logo
Terminal=false Terminal=false
Name=%VMNAME%: Add more shortcuts... Name=%VMNAME%: Add more shortcuts...
GenericName=%VMNAME%: Add more shortcuts... GenericName=%VMNAME%: Add more shortcuts...

View File

@ -2,7 +2,7 @@
Version=1.0 Version=1.0
Type=Application Type=Application
Exec=sh -c 'echo firefox | /usr/lib/qubes/qfile-daemon-dvm qubes.VMShell dom0 DEFAULT red' 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 Terminal=false
Name=DispVM: Firefox web browser Name=DispVM: Firefox web browser
GenericName=DispVM: Web browser GenericName=DispVM: Web browser

View File

@ -2,4 +2,4 @@
Encoding=UTF-8 Encoding=UTF-8
Type=Directory Type=Directory
Name=DisposableVM Name=DisposableVM
Icon=/usr/share/qubes/icons/dispvm-red.png Icon=dispvm-red

View File

@ -2,4 +2,4 @@
Encoding=UTF-8 Encoding=UTF-8
Type=Directory Type=Directory
Name=ServiceVM: %VMNAME% Name=ServiceVM: %VMNAME%
Icon=%VMDIR%/icon.png Icon=%XDGICON%

View File

@ -2,7 +2,7 @@
Version=1.0 Version=1.0
Type=Application Type=Application
Exec=qvm-start --quiet --tray %VMNAME% Exec=qvm-start --quiet --tray %VMNAME%
Icon=%VMDIR%/icon.png Icon=%XDGICON%
Terminal=false Terminal=false
Name=%VMNAME%: Start Name=%VMNAME%: Start
GenericName=%VMNAME%: Start GenericName=%VMNAME%: Start

View File

@ -2,4 +2,4 @@
Encoding=UTF-8 Encoding=UTF-8
Type=Directory Type=Directory
Name=Template: %VMNAME% Name=Template: %VMNAME%
Icon=/usr/share/qubes/icons/template.png Icon=qubes-logo

View File

@ -2,4 +2,4 @@
Encoding=UTF-8 Encoding=UTF-8
Type=Directory Type=Directory
Name=Domain: %VMNAME% Name=Domain: %VMNAME%
Icon=%VMDIR%/icon.png Icon=%XDGICON%

View File

@ -3,11 +3,14 @@ SRC=$1
DSTDIR=$2 DSTDIR=$2
VMNAME=$3 VMNAME=$3
VMDIR=$4 VMDIR=$4
XDGICON=$5
DST=$DSTDIR/$VMNAME-$(basename $SRC) DST=$DSTDIR/$VMNAME-$(basename $SRC)
sed -e "s/%VMNAME%/$VMNAME/" \ sed \
-e "s/%VMNAME%/$VMNAME/" \
-e "s %VMDIR% $VMDIR " \ -e "s %VMDIR% $VMDIR " \
-e "s/%XDGICON%/$XDGICON/" \
<$SRC >$DST <$SRC >$DST

View File

@ -3,9 +3,12 @@ SRC=$1
DST=$2 DST=$2
VMNAME=$3 VMNAME=$3
VMDIR=$4 VMDIR=$4
XDGICON=$5
sed -e "s/%VMNAME%/$VMNAME/" \ sed \
-e "s/%VMNAME%/$VMNAME/" \
-e "s %VMDIR% $VMDIR " \ -e "s %VMDIR% $VMDIR " \
-e "s/%XDGICON%/$XDGICON/" \
<$SRC >$DST <$SRC >$DST

View File

@ -26,6 +26,7 @@ VMTYPE=$3
if [ -z "$VMTYPE" ]; then if [ -z "$VMTYPE" ]; then
VMTYPE=appvms VMTYPE=appvms
fi fi
XDGICON=$4
VMDIR=/var/lib/qubes/$VMTYPE/$VMNAME VMDIR=/var/lib/qubes/$VMTYPE/$VMNAME
APPSDIR=$VMDIR/apps APPSDIR=$VMDIR/apps
@ -38,11 +39,11 @@ mkdir -p $APPSDIR
if [ "$SRCDIR" != "none" ]; then if [ "$SRCDIR" != "none" ]; then
echo "--> Converting Appmenu Templates..." echo "--> Converting Appmenu Templates..."
if [ -r "$VMDIR/whitelisted-appmenus.list" ]; then 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 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 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 if [ "$VMTYPE" = "vm-templates" ]; then
DIR_TEMPLATE=/usr/share/qubes-appmenus/qubes-templatevm.directory.template DIR_TEMPLATE=/usr/share/qubes-appmenus/qubes-templatevm.directory.template
@ -51,7 +52,7 @@ if [ "$SRCDIR" != "none" ]; then
else else
DIR_TEMPLATE=/usr/share/qubes-appmenus/qubes-vm.directory.template DIR_TEMPLATE=/usr/share/qubes-appmenus/qubes-vm.directory.template
fi 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 fi
echo "--> Adding Apps to the Menu..." echo "--> Adding Apps to the Menu..."

View File

@ -78,12 +78,12 @@ def QubesVm_appmenus_create(self, verbose=False, source_template = None):
try: try:
if source_template is not None: 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: 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: else:
# Only add apps to menu # 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: except subprocess.CalledProcessError:
print >> sys.stderr, "Ooops, there was a problem creating appmenus for {0} VM!".format (self.name) print >> sys.stderr, "Ooops, there was a problem creating appmenus for {0} VM!".format (self.name)

View File

@ -197,7 +197,7 @@ def create_template(path, values):
desktop_file.write("Icon={0}\n".format(os.path.join( desktop_file.write("Icon={0}\n".format(os.path.join(
'%VMDIR%', vm_files['appmenus_icons_subdir'], icon_file))) '%VMDIR%', vm_files['appmenus_icons_subdir'], icon_file)))
else: else:
desktop_file.write("Icon=%VMDIR%/icon.png\n") desktop_file.write("Icon=%XDGICON%\n")
for key in ["Name", "GenericName" ]: for key in ["Name", "GenericName" ]:
if values.has_key(key): if values.has_key(key):