#!/bin/sh # Media player menu with rofi if [ -z "${ROFI_OUTSIDE}" ]; then export mediaplayer=$1 export Mediaplayer=$(echo $1 | sed -E 's/(.)/\U\1/') exec rofi -no-lazy-grab -show-icons -no-custom -modi m:$0 -show m \ -kb-custom-1 Super+z \ -kb-custom-2 Super+x \ -kb-custom-3 Super+c \ -kb-custom-4 Super+v \ -kb-custom-5 Super+b \ -kb-custom-6 Super+n \ -kb-custom-7 Super+m \ -kb-custom-8 Super+s \ -kb-cancel Escape,Control+g,Super+Escape fi if [ $ROFI_RETV -ge 10 ] && [ $ROFI_RETV -le 28 ]; then ROFI_INFO=$((ROFI_RETV-9)) ROFI_RETV=1 fi playerctl="playerctl -p $mediaplayer" case $ROFI_RETV in 0) # Prompt printf "\00prompt\037media player\n" printf "\00message\037$...\n" printf "\00use-hot-keys\037true\n" # Available actions i=0 while read icon description do i=$((i+1)) printf "$description\00icon\037$icon\037info\037$i\n" done <&2 ;; esac