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:
parent
5786aee59f
commit
ead1c1fcc3
@ -78,8 +78,8 @@ interval=5
|
|||||||
|
|
||||||
[separator]
|
[separator]
|
||||||
|
|
||||||
[battery]
|
[rotation]
|
||||||
interval=5
|
interval=once
|
||||||
|
|
||||||
[separator]
|
[separator]
|
||||||
|
|
||||||
@ -89,6 +89,12 @@ interval=30
|
|||||||
|
|
||||||
[separator]
|
[separator]
|
||||||
|
|
||||||
|
[battery]
|
||||||
|
interval=30
|
||||||
|
signal=11
|
||||||
|
|
||||||
|
[separator]
|
||||||
|
|
||||||
[clock]
|
[clock]
|
||||||
interval=5
|
interval=5
|
||||||
min_width=" 00:00"
|
min_width=" 00:00"
|
||||||
|
20
.config/i3/blocks/rotation
Executable file
20
.config/i3/blocks/rotation
Executable 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
|
Loading…
Reference in New Issue
Block a user