#!/bin/bash

entries="⇠ Logout\n⏾ Suspend\n⭮ Reboot\n⏻ Shutdown"

selected=$(echo -e $entries|wofi --width 350 --height 250 --dmenu --cache-file /dev/null | awk '{print tolower($2)}')

cmd="{{- if .settings.systemd }}systemctl{{ else }}loginctl{{ end }}"

case $selected in
  logout)
    swaymsg exit;;
  suspend)
    exec ${cmd} suspend;;
  reboot)
    exec ${cmd} reboot;;
  shutdown)
    exec ${cmd} poweroff -i;;
esac
