#!/usr/bin/env bash

CFG="$HOME/.config/eww/arin/sidedar"
EWW=`which eww`

close_eww() {
	${EWW} --config "$CFG" close resources logout suspend lock reboot shutdown quotes
}

## Options #############################################
if  [[ $1 = "--lock" ]]; then
	close_eww
    betterlockscreen --lock

elif  [[ $1 = "--logout" ]]; then
	close_eww
    #openbox --exit
    berryc quit

elif  [[ $1 = "--suspend" ]]; then
	close_eww
	amixer set Master mute
	systemctl suspend

elif  [[ $1 = "--reboot" ]]; then
	close_eww
    systemctl reboot

elif  [[ $1 = "--shutdown" ]]; then
	close_eww
    systemctl poweroff

## Help Menu #############################################
else
echo "
Available options:
--lock	--logout	--suspend	--reboot	--shutdown
"
fi
