Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i make a tray icon in Linux using C++?

In Windows, I can use Shell_NotifyIcon(). What is the Linux equivalent of this function?

Is it different in GNOME (gtk) and KDE (qt)? Can't find any tutorials on the Internet.

like image 558
Mad Fish Avatar asked Dec 10 '25 15:12

Mad Fish


1 Answers

Yes, it depends on a desktop environment you're using.

In Qt (KDE), you can do this in a cross-platform manner using QSystemTrayIcon.

There is even a sample application in Qt.

In GTK, you do this with GtkStatusIcon. There is a sample application in this blog post.

like image 146
Reed Copsey Avatar answered Dec 12 '25 06:12

Reed Copsey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!