Barbu Paul Gh. | 24 Dec 2011 14:44
Picon
Gravatar

Start rest break on key press

Hello!

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 using:
Linux localhost 3.1.5-1-ARCH GNU/Linux

Merry Christmas!

--

-- 

Common sense is not so common - Voltaire
http://tweak-it.tk/ - Personal portfolio and web-log - Barbu Paul - Gh.
Visit My GitHub profile to see my open-source projects - https://github.com/paullik

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
Omar B. | 24 Dec 2011 17:57
Picon
Favicon

Re: Start rest break on key press

would also like to know this and if there's also a key to pause/restart the timer.


> Date: Sat, 24 Dec 2011 15:44:37 +0200
> From: paullik.paul <at> gmail.com
> To: workrave-user <at> lists.sourceforge.net
> Subject: [Workrave-user] Start rest break on key press
>
> Hello!
>
> 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 using:
> Linux localhost 3.1.5-1-ARCH GNU/Linux
>
> Merry Christmas!
>
> --
>
> Common sense is not so common - Voltaire
> http://tweak-it.tk/ - Personal portfolio and web-log - Barbu Paul - Gh.
> Visit My GitHub profile to see my open-source projects - https://github.com/paullik
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> Workrave-user mailing list
> Workrave-user <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/workrave-user
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Workrave-user mailing list
Workrave-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/workrave-user
Joe Wells | 30 Dec 2011 02:35
Picon
Favicon

Re: Start rest break on key press

"Barbu Paul Gh." <paullik.paul <at> gmail.com> 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. <estelar57 <at> hotmail.com> 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

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox

Gmane