How would I create icon+popup on taskbar where clicking items runs diff. scripts?

I want to create a popup that you access from a taskbar tray icon. If you click the icon, you get a context menu (similar to what you see when you click the scissors icon for clipboard) and each of the items in the popup runs a script that I created.

How would I do this?

I don’t know about system tray icons, but you can add icons that start a bash or other script from your desktop and from the KDE or GNOME menu. I do this very thing with many of my bash scripts when they are first run. Its easier to do than creating a system tray icon, if you don’t already know how they work, that is for sure. Here are a couple of bash script examples:

N.S.F. - New Script File, Bash Script File Header Creator - Version 3.00: https://forums.opensuse.org/blogs/jdmcdaniel3/n-s-f-new-script-file-bash-script-file-header-creator-version-2-6-37/

SYSEdit - System File Editor - Version 1.50: https://forums.opensuse.org/blogs/jdmcdaniel3/sysedit-system-file-editor-version-1-00-60/

Both include pop up windows when used that are compatible with KDE and GNOME with full source code included. Check them out and you will see what I mean.

Thank You,

Thanks for the help, but this isn’t quite what I’m looking for. :slight_smile: I want an icon that can be clicked on the taskbar which then pops up a context-menu with items in it. Each of those items will start a script.

Let me know if you come up with that, but in the meantime, you do have other options.

Thank You,

You can write a bash script using kdialog to create your context menu. Then add a desktop description file with an icon which you can place into the task bar. The desktop file will start your context menu script.

Hello Vodoo, its good to see your green light on today. The two bash scripts I pointed 6tr6tr to, NSF and SYSEDIT, both use kdialog if it finds you are using the KDE Desktop. I feel both scripts standalone on their own merits, but also show how to use GUI dialogs from a bash script.

Thank You,

I think you’re describing what the Quicklaunch widget (on KDE) does.

Where would one find out about kdialog? I mean, now that I know it exists, I can search for documentation ( I haven’t yet, I will). But how could I find that things like it even exist? I saw no mention of it in the bash documentation.

Bart

Really, you can just search the internet and find all sorts of links for kdialog. I use it in several of my bash scripts, like this one: SYSEdit - System File Editor - Version 1.50 - Blogs - openSUSE Forums

Get the script and see what I mean. Kdialog is intended to be used with KDE normally.

Thank You,

Thanks for replying to my continuation of a relatively old thread.

I understand I can find references to kdialog and have, in fact downloaded your script as a lesson. (Thank you so much!)

My real question though is, how would I have know kdialog even existed if I had not seen reference to it in this thread? How many other graphical ah… functions (?) exist? Is there a list of them somewhere? How did you find out about kdialog? Please don’t list them all for me, please tell me where I can discover them for myself.

Bart

Well as for Kdialog, it was mentioned to me here in the forum. Further, I did a lot of online searches on bash scripts where I realized Kdialog was popping up in those searches sometimes, but I did not know what it was for. I really doubt there is just one place to look as its a kind of ever expanding subject the more you look into it.

Thank You,

montana suse user wrote:
> My real question though is, how would I have know kdialog even existed
> if I had not seen reference to it in this thread? How many other
> graphical ah… functions (?) exist? Is there a list of them somewhere?
> How did you find out about kdialog? Please don’t list them all for
> me, please tell me where I can discover them for myself.

kdialog is designed for KDE. If you type ‘bash dialog’ into google, you
will find the more generic utility ‘dialog’, along with other things.

There are many, many examples of such programs, generally grouped into
‘toolkits’ or sometimes ‘widgets’ (although that usually means something
slightly different). ‘shell gui’ or ‘bash gui’ might throw up some hits
as well.

No there isn’t a list that I’m aware of. You find out about such things
by reading around so that when you want to use them, you’re already at
least vaguely aware of them.

One widespread toolkit is Tcl/Tk. You could start there.

http://www.tcl.tk/
http://www.tkdocs.com/tutorial/widgets.html

On 2013-08-11, montana suse user <montana_suse_user@no-mx.forums.opensuse.org> wrote:
> My real question though is, how would I have know kdialog even existed
> if I had not seen reference to it in this thread? How many other
> graphical ah… functions (?) exist? Is there a list of them somewhere?
> How did you find out about kdialog? Please don’t list them all for
> me, please tell me where I can discover them for myself.

For shell scripting, you could have a look at :

http://techbase.kde.org/Development/Tutorials/Shell_Scripting_with_KDE_Dialogs#kdialog_Usage

If you code in C++/Python, I’d recommend using the corresponding Qt API.

On 2013-08-13 11:21, Dave Howorth wrote:
> One widespread toolkit is Tcl/Tk. You could start there.

IIRC, the kernel “make xconfig” section is done with it. And “make
menuconfig” with something else.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)