#!/bin/bash
#
# Show caffeine status

coffee=$(pgrep -f caffeine-ng | grep -q . && echo "running" || echo "not")

if [ -n "$1" ]; then
	if [ "$1" = "toggle" ]; then
		if [ "$coffee" = "running" ]; then
			caffeine kill
			echo "󰛨"
			exit 1
		elif [ "$coffee" = "not" ]; then
			caffeine start &
			echo "󰹏"
			exit 1
		fi
	fi
else
	if [ "$coffee" = "running" ]; then
		echo "󰛨"
	elif [ "$coffee" = "not" ]; then
		echo "󰹏"
	fi
fi
