From: Joe W. <jb...@bl...> - 2011-12-30 01:35:21
|
"Barbu Paul Gh." <pau...@gm...> writes: > I'd like to know if I can bind a sequence of keys in order to start a rest break > in workrave. > Currently I have to right click it and press the "rest break" button. I'm not sure if the D-Bus interface supports that. You can force a break with the GConf interface by (temporarily) setting the time limit very low. For example, this sets the time limit for the rest break to 5 seconds: gconftool-2 --set --type=int /apps/workrave/timers/rest_break/limit 5 Normally, you will have already used a lot more than 5 seconds so the break will start immediately. You can do the same thing with the micro-pause and the daily limit: gconftool-2 --set --type=int /apps/workrave/timers/micro_pause/limit 5 gconftool-2 --set --type=int /apps/workrave/timers/daily_limit/limit 5 Of course, you need to remember to restore the normal limit after the break has started, or else you will be trapped in an endless sequence of breaks. This obviously doesn't work on Windows because there is no GConf. I don't know if Workrave listens to Windows registry changes in the same way. Omar B. <est...@ho...> writes: > would also like to know this and if there's also a key to pause/restart the > timer. I am not sure whether you can pause any of the timers (micro-break, rest break, and daily limit) per se, but you can disable the entirety of Workrave and I think this pauses the timers where they are. I think you can do this with the D-Bus method SetOperationMode, although I have never tried this. In principle you can do the following with GConf, but it does not work for me: # suspend Workrave: gconftool-2 --set --type=int /apps/workrave/gui/operation-mode 1 # resume normal Workrave operation: gconftool-2 --set --type=int /apps/workrave/gui/operation-mode 0 I can use GConf to observe the setting (i.e., I can find out if the user has used the mouse to do this), but if I try to change this setting via GConf it does not work in Workrave 1.8.5. I think there was an e-mail discussion of this a while back on this list and the bug was acknowledged. It might be fixed now in the latest version, so the above commands might work for you. If you want to use D-Bus, you might start with the dbus_script.py that comes with Workrave which gives an example of using a different part of the D-Bus interface. This script gets installed in /usr/share/doc/workrave/examples by the Ubuntu (Debian) package. I hope this helps. -- With my best wishes, Joe |