Skip to content

Commit

Permalink
Merge pull request #879 from principis/fix-polkit
Browse files Browse the repository at this point in the history
Fix polkit policy
  • Loading branch information
boltgolt authored Feb 1, 2025
2 parents 0a68a4b + b3e783e commit e87a99b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
14 changes: 14 additions & 0 deletions howdy-gtk/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 20 additions & 0 deletions howdy-gtk/src/polkit/com.github.boltgolt.howdy-gtk.policy.in
Original file line number Diff line number Diff line change
@@ -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>
29 changes: 0 additions & 29 deletions howdy/fedora/com.github.boltgolt.howdy.policy

This file was deleted.

3 changes: 2 additions & 1 deletion meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ 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)')
option('python_path', type: 'string', value: '/usr/bin/python', description: 'Set the path to the python executable')
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')

0 comments on commit e87a99b

Please # to comment.