PDA

View Full Version : [ubuntu] HOWTO use Workrave inside Unity



avl555
April 29th, 2012, 02:12 PM
This is a HOWTO to use programs like Workrave that require a good system tray to work in Unity. I was very annoyed by Unity's lack of a good system tray that I found a different solution.

Note: Workrave 1.10 will include a Unity indicator, but I wasn't able to compile that version. See it's NEWS file (https://github.com/rcaelers/workrave/blob/master/NEWS).

See the attached screenshot for what it will become.

1. Install packages

sudo apt-get install xfce4-panel wmctrl
You might need to install additional packages with

2. Set up panel

Start xfce4-panel inside a console (or via alt+f2).
Select 'one empty panel' (or something like that) in the popup.
Set the panel in a good location, for example, at the top.
Set the height (in the panel preferences) to 24 pixels.
Set the background to solid color and then the alpha to zero (fully transparent).
Add the panel applet 'notification area' to the panel.

Warning: don't use the Dash: it will overlay the panel. This will be fixed later.

3. Make the panel start at system start
Create a file somewhere in your home directory with this contents:


#!/bin/bash
xfce4-panel &
sleep 3;
wmctrl -l -G | /bin/egrep "your-hostname xfce4-panel$" | cut -d " " -f 1 | xargs -n 1 wmctrl -b add,above -i -r

workrave &

The line starting with 'wmctrl' does a bit of magic: it finds the window ID of the applet and makes it the topmost window. This way it won't disappear when you use the Dash (Windows/Super-key). Remember to replace the hostname in the egrep command. Run
wmctrl -l -G to see what you have to grep for.

Make it executable:

sudo chmod +x your-panel-applet-script-filename.sh

And add it to the list of startup applications.

4. Bonus: hide letters under it (Firefox page titles etc.)
Set the background to the attached 'top bar.png' file. This is a screenshot of a part of the top bar. This hides long page titles of web pages etc.

5. Bonus: add analog Xfce clock
You can also use other panel applets, but the analog Xfce panel applet won't work (the clock is black with a dark-grey background). Use this (http://forum.xfce.org/viewtopic.php?pid=25934#p25934) solution to make it visible again. It makes the clock white.

superpico
June 9th, 2012, 04:23 AM
Seeing as there's no reply yet, I wanted to say thank you for this post! It makes workrave usable on Ubuntu 12.04 :)

A small issue for me, I can't get my script to run as a startup application, I get the following error on login:

The notification area lost selection
Most likely another widget took over the function of a notification area. This area will be unused.

avl555
June 10th, 2012, 11:21 AM
Superpico, I get that same error sometimes, but it keeps working (icons that are normally in the Unity tray have then moved to the Xfce panel tray.)
Maybe it helps putting a line

sleep 10
before

xfce4-panel &
as I have done.
(Actually, I start a lot of programs this way, by putting them in the bin/startup file and inserting sleeps between them, this way preventing that the computer becomes very slow after logging in.)

karlrt
February 14th, 2013, 10:41 AM
Hi,

https://launchpad.net/~rob-caelers/+archive/workrave

the ppa claims to fix this (also in 12.04) but if I enable the applet i dont see anything changing in the applet area :(

dda
March 13th, 2013, 06:39 AM
karlrt, you need to enable it in dconf editor, add to desktop -> unity -> panel

Mikael_Fremling
February 10th, 2014, 05:20 PM
On ubuntu 13.10 the path com.canonical.unity.panel has disapeared. Is there some other path to use?

In the flip side. The settings of workrave can be acceced directly from dconf through org.workrave.timers

rubo77
November 30th, 2014, 11:43 AM
I uploaded your attached Image here:
http://i.imgur.com/IW1VUUU.png


I managed to compile workrave from source:
http://askubuntu.com/questions/554724/compile-workrave-from-source

But still no Unity indicator
I guess this solution won't work since 13.10 so Is there a solution for Ubuntu 14.10 also?

As a workaround, I can access the settings by rightclicking on the indicator Window:

http://i.imgur.com/wi4aFws.png

Ivan_Koldaev
April 4th, 2015, 01:27 AM
As a workaround, I can access the settings by rightclicking on the indicator Window:

http://i.imgur.com/wi4aFws.png
Also, if you accidentally closed the small indicator window, you would lost last option to access Workrave settings.
To restore the indicator window do following:


dconf write /org/workrave/gui/main-window/enabled true

sudo killall workrave
Run workrave. The small indicator window (as pictured above) will appear.