#!/bin/bash

selected=$(printf "Lock\0icon\x1fsystem-lock-screen
Update\0icon\x1fsystem-software-update
Shutdown\0icon\x1fsystem-shutdown
Reboot\0icon\x1fsystem-reboot
Exit i3\0icon\x1fsystem-log-out
Reload i3\0icon\x1fsystem-log-out
Restart i3\0icon\x1fsystem-log-out" | rofi -dmenu -show-icons -i -theme disconnect -p System)

echo "$selected"

case $selected in
  "Reload i3")
    i3 reload
    ;;
  "Restart i3")
    i3 restart
    ;;
  "Exit i3")
    i3 exit
    ;;
  "Update")
    kitty /usr/local/share/dotfiles/scripts/update.sh
    ;;
  "Lock")
    /usr/local/share/dotfiles/scripts/i3lock.sh
    ;;
  "Shutdown")
    systemctl poweroff
    ;;
  "Reboot")
    reboot
    ;;
esac
