You are not logged in.
Hey all!
I've been using openbox from the day I installed Arch a few months back, and still like many people wonder how I lived without it before.
There's just one thing missing that could make it perfect. A system tray that is accessed in a similar way to the root menu!
I've searched high and wide for a pipe-menu for this functionality, but found nothing. So now, I'm looking for the next best thing. Something that shows up on a keyboard command, and holds onto all those apps that minimise themselves to the tray, like pidgin, Skype, dropbox...
I've heard of piedock, but I'm not sure this covers it, as that seems more of a launcher and somewhere for all my minimised windows to go, which isn't really what I'm after (plus that the package fails to build, but that's another issue).
If there's an answer to my call, please don't hesitate to share it! Thanks all.
Last edited by Reded (2012-06-13 04:17:31)
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
Tint2 could work. It is also a task manager and launcher, but it is highly configurable, so you can configure it to be just a tray without anything else.
You can use fairly default configs to have the tray hide off screen until you mouse-over a screen edge. Alternately, if you're a little more creative you can have it display anywhere on screen and show up in response to a key/mouse-binding.
I've hijacked tint2 to do all kinds of cool gui's that one would never suspect were built from a taskbar program.
Anyhow, odds are, fairly common settings for tint2 (no fancy trickery) would get you just what it sounds like you want.
Edit: there is also stalonetray which from what I've heard is quite good, but I have no experience with it.
Last edited by Trilby (2012-06-08 04:50:44)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
See I already use stalonetray but even that uses screen space! What you've said about tint 2 sounds interesting though. I'm particularly interested in making it appear where my cursor is when I (for example) click two mouse buttons together, or something.
I'll have a search around for some configs. Maybe I'll even try to make it output a text list so it really looks part of openbox! Thanks for the answer. I'll keep the thread unsolved for a little while and see what other answers I get.
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
Have you tried stalonetray with
dockapp_mode simple
??
I think that is the correct option. My tray hides in the corner. When I shove the mouse into the corner, the tray appears under the mouse.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Yes I have, and that's not what in after I'd like it to appear wherever my mouse cursor happens to be at the time when the keyboard (or mouseclick) shortcut is activated. Can I do that with stalonetray?
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
I'm not sure about outputting a text list. It doesn't have such a feature built in, so you'd have to build that yourself. And once you do that, you might as well use a pipe-menu or something like mygtkmenu.
Showing up at a particular place would be easy enough, but would take just a little trickery beyond the "normal" configs you've find in online tutorials.
You could bind a script to a key or mouse click (in OB's rc.xml). That script would have to fill in the cursor coordinates in a template tintrc then call tint2 passing that newly created rc file. Basically you could have something like the following:
#!/bin/bash
xdotool getmouselocation --shell
tint2 -c <<EOF >/dev/null 2>&1
panel_position = bottom right
panel_size $X $Y
# add other "standard" tint2 config stuff here to put the systray at the left-top of the main panel
# the main panel will be transparent, so the systray will appear at the X and Y coordinates determined by xdotool above
EOF
xdotool search --class "tint2" behave mouse-click windowkill
Other hackery I've done with tint2 can be seen here
Really you can do such hackery with any app, if you are creative enough.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hi again, I'm really not up to scratch on any sort of scripting - I essentially copy-pasted your script and marked it executable (And made it call by Ctrl+Alt in my Openbox rc.xml) And nothing seems to be happening - What parts of it do I have to change in order for it to work? I'm 99% sure I've created my tint2 to essentially be a System Tray and nothing else, I'm just getting my head around the part about making it appear/disappear on my keyboard shortcut
Returned this when I ran it in terminal - Like I said I just copied/pasted yours, so I'm not sure if there's anything else that needs adding?
./tintscript
findclient: 4466852
findclient: 4466851
X=1928
Y=581
SCREEN=0
WINDOW=4466851
./tintscript: line 9: 13660 Segmentation fault tint2 -c > /dev/null 2>&1 <<EOF
panel_position = bottom right
panel_size $X $Y
# add other "standard" tint2 config stuff here to put the systray at the left-top of the main panel
# the main panel will be transparent, so the systray will appear at the X and Y coordinates determined by xdotool above
EOF
Last edited by Reded (2012-06-08 06:17:23)
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
I went through the exact same quest as you when I switched to Openbox a while back. The answer I found was no, there isn't a way to put tray icons into a menu.
The more I thought about it the more confusing the situation became. If I middle click on the root window, a menu appears with my tray icons, and I click one of them, what happens? Every tray icon behaves differently. Some display status, some have a left click action or menu, some have a right click menu, and so on.
Trilby's idea of having a mouse click load a small tint2 bar with a tray is an interesting idea. I too have no idea how to get that to work.
Have you tried stalonetray with
dockapp_mode simple
I think that is the correct option. My tray hides in the corner. When I shove the mouse into the corner, the tray appears under the mouse.
This is exactly what I decided to do. I have stalonetray load in the bottom left corner. It's "hidden", so I only see a small line, and the tray only appears when I mouse over it. I usually forget it's even there until I load one ofe the two dingbat applications that refuse to support disabling the tray icon.
Offline
tray-shmay !!!!
Just create an additional workspace and put the apps there, like chat or whatever you planned to put in the tray. Assign Alt-Tab and Alt-Shift-Tab to switch between apps on the same workspace and all apps (on all workspaces) respectively.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
tray-shmay !!!!
Just create an additional workspace and put the apps there, like chat or whatever you planned to put in the tray. Assign Alt-Tab and Alt-Shift-Tab to switch between apps on the same workspace and all apps (on all workspaces) respectively.
Woah, wait a minute here. There's two scenarios that are tricky if I choose to just ignore tray icons:
If I accidentally close the Skype window (click on the "X") and it remains running in the non-existant tray, is there any way to get it back? (By the way, I want to slap whoever first thought of that little "feature")
The "Stop" button for gtk-recordmydesktop exists as a tray icon. The first time I ran it without a tray, I ended up having... complications. Maybe I should look into using a different desktop recording program.
Offline
for skype, you could always set up a rule in OB to run it full screen -- problem solved.
I never used gtk-recordmydesktop --- so you are on your own there.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
My example could only graciously be called pseudo-code. I would not expect it to work at all as is.
First, I missed an important part in the first xdotool command. That line should read
eval `xdotool getmouselocation --shell`
Second, the embedded here-document tint2rc is grossly incomplete. I left those details out because that part is well documented in the tint2 docs or various websites.
Third, I just guessed on the classname for the second xdotool command. This would have to be verified (AKA changed) after checking with xprop (or `xprop | grep -i class` then click on a tint2 panel).
Now, as for one of the errors, it looks like the output redirection was put before the opening of the here-document. This will not work. The "<<EOF" must be before the ">/dev/null 2>&1" on the line that calls tint2.
In retrospect, all the output redirection should just be left out at this stage. It's really only there for "cosmetic" purposes, and while futzing with this, it may be useful to see all the output in the shell that launches the script (tty1 if it's ran by a key/mouse binding).
So, the call to tint2 should just look like
tint2 -c <<EOF
for now.
Also, I don't currently have tint2 installed, so I can't test this at all myself. I don't suspect this will be a very suitable "solution" if you are not comfortable with scripting, unless you see this as a good chance to get experience. I do expect that such an approach will require lots of tweaking - but with a little learning and effort, you could get it to do what you want.
I would not be surprised if there are already apps out there that would not take as much learning or effort ... I just don't know of them.
Perhaps a easier approach would be to check out the code of stalonetray or another simple trayer. Then exapt some of that code to make your own pipemenu.
This would have the advantage of being able to be text-based, and use the already configured OBmenu look and feel.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
It's kind of interesting that the day I was looking for something exactly like this (scouring google), is the same day this thread was started. Anyway, here's how I deal with skype:
stalonetray > /dev/null 2>& 1 & pid=$!
sleep 0.2s
stalonetray -r skype > /dev/null 2>& 1
kill $pid > /dev/null 2>& 1
stalonetray has a feature that allows you to send clicks to an icon from the command line. Save that to a file and add it as a choice on your root menu. It will always show skype. It's not a perfect solution, but good enough for me.
If I accidentally close the Skype window (click on the "X") and it remains running in the non-existant tray, is there any way to get it back? (By the way, I want to slap whoever first thought of that little "feature")
Stole the words right out of my mouth.
Last edited by ignorant (2012-06-13 03:02:05)
Offline
It's kind of interesting that the day I was looking for something exactly like this (scouring google), is the same day this thread was started. Anyway, here's how I deal with skype:
That's awesome! I assume the other programs I use (Pidgin, Dropbox, qbittorrent) Can be easily substituted where the word 'skype' appears to add others to it? *tests*
My question is, is there a way to 'search' for programs minimised to the tray, so I can make sure I add the right command, as simply adding 'pidgin' didn't do anything
Last edited by Reded (2012-06-13 03:10:44)
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
Here is another solution to open and close the tray at the mouse location:
run stalonetray with --window-type toolbar
Show tray at mousepos:
eval $(xdotool getmouselocation --shell 2> /dev/null)
xdotool search --name "stalonetray" windowmap windowmove $X $Y windowactivate
Hide tray:
xdotool search --name "stalonetray" windowunmap
Last edited by progandy (2012-06-13 03:39:17)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Here is another solution to open and close the tray at the mouse location:
run stalonetray with --window-type toolbar
Show tray at mousepos:eval $(xdotool getmouselocation --shell 2> /dev/null) xdotool search --name "stalonetray" windowmap windowmove $X $Y windowactivate
Hide tray:
xdotool search --name "stalonetray" windowunmap
That's a keeper
The one above, using stalonetray's -r idea and adding those commands to a pipe, was a fantastic one, BUT Pidgin and Dropbox seemed to disagree with it
Your solution is a great one, once I've implemented it fully I'll mark this as solved!
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
That's awesome! I assume the other programs I use (Pidgin, Dropbox, qbittorrent) Can be easily substituted where the word 'skype' appears to add others to it? *tests*
My question is, is there a way to 'search' for programs minimised to the tray, so I can make sure I add the right command, as simply adding 'pidgin' didn't do anything
I'm not sure. I just typed "skype" the first time and it worked for skype. Maybe you could start up stalonetray normally and run xprop on the icons to get something. It would be awesome if stalonetray had even more command-line features.
Last edited by ignorant (2012-06-13 03:58:12)
Offline
Hehe, I tried xprop on the Pidgin icon and it returned the output for stalonetray, not Pidgin
And yes I agree with wanting more command-line features on Stalonetray - if I could figure out a way to 'search' stalonetray for icons, then run the icons, I think a pipemenu could be created (OpenBox users dream of the day!!) Make it search for icons, show a list from the output, then allow us to click them
For now the xdotool method is a winner for me, I've simply mapped the script to alt-f1. I'm not using the xdotool line to hide it, as that seems to make it appear in my window list, so when I want it out the way I point my mouse off-screen and hit alt-f1 again!
Thanks for the help everyone, this thread has been a fun little journey
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
Anyway, here's how I deal with skype:
stalonetray > /dev/null 2>& 1 & pid=$! sleep 0.2s stalonetray -r skype > /dev/null 2>& 1 kill $pid > /dev/null 2>& 1
stalonetray has a feature that allows you to send clicks to an icon from the command line. Save that to a file and add it as a choice on your root menu. It will always show skype. It's not a perfect solution, but good enough for me.
Very interesting. So I would still need stalonetray installed but it wouldn't have to be loaded on the screen.
Pidgin and Dropbox seemed to disagree with it
If my experience with Window Maker has taught me correctly, Pidgin is know by X as "Pidgin" not "pidgin". Try using xprop on the application window, not the tray icon. Oh, by the way, the tray icon for Pidgin can be disabled so that closing the window will close the application.
Last edited by drcouzelis (2012-06-13 13:39:32)
Offline
I tried Pidgin, also failed, but I'll have more of a play today
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline
Just a note: I noticed sometimes my script doesn't always kill stalonetray correctly, you might have to use `kill -9 $pid` instead of `kill $pid`.
Offline
If my experience with Window Maker has taught me correctly, Pidgin is know by X as "Pidgin" not "pidgin". Try using xprop on the application window, not the tray icon. Oh, by the way, the tray icon for Pidgin can be disabled so that closing the window will close the application.
I tried xprop on the Pidgin window, I tried the many different names that listed and none worked
"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying "End-of-the-World Switch. PLEASE DO NOT TOUCH", the paint wouldn't even have time to dry."
Offline