learnsilikon.blogg.se

Rescuetime for mac
Rescuetime for mac








rescuetime for mac

The STDOUT output is directed to the void so that it doesn’t create new mail entries. ps aux | grep -v grep | grep -ci $app > /dev/null lists all running processes, excluding the grep process, and finally counting the found lines while greping for the application’s name.

rescuetime for mac

  • app=Rescuetime sets a variable of what application we’re trying to keep open.
  • rescuetime for mac

    */5 * * * * app=Rescuetime ps aux | grep -v grep | grep -ci $app > /dev/null || open -hide -background /Applications/$app.app

    #Rescuetime for mac full

    # Scroll to see full command (it is one line due to fitting in the crontab) This will prevent the open from triggering multiple times during the day. My next approach was to only open the application if it wasn’t already running. I could decrease the frequency that the command would run or… Only open if Application isn’t Running When I looked at the time it was always on the minute the cron would trigger… If I had to take a guess, the open was causing focus to switch briefly and would interrupt keystrokes on the current application I was in. I noticed every now and then a keystroke or two wouldn’t register. The hide and background flags didn’t work for some applications (e.g., Evernote always appears in the forefront for whatever reason).ĭone deal then right? Wrong. I even tested this with other applications and it mostly worked as expected. This worked for me – it opened RescueTime if it was closed out. The -hide and -background ensure that the application doesn’t open in an obtrusive manner (i.e., think applications with a GUI). Using we can see that this will run the open for ResuceTime command every 5 minutes. */5 * * * * open -hide -background /Applications/RescueTime.app










    Rescuetime for mac