linuxShortcuts/KDE/OXO.sh

30 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2022-10-07 11:40:50 +00:00
#!/bin/bash
# Goes back to Main if tomatoshell is not running
[ $(pgrep -f 'OXO.sh' | wc -l) -gt 2 ] && exit
2023-06-23 13:10:17 +00:00
[ $(pgrep -f 'start-oxo.sh') ] && exit
sleep 30s
2022-10-07 11:40:50 +00:00
while [ 1 = 1 ]; do
sleep 30s
2022-10-07 11:40:50 +00:00
# If activity is not OXO, exit
if [ `kactivities-cli --current-activity | grep "OXO" | wc -l` = 0 ]; then
exit 0
fi
# If there are less than 2 instances of tomato, it means it is just grep and not tomato itself
2022-10-07 11:40:50 +00:00
if [ ! $(pgrep -f /usr/local/bin/pdshell) ]; then
beep
echo "Start a pomodoro to work" | festival --tts &
notify-send --icon=$(getIconFromKDEactivity OXO) -a "OXO Innovation" "Start a pomodoro to Work"
sleep 2s
kactivities-cli --set-current-activity $(kactivities-cli --list-activities | grep "Main" | cut -d' ' -f2)
fi
done
2022-10-07 11:40:50 +00:00
# /bin/terminator -m -T Pomodoro -x tomatoshell --oxo
# 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"