diff --git a/bin/mb-volmenu b/bin/mb-volmenu new file mode 100755 index 0000000..cff31c8 --- /dev/null +++ b/bin/mb-volmenu @@ -0,0 +1,118 @@ +#!/bin/bash +# mb-volmenu + +. ~/.config/mabox/mabox.conf + +me="mb-volmenu ipc" + +case $LANG in + pl*) + TITLE="Menu dźwięku" + VOLCONTROL="Kontrola Głośności" + MUSIC_PLAYERS="Odtwarzacze dżwięku" + MUSIC_MENU="Menu Muzyka" + PYRTERM="PyRadio w terminalu" + PYRQUAKE="PyRadio pokaż-ukryj" + VIS="Wizualizacja" + KILLCAVA="Zabij Cava" + COLORIZE="Pokoloruj..." + COL_CAVA="Pokoloruj Cava" + COL_PYRADIO="Pokoloruj PyRadio" + ;; + es*) + TITLE="Audio Menu" + VOLCONTROL="Volume Control" + MUSIC_PLAYERS="Music Players" + MUSIC_MENU="Music Menu" + PYRTERM="PyRadio in terminal" + PYRQUAKE="PyRadio show-hide" + VIS="Visualization" + KILLCAVA="Zabij Cava" + COLORIZE="Colorize..." + COL_CAVA="Colorize Cava" + COL_PYRADIO="Colorize PyRadio" + ;; + *) + TITLE="Audio Menu" + VOLCONTROL="Volume Control" + MUSIC_PLAYERS="Music Players" + MUSIC_MENU="Music Menu" + PYRTERM="PyRadio in terminal" + PYRQUAKE="PyRadio show-hide" + VIS="Visualization" + KILLCAVA="Kill Cava" + COLORIZE="Colorize..." + COL_CAVA="Colorize Cava" + COL_PYRADIO="Colorize PyRadio" + ;; +esac + +colorizer=0 + +out+=("^sep($TITLE)") +out+=("$VOLCONTROL [W-r],jumpapp -m pavucontrol") +out+=("^sep($MUSIC_PLAYERS)") +hash audacious 2>/dev/null && out+=("Audacious,jumpapp audacious") +hash qmmp 2>/dev/null && out+=("Qmmp,jumpapp -c Qmmp qmmp") +hash spotify 2>/dev/null && out+=("Spotify,jumpapp spotify") +hash strawberry 2>/dev/null && out+=("Strawberry,jumpapp strawberry") +out+=("$MUSIC_MENU [W-m],mb-music -s") +if pgrep -f "/usr/bin/python /usr/bin/pyradio" >/dev/null ;then + outC+=("$COL_PYRADIO,colorizer-pyradio -s") + colorizer=1 +else + #out+=("$START_PYRADIO W + r ,xdotool key super+r;$me") + out+=("^sep(Radio)") + out+=("$PYRTERM,terminator --icon=/usr/share/icons/pyradio.png --geometry=564x440-20-20 -x pyradio -lt") + out+=("$PYRQUAKE [W-r],quake-radio") +fi + +out+=("^sep($VIS)") +if pgrep -f cavatransparent >/dev/null ;then + out+=("󰺢 $KILLCAVA,cavactl stop") + colorizer=1 + outC+=("$COL_CAVA,colorizer-cava -s") +else + out+=("󰺢 Cava,cavactl start && ${me}") +fi + + +if [[ "${colorizer}" == "1" ]] ;then + out+=("^sep($COLORIZE)") + out+=("${outC[@]}") +fi + + + + + +### RUN +if [[ "$1" == "-s" || "$1" == "ipc" ]]; then +. /usr/share/mb-jgtools/pipemenu-standalone.cfg +. $HOME/.config/mabox/mabox.conf + +MENU_PADDING_TOP=${jgtools_padding:-0} +MENU_HALIGN="left" +JGWIDTH=270 +TABS=200 +if [[ "$1" == "ipc" ]]; then +POSITION_MODE="ipc" +else +POSITION_MODE="fixed" +fi + +[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius +[ -z $jgmenu_use_borders ] && menu_border=0 + +mkconfigfile +cat < ${MENU_ITEMS} +$(printf '%s\n' "${out[@]}") +$(printf '%s\n' "${out2[@]}") +EOF +jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null +exit 0 +fi + +# DEBUG +#printf '%s\n' "${out[@]}" +#printf '%s\n' "${out2[@]}" diff --git a/bin/transparent-cava b/bin/transparent-cava index 3cd36fb..b177068 100755 --- a/bin/transparent-cava +++ b/bin/transparent-cava @@ -1,7 +1,8 @@ #!/bin/bash -#: Usage: transparent-cava (height in pixels) (width full or half) -#: example transparent-cava 100 full -#: default is 200px height and half width +#: transparent-cava (height in pixels) (width full, half or third) + + +. ~/.config/mabox/mabox.conf CONFIG_DIR="$HOME/.config/terminator" CONFIG_FILE="$CONFIG_DIR/cava-transparent" @@ -29,15 +30,19 @@ cat < ${CONFIG_FILE} EOF fi -CAVA_HEIGHT=${1:-200} -CAVA_WIDTH=${2:-half} + +CAVA_HEIGHT=${cava_height:-200} +CAVA_WIDTH=${cava_width:-half} WIDTH=$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f1) HEIGHT=$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f2) TOP=$((HEIGHT-CAVA_HEIGHT)) LEFT=0 -if [ "$CAVA_WIDTH" != "full" ];then +if [ "$CAVA_WIDTH" == "half" ];then LEFT=$((WIDTH/4)) WIDTH=$((WIDTH/2)) +elif [ "$CAVA_WIDTH" == "third" ];then +LEFT=$((WIDTH/3)) +WIDTH=$((WIDTH/3)) else : fi