summaryrefslogtreecommitdiffstats
path: root/testing/source/vtown/kde/post-install/powerdevil.post-install
blob: 4d6b9f836231cd9315ca7ecafbc91a19a9535eeb (about) (plain) (blame)
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
# Move the polkit dbus configuration files to the proper place:
mkdir -p $PKG/etc
mv $PKG/etc/kde/dbus-1 $PKG/etc/

mkdir -p $PKG/etc/polkit-1/rules.d

# Add upower policy allowing users in the 'power' group
# to suspend/hibernate the computer:
install -m 0644 -o root \
  $CWD/post-install/powerdevil/10-enable-upower-suspend.rules \
  $PKG/etc/polkit-1/rules.d/10-enable-upower-suspend.rules.new

if [ "$SLKELOGIND" == "no" ]; then
  # Add ConsoleKit2 policy file that allows users in the 'power' group
  # to shutdown/reboot the computer:
  install -m 0644 -o root \
    $CWD/post-install/powerdevil/10-enable-ck2-power.rules \
    $PKG/etc/polkit-1/rules.d/10-enable-session-power.rules.new
else
  # Add login1 policy file that allows users in the 'power' group
  # to shutdown/reboot the computer:
  install -m 0644 -o root \
    $CWD/post-install/powerdevil/10-enable-elogind-power.rules \
    $PKG/etc/polkit-1/rules.d/10-enable-session-power.rules.new
  # Add powerdevil policy file that allows users in the 'power' group
  # to check for existence of a discrete gpu:
  install -m 0644 -o root \
    $CWD/post-install/powerdevil/10-enable-powerdevil-discrete-gpu.rules \
    $PKG/etc/polkit-1/rules.d/10-enable-powerdevil-discrete-gpu.rules.new
fi