Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-10-10 15:59:01

marmz
Member
Registered: 2018-10-10
Posts: 1

Custom systray on module Insert/Remove

Hi!
Just added a simple launcher to my xfce4-panel (4.12.1).
This launcher simply executes an "insert mymodule.ko" command ...
Now i'd like to show a "systray" icon on notification area on module Insert, then make it disappear if module is Removed

Unfortunately, even if the "use notification" option is checked/enabled, no systray icon is shown.

I'm pretty sure this is one of those old, well-known, repeated questions....but please have some patience for me.. smile
Any idea or suggestion is appreciated. Thanks!

Offline

#2 2018-10-10 16:33:35

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

Re: Custom systray on module Insert/Remove

Hello and welcome.

If you want something in the notification area, you'll have to code a systray applet to perform the task.

If you are open to alternatives, you could use the genmon plugin and a script like this:

#!/bin/bash

IN_ICON="/usr/share/icons/Adwaita/22x22/actions/call-start.png"
OUT_ICON="/usr/share/icons/Adwaita/22x22/actions/call-stop.png"

MOD="cdrom"

[[ "$(lsmod | grep cdrom | awk '{print $1}')" = "$MOD" ]] && ICON=$IN_ICON || ICON=$OUT_ICON

echo "<img>$ICON</img>"

...adjust the IN_ICON, OUT_ICON and MOD values to suit your specific needs.

This will create a panel icon (you can place it near the notification area) and it will flip icons depending on whether a specific module is loaded or not.


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

Board footer

Powered by FluxBB