summaryrefslogtreecommitdiff
path: root/polybar/scripts/bar-mode-status.sh
diff options
context:
space:
mode:
authorDavid Moc <personal@cdatgoose.org>2026-05-24 11:48:07 +0200
committerDavid Moc <personal@cdatgoose.org>2026-05-24 11:48:07 +0200
commit5fb19f10389b70ee2389755106092a9ef6c64598 (patch)
tree969eb0466de581cb14aa09f751a95138620fc720 /polybar/scripts/bar-mode-status.sh
Go
Diffstat (limited to 'polybar/scripts/bar-mode-status.sh')
-rwxr-xr-xpolybar/scripts/bar-mode-status.sh18
1 files changed, 18 insertions, 0 deletions
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