summaryrefslogtreecommitdiff
path: root/polybar/scripts/display-status.sh
blob: 620e3da373a4cfd80ec87cd6164d63d7b32fff33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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