Command to exec after running the program?

Auteur Réponses
azzid Lundi 17 Février 2014 à 20:38

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 Lundi 17 Février 2014 à 21:22

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

Should do the trick
azzid Mardi 18 Février 2014 à 16:53

Worked perfectly!

azzid Lundi 24 Février 2014 à 19:36

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 Lundi 24 Février 2014 à 20:26

Capitain_Jack Mardi 21 Février 2017 à 3:28

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.

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:


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)