You are not logged in.
Hi guys
I have a (hopefully) interesting question:
-in openbox-
how would i go about executing a specific application when i switch to, say workspace 4? Ahah, now, i could map the same hotkey to switching and to that program, aren't I thick... no wait, i usually switch with the arrow keys... now damn, that doesn't work anymore. maybe I can write a little script to execute when i switch workspaces and check which workspace i am on and then execute that other program (or not, according to what it found out)...
So. problem solved, eh? Not quite. how do i check which workspace i am on? is there some api to openbox or if not, as openbox is EWMH compliant there should be a way to find out, not?
cheers Barde
PS: in awesome this would be easier as it has these nice hooks and that neat lua config file... but there are no such things in openbox, are there?
Offline
Here's one way to do it:
#!/bin/sh
while true; do
DESK=$(($(xprop -root | grep "_NET_CURRENT_DESKTOP(CARDINAL)" | egrep -o [[:digit:]]) + 1))
[ $DESK == 4 ] && thunar && break
sleep 1
done
This script only works once, but it should give you a general idea...
Offline
you're the man! thx a whole bunch! (have a cookie )
what do you mean by only works once
cheers Barde
Offline
what do you mean by only works once
The loop ends once the application is executed successfully. So you'd need to restart the script in case you close this application afterwards...
Offline
ah. i see. that is no problem at all. i will just map the script (without the while loop) to any (both) keybindings i use to switch desktops
thanks again
Barde
PS: I never told what i wanted to do with it: the plan is to have a dedicated programming workspace.
point is that I use the layout de_CH which has most of the keys relevant to programming at very dumb places. so i want that the keymap is automatically switched to en_US when i enter this workspace and back when i leave it again
Last edited by Heller_Barde (2008-10-15 21:23:35)
Offline