LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Bash for switching compositing on and off for specific programs (https://www.linuxquestions.org/questions/programming-9/bash-for-switching-compositing-on-and-off-for-specific-programs-4175576420/)

tpprynn 04-01-2016 12:25 PM

Bash for switching compositing on and off for specific programs
 
I'm using Compton with Lubuntu 14.04.4 and had spent some time, now abandoned, trying to get it to not put shadows on menus. Now I think what would be ideal is to have a script that is triggered with a keyboard shortcut to start, in my case, Libreoffice Writer or Firefox and switch Compton off and then resume Compton when either of those programs are exited. Ideally if the script could force Writer or FF to go fullscreen also that'd be great. I naively made a start realised I don't know anywhere near enough ot pull this off myself. Could someone fluent either tell me what I need in a script or give me some pointers that'd help me come up with this?

Presumably there is some kind of routine in these two programs that turns them fullscreen, so even if it's tricky/impossible at present to get Firefox to open fullscreen just by clicking its usual icon a script could automate what is done normally with a couple of consecutve keypresses?

As you can imagine, all I have is my just-begone script (with chmod +x applied ot it), which switches Compton off and starts Writer, but I wouldn't know what comes next to cover the exiting of the porgram and resumption of Compton. I have used xbindkeys to make the custom trigger.

Thanks for any tips.

genss 04-02-2016 01:16 PM

for turning compositing on/off you could, idk, write a script to start those programs like

Code:

#!/bin/sh
however_you_start_compton
firefox
however_you_stop_compton

ofc the problem there comes when one window exits but the other one is still running
deal with it with a temporary file that, idk, does reference counting or something

as for starting programs maximized i assume you are running openbox
openbox can do that, see http://askubuntu.com/questions/27583...hrough-ob-menu

for further scripting see wmctrl, xdotool and xwininfo
and the openbox config for keyboard shortcuts

ondoho 04-05-2016 02:16 AM

you have a problem (we do not know what it is) and have attempted a solution (switching off compton).
the real solution might be elsewhere.
this is called an x-y-problem.

it would be better if you tell us the actual problem.

btw, comptopn is very configurable, it should be possible to tell it to just not use it for particular apps.


All times are GMT -5. The time now is 05:57 AM.