#!/bin/bash

# Qtile idle-inhibitor toggle
function toggle {
    if pgrep -f "swayidle" > /dev/null
    then
        systemctl --user stop swayidle.service
        notify-send -r 5556 -u normal "  Screensaver Disabled"
    else
        systemctl --user start swayidle.service
        notify-send -r 5556 -u normal "  Screensaver Enabled"
    fi
}

case $1 in
	toggle)
		toggle
		;;
	*)
		if pgrep -f "swayidle" > /dev/null
		then
			icon=""
		else
			icon=""
		fi
		printf "%s" "$icon"
		;;
esac

