#!/bin/bash # # SCRIPT NAME: # power.sh # # AUTHOR: # Severin Kaderli # # 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