-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgenerate_desktop_files
executable file
·67 lines (52 loc) · 1.86 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 = "mintnanny"
PATH = "/usr/share/linuxmint/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=pkexec mintnanny
Icon=mintnanny
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Application;System;Settings;
StartupNotify=false
NotShowIn=KDE;
"""
additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/mintNanny.desktop", prefix, _("Domain Blocker"), _("Block access to selected domain names"), suffix)
prefix = "[Desktop Entry]\n"
suffix = """Exec=pkexec mintnanny
Icon=mintnanny
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Qt;KDE;Settings;
X-KDE-StartupNotify=false
OnlyShowIn=KDE;
"""
additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/kde4/mintNanny.desktop", prefix, _("Domain Blocker"), _("Block access to selected domain names"), suffix, genericName=_("Parental Control"))
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.mintnanny">
<icon_name>mintnanny</icon_name>
"""
suffix = """
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/mintnanny</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.mintnanny.policy", prefix, _("Domain Blocker"), suffix)