Commit 13f43fa 1 parent 4ddbb9c commit 13f43fa Copy full SHA for 13f43fa
File tree 4 files changed +32
-1
lines changed
4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ function install {
65
65
cp -r scripts/ /usr/local/share/auto-cpufreq/
66
66
cp -r images/ /usr/local/share/auto-cpufreq/
67
67
cp images/icon.png /usr/share/pixmaps/auto-cpufreq.png
68
+ cp scripts/org.auto-cpufreq.pkexec.policy /usr/share/polkit-1/actions
68
69
69
70
# this is necessary since we need this script before we can run auto-cpufreq itself
70
71
cp scripts/auto-cpufreq-venv-wrapper /usr/local/bin/auto-cpufreq
Original file line number Diff line number Diff line change 27
27
28
28
warnings .filterwarnings ("ignore" )
29
29
30
+ # add path to auto-cpufreq executables for GUI
31
+ os .environ ["PATH" ] += ":/usr/local/bin"
32
+
30
33
# ToDo:
31
34
# - replace get system/CPU load from: psutil.getloadavg() | available in 5.6.2)
32
35
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE policyconfig PUBLIC
3
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
4
+ "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
5
+ <policyconfig >
6
+ <action id =" org.auto-cpufreq.pkexec" >
7
+ <description >Run auto-cpufreq command</description >
8
+ <message >Authentication is required to run auto-cpufreq</message >
9
+ <icon_name >auto-cpufreq</icon_name >
10
+ <defaults >
11
+ <allow_any >auth_admin</allow_any >
12
+ <allow_inactive >auth_admin</allow_inactive >
13
+ <allow_active >auth_admin</allow_active >
14
+ </defaults >
15
+ <annotate key =" org.freedesktop.policykit.exec.path" >/opt/auto-cpufreq/venv/bin/python</annotate >
16
+ <annotate key =" org.freedesktop.policykit.exec.argv1" >/opt/auto-cpufreq/venv/bin/app.py</annotate >
17
+ <annotate key =" org.freedesktop.policykit.exec.allow_gui" >true</annotate >
18
+ </action >
19
+ </policyconfig >
Original file line number Diff line number Diff line change @@ -5,4 +5,12 @@ venv_dir=/opt/auto-cpufreq/venv
5
5
. " ${venv_dir} /bin/activate"
6
6
python_command=" ${venv_dir} /bin/python ${venv_dir} /bin/app.py"
7
7
8
- pkexec env DISPLAY=$DISPLAY WAYLAND_DISPLAY=$WAYLAND_DISPLAY XDG_SESSION_TYPE=$XDG_SESSION_TYPE XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY GTK_THEME=$GTK_THEME PATH=$PATH ${python_command}
8
+ if [ " $XDG_SESSION_TYPE " = " wayland" ] ; then
9
+ # necessary for running on wayland
10
+ xhost +SI:localuser:root
11
+ pkexec ${python_command}
12
+ xhost -SI:localuser:root
13
+ xhost
14
+ else
15
+ pkexec ${python_command}
16
+ fi
You can’t perform that action at this time.
0 commit comments