LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-19-2015, 04:46 AM   #1
yoreei
LQ Newbie
 
Registered: Mar 2015
Posts: 9

Rep: Reputation: 0
How to create system tray icon on Linux


So I recently started learning GTK+ with the intention of making a small applet for switching languages. I was shocked when I saw the following:

GtkStatusIcon has been deprecated in 3.14. You should consider using notifications or more modern platform-specific APIs instead.

What does that mean? Should I now investigate on how to separately integrate my app with GNOME Shell, KDE Plasma, and Win32? Isn't there a unified way? This is what a widget toolkit is supposed to do!

Help me out there, I am kinda scared... what is going on with Linux on desktop... Are we heading towards total separation?
 
Old 03-19-2015, 09:52 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by yoreei View Post
what is going on with Linux on desktop... Are we heading towards total separation?
Hard to tell when Windows'isms sneak into the Linux Culture. eg. "system tray". No such beast.
It's a "notification area" in Xfce4 terminology. IDK what they call it on other DEs, but I strongly believe that it is not a "system tray".
 
Old 03-19-2015, 12:04 PM   #3
yoreei
LQ Newbie
 
Registered: Mar 2015
Posts: 9

Original Poster
Rep: Reputation: 0
http://en.m.wikipedia.org/wiki/Notification_area
Yep, hard to find answers with Windows haters roaming around.
As I see, your experiance is limited to xfce4 only. I can tell you they do call it a system tray in other environments. Especially in the "do it yourself" world where stand-alone "system-trays" like Stalonetray can be installed to the system. But that's not for beginners, so you wouldn't know.
Anyway. Even if system tray is windows terminology (and it isn't, check the wikipedia article) I still fail to see how I used the terminology wrong, because ideally, I was searching for a way (a toolkit, a library, etc.) Which will allow me to create 'trays' in all the major environments: Ubuntu with their 'appIndicators'
Gnome with their 'persistent notifications'
KDE with their 'plasmoids'
Everyone else in the Linux on Desktop world who use good ol' Freedesktop notifications
AND (probably) goddamn m$Windows
 
Old 03-19-2015, 01:04 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Good luck with that.
 
Old 03-19-2015, 01:55 PM   #5
yoreei
LQ Newbie
 
Registered: Mar 2015
Posts: 9

Original Poster
Rep: Reputation: 0
Ffss. Some people have too much free time
 
Old 03-19-2015, 02:12 PM   #6
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,673

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
To expand on the above. If you write a desktop-integrated application you must integrate it with the desktop you want to integrate it with. Since there is no "Linux Desktop" you cannot, by definition, integrate into the "Linux Desktop".
I'm not sure what you are trying to achieve here and why you think somebody running Fluxbox or Ratpoison would suddenly want a system tray anyhow? It's obvious from a quick Google that the people who write Gnome don't want a "system tray" style notification any more and as far as I can see Canonical (behind Ubuntu's Unity) don't seem to want a traditional type either.
So what exactly are you trying to achieve?
 
Old 03-19-2015, 02:53 PM   #7
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 91
Quote:
Originally Posted by 273 View Post
Since there is no "Linux Desktop" you cannot, by definition, integrate into the "Linux Desktop".
Freedesktop.org have defined standards for desktops. Traditionally, GNOME and KDE have honored freedesktop standards. GNOME people seem to have their own mind nowadays.
 
Old 03-19-2015, 02:59 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,673

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by cepheus11 View Post
Freedesktop.org have defined standards for desktops. Traditionally, GNOME and KDE have honored freedesktop standards. GNOME people seem to have their own mind nowadays.
According to their desktop they haven't defined any standards.
Quote:
Originally Posted by Freedesktop.org
freedesktop.org is not a formal standards organization, though some see a need for one that covers some of the areas we are working on. For Linux operating system standards, look at the Linux Standard Base project. The X.Org Foundation and the IETF are other groups that do formal standards. The Free Standards Group is one group that publishes "de jure" standards for free software; freedesktop.org is loosely affiliated with the FSG.

Unlike a standards organization, freedesktop.org is a "collaboration zone" where ideas and code are tossed around, and de facto specifications are encouraged. The primary entry to these discussions is the xdg mailing list.
My emphasis.
Also, while there is collaboration to help applications form one desktop work with another, for example, the whole fact that you don't even need a DE to run a Linux GUI means there can never be a "Linux Desktop".
 
Old 03-19-2015, 05:04 PM   #9
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 91
Quote:
Originally Posted by 273 View Post
According to their desktop they haven't defined any standards.
This is unnecessary quibbling with words - thanks to them, we have custom start menu, application links, application category, mime type, default application priorities, icons, and whatever else config.
 
Old 03-19-2015, 05:23 PM   #10
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,092
Blog Entries: 23

Rep: Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077Reputation: 4077
Quote:
Originally Posted by yoreei View Post
http://en.m.wikipedia.org/wiki/Notification_area
Yep, hard to find answers with Windows haters roaming around.
As I see, your experiance is limited to xfce4 only. I can tell you they do call it a system tray in other environments. Especially in the "do it yourself" world where stand-alone "system-trays" like Stalonetray can be installed to the system. But that's not for beginners, so you wouldn't know.
Anyway. Even if system tray is windows terminology (and it isn't, check the wikipedia article) I still fail to see how I used the terminology wrong, because ideally, I was searching for a way (a toolkit, a library, etc.) Which will allow me to create 'trays' in all the major environments: Ubuntu with their 'appIndicators'
Gnome with their 'persistent notifications'
KDE with their 'plasmoids'
Everyone else in the Linux on Desktop world who use good ol' Freedesktop notifications
AND (probably) goddamn m$Windows
Please read and observe the LQ Rules, and show some respect for your fellow members.

Please refrain from immature personal attacks, name calling and not-so-clever-as-you-think insults on other members, especially those who have tried to provide a useful answer to your question. And please avoid tantrums and use of profanity in response to answers that do not fit your unfounded pre-conceptions.

If you had considered Habitual's helpful answer this thread might have proceeded along a more uesful path.

Last edited by astrogeek; 03-19-2015 at 05:30 PM.
 
Old 03-19-2015, 05:48 PM   #11
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,673

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by cepheus11 View Post
This is unnecessary quibbling with words - thanks to them, we have custom start menu, application links, application category, mime type, default application priorities, icons, and whatever else config.
There is more than just a semantic difference between somebody having defined standards and having helped agree them. It's another important difference between, say, Windows and Linux -- there is no one person "in charge" which helps explain the different approaches different Linux developers take. That is why I pointed out that the standards were not defined by a body -- in an attempt to explain to the OP why things aren't the way they are with Windows.

As far as what Freedesktop.org have achieved, I agree it's impressive and useful. However, again, what they have achieved is not something which can directly help somebody who wants there to be a system tray on every system on which their applications runs. In fact, in some ways, these standards make it easier to do without things like a system tray. If I understand it correctly Gnome are moving to a "notification queue" system which is actually supposed to help developers use the same code for Gnome and KDE but for things which look very different in implementation.

Or, to put it another way, there is no "Linux Desktop" there are many "Linux Desktops" following the "Linux Desktop Standard".

Apologies for quibbling but I am trying to convey to the OP that there are big differences between Windows and Linux so the same approach can't always be used. I'm still wondering how this system tray icon is supposed to work under Ratpoision .

Last edited by 273; 03-19-2015 at 05:54 PM.
 
Old 03-19-2015, 06:38 PM   #12
yoreei
LQ Newbie
 
Registered: Mar 2015
Posts: 9

Original Poster
Rep: Reputation: 0
You all made me sound like I was someone who thinks Linux should be just like Windows. I am sorry if I have not expressed myself right
'Queued Notifications', 'plasmoids', systrays, 'appIndicators' whatever those DEs choose to call them, they are basically the same thing, having the same functionality in a desktop. I was just curious if what was expected from a developer if he wanted to access this 'functionality' on all of the DEs that support it, was to write code specific for each and every platform. Although after a lot of unnecessary 'Linux is not Windows' shouting, it has become clear that this is the case.
I feel sorry that this thread ended up being the way it is.

Quote:
'm not sure what you are trying to achieve here and why you think somebody running Fluxbox or Ratpoison would suddenly want a system tray anyhow? It's obvious from a quick Google that the people who write Gnome don't want a "system tray" style notification any more and as far as I can see Canonical (behind Ubuntu's Unity) don't seem to want a traditional type either.
So what exactly are you trying to achieve
--> I am not trying to force people who don't want to have this 'functionality' have it. I'd like however, to be able to reach as many people who want to have it.
It seems as if you are saying Gnome's and Ubuntu's "system trays" are different from Freedesktop's. The way that I understand the situation is that we have 4 different ways of achieving the same thing depending on what desktop environment the user is using. I am not even saying this is bad. No! This is great in it's own terms and I understand this pretty well.

I asked for developing techniques but I got a philosophical (and a little rude to me) discussion. Maybe I did't post in the right forum.

Quote:
Please refrain from immature personal attacks, name calling and not-so-clever-as-you-think insults on other members, especially those who have tried to provide a useful answer to your question. And please avoid tantrums and use of profanity in response to answers that do not fit your unfounded pre-conceptions.
I do deserve this, I know. But so does one more person in this thread
I really hope though that this message will not be the last here. I ask once again the Linuxquestions community for answers. This time ON TOPIC, please. Enough terminology
 
Old 03-19-2015, 06:58 PM   #13
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,673

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Perhaps these will give you some tips:
https://wiki.gnome.org/Design/OS/Notifications
https://wiki.ubuntu.com/NotifyOSD
http://api.kde.org/4.0-api/kdelibs-a...ification.html
It seems that nowadays "the desktop is dead" so status bars/system trays/whatever are being deprecated by the cooler desktops in favour of notifications like iOS.
But is seems you knew that already?
 
Old 03-19-2015, 08:44 PM   #14
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,309

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
if i understand op correctly. this worx for me on gnome-2:
http://www.linuxquestions.org/questi...ml#post5241351


also, this command worx:
Code:
notify-send hello-world

Last edited by schneidz; 03-19-2015 at 08:51 PM.
 
  


Reply

Tags
gnome-shell, gtk+, notification


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Amarok icon not displaying in system tray shiftless Linux - Software 1 12-14-2008 07:18 AM
Q re: KMail system tray icon daihard Linux - Software 0 09-30-2005 12:51 PM
Add an Icon to The System Tray hhamid General 3 09-13-2005 05:11 AM
Add an Icon to The System Tray hhamid Programming 4 09-13-2005 03:16 AM
AMSN icon in system tray, help BlenderGuy Linux - Newbie 6 03-04-2004 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration