@@ -5,10 +5,20 @@ GNU General Public License v3.0
55*/
66
77// initialization
8- const debugMode = readConfig ( "debugMode" , true ) ;
9- function debug ( ...args ) { if ( debugMode )
10- console . debug ( "alwaysopenonactivescreen:" , ...args ) ; }
11- debug ( "initializing" ) ;
8+ const config = {
9+ classlist : readConfig ( "classlist" , "" )
10+ . toLowerCase ( )
11+ . split ( "\n" )
12+ . map ( ( s ) => s . trim ( ) ) ,
13+ allowmode : readConfig ( "allowmode" , false ) ,
14+ denymode : readConfig ( "denymode" , true ) ,
15+ debugmode : readConfig ( "debugMode" , false ) ,
16+ } ;
17+
18+ function debug ( ...args ) {
19+ if ( config . debugmode ) console . debug ( "alwaysopenonactivescreen:" , ...args ) ;
20+ }
21+ debug ( "initializing" ) ;
1222
1323// when a client is added
1424workspace . clientAdded . connect ( client => {
@@ -19,9 +29,12 @@ workspace.clientAdded.connect(client => {
1929
2030 // abort if client is null, not regeometrizable, or already on right screen
2131 if ( ! client
22- || ! ( client . resizeable && client . moveable && client . moveableAcrossScreens )
23- || client . screen == activeScreen )
24- return ;
32+ || ( config . denymode && config . classlist . includes ( String ( client . resourceClass ) ) ) // using denymode and window class is in list
33+ || ( config . allowmode && ! config . classlist . includes ( String ( client . resourceClass ) ) ) // using allowmode and window class is not in list
34+ || ! ( client . resizeable && client . moveable && client . moveableAcrossScreens )
35+ || ! ( client . resizeable && client . moveable && client . moveableAcrossScreens )
36+ || client . screen == activeScreen )
37+ return ;
2538
2639 // move client to active screen
2740 debug ( "sending client" , client . caption , "to active screen" , activeScreen ) ;
0 commit comments