Registered Member
|
Hi there,
I am a bit frustrated ... and need some help ... The problem : When I start my Kubuntu Trusty (KDE 4.13.3) amd64 , one of the applications that autostarts is Babylon, the translator, through Wine ... it works acceptably well. It autostarts minimized on the System Tray (not on the panel or taskbar) , which is cool ( http://ge.tt/40mVVBq1 ) . The thing is I would like to set a shortcut to activate it (bring it to the foreground) ( http://ge.tt/820sXBq1 ) ... and I am not able to get there Aparently three options : I can think of ways to set this shortcut : - Customizing the System Tray entries preferences. - Through qdbus . - Using tools like 'xdotool' , 'wmctrl' , 'xlsclients' , 'devilspie' , etc ... Customizing the System Tray entries preferences : I can not set a shortcut through this way because the option is greyed out ( http://ge.tt/9E6FYBq1 ) . Through qdbus : I have been wading through StatusNotifiers ... but I haven't found anything apparently related to Babylon or Wine ( I am not very familiar with this tool either way ) . Using tools like 'xdotool' , 'wmctrl' , 'xlsclients' , 'devilspie' , etc ... : Let me tell you that I am not an expert at all about using these tools, but I had though in something like : wmctrl -lpx ... for getting the Babylon's windowid ... and ... xdotool windowactivate $windowid ... then make a little bash script and bind it to a global KDE shortcut. This doesn't work. The problem seems to be that neither 'wmcrtl' nor 'xdotool' have access to the System Tray. Another option might be something like : xlsclients -al ... for getting the Babylon's windowid ... and ... xdotool windowactivate $windowid ... and so on ... 'xlsclients' seems to have access to all applications running on my system, but it throws an unending amount of information ... and when searching for 'Babylon' , 'babylon', 'Wine' , 'wine' and the like nothing comes up. Either way I wouldn't be able to foreground Babylon through 'xdotool' ... I have spend some time searching on the web without luck, and now I'm frustrated and stuck ... I would appreciate if somebody could show me some guidance ... Thanks a lot. |
Administrator
|
See if this topic helps you: viewtopic.php?f=66&t=122111&p=315841&#p315822
Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.
10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts |
Registered Member
|
With Babylon minimized on the System Tray ... ... I send through Konsole :
xwininfo -tree -root | grep "Wine" ... I get : 0x2e00009 (has no name): ("explorer.exe" "Wine") 24x24+0+0 +877+772 0x2e0000c (has no name): ("explorer.exe" "Wine") 1280x34+0+766 +0+766 0x2e0000b (has no name): ("explorer.exe" "Wine") 24x24+1+1 +1+1 0x2e0000a (has no name): ("explorer.exe" "Wine") 1x1+0+0 +0+0 0x3a00001 "BabyScrnag": ("Babylon.exe" "Wine") 106x2+3+22 +3+22 0x3600013 "Babylon": ("Babylon.exe" "Wine") 1x1+0+0 +0+0 0x2e00002 (has no name): ("explorer.exe" "Wine") 1280x20+1280+800 +1280+800 0x3600012 (has no name): ("Babylon.exe" "Wine") 1x1+0+0 +0+0 0x360000c (has no name): ("Babylon.exe" "Wine") 1x1+0+0 +0+0 0x360000a "AXWIN Frame Window": ("Babylon.exe" "Wine") 952x573+4+23 +4+23 0x2e00006 (has no name): ("explorer.exe" "Wine") 1x1+0+0 +0+0 0x2e00005 (has no name): ("explorer.exe" "Wine") 1x1+0+0 +0+0 0x2e00004 (has no name): ("explorer.exe" "Wine") 1x1+0+0 +0+0 0x2e00003 (has no name): ("explorer.exe" "Wine") 1x1+0+0 +0+0 When I send through Konsole : xdotool search --classname Babylon.exe windowmap "AXWIN Frame Window" comes up ... which is something like an empty and transparent frame ... ... I guess what I might want is the "BabyScrnag" one ... ... but if I try : xdotool windowactivate 0x3a00001 ... I am getting : "XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1)" How could I refer to "BabyScrnag" instance ? Do you want the full output from 'xwininfo -tree -root' ? Thank you. |
|
BabyScrnag is only 2px high - I doubt that's the window of your interest?
The problem is that mapping a window does just that: map the window. If the client doesn't react to that event, it will not setup any actual content - internally even may still think to be hidden. If wine accepts faked events, you may try to "xdotool click" the systray icon. For FDO typed systray icons (asuuming babylon is), the icon will be a subwindow to the panel window where the systray resides. It's likely not gonna have many attributes (classname etc.) though. |
Registered Member
|
I followed your hint, luebking ...
... then ...
... my panel autohides, so I have to first use xdotool to show the panel, then click on Babylon icon and finally move again the pointer to a safe place and so left the panel to autohide again. ( http://ge.tt/8YuP7Nq1/v/0 ) Since my Babylon System Tray icon is virtually always on the same position, I tried to make things even simpler. While the mouse pointer was resting over Babylon System Tray icon :
... and finally :
I have to admit that while neither option is very elegant nor ultra-quick ... and the proccess unhiding/hiding the panel meanwhile the Babylon client comes up is some kind of orthopedic ... it works. So even though the solution is not optimal, I guess the question is SOLVED. Since Babylon client actually implements a customizable internal shortcut to activate itself, which apparently does not work through Wine, I will keep searching a way to send this shortcut key press simulation to the client and so get a more consistent and graceful solution. I just have learnt that while Babylon client is resting on the System Tray, I can not send this info through 'X window utilities' ... maybe qdbus will be my friend ... I'll see ... Let me please ask you one more question it just came from the botom of my head : I have a Babylon entry in my Kmenu. When Babylon autostarts on boot time it actually executes a copy of this babylon.desktop file placed on ~/.config/autostart :
Would it be useful to inform any of these X-DBUS or X-KDE parameters in order to make things easier regarding this kind of problem ? Thank you very much !!! |
|
Babylon won't talk dbus (dbus is not a usual IPC on windows) and no config entry would ever change that.
I'd check for "babylon.exe /?" what under windows would usually print a list of supported command switches. It _may_ offer to bring the window up and that _may_ work under wine. Please reconsider the "i click the same position" approach which is pot. harmful (anything can be there and you're causing unwanted things) You could go for fetching the panel from "xwininfo -children -root" and then passing its id to "xwininfo -children -id <panel_id>" to get to the likely babylon systray window (esp. if you're not running other wine systray apps) While clicking a hidden window does not work, sending a keypress though should, btw. - at least in theory |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar