summaryrefslogtreecommitdiff
path: root/polybar/scripts/bar-mode-status.sh
diff options
context:
space:
mode:
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