From 5fb19f10389b70ee2389755106092a9ef6c64598 Mon Sep 17 00:00:00 2001 From: David Moc Date: Sun, 24 May 2026 11:48:07 +0200 Subject: Go --- polybar/scripts/bar-mode-status.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 polybar/scripts/bar-mode-status.sh (limited to 'polybar/scripts/bar-mode-status.sh') diff --git a/polybar/scripts/bar-mode-status.sh b/polybar/scripts/bar-mode-status.sh new file mode 100755 index 0000000..7e6d787 --- /dev/null +++ b/polybar/scripts/bar-mode-status.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +state_dir="${XDG_RUNTIME_DIR:-/tmp}" +if [ ! -w "$state_dir" ]; then + state_dir="${XDG_CACHE_HOME:-$HOME/.cache}" +fi +if [ ! -w "$state_dir" ]; then + state_dir="/tmp" +fi + +mode_file="$state_dir/polybar-mode.state" + +if [ -r "$mode_file" ] && [ "$(cat "$mode_file")" = "full" ]; then + echo "%{F#d79921}less%{F-}" +else + echo "%{F#98971a}more%{F-}" +fi -- cgit v1.2.3