09-17-2017, 11:40 AM
(This post was last modified: 09-18-2017, 06:07 AM by MarkHaysHarris777.)
Greetings,
I'm going to expand a bit on the previous post by allowing for a parameter to be passed to the Pb_poweroff.sh script so that more than one key-binding may trigger the script for a different desired affect -- reboot for instance. So let's first make some minor changes to the script in /usr/local/sbin/
Pb_poweroff.sh
Code:
#!/bin/sh
if [ "$1" = "OFF" ]
then
systemctl poweroff
else
systemctl reboot
fi
The default of the above script is to reboot the Pinebook, regardless of parameter. On the other hand, if the parameter passed is "OFF" then the command script will shutdown and power off the Pinebook as expected.
To make the changes effective lets change our power off bindsym in ~/.config/i3/config to the following:
bindsym $mod+Shift+XF86_PowerOff exec sudo /usr/local/sbin/Pb_poweroff.sh OFF
To make the reboot change effective add the following bindsym to ~/.config/i3/config :
bindsym $mod+Control+XF86_PowerOff exec sudo /usr/local/sbin/Pb_poweroff.sh REBOOT
Notice I've changed the modifier key from Shift to Control, and I've changed the parameter to REBOOT. The effect is that the power button used with $mod+Shift will power off, while the power button used with $mod+Control will in fact reboot the system.
Note: to make the changes active press $mod+Shift+c to re-read the config file, or press $mod+Shift+r to restart the i3 window manager.
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )