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