Shake to reset sleep timer #126

Closed
opened 2026-04-24 23:08:39 +02:00 by adam · 8 comments
Owner

Originally created by @rwa96 on GitHub (May 4, 2022).

Is your feature request related to a problem? Please describe.

In case you enabled the sleep timer but didn't fall asleep before it ended, there is no convenient way to reset it. Currently you have to unlock the phone, look at the bright screen and press multiple buttons in the app to reset it.

Describe the solution you'd like

Instead of using gui elements for a timer reset, you could simply shake the phone. This feature only makes sense if the user can tell that the sleep timer is almost up, which can be implemented with a fadeout effect at the end of the timer. After the User has shook the phone, It should vibrate to indicate a successful reset. In short, this feature would be comprized of four components:

  • A fadeout effect that lets the user know that the sleep timer is almost up
  • A shake gesture detection that resets the sleep timer to its maximum value
  • A phone vibration to indicate that the reset was successfull
  • Settings-menu entries that let you enable/disable this feature and change the fadeout-effect duration

Describe alternatives you've considered

I can't think of a reliable and more convenient way to reset the sleep timer. There could be other ways to let the user know that the sleep timer is almost up, but a 10 or 20 second fadeout effect works quite well in my opinion.

Additional context

The app AudioAnchor has this feature and it works very well in my experience.

Originally created by @rwa96 on GitHub (May 4, 2022). ### Is your feature request related to a problem? Please describe. In case you enabled the sleep timer but didn't fall asleep before it ended, there is no convenient way to reset it. Currently you have to unlock the phone, look at the bright screen and press multiple buttons in the app to reset it. ### Describe the solution you'd like Instead of using gui elements for a timer reset, you could simply shake the phone. This feature only makes sense if the user can tell that the sleep timer is almost up, which can be implemented with a fadeout effect at the end of the timer. After the User has shook the phone, It should vibrate to indicate a successful reset. In short, this feature would be comprized of four components: * A fadeout effect that lets the user know that the sleep timer is almost up * A shake gesture detection that resets the sleep timer to its maximum value * A phone vibration to indicate that the reset was successfull * Settings-menu entries that let you enable/disable this feature and change the fadeout-effect duration ### Describe alternatives you've considered I can't think of a reliable and more convenient way to reset the sleep timer. There could be other ways to let the user know that the sleep timer is almost up, but a 10 or 20 second fadeout effect works quite well in my opinion. ### Additional context The app [AudioAnchor](https://f-droid.org/en/packages/com.prangesoftwaresolutions.audioanchor/) has this feature and it works very well in my experience.
adam added the enhancement label 2026-04-24 23:08:39 +02:00
adam closed this issue 2026-04-24 23:08:39 +02:00
Author
Owner

@advplyr commented on GitHub (May 4, 2022):

Have you tested the current sleep timer and it is not working? Currently the sleep timer starts to fade out at 30 seconds remaining. If you shake the phone within 30 seconds of finishing it will reset the sleep timer. The shake sensitivity is very low now by request.
The only things you mentioned not available is the vibration and adjustable settings, both of those I think we should add.

Original discussion was here: https://github.com/advplyr/audiobookshelf-app/issues/10

@advplyr commented on GitHub (May 4, 2022): Have you tested the current sleep timer and it is not working? Currently the sleep timer starts to fade out at 30 seconds remaining. If you shake the phone within 30 seconds of finishing it will reset the sleep timer. The shake sensitivity is very low now by request. The only things you mentioned not available is the vibration and adjustable settings, both of those I think we should add. Original discussion was here: https://github.com/advplyr/audiobookshelf-app/issues/10
Author
Owner

@rwa96 commented on GitHub (May 4, 2022):

Oh, I'm sorry about this... I didn't realize it was implemented already. The vibration would be nice though.

@rwa96 commented on GitHub (May 4, 2022): Oh, I'm sorry about this... I didn't realize it was implemented already. The vibration would be nice though.
Author
Owner

@advplyr commented on GitHub (May 7, 2022):

Added vibrate in v0.9.44-beta

@advplyr commented on GitHub (May 7, 2022): Added vibrate in [v0.9.44-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.44-beta)
Author
Owner

@Fribb commented on GitHub (Jul 25, 2022):

Added vibrate in v0.9.44-beta

can there be a way to disable the "shake" in the settings? The problem I have is the following:

I currently listen to my Audiobooks while in bed before falling asleep. Before I go to bed I set the Sleep timer to the end of the Chapter. When the chapter ends I have to pick the phone up and put it onto my wireless charging pad so that it can recharge overnight. This seems to extend the sleep timer again, even though the chapter is already finished (the Android playback item on the lock screen goes away) and starts to play the next chapter and then I have to unlock the phone and stop it again manually.

The reason I need to pick it up is that, while charging my Pixel 4 XL with Android 12 (App is 0.9.54-beta), it seems to kill the App halfway through the chapter while playing.

@Fribb commented on GitHub (Jul 25, 2022): > Added vibrate in [v0.9.44-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.44-beta) can there be a way to disable the "shake" in the settings? The problem I have is the following: I currently listen to my Audiobooks while in bed before falling asleep. Before I go to bed I set the Sleep timer to the end of the Chapter. When the chapter ends I have to pick the phone up and put it onto my wireless charging pad so that it can recharge overnight. This seems to extend the sleep timer again, even though the chapter is already finished (the Android playback item on the lock screen goes away) and starts to play the next chapter and then I have to unlock the phone and stop it again manually. The reason I need to pick it up is that, while charging my Pixel 4 XL with Android 12 (App is 0.9.54-beta), it seems to kill the App halfway through the chapter while playing.
Author
Owner

@advplyr commented on GitHub (Jul 25, 2022):

Having the setting to disable the vibrate is a good call. Maybe a setting to adjust sensitivity. I created a new issue for that.

It sounds like there are other bugs you are mentioning that I wasn't aware of but I'm not sure. You are saying that if you plug your phone in to the charger while listening the app will shut itself off after some time?

@advplyr commented on GitHub (Jul 25, 2022): Having the setting to disable the vibrate is a good call. Maybe a setting to adjust sensitivity. I created a new issue for that. It sounds like there are other bugs you are mentioning that I wasn't aware of but I'm not sure. You are saying that if you plug your phone in to the charger while listening the app will shut itself off after some time?
Author
Owner

@Fribb commented on GitHub (Jul 25, 2022):

Having the setting to disable the vibrate is a good call. Maybe a setting to adjust sensitivity. I created a new issue for that.

It sounds like there are other bugs you are mentioning that I wasn't aware of but I'm not sure. You are saying that if you plug your phone in to the charger while listening the app will shut itself off after some time?

It seems to behave that way, when I put it in to recharge while the app was running and playing it suddenly stopped and the whole app was stopped. This didn't happen when I wasn't charging.

@Fribb commented on GitHub (Jul 25, 2022): > Having the setting to disable the vibrate is a good call. Maybe a setting to adjust sensitivity. I created a new issue for that. > > It sounds like there are other bugs you are mentioning that I wasn't aware of but I'm not sure. You are saying that if you plug your phone in to the charger while listening the app will shut itself off after some time? It seems to behave that way, when I put it in to recharge while the app was running and playing it suddenly stopped and the whole app was stopped. This didn't happen when I wasn't charging.
Author
Owner

@Fribb commented on GitHub (Jul 27, 2022):

It sounds like there are other bugs you are mentioning that I wasn't aware of but I'm not sure. You are saying that if you plug your phone in to the charger while listening the app will shut itself off after some time?

@advplyr so I tested this out the last couple of days and what I described didn't happen again so I would say that it either fixed itself or was something unrelated.

@Fribb commented on GitHub (Jul 27, 2022): > It sounds like there are other bugs you are mentioning that I wasn't aware of but I'm not sure. You are saying that if you plug your phone in to the charger while listening the app will shut itself off after some time? @advplyr so I tested this out the last couple of days and what I described didn't happen again so I would say that it either fixed itself or was something unrelated.
Author
Owner

@advplyr commented on GitHub (Aug 12, 2022):

Added setting to disabled shake to reset sleep timer in v0.9.56-beta

@advplyr commented on GitHub (Aug 12, 2022): Added setting to disabled shake to reset sleep timer in [v0.9.56-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.56-beta)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#126