#!/bin/sh

mode=$(echo -e "󰤄\n⏻\n" | rofi \
    -modes drun,run,calc \
    -dmenu -p "Power menu" \
    -theme "$HOME/.config/rofi/styles/style-powermenu.rasi" \
    -markup-rows \
    -drun-use-desktop-cache \
)

case "$mode" in
    "󰤄")
        systemctl suspend
        ;;
    "⏻")
        systemctl poweroff
        ;;
    "")
        systemctl reboot
        ;;
    *)
        exit 0
        ;;
esac
