2022-03-13 14:38:01 +01:00
|
|
|
#!/bin/bash
|
2023-09-05 10:38:00 +02:00
|
|
|
#: Usage: transparent-cava (height in pixels) (width full or half)
|
2022-03-13 14:38:01 +01:00
|
|
|
#: example transparent-cava 100 full
|
|
|
|
#: default is 200px height and half width
|
|
|
|
|
|
|
|
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"
|
2024-01-25 13:54:28 +01:00
|
|
|
font = Sans 2
|
2022-03-13 14:38:01 +01:00
|
|
|
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=${1:-200}
|
|
|
|
CAVA_WIDTH=${2:-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
|
|
|
|
LEFT=$((WIDTH/4))
|
|
|
|
WIDTH=$((WIDTH/2))
|
|
|
|
else
|
|
|
|
:
|
|
|
|
fi
|
|
|
|
|
2023-09-05 10:38:00 +02:00
|
|
|
terminator -b -g "${CONFIG_FILE}" -T cavatransparent --geometry "${WIDTH}x${CAVA_HEIGHT}+${LEFT}+${TOP}" -i amarok_playcount
|