#!/usr/bin/env fish

set message

if test (mpc status %consume%) = "on"
	set -a message "󰉚"
else
	set -a message "󰗳"
end

if test (mpc status %random%) = "on"
	set -a message "󰒟"
else
	set -a message "󰒞"
end

if test (mpc status %repeat%) = "on"
	set -a message "󰑖"
else
	set -a message "󰑗"
end

if test (mpc status %single%) = "on"
	set -a message "󰎄"
else
	set -a message "󰌳"
end

set options "󰐎 Play/Pause" "󰓛 Stop" "󰒭 Next" "󰒮 Previous" "󰉚 Consume" "󰒟 Random" "󰑖 Repeat" "󰎄 Single" 

set input (menu --mesg="$(mpc current --format "%artist% - %album% - %title%")
$(string join -- ' ' $message)" $options)

switch $input
	case $options[1]
		mpc consume
	case $options[2]
		mpc random
	case $options[3]
		mpc repeat
	case $options[4]
		mpc single
end
