You are not logged in.
Hi all.
I never worked with this stuff so I have no idea what to search so I ask here.
How I can do a program that just sits on background and on specific key press prints some message or do something else (not important for now the action) in OpenBox (if it matters)?
Another program I would like to write is a program that can handle window actions, like getting window name (and probably ID if there is any), do X when new window created, do Y when window closed, Z when focused and etc, again in OpenBox.
Sorry for those lame question but I really never worked with specific DE/WM so I have no idea.
I don't need code just point me to the right direction
Thanks a lot!
Oh forgot, I'm going to write in C/C++ so if there is libraries preferably that they will exists for C/C++
Last edited by skwo (2009-02-20 10:52:40)
ArchLinux x86_64 on Dell Latitude E5410
Offline
I know nothing about interfacing with openbox, but about sitting in the background and await key presses I use xbindkeys and it works very well. Seek in the wiki for more info.
Offline
/me is pointing in you in the right direction mainly because that's about as much as i know on the topics...
wmctrl, xdotools, xbindkeys (as mentioned), xmodmap, and ~/.config/openbox/rc.xml
//github/
Offline
Openbox already handles key mapping in rc.xml, as referenced above. And you could check out devilspie for the window action stuff.
Offline
Ok thanks but thats not what I'm looking for. Its all nice but I need to write my own software. Mainly what I want to do is to write keyboard layout switcher per window, since that was my problem with openbox. I want to write program that registers all open window into some linked list maybe + stores they layouts (at the beginning it will be the first layout), when window closed Ill remove it from list, when window opened Ill put into the list, and when window focused Ill find it in the list, get the layout currently written for that window and execute setxkbmap LAYOUT, and when some combination of keys pressed this program will switch the layout for current focused window.
So I would like to get, again, some direction where to look. Take for example devilspie: some how it can get info about opened windows, closed windows and do something with them.
Thanks again!
ArchLinux x86_64 on Dell Latitude E5410
Offline
Wont this work?
Script to change the layout
setxkbmap *
get current window name(with wmctrl) and layout and write it to some temp file
Script to Alt-tab
#!/bin/pseudo
xdotools to send the alt-tab key to openbox
wmctrl to get the active window name
read the temp file and setxkbmap layout of the current window
Last edited by u_no_hu (2009-02-21 04:02:18)
Offline
Its all nice, but now what I'm looking for. I rarely use Alt+Tab, imho panels are better.
Anyway I found that devilspie is using libwnck to watch for windows. Is there a better solution than libwnck?
And I still got problem with global key listener, so the program will react to some keys if it its not focused.
Thanks again
[edit]
Oh seems like libwnck will work only under gnome. Need a better solution.
[/edit]
Last edited by skwo (2009-02-21 11:44:22)
ArchLinux x86_64 on Dell Latitude E5410
Offline
Well at least someone?
I can't believe no one ever messed with this stuff.
I successfully got the name of root window via xlib, but it lists like 190 child windows, and some of them not even visible. And I still can't get how to react on specific actions like: Window Focused, Window Opened, Window Closed and etc.
There is not much documentation (or at least understandable) for XLib.
Thanks again!
ArchLinux x86_64 on Dell Latitude E5410
Offline
Why don't you try looking into some of panel's code out there ? You can look at the gnome code for this functionality, but beats me where you'd find it.
libwnck sounds about right, though...
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Well I don't know much about how each DE/WM manages their windows so I wasn't sure if the solution gnome uses will fit OpenBox, Ill check the source of the needed packages (gnome-settings-daemon I think).
Thanks!
ArchLinux x86_64 on Dell Latitude E5410
Offline
Have a look at wmctrl source code... It works with all EWMH compliant WMs ...And its a single file so you can easily scrap what you need from it
Offline
Wow thanks! It seems very useful!
ArchLinux x86_64 on Dell Latitude E5410
Offline