-
Notifications
You must be signed in to change notification settings - Fork 73
/
generate_desktop_files
executable file
·53 lines (41 loc) · 1.71 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
#!/usr/bin/python3
DOMAIN = "mintsources"
PATH = "/usr/share/linuxmint/locale"
import os, gettext, sys
sys.path.append('/usr/lib/linuxmint/common')
from mintcommon import additionalfiles
os.environ['LANGUAGE'] = "en_US.UTF-8"
gettext.install(DOMAIN, PATH)
prefix = "[Desktop Entry]\n"
suffix = """Exec=pkexec mintsources
Icon=mintsources
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=software-properties
MimeType=text/x-apt-sources-list;
"""
additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/mintsources.desktop", prefix, _("Software Sources"), _("Configure the sources for installable software and updates"), suffix)
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.mintsources">
<icon_name>mintsources</icon_name>
"""
suffix = """
<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/mintsources</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>
"""
additionalfiles.generate_polkit_policy(DOMAIN, PATH, "usr/share/polkit-1/actions/com.linuxmint.mintsources.policy", prefix, _("Software Sources"), suffix)