Systranything: A simple tool to create a context menu in the systray

Some time ago, I was looking for an easy way to turn on and off my VPN from a context menu triggered by a click on an icon in the system tray. I thought there was surely an existing tool I could use in which I would only have to plug a few shell scripts to do what I wanted.

I couldn’t find such a tool. So I thought it’d be cool to write it myself.

So here it is. Maybe it can be useful for other people too:

I had to create haskell-gi bindings for the library libayatana-appindicator. That’s the library I use to add the icon in the systray and create the context menu. Creating those bindings was amazingly easy. I want to take advantage of this post to thank the authors of haskell-gi for such an amazing tool and for making it so easy to write GUI apps in Haskell :slight_smile:

12 Likes

It’s for Gnome and KDE desktops, correct? You might want to explain that in README.

Not exactly. It’s for any software that implements the StatusNotifierHost spec from freedesktop.org

I’m not sure about Gnome. It should definitely work with KDE.

Personnaly, I use xmonad along polybar. I have systranything showing up in the polybar tray module among other things, like slack status, the NetworkManager icon (nm-applet), etc…

So it’s not tied to a specific desktop environment. But you’re right I should explain this in the README :+1:

1 Like

Looks useful! You may want to add a screenshot + prebuilt binary releases if you want more users.

2 Likes

A screenshot?

But there is nothing to see, really :man_shrugging: an icon (like the other icons in the systray) and a context menu (a GTK menu like any other GTK menu), both chosen by the user and defined in the configuration file.

However, you are the second person who asked me for such a screenshot. Then maybe I should add one even if I don’t find it very relevant.

I really wanted to create a static binary for that project. But because it uses GTK, it doesn’t seem easy if not totally impossible.

Anyway, I’m happy to take PRs if you’re willing to give it a try.

2 Likes

You know exactly what it is because you’ve been working on it for hours/days/weeks, so I think it’s natural that you wouldn’t find a screenshot relevant. On the other hand, for people who don’t know what it is, I suspect a screenshot is the single most effective way of communicating to them.

1 Like