#!/bin/bash bar_config=$(swaymsg -t get_bar_config "bar-0") mode=$(echo "$bar_config" | jq -r '.mode') if [ "$mode" == "dock" ]; then swaymsg "bar mode invisible" elif [ "$mode" == "invisible" ]; then swaymsg "bar mode dock" fi