Add power menu to polybar
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
7bf11a5cdb
commit
6270596a5d
5 changed files with 50 additions and 10 deletions
33
system/bin/power.sh
Executable file
33
system/bin/power.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# SCRIPT NAME:
|
||||
# power.sh
|
||||
#
|
||||
# AUTHOR:
|
||||
# Severin Kaderli <severin.kaderli@gmail.com>
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# Displays a power menu using zenity.
|
||||
#
|
||||
# USAGE:
|
||||
# ./power.sh
|
||||
|
||||
TEXT="Choose action"
|
||||
WIDTH=400
|
||||
HEIGHT=200
|
||||
ACTIONS=(
|
||||
"Reboot"
|
||||
"Shutdown"
|
||||
)
|
||||
|
||||
action=$(zenity --list --width="${WIDTH}" --height="${HEIGHT}" --text="${TEXT}" --column="Action" "${ACTIONS[@]}")
|
||||
|
||||
echo "$action"
|
||||
if [ "${action}" == "Reboot" ]
|
||||
then
|
||||
systemctl reboot
|
||||
elif [ "${action}" == "Shutdown" ]
|
||||
then
|
||||
systemctl poweroff
|
||||
fi
|
||||
|
|
@ -13,4 +13,4 @@
|
|||
# USAGE:
|
||||
# ./resolution.sh
|
||||
#xrandr --setprovideroutputsource modesetting NVIDIA-0
|
||||
xrandr --output HDMI3 --off --output HDMI2 --off --output HDMI1 --mode 1280x1024 --pos 80x56 --rotate normal --output eDP1 --primary --mode 1920x1080 --pos 1360x0 --rotate normal --output DP3 --off --output DP2 --off --output DP1 --off
|
||||
xrandr --output HDMI3 --off --output HDMI2 --off --output HDMI-1 --mode 1280x1024 --pos 80x56 --rotate normal --output eDP-1 --primary --mode 1920x1080 --pos 1360x0 --rotate normal --output DP3 --off --output DP2 --off --output DP1 --off
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue