LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-01-2016, 12:25 PM   #1
tpprynn
Member
 
Registered: Oct 2013
Location: Kent, UK
Distribution: Debian
Posts: 63

Rep: Reputation: 0
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.

Last edited by tpprynn; 04-01-2016 at 12:26 PM.
 
Old 04-02-2016, 01:16 PM   #2
genss
Member
 
Registered: Nov 2013
Posts: 744

Rep: Reputation: Disabled
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
 
Old 04-05-2016, 02:16 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pin only specific programs aquaboot Debian 2 07-25-2015 01:55 PM
[SOLVED] how can I create a string variable in bash in a specific format in bash mia_tech Linux - General 7 05-29-2014 11:34 AM
Simple question about switching between programs. xadrith Linux - Desktop 1 06-15-2008 03:05 PM
Before switching to Linux, are there any good alternatives to these programs? ralph76 Linux - Software 4 06-26-2004 01:48 PM
Script to open programs in specific desktops plainkeyman Linux - Software 1 06-23-2004 01:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration