Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-03-06 21:16:10

hutzlibu
Member
Registered: 2019-02-25
Posts: 4

Chrome/Firefox .. open new windows in fullscreen (on second monitor)

Ok, this is somewhat complicated:
I have a WebApp(I develope) which I use in fullscreen mode. And the App itself opens new windows ... which are not in fullscreen.
So I have to manually activate fullscreen and if I am on my Desktop computer, move it to the second screen.

And I know it is not a lot of work, but it still breaks my workflow and the immersion in the app, so I would like to automate it with a script, if possible:

- need to detect if a new window from chromium (or firefox) opens

   - if the url matches xxx, then proceed (optional)
- move window to second screen, if avaiable  (dedection part is optional, I can just make 2 scripts, one for laptop, one for desktop)
- make it fullscreen

Now is something like this possible, without having to recompile anything?
That would be awesome ...

Offline

#2 2019-03-07 01:20:26

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,985

Re: Chrome/Firefox .. open new windows in fullscreen (on second monitor)

Hello and welcome.

devilspie might be able to do this for you.

Can you install devilspie and run it in a terminal window like this:

devilspie -d

...then start your webapp. Post back what is displayed in the terminal window when you open the webapp.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-03-07 13:08:35

hutzlibu
Member
Registered: 2019-02-25
Posts: 4

Re: Chrome/Firefox .. open new windows in fullscreen (on second monitor)

Oh hello and thanks for the welcome  ... but it is not my first time here, but I was inactive for quite some time and my old account was deleted or I forgot the name wink

Anyway, devilspie's output, for chrome:

Window Title: 'Unbenannt - Chromium'; Application Name: 'Unbenannt - Chromium'; Class: 'Chromium'; Geometry: 1920x1052+0+0

and after opening a window the same:

Window Title: 'Unbenannt - Chromium'; Application Name: 'Unbenannt - Chromium'; Class: 'Chromium'; Geometry: 1920x1052+0+0

And for firefox it is pretty much the same

Window Title: 'Mozilla Firefox'; Application Name: 'Firefox'; Class: 'Firefox'; Geometry: 1920x1052+0+0

so unfortunately he does not give away too much, like url.
(btw. I use manjaro)

Offline

#4 2019-03-07 15:06:22

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,985

Re: Chrome/Firefox .. open new windows in fullscreen (on second monitor)

Unfortunately devlispie won't be helpful.

How about creating a link/shortcut that starts the instance and then moves window and maximizes it? Something like:

#!/bin/bash

firefox --new-window www.google.ca
sleep 1
wmctrl -r :ACTIVE: -t 1
wmctrl -s 1
wmctrl -r :ACTIVE: -b toggle,fullscreen

...change the URL to your specific one and play with the sleep command if the window takes time to get drawn to the screen. You can create a link to this script or assign it to a keyboard shortcut.

Note: it requires the wmctrl package. wmctrl will move the window to the second workspace, move you to the second workspace, and then maximize the window.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2019-03-08 12:35:49

hutzlibu
Member
Registered: 2019-02-25
Posts: 4

Re: Chrome/Firefox .. open new windows in fullscreen (on second monitor)

Wmctrl might do the trick. But there I would be bound to the command line.

But I found that there is devilspie2 or kpie, which work with lua ... I see what I can do with that, but with no working repository I need to compile them, let's see how far I can get.

Thanks for the hint!

Offline

#6 2019-03-08 18:35:59

hutzlibu
Member
Registered: 2019-02-25
Posts: 4

Re: Chrome/Firefox .. open new windows in fullscreen (on second monitor)

Ok, I am really amazed by devilspie2.
I have not figured it all out, as I just started messing around, but it worked pretty much like expected. Very nice!

http://www.nongnu.org/devilspie2/

Offline

Board footer

Powered by FluxBB