appmenus: force X-Qubes-VM category for all VM-related entries

This will ease filtering entries when constructing applications menu.
For example '<OnlyUnallocated/>' key used in Xfce4 before looks to
introduce some problems.

Fixes QubesOS/qubes-issues#2129
This commit is contained in:
Marek Marczykowski-Górecki 2016-07-15 11:31:27 +02:00
parent e90c8a97ff
commit 7080c0371d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
4 changed files with 6 additions and 3 deletions

View File

@ -7,4 +7,4 @@ Terminal=false
Name=%VMNAME%: Add more shortcuts... Name=%VMNAME%: Add more shortcuts...
GenericName=%VMNAME%: Add more shortcuts... GenericName=%VMNAME%: Add more shortcuts...
StartupNotify=false StartupNotify=false
Categories=System; Categories=System;X-Qubes-VM;

View File

@ -7,4 +7,4 @@ Terminal=false
Name=DispVM: Firefox web browser Name=DispVM: Firefox web browser
GenericName=DispVM: Web browser GenericName=DispVM: Web browser
StartupNotify=false StartupNotify=false
Categories=Network; Categories=Network;X-Qubes-VM;

View File

@ -7,4 +7,4 @@ Terminal=false
Name=%VMNAME%: Start Name=%VMNAME%: Start
GenericName=%VMNAME%: Start GenericName=%VMNAME%: Start
StartupNotify=false StartupNotify=false
Categories=System; Categories=System;X-Qubes-VM;

View File

@ -213,6 +213,9 @@ def create_template(path, values):
if key in values: if key in values:
desktop_entry += "{0}=%VMNAME%: {1}\n".format(key, values[key]) desktop_entry += "{0}=%VMNAME%: {1}\n".format(key, values[key])
# force category X-Qubes-VM
values["Categories"] = values.get("Categories", "") + "X-Qubes-VM;"
for key in ["Comment", "Categories"]: for key in ["Comment", "Categories"]:
if key in values: if key in values:
desktop_entry += "{0}={1}\n".format(key, values[key]) desktop_entry += "{0}={1}\n".format(key, values[key])