normal update
This commit is contained in:
parent
cff1deb93f
commit
8137ce7e25
10 changed files with 48 additions and 88 deletions
22
scripts/youtubeBlocker.sh
Executable file
22
scripts/youtubeBlocker.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
is_valid_youtube_time() {
|
||||
now=$(date +%H%M)
|
||||
start=1000
|
||||
end=1800
|
||||
|
||||
(( 10#$now >= start && 10#$now <= end ))
|
||||
}
|
||||
|
||||
handle() {
|
||||
case $1 in
|
||||
activewindow*)
|
||||
echo $1
|
||||
if [[ $1 == *YouTube* ]] && ! is_valid_youtube_time; then
|
||||
hyprctl dispatch killactive
|
||||
notify-send "ENOUGH, LOCK IN"
|
||||
fi
|
||||
esac
|
||||
}
|
||||
|
||||
socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done
|
||||
Loading…
Add table
Add a link
Reference in a new issue