KDE: enforce I am working with pomodoros

This commit is contained in:
Bruno F. Fontes 2022-04-01 20:17:59 -03:00
parent f2471555fd
commit e8ba3582c2
Signed by: brunofontes
GPG Key ID: 4DAA810052CF68B6
2 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,20 @@
#!/bin/sh
kactivities-cli --stop-activity `kactivities-cli --list-activities | grep "Main" | cut -d' ' -f2`
notify-send --icon=`kactivities-cli --list-activities | grep "OXO" | cut -d' ' -f4` -a "OXO Innovation" "Main profile closed"
sleep 30s
while [ 1 = 1 ]; do
sleep 30s
if [ `kactivities-cli --current-activity | grep "Main" | wc -l` -gt 0 ]; then
exit 0
fi
tomato=`ps -aux | grep tomatoshell | wc -l`
# If there are less than 2 instances of tomato, it means it is just grep and not tomato itself
if [ $tomato -lt 2 ]; then
kactivities-cli --set-current-activity `kactivities-cli --list-activities | grep "Main" | cut -d' ' -f2`
notify-send --icon=`kactivities-cli --list-activities | grep "OXO" | cut -d' ' -f4` -a "OXO Innovation" "Start a pomodoro to Work"
fi
done
# kactivities-cli --stop-activity `kactivities-cli --list-activities | grep "Main" | cut -d' ' -f2`
# notify-send --icon=`kactivities-cli --list-activities | grep "OXO" | cut -d' ' -f4` -a "OXO Innovation" "Main profile closed"

10
KDE/lockOXO.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
sleep 5s
while [ 1 = 1 ]; do
current=`kactivities-cli --current-activity | grep "Main"`
if [[ $current ]]; then
kactivities-cli --stop-activity `kactivities-cli --list-activities | grep "Main" | cut -d' ' -f2`
notify-send --icon=`kactivities-cli --list-activities | grep "OXO" | cut -d' ' -f4` -a "OXO Innovation" "Main profile closed"
fi
sleep 20s
done