diff --git a/.config/i3/blocks/config b/.config/i3/blocks/config index 02aaaf5..9018e49 100644 --- a/.config/i3/blocks/config +++ b/.config/i3/blocks/config @@ -79,8 +79,8 @@ interval=10 [separator] -[battery] -interval=5 +[rotation] +interval=once [separator] @@ -90,6 +90,12 @@ interval=30 [separator] +[battery] +interval=30 +signal=11 + +[separator] + [clock] interval=10 min_width=" 00:00" diff --git a/.config/i3/blocks/rotation b/.config/i3/blocks/rotation new file mode 100755 index 0000000..99a55d5 --- /dev/null +++ b/.config/i3/blocks/rotation @@ -0,0 +1,20 @@ +#!/bin/sh + +lock="/tmp/rotlock" + +[[ -e $lock ]] || echo "unlocked" > "$lock" + +status=$(<$lock) + +if [ $BLOCK_BUTTON -gt 0 ]; then + case $status in + "unlocked") status="locked" ;; + "locked") status="unlocked";; + esac + echo $status > "$lock" +fi + +case $status in + "locked") echo "";; + "unlocked") echo "";; +esac