1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Add rotation lock i3block

This commit is contained in:
Joe Groocock 2016-05-15 23:40:57 +01:00
parent 8b95f13919
commit 45192635af
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
2 changed files with 28 additions and 2 deletions

View File

@ -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"

20
.config/i3/blocks/rotation Executable file
View File

@ -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