From bfd6735c3da22ff147c2e188713f76494b149d96 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 21 Jul 2021 02:17:04 +0200 Subject: [PATCH] rofi-mediaplayer: switch to a module script --- bin/rofi-mediaplayer | 54 +++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/bin/rofi-mediaplayer b/bin/rofi-mediaplayer index 4f6009a..b5daf93 100755 --- a/bin/rofi-mediaplayer +++ b/bin/rofi-mediaplayer @@ -2,13 +2,30 @@ # Media player menu with rofi -mediaplayer=$1 -choice=$( - { +if [ -z "${ROFI_OUTSIDE}" ]; then + export mediaplayer=$1 + exec rofi -show-icons -no-custom -modi m:$0 -show m \ + -kb-select-1 Super+z \ + -kb-select-2 Super+x \ + -kb-select-3 Super+c \ + -kb-select-4 Super+v \ + -kb-select-5 Super+b \ + -kb-select-6 Super+m \ + -kb-select-7 Super+s +fi + +case $ROFI_RETV in + 0) + # Prompt + printf "\00prompt\x1fmedia player\n" + printf "\00message\x1f$...\n" + # Available actions + i=0 while read icon description do - printf "$description\00icon\37$icon\n" + i=$((i+1)) + printf "$description\00icon\x1f$icon\x1finfo\x1f$i\n" done <&2 + ;; esac