-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path0001-fix-polkit.patch
More file actions
106 lines (103 loc) · 4.32 KB
/
Copy path0001-fix-polkit.patch
File metadata and controls
106 lines (103 loc) · 4.32 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
commit d1385da5037719ef427b6c37de38275e574362e7
Author: Arthur Bols <arthur@bols.dev>
Date: Wed Jan 24 17:33:18 2024 +0100
Fix polkit policy
- Remove unused actions
- Add howdy-gtk action
diff --git a/howdy-gtk/meson.build b/howdy-gtk/meson.build
index c820799..dd39199 100644
--- a/howdy-gtk/meson.build
+++ b/howdy-gtk/meson.build
@@ -79,3 +79,17 @@ install_data(
install_dir: get_option('prefix') / get_option('bindir'),
install_tag: 'bin',
)
+
+if get_option('with_polkit')
+ polkit_config = configure_file(
+ input: 'src/polkit/com.github.boltgolt.howdy-gtk.policy.in',
+ output: 'com.github.boltgolt.howdy-gtk.policy',
+ configuration: {'script_path': cli_path, 'python_path': py.full_path()}
+ )
+ install_data(
+ polkit_config,
+ install_dir: get_option('prefix') / get_option('datadir') / 'polkit-1' / 'actions',
+ install_mode: 'rw-r--r--',
+ install_tag: 'polkit',
+ )
+endif
diff --git a/howdy-gtk/src/polkit/com.github.boltgolt.howdy-gtk.policy.in b/howdy-gtk/src/polkit/com.github.boltgolt.howdy-gtk.policy.in
new file mode 100644
index 0000000..bf2c716
--- /dev/null
+++ b/howdy-gtk/src/polkit/com.github.boltgolt.howdy-gtk.policy.in
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD polkit Policy Configuration 1.0//EN"
+ "https://specifications.freedesktop.org/PolicyKit/1.0/policyconfig.dtd">
+<policyconfig>
+ <vendor>boltgolt</vendor>
+ <vendor_url>https://github.com/boltgolt/howdy</vendor_url>
+ <icon_name>howdy-gtk</icon_name>
+ <action id="com.github.boltgolt.howdy-gtk">
+ <description>Howdy interface</description>
+ <message>Authentication is required to run howdy-gtk</message>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">@python_path@</annotate>
+ <annotate key="org.freedesktop.policykit.exec.argv1">@script_path@</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
\ No newline at end of file
diff --git a/howdy/fedora/com.github.boltgolt.howdy.policy b/howdy/fedora/com.github.boltgolt.howdy.policy
deleted file mode 100644
index de571ee..0000000
--- a/howdy/fedora/com.github.boltgolt.howdy.policy
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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.0/policyconfig.dtd">
-<policyconfig>
-
- <vendor>boltgolt</vendor>
- <vendor_url>https://github.com/boltgolt/</vendor_url>
- <action id="com.github.boltgolt.howdy.add">
- <_description>Add user profile</_description>
- <_message>Privileges are required to verify facial recognition.</_message>
- <defaults>
- <allow_any>no</allow_any>
- <allow_inactive>no</allow_inactive>
- <allow_active>yes</allow_active>
- </defaults>
- </action>
-
- <action id="com.github.boltgolt.howdy.remove">
- <_description>Remove user profile</_description>
- <_message>Privileges are required to verify facial recognition.</_message>
- <defaults>
- <allow_any>no</allow_any>
- <allow_inactive>no</allow_inactive>
- <allow_active>yes</allow_active>
- </defaults>
- </action>
-
-</policyconfig>
diff --git a/meson.options b/meson.options
index 1a35b81..a294ace 100644
--- a/meson.options
+++ b/meson.options
@@ -6,4 +6,5 @@ option('user_models_dir', type: 'string', value: '', description: 'Set the user
option('log_path', type: 'string', value: '/var/log/howdy', description: 'Set the log file path')
option('install_in_site_packages', type: 'boolean', value: false, description: 'Install howdy python files in site packages')
option('py_sources_dir', type: 'string', value: '', description: 'Set the python sources directory')
-option('install_pam_config', type: 'boolean', value: false, description: 'Install pam config file (for Debian/Ubuntu)')
\ No newline at end of file
+option('install_pam_config', type: 'boolean', value: false, description: 'Install pam config file (for Debian/Ubuntu)')
+option('with_polkit', type: 'boolean', value: false, description: 'Install polkit policy config file')
\ No newline at end of file