π

Who Wants to Volunteer For xfce4-toggle-plugin?

Show Sidebar

Update 2020-02-06: Difference to libnotify

Update 2020-02-07: workaround using yad

I do have an idea. Unfortunately, my previous experience with C is from another millennia. Therefore, I need to find somebody who wants to invest a couple of hours to implement something that is going to make many Xfce users happy ones. Including myself. :-)

It should not really be complicated because of limited feature-set and almost every sub-part of it was already implemented in other plugins.

Examples Application: RChat

Imagine, you are using a chat software. Let's call it "RChat" for this example. RChat is nifty but lacks Xfce-integration in terms of a plugin that shows you when new messages arrive at your side.

However, the developers of RChat are that cool that they provide settings where user-configurable commands can be executed when a message is received.

With a hypothetical xfce4-toggle-plugin, you are able to get a "new RChat message arrived"-notification by just simple configuration. You add an instance of xfce4-toggle-plugin to your panel. In the plugin settings, you define:

Within RChat settings, you use the following command when new messages arrive:

 xfce4-toggle-plugin --instance "RChat" --activate	  

With the small downside that you have to disable manually, you now have a notification plugin for RChat although nobody implemented the xfce4-plugin-rchat yet.

xfce4-toggle-plugin

In order to provide this kind of functionality, the plugin configure screen should provide settings for the following things:

A command-line interface (CLI) with parameters like:

 xfce4-toggle-plugin --instance "<the identification name>" --activate	  

CLI parameters:

Somebody from the Xfce IRC already provided a small stub for this plugin. The xfce4 IRC gave positive feedback already as requested by the feature-request process. Since this is a totally new plugin, there is no sub-project where I could have added an issue for this.

Difference to Libnotify

I am perfectly aware of the existance of libnotify and the corresponding pop-up notifications on events. I'm using it on a daily basis.

The difference to xfce4-toggle-plugin is probably subtle. With libnotify I am forced to "react" to a given event instantly. Otherwise, I forget the thing that corresponds to the message. The other possibility is to use "sticky" notification messages that stay on-screen until I click on them. I don't want this in business meetings.

Further more, I don't want to manually change to the "do not disturb"-status in order to prevent notifications alltogether.

Additionally, libnotify messages don't offer any kind of interaction in contrast to the icon click options for the xfce4-toggle-plugin.

Examples Application: Background Task Issue

To demonstrate the broad applicability of this plugin, I'm going to describe a different use-case for this plugin.

If you're fond of scheduled background tasks just like me, you're probably familiar with cron. In general, this concept is really nice but error-handling is somewhat poor. If you don't pay attention, execution errors might never get your attention.

If you are not using a method like this, you might want to use xfce4-toggle-plugin for notifications.

The scheduled cron job gets extended:

 /path/to/command --my-parameter 42 || xfce4-toggle-plugin --instance "mycrontask" --activate	  

In case the /path/to/command execution fails somehow and its return value is not zero, you get notified via your handy panel icon. As soon as you resolved the issue, you can then deactivate the notification by clicking on it.

Please Do Step Forward

There are tons of thinkable examples where Xfce4-users are able to provide simple graphical feedback on arbitrary things without coding specific plugins.

Of course, three are other generic plugins that could be implemented in a similar way: displaying numbers or barcharts and so forth. You already got the idea.

So if you do feel that you want to contribute to this small project, please do step forward. Fork the project stub on GitHub and make this idea a reality! I'm happy to support with testing and documentation.

Thank you very much in advance!

Workaround: yad

Geoff Beier sent me an email comment where he describes a cool workaround:

Until you get a volunteer, it might be worth experimenting with yad to see if you get what you want. I've been using that to show dialogs from shell scripts, but I noticed recently it can also put an icon in your tray.
yad --notification --image=/usr/share/app-info/icons/fedora/64x64/rhythmbox.png &>/dev/null &
On my system, yad comes in its own package but I'd not be surprised to see it bundled with dialog

Installation on Xubuntu was easily done with sudo apt-get install yad and examples do look interesting. I was not aware of that tool before. With its --notification feature with --image, I get the main parts of my idea right away.

This way, I can configure simple notification commands everywhere.

Thanks a bunch!

Volunteers for xfce4-toggle-plugin still very much appreciated!

Comment via email (persistent) or via Disqus (ephemeral) comments below: