-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to suspend for x amount of time #98
Comments
This would be a great feature. It shouldn't be hard to code it. It's been years since I don't touch C++ but maybe I try coding it myself and send a PR. |
This is the only reason I have had to move to using stretchly, which i don't like much (web app in chromium/electron which consumes 10x the memory of workrave). |
Same for me! I'm ready to pay 10 Euro to anyone who implements this. |
Yes please! Sometimes I am in a meeting, or super focused, and don't want to be interrupted for a bit - but then I forget to turn it back on again, which often leads to harmful fatigue and long unproductivity. Maybe I can find some time to look into this - @nkomarov is your offer still on? ;) |
|
I am thinking of a small script now since I am not that versed in C - which you would then invoke like Personally, I currently rather quit Workrave than suspending, because then it at least comes back to its original state on restart. I had some really bad days which would not have happened if workrave wouldn't have been suspended from the previous day... In addition to this, I have now set a cronjob that restarts workrave hourly so I don't get too caught up without it :) |
Here is a POSIX-compliant script inspired by #134 you can put into any bin-folder (I use Thanks to the #!/bin/sh
set -e
my_hook() {
echo "Setting Workrave operation mode to normal"
setWorkraveOperationMode "normal"
}
trap my_hook EXIT INT
setWorkraveOperationMode() {
dbus-send --session --dest=org.workrave.Workrave --type=method_call \
/org/workrave/Workrave/Core org.workrave.CoreInterface.SetOperationMode \
string:"$1"
}
echo "Silencing workrave"
setWorkraveOperationMode "quiet"
sleep ${1}m |
And here an even more advanced script, with full screen detection (when using X), see explanation in the script: #!/bin/sh
# Sets Workrave mode to quiet and waits the given amount of minutes (default: 10)
# If no amount is given or the -f flag is provided, it checks whether a fullscreen application is running and if no, exits
# On exit or Ctrl-C (SIGINT) it sets the Workrave mode back to normal
while true; do
case $1 in
(-q) quiet=1; shift 1;;
(-f) fullscreen=1; shift 1;;
(*) break;;
esac
done
getFullscreen() {
# See https://askubuntu.com/a/1265587
# Get screen size
root_geo=$(xwininfo -root | awk -F'[ +x]' '$3 ~ /-geometry/ {printf "%dx%d",$4/'"$(xrandr | grep ' connected ' | wc -l)"',$5}')
# Check if any window fills the screen
xwininfo -root -tree | grep $root_geo | grep -qv "\(Desktop\|has no name\)"
}
setWorkraveOperationMode() {
dbus-send --session --dest=org.workrave.Workrave --type=method_call \
/org/workrave/Workrave/Core org.workrave.CoreInterface.SetOperationMode \
string:"$1"
}
resetWorkraveMode() {
test "$quiet" || echo "Setting Workrave operation mode to normal"
setWorkraveOperationMode "normal"
}
trap resetWorkraveMode EXIT INT
test "$quiet" || echo "Silencing workrave"
setWorkraveOperationMode "quiet"
while true; do
sleep ${1:-10}m
test "$fullscreen" && getFullscreen || break
done |
Uhm... I appreciate your work but I use it in Windows so it doesn't run just like that. I expected a new code for the workrave itself... Anyway, if you feel like I should send you money, write to me. |
Nah, I'll see whether I can get something for workrave itself sometime, because this workaround is also a bit brittle :) |
This would be much helpful... With COVID-19 and work from home for past year plus, screen share for discussions are the norm. It would be a HUGE value-add if the pop-ups do not come in when screen is shared. Something like Skype/Teams DND status ? |
@rcaelers Glad I'm not the only one requesting this :) UI wise I'm very often very annoyed when a software just gives me a few limited options time period options which often just doesn't fit me. Software isn't meant to limit us but rather to efficiently help us. In this case though, I'm not opposed to providing a set of options if that gives you less work, but it should cover all needs. I would maybe say something like 30 mins, 1 hr, 2 hrs, 3 hrs, 4 hrs, 5 hrs, 6 hrs, 8 hrs, 12 hrs, 18 hrs, 24 hrs, 7 days. |
I am using https://github.com/hovancik/stretchly now which natively has this feature ;) |
Thank you for your comment @xeruf This prompted me to compare Stretchly with Workrave, but my conclusion is that despite its technological promises, Stretchly unfortunately still has a long way to go before functionally matching Workrave as of 1.7. Workrave must overall remain better for the vast majority if not the totality of users. It should be noted that Stretchly reserves some preferences to what it calls "contributors". As I am not considered such a contributor, I did not evaluate a full version of Stretchly, but from what I can see that would not change my conclusion. |
As for such comparisons, I am planning to create an open database that is somewhat similar to OpenStreetMap and Wikipedia but specifically for comparing things, because I am annoyed by all these bloated, undetailed alternative sites so far. It is indeed not the job of a tool creator to create separate comparison tables... |
I currently use an external reminder to check if Workrave is running/activated. @rcaelers please implement the subj feature, I (and maybe others) will donate. |
This would be great to have. Too many times do I suspend it during presentations and some meetings, only to forget to turn it back on. The same goes with some games where I do NOT want interruptions (ie. competitive). It's been one of my biggest gripes actually! |
Would candy or maple syrup qualify as "feedback"? |
|
|
@pabloab: Using Temporarily x > Indefinitely has the same effect as just setting the mode to x. In the current implementation, I have added the time on which Workrave will revert to Normal to the selected mode (the (until 21:53)). So it may not be obvious that just setting the mode to x will disable the "Temporarily" part. I could add the (until 21:53) to the Temporarily x submenu; maybe even the current mode indicator could be moved to the submenu, but I think it is more user-friendly to have the current state in the top Operation Mode menu. @nkomarov: snapshots of 1.11 are available from https://workrave.org/snapshots/ (1.10.49 + 447 commit is currently the latest version). Note that 1.11 may not be as stable as 1.10 @Chealer: Not sure I understand... |
@pabloab could you clarify what your screenshot shows? Is it the future / bleeding edge Workrave, or is it a Workrave you modified yourself to improve the menu? @rcaelers thank you for the complete reply. I agree the interface challenge is non-trivial. Question: suppose Workrave is set to Quiet, and the user does Temporarily Suspend for 1 hour. In that scenario, what happens after an hour? Does Workrave become Quiet or Normal? @rcaelers regarding my question, it was mostly a funny way to express my appreciation, but if you do want something, just leave me your address and I should send you something :-) |
I checked with 1_10_49-15 of Jan 30 2022 (version v1.10.49 + 15 commits), can't see a submenu of this feature. |
You are probably looking at the Workrave 1.10 snapshots. You should instead go to the Workrave 1.11 snapshots. |
This has been implemented in 1.11, which is now in beta |
(This should be labeled as a feature-request.)
Redshift have a very useful feature: The ability to suspend it for x minutes/hours:
Very useful to see movies/series. Would be great to have same feature on Workrave. Very often I suspend/quiet (BTW, one of them could be removed) and then forget to enable it again.
The text was updated successfully, but these errors were encountered: