#!/bin/sh # switch power state using dmenu sel=$(printf 'poweroff\nreboot\nsuspend\nlock' \ | dmenu -f -i -l 4 \ ) case "${sel}" in poweroff|reboot|suspend) systemctl "${sel}" ;; lock) lock ;; esac