51 lines
1.2 KiB
Bash
Executable File
51 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#: 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"
|
|
if [ ! -f $CONFIG_FILE ]; then
|
|
cat <<EOF > ${CONFIG_FILE}
|
|
[global_config]
|
|
dbus = False
|
|
[keybindings]
|
|
[profiles]
|
|
[[default]]
|
|
allow_bold = False
|
|
background_darkness = 0.0
|
|
background_type = transparent
|
|
cursor_blink = False
|
|
cursor_color = "#aaaaaa"
|
|
font = Sans 2
|
|
show_titlebar = False
|
|
scrollbar_position = hidden
|
|
scroll_on_keystroke = False
|
|
use_custom_command = True
|
|
custom_command = cava
|
|
use_system_font = False
|
|
[layouts]
|
|
[plugins]
|
|
EOF
|
|
fi
|
|
|
|
|
|
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" == "half" ];then
|
|
LEFT=$((WIDTH/4))
|
|
WIDTH=$((WIDTH/2))
|
|
elif [ "$CAVA_WIDTH" == "third" ];then
|
|
LEFT=$((WIDTH/3))
|
|
WIDTH=$((WIDTH/3))
|
|
else
|
|
:
|
|
fi
|
|
|
|
terminator -b -g "${CONFIG_FILE}" -T cavatransparent --geometry "${WIDTH}x${CAVA_HEIGHT}+${LEFT}+${TOP}" -i amarok_playcount
|