#!/bin/bash
# a simple logout dialog

# launch exit menu
choice=$(printf "\n\n\n\n\n\n" | \
    rofi -theme /usr/share/nakedrasi/nakedquit.rasi -dmenu)

# execute the choice in background
case "$choice" in
  ) pgrep -x i3 > /dev/null && i3-msg exit || xdotool key Ctrl+Alt+BackSpace & ;;
  ) i3lock-fancy & ;;
  ) systemctl suspend & ;;
  ) systemctl hibernate & ;;
  ) systemctl reboot & ;;
  ) systemctl poweroff & ;;
  ) exit ;;
esac

exit 0
