-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathgenerate_desktop_files
executable file
·67 lines (52 loc) · 1.98 KB
/
generate_desktop_files
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/python3
DOMAIN = "mintdrivers"
PATH = "/usr/share/locale"
import os
import gettext
from mintcommon import additionalfiles
os.environ['LANGUAGE'] = "en_US.UTF-8"
gettext.install(DOMAIN, PATH)
prefix = "[Desktop Entry]\n"
suffix = """Exec=driver-manager
Icon=mintdrivers
Terminal=false
X-MultipleArgs=false
Type=Application
Categories=GNOME;GTK;System;Settings;X-GNOME-SystemSettings;X-GNOME-Settings-Panel;XFCE;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;
X-GNOME-Settings-Panel=driver-manager
X-KDE-SubstituteUID=true
NotShowIn=KDE;
"""
additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/mintdrivers.desktop", prefix, _("Driver Manager"), _("Additional and proprietary drivers"), suffix)
prefix = "[Desktop Entry]\n"
suffix = """Exec=driver-manager
Icon=mintdrivers
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Qt;KDE;System;
X-KDE-StartupNotify=false
OnlyShowIn=KDE;
"""
additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/kde4/mintdrivers.desktop", prefix, _("Driver Manager"), _("Additional and proprietary drivers"), suffix, genericName=_("Manage the drivers for your devices"))
prefix = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>Linux Mint</vendor>
<vendor_url>https://linuxmint.com/</vendor_url>
<action id="com.linuxmint.mintdrivers">
"""
suffix = """
<icon_name>mintdrivers</icon_name>
<defaults>
<allow_any>auth_admin_keep</allow_any>
<allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/mintdrivers-add-live-media</annotate>
</action>
</policyconfig>
"""
additionalfiles.generate_polkit_policy(DOMAIN, PATH, "usr/share/polkit-1/actions/com.linuxmint.mintdrivers.policy", prefix, _("Mount installation media"), suffix)