Author: Adam Evyčędo <git@apiote.xyz>
hiding bar on full screen mpv
.config/sh/functions | 10 ++++------
diff --git a/.config/sh/functions b/.config/sh/functions index 545a0b4f4be51c7d22c9c81abd554a02734361e2..25eea9f4733be76bb30942a13f5b43b352ba7597 100644 --- a/.config/sh/functions +++ b/.config/sh/functions @@ -1319,16 +1319,14 @@ } barHider() { # TODO subscribe to workspace too, but jq throws some error - swaymsg -t subscribe -m "['window']" | script -E never -qfc "jq '[.change, .container.app_id] | @csv' -r" | while read -r line + swaymsg -t subscribe -m "['window']" | script -O /dev/null -E never -q -f -c "jq '[.change, .container.app_id] | @csv' -r" | while read -r line do change=$(echo "$line" | cut -d',' -f1 | tr -d '"') app=$(echo "$line" | cut -d',' -f2 | tr -d '"' | sed 's/\r//') - if [ "$app" = 'null' ] || { [ "$app" = 'mpv' ] && { [ "$change" = 'fullscreen_mode' ] || [ "$change" = 'close' ]; }; } - then - if swaymsg -t get_tree -r | jq '.. | objects | select(.app_id == "mpv") | [ .focused, .fullscreen_mode ] | @csv' | grep -q 'true,1' - then - swaymsg bar mode hide + if [ "$app" = 'null' ] || { [ "$app" = 'mpv' ] && { [ "$change" = 'fullscreen_mode' ] || [ "$change" = 'close' ]; }; }; then + if swaymsg -t get_tree -r | jq '.. | objects | select(.app_id == "mpv") | [ .focused, .fullscreen_mode ] | @csv' | grep -q 'true,1'; then + swaymsg bar mode dock else swaymsg bar mode overlay fi