You are not logged in.
Hi friends! There is a way for config Openbox to exec some command when a windows is focused? I have done some changes in rc.xml before but no idea if it is possible.
Thanks!
Offline
when any window is focused???
or a certain, defined window?
please tell us what you are trying to achieve, i think there's probably a better way.
Offline
Any windows or certain, dont mind.
I need create a special user account, when it login and start openbox a virtual machine is automatically opened in fullscreen mode. Its easy config openbox/autostart with:
vboxmanage startvm "{8fca9a6d-b285-4873-912f-c873ae41a1d1}"
The problem is that when virtualmachine is powered off I would like to logout and go back to lightdm or poweroff the computer automatically. I have no idea how to solve it, because when vboxmanage startvm command is exec, it runs in background and dont wait until the process ends, and continue executing next command. This is because i cant do something similar to:
vboxmanage startvm "{8fca9a6d-b285-4873-912f-c873ae41a1d1}"; poweroff
My idea is exec some script when virtualbox losses the focus for this special user.
Thanks for your support!
Last edited by pepemopap (2018-10-10 07:28:55)
Offline
Something like this perhaps
https://unix.stackexchange.com/question … us-unfocus
Offline
Something like this perhaps
https://unix.stackexchange.com/question … us-unfocus
Thanks, but iI would prefer another solution thath no use a infinite pooling loop exec a command every second.
Offline
^ Fair, there is also 'xprop -spy'
https://askubuntu.com/questions/1010276 … ut-polling
but irc i read someplace that is memory leaker.
Offline
The problem is that when virtualmachine is powered off I would like to logout and go back to lightdm or poweroff the computer automatically. I have no idea how to solve it, because when vboxmanage startvm command is exec, it runs in background and dont wait until the process ends, and continue executing next command. This is because i cant do something similar to:
vboxmanage startvm "{8fca9a6d-b285-4873-912f-c873ae41a1d1}"; poweroff
i see.
so what you really need is vboxmanage to stay in the foreground.
i just had a look at how vboxmanage actually starts virtual machines.
looking at output from
ps aux
i noticed that vboxmanage just starts a few other processes, namely something like this:
/usr/lib/virtualbox/VirtualBox --comment refracta --startvm d384c0d0-389e-49c0-8f5b-18b56fb327d8 --no-startvm-errormsgbox
i tried, and i can start this directly, and it stays in the foreground.
so try adding this to autostart:
/usr/lib/virtualbox/VirtualBox --comment refracta --startvm d384c0d0-389e-49c0-8f5b-18b56fb327d8 --no-startvm-errormsgbox; poweroff
Offline
Wow ohnonot! Very clever! Works perfect!
Thanks
Offline