Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-04-14 01:04:47

joseba.villanueva
Member
Registered: 2016-04-14
Posts: 13

Taskbar: icon appears/disappears if the application is running/stop

I have read some talks about adding active icons in the panel in xfce4 but none of them have solved my doubt:

I have an app that works in background. When it is running, I would like that an icon should only appear in the panel (right panel - notification area) and disappears when not working. This behabiour is similar than Dropbox app. How can I do to get this behaviour in my app? I have installed Xubuntu 14.04.


Any ideas?

Thank you

Last edited by joseba.villanueva (2016-04-14 02:07:10)

Offline

#2 2016-04-14 10:34:44

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Taskbar: icon appears/disappears if the application is running/stop

Hello and welcome.

Have a look at the genmon panel plugin. It's a timer-based plugin that is used to execute scripts/processes in a scheduled manner. You can configure the text and/or icon to display when a given process is started. You can also craft a script in such a way to test for the existence of something, and depending on the result, display a different icon,.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-04-14 21:02:17

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: Taskbar: icon appears/disappears if the application is running/stop

have a look at alltray: https://github.com/mbt/alltray or at yad(it has an option to dispay notify icons) : https://sourceforge.net/projects/yad-dialog/

Last edited by sixsixfive (2016-04-14 21:04:55)

Offline

#4 2016-04-15 04:34:53

joseba.villanueva
Member
Registered: 2016-04-14
Posts: 13

Re: Taskbar: icon appears/disappears if the application is running/stop

Thanks for the information. I will try it this weekend.

Offline

#5 2016-04-17 09:06:48

joseba.villanueva
Member
Registered: 2016-04-14
Posts: 13

Re: Taskbar: icon appears/disappears if the application is running/stop

I've tried your solutions with different results:

- genmon: It is supposed I could intall it, but it doesn't appear in my Xubuntu 14.04. I installed it from Software Manager. I would like to know how it works because in other forums people recommend it too.

- alltray: I check it and it is an interesting application. But it is not exactly what I am looking for. I think it is similar than "kDocker" app. I prepared a script with "kDocker" that works for me:

#!/bin/bash
kdocker -n MyNameScript -i /path/to/my/icon/script/IconScript.png -d 40 /path/to/my/script &
http://askubuntu.com/questions/20989/ho … -minimized



But the solution that best fits what I want to do is described by Jacob Vlijm:
http://askubuntu.com/a/757599/344918

It is what I was looking for.

Thank you for your help.

Last edited by joseba.villanueva (2016-04-17 09:09:34)

Offline

#6 2016-04-17 09:58:11

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Taskbar: icon appears/disappears if the application is running/stop

joseba.villanueva wrote:

- genmon: It is supposed I could intall it, but it doesn't appear in my Xubuntu 14.04. I installed it from Software Manager. I would like to know how it works because in other forums people recommend it too.

Create the following script:

#!/bin/sh

APP="mousepad"

if pgrep $APP; then
	echo "<img>/home/toz/.icons/arch.png</img>" 
else
	echo "<txt></txt>"
fi

exit 0

...replace the APP value with the app/script you want to monitor, and the name of the icon that you want to display when the process is active. Add the genmon plugin to the panel and set:
- Command = /path/to/your/script
- uncheck Label
- set Period to the time between checks for the process.

But the solution that best fits what I want to do is described by Jacob Vlijm:
http://askubuntu.com/a/757599/344918

This solution will only work in Xfce with the xfce4-indicator-plugin - not all distros ship this as it is an ubuntu-specific package.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2016-04-18 04:33:23

joseba.villanueva
Member
Registered: 2016-04-14
Posts: 13

Re: Taskbar: icon appears/disappears if the application is running/stop

I am sorry. Perhaps I haven't explained correctly. I installed the genmon-panel-plugin by Software Manager, but I can't open it. There is no icon, command, etc... that let me to open it.

I tried to compile the plugin but it gave me the message below:

checking for libxfce4panel-1.0 >= 4.8.0... not found
*** The required package libxfce4panel-1.0 was not found on your system.
*** Please install libxfce4panel-1.0 (atleast version 4.8.0) or adjust
*** the PKG_CONFIG_PATH environment variable if you
*** installed the package in a nonstandard prefix so that
*** pkg-config is able to find it.

So I guess  that the plugin is not correctly installed in spite of showing that it is installed (Software Manager).

I tried to install this package via Synaptic but it doesn't appear.

Any ideas how to fix it?

Offline

#8 2016-04-18 10:05:38

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Taskbar: icon appears/disappears if the application is running/stop

joseba.villanueva wrote:

I am sorry. Perhaps I haven't explained correctly. I installed the genmon-panel-plugin by Software Manager, but I can't open it. There is no icon, command, etc... that let me to open it.

It's a panel plugin and you would enable and use it like you would use other panel plugins.

Right-click the panel, select Panel > Add New Items. Locate "Generic Monitor" in the list, select it and click "Add". It will now appear in your panel with the default text of "(genmon)XXX". Right-click the plugin, choose properties and configure it.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2016-04-18 12:51:10

joseba.villanueva
Member
Registered: 2016-04-14
Posts: 13

Re: Taskbar: icon appears/disappears if the application is running/stop

Upssss...

I was trying to look for as a "genmon-panel-plugin" in the "Add New Items". I had no idea that I had to enable "Generic Monitor"!! Now it appears. I will try tomorrow.

Thank you for your patient!

Offline

#10 2016-04-19 06:03:17

joseba.villanueva
Member
Registered: 2016-04-14
Posts: 13

Re: Taskbar: icon appears/disappears if the application is running/stop

Yeah, ToZ. It works perfectly. Thank you.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 562.88 KiB (Peak: 579.73 KiB) ]