Forum

Command to exec after running the program?

Författare Svar
azzid Monday 17 February 2014 at 20:38
azzidAnonymous

I'd like to change my monitor setup before and after running a program.

I found the miscellaneous setting "Command to exec before running the program".

Adding the command "/usr/bin/disper -S" successfully turns my extra monitor off before starting the program.

I'd like to run another command (/usr/bin/disper -e -t left) after the program quits to re-enable the monitor.

How can I do that?
petch Monday 17 February 2014 at 21:22
petch

Beside editing the shortcut script directly, I think
trap '/usr/bin/disper -e -t left' EXIT

Should do the trick
azzid Tuesday 18 February 2014 at 16:53
azzidAnonymous

Worked perfectly!

Thanks.
azzid Monday 24 February 2014 at 19:36
azzidAnonymous

As a follow-up I'd like to point out that this only seem to work when starting the program from within the PlayOnLinux gui.

If I start the program using the dedicated shortcut or the command line it will not run disper. Neither before nor after running the program.
petch Monday 24 February 2014 at 20:26
petch

Capitain_Jack Tuesday 21 February 2017 at 3:28
Capitain_Jack

Beside editing the shortcut script directly, I think
trap '/usr/bin/disper -e -t left' EXIT

Should do the trick

Man that with some other knowledge lead me to the final solution.

http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

With this old version tutorial you learn how to identify resolutions and extract the lines to config trough xrandr , but to let settings fixed you need to discover witch version of gdm you're runnig (in my case wasn't gdm, was gdm3).

you can always read the wiki to adapt new versions to old solutions:

https://wiki.ubuntu.com/X/Config/Resolution

 

and mixing both I ended up inlcuding, into playonlinux configuration box (the last tab, in a space that says "Command to execute before openning the program":
trap 'xrandr --output HDMI-0 --mode 1600x900' EXIT

 

Maybe you guys with more time and knowledge can develop an easy script for setting this within POL.

hope it helps, if so, let me know.


Debian SparkyLinux Testing (Rolling)
64bit
AMD CPU
ATI GPU