diff --git a/KDE/OXO.sh b/KDE/OXO.sh index 15e4c56..8c9c0fd 100755 --- a/KDE/OXO.sh +++ b/KDE/OXO.sh @@ -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" diff --git a/KDE/lockOXO.sh b/KDE/lockOXO.sh new file mode 100755 index 0000000..a85de0b --- /dev/null +++ b/KDE/lockOXO.sh @@ -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