From ed28769d9bb4a16f10487637f7509bdc5584acac Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Tue, 5 Sep 2023 10:38:00 +0200 Subject: [PATCH] quake-term, transparent-cava --- bin/mabox-terminal | 16 ++++++---------- bin/transparent-cava | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/bin/mabox-terminal b/bin/mabox-terminal index ee3a76b..b8bf525 100755 --- a/bin/mabox-terminal +++ b/bin/mabox-terminal @@ -1,7 +1,7 @@ #!/bin/bash # Author: Daniel Napora -# "Show-Hide" terminal wrapper for terminator for use with keybind eg. super + enter. +# "Show-Hide" terminal wrapper for terminator for use with keybind eg. C-~ or F12. # Depenging on actual state it will start, show or hide terminal window. GEOMETRY_FILE="$HOME/.config/mabox/.quake-term" @@ -12,7 +12,7 @@ ID=$(wmctrl -x -l | grep ${NAME} | awk '{print $1}' | head -n 1) if [ -z "${ID}" ]; then if [ -f "$GEOMETRY_FILE" ]; then POS=$(head -n 1 $GEOMETRY_FILE) - terminator -T ${NAME} -b --geometry "$POS" + terminator -T ${NAME} -b --geometry "$POS" -i utilities-terminal else TOP=$(wmctrl -d|grep "*"|awk '{print $8}'|cut -d',' -f2) LEFT=$[$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f1)/8] @@ -28,21 +28,17 @@ else else xdotool windowactivate ${ID_DEC} fi + eval $(xdotool getwindowgeometry --shell $(xdotool search --name $NAME)) + echo "${WIDTH}x${HEIGHT}+${X}+${Y}" > $GEOMETRY_FILE fi } -__save() { - eval $(xdotool getwindowgeometry --shell $(xdotool getactivewindow)) - echo "${WIDTH}x${HEIGHT}+${X}+${Y}" > $GEOMETRY_FILE - -} __reset() { - rm -f $GEOMETRY_FILE + rm "$GEOMETRY_FILE" } case "$1" in - save) __save;; - reset) __reset;; + reset) __reset;; *) __run;; esac diff --git a/bin/transparent-cava b/bin/transparent-cava index 81bd414..e1f2776 100755 --- a/bin/transparent-cava +++ b/bin/transparent-cava @@ -1,5 +1,5 @@ #!/bin/bash -#: Usage: transparent-cava (height in pixels) (width full or halt) +#: Usage: transparent-cava (height in pixels) (width full or half) #: example transparent-cava 100 full #: default is 200px height and half width @@ -42,4 +42,4 @@ else : fi -terminator -b -g "${CONFIG_FILE}" -T cavatransparent --geometry "${WIDTH}x${CAVA_HEIGHT}+${LEFT}+${TOP}" +terminator -b -g "${CONFIG_FILE}" -T cavatransparent --geometry "${WIDTH}x${CAVA_HEIGHT}+${LEFT}+${TOP}" -i amarok_playcount