-
Notifications
You must be signed in to change notification settings - Fork 24
/
generate_desktop_files
executable file
·52 lines (40 loc) · 1.55 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
#!/usr/bin/python3
DOMAIN = "lightdm-settings"
PATH = "/usr/share/locale"
import os, gettext
from mintcommon import additionalfiles
os.environ['LANGUAGE'] = "en_US.UTF-8"
gettext.install(DOMAIN, PATH)
prefix = """[Desktop Entry]
Encoding=UTF-8
"""
suffix = """Exec=pkexec lightdm-settings
Icon=lightdm-settings
StartupNotify=true
Terminal=false
Type=Application
Categories=GNOME;GTK;Settings;System;XFCE;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;
X-KDE-SubstituteUID=true
"""
additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/lightdm-settings.desktop", prefix, _("Login Window"), _("Configure the login window"), suffix)
prefix="""<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"https://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>Linux Mint</vendor>
<vendor_url>https://linuxmint.com/</vendor_url>
<action id="org.x.lightdm-settings">
"""
suffix="""
<icon_name>preferences-system-login</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/lightdm-settings</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>"""
additionalfiles.generate_polkit_policy(DOMAIN, PATH, "usr/share/polkit-1/actions/org.x.lightdm-settings.policy", prefix, _("Login Window"), suffix)