Toggldesktop: Option to auto stop timer on OS shutdown

Created on 21 Oct 2015  路  24Comments  路  Source: toggl-open-source/toggldesktop

Sometime I turn off the computer and forget stop the Toggl Timer. It's still running and only stop when I turn on computer again and turn off it.
Please add an option if user checked. Toggl auto stop timer when OS shutdown (on both Windows and Mac).

Also thank for awesome app, it help me a lot.

enhancement has-PR linux macOS windows

Most helpful comment

It would also be very helpful if you could stop the timer on screen lock.
My personal work flow is do work -> when time for a break, lock screen -> go elsewhere.

Should it be the new feature request, or it would be done within this one?

Another option is to implement a console command for stop timer, so we could bind it to screen locked event, or even lock screen hot-key.

All 24 comments

On a Mac, the Desktop app is able to listen to system power off event, but also to system sleep and wake. So it would be possible to stop the timer automatically, if its running and the user had enabled it in the Desktop app.

I hit this issue too, and it reduces the reliability of the hours logged.

Needs also setting in the preferences.

This feature would definitely help me out, thanks!

Our previous time tracker had this feature. Since we got toggl i really miss it... :-1:

+1

I'm glad that this is so popular. I'd like to add some notes. This functionality stops the time entry on desktop app, but if the shut down is too far (no network connection anymore) the data is not transferred to the servers and this means that you still might get the notification email about working too much (if you have it enabled). Also time still runs on the web app. If you start the desktop app the next time the update syncs to web and everything should be up to date again.

Things that need to be done:

  • [聽] Add setting to preferences ( text: Stop running entry on computer sleep/shutdown )
  • [ ] Implement the functionality in windows
  • [ ] Implement the functionality in osx
  • [ ] Implement the functionality in linux

It would also be useful if you could set up time when Toggl will automatically stop the timer. I think this should be easy to implement as it wouldn't have to listen for OS specific power off signal, it will simply stop timer on Toggl side.
There is already possibility to set when to stop reminding you to log time so this would be same feature

I would like to see this on Linux too, could you please add the label ?

Just for information. Both of these functions:

  • Stop timer when computer shuts down
  • Stop at work day end ( certain defined time )

are already available in Toggl Button Chrome extension.
(https://chrome.google.com/webstore/detail/toggl-button-timer-with-p/oejgccbfbmkkpaidnkphaiaecficdnfn?hl=en)

You can use that until we implement it in the desktop apps.

In fact the Chrome extension does not stop the timer on computer shut down but on Chrome close...
I would like a setting to stop the timer on computer shutdown.

Hello,

I come back to you for news of this function?
I forgot to stop the timer when I quit Windows.
Upon my return, Toggl deducted 17 hours of work !!!

Please do it.

I've bumped it up on our todo list. Thank you for all the feedback.

Definitely a most wanted feature (on linux).

Auto-stopping on OS shutdown and sleep is very much wanted.

@IndrekV I would like to contribute by working on this issue. Do you mind if I jump in? That would also mean I would need a small intro on the code or if you have some suggestions on how to jump in ?

@sherry-ummen
What platform are you familiar with?

As the logic is different with all the platforms it has to be done separately for all platforms.

I'll write down the things that need to be done for each platform:

  • Add new line to preferences ("Stop timer when computer shuts off/sleeps")
    (you can check this commit that added "pomodoro break" preference 54cf2df745d2732297cf89374862d5bf08daa746)

  • Add logic of stoping the entry to the platform ui.
    Detect the shutdown/sleep event and check preference and then call stop action (on windows its Toggl.Stop();)

@IndrekV thanks for the reply and the heads up

I am familiar with Windows mostly, I have access to Linux system as well. So I will try to concentrate on Windows for now and then lets see further. I will check your pointers. Thanks once again.

It would also be very helpful if you could stop the timer on screen lock.
My personal work flow is do work -> when time for a break, lock screen -> go elsewhere.

Should it be the new feature request, or it would be done within this one?

Another option is to implement a console command for stop timer, so we could bind it to screen locked event, or even lock screen hot-key.

@agornushkin
You can actually stop time entry from command line without any changes to Toggl Desktop. It is possible to send requests straight to the Toggl API. See this documentation https://github.com/toggl/toggl_api_docs/blob/master/chapters/time_entries.md#stop-a-time-entry

You should probably first see the part where you can get the currently running entry and then use the time entry id to stop it
https://github.com/toggl/toggl_api_docs/blob/master/chapters/time_entries.md#get-running-time-entry

@IndrekV

Whilst good to know there's a API ability to do so, I feel like the point being made is it would be nice to have it as an automated optional feature of the app itself.

The browser extension has the option of "automatically stop at hh:mm", and I feel like it would be pretty similar in behaviour to that.

@IndrekV
How long until this is done?

A simple text box that said do this when that happens, eg.
run _this_ script on timer start/stop/shutdown/sleep.

Honestly, I think many of us could survive with just that, it's probably no more than a coffee cups worth of work there <3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tanel picture tanel  路  4Comments

DustinJSilk picture DustinJSilk  路  7Comments

sojusnik picture sojusnik  路  4Comments

vikahl picture vikahl  路  6Comments

sojusnik picture sojusnik  路  6Comments