info-eyestrain: add script
This commit is contained in:
parent
d9d00e831a
commit
4c8743b122
15
polybar-scripts/info-eyestrain/README.md
Normal file
15
polybar-scripts/info-eyestrain/README.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Script: info-eyestrain
|
||||||
|
|
||||||
|
A script for avoiding digital eye strain.
|
||||||
|
|
||||||
|
It follows the 20-20-20 rule. The timer displays how long it is until the next break. You can add this to send a notification and play a sound when the time is up.
|
||||||
|
|
||||||
|
|
||||||
|
## Module
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[module/info-eyestrain]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/polybar-scripts/info-eyestrain.sh
|
||||||
|
interval = 60
|
||||||
|
```
|
10
polybar-scripts/info-eyestrain/info-eyestrain.sh
Executable file
10
polybar-scripts/info-eyestrain/info-eyestrain.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
time=$((20 - $(date '+%-M') % 20))
|
||||||
|
|
||||||
|
#if [ $time -eq 20 ]; then
|
||||||
|
# notify-send 'Break' &
|
||||||
|
# ogg123 beep.ogg &> /dev/null &
|
||||||
|
#fi
|
||||||
|
|
||||||
|
echo "$time"
|
Loading…
x
Reference in New Issue
Block a user