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/display-status.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 polybar/scripts/display-status.sh (limited to 'polybar/scripts/display-status.sh') diff --git a/polybar/scripts/display-status.sh b/polybar/scripts/display-status.sh new file mode 100755 index 0000000..620e3da --- /dev/null +++ b/polybar/scripts/display-status.sh @@ -0,0 +1,17 @@ +#!/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 +state_file="$state_dir/polybar-display-night.state" + +if [ -f "$state_file" ]; then + echo "%{F#d65d0e}night%{F-}" +else + echo "day" +fi -- cgit v1.2.3