-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add configuration to include/exclude windows by application
- Loading branch information
Showing
12 changed files
with
142 additions
and
115 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# v3.0 | ||
- add configuration to include/exclude windows by application | ||
|
||
# v3.0 | ||
- better compatibility with Wayland | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
Makes new windows always open on the monitor that is set as the primary in [i]System Settings[/i] > [i]Display and Monitor[/i] > [i]Display Configuration[/i] > checkbox [i]Primary[/i]. | ||
|
||
The windows to be affected can be filtered by application. | ||
|
||
Alternatives:[list] | ||
[*] [url=https://store.kde.org/p/1617640/]Always Open on Active Screen[/url] (the one that has the mouse cursor) | ||
[*] [url=https://store.kde.org/p/1618008/]Always Open on Focused Screen[/url] (the one that has the focused window)[/list]For more information on installation as well as any requests, please visit [url=https://github.com/nclarius/KWin-window-positioning-scripts/tree/main/always-open-on-primary-screen]the GitHub page[/url]. | ||
[*] [url=https://store.kde.org/p/1618008/]Always Open on Focused Screen[/url] (the one that has the focused window)[/list]For more information on installation and configuration as well as any requests, please visit [url=https://github.com/nclarius/KWin-window-positioning-scripts/tree/main/always-open-on-primary-screen]the GitHub page[/url]. | ||
|
||
© 2021 Natalie Clarius ‹[email protected]› | ||
© 2021-2022 Natalie Clarius ‹[email protected]› | ||
|
||
with contributions by [url=https://github.com/joedefen]Joe Defenderfer[/url]. | ||
with contributions by [url=https://github.com/joedefen]Joe Defenderfer[/url] and [url=https://github.com/tam1m]Tamim Baschour[/url]. | ||
|
||
This work is licensed under the GNU General Public License v3.0. | ||
This program comes with absolutely no warranty. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
Extension for KDE’s window manager to make new windows always open on the monitor that is set as primary in *System Settings* > *Display and Monitor* > *Display Configuration* > checkbox *Primary*. | ||
|
||
The windows to be affected can be filtered by application. | ||
|
||
![logo](.img/logo_.png) | ||
|
||
|
||
|
@@ -25,20 +27,40 @@ cd KWin-window-positioning-scripts/always-open-on-primary-screen | |
``` | ||
|
||
|
||
## Configuration | ||
|
||
*System Settings* > *Window Management* > *KWin Scripts* > configuration button in the *Always Open on Primary Screen* entry. | ||
|
||
You may need to uncheck the checkbox for the script, apply the settings, recheck, and reapply in order for the changes to take effect. | ||
|
||
In Plasma versions < 5.24, a bug in the KWin scripting system [[1]](https://bugs.kde.org/show_bug.cgi?id=411430) [[2]](https://bugs.kde.org/show_bug.cgi?id=444378) may cause the configuration not to be found. To fix this, please execute the following commands in a terminal: | ||
|
||
```bash | ||
sed -i 's/ConfigModule/Library/g' ~/.local/share/kwin/scripts/tilegaps/metadata.desktop | ||
mkdir -p ~/.local/share/kservices5/ | ||
ln -sf ~/.local/share/kwin/scripts/tilegaps/metadata.desktop ~/.local/share/kservices5/tilegaps.desktop | ||
qdbus org.kde.KWin /KWin reconfigure | ||
``` | ||
|
||
### Window class | ||
|
||
To find the window class name of an application: Right-click on the titlebar of a window of the application > *More Actions* > *Configure Special Application Settings...* > the pre-filled entry in *Window class (application)* (if it consists of two words, only the second part) is the window class to put in the script configuration. | ||
|
||
|
||
## Troubleshooting and known issues | ||
|
||
- If some applications still open on the wrong screen, consider disabling applications requesting their own window geometry (this features only exists on X11): *System Settings* > *Window Management* > *Window Behavior* > *Advanced* > *Window placement* > *Allow apps to remember the positions of their own windows, if they support it*. | ||
- Some XWayland applications may attempt to remember their window position; this can be prevented with a window rule, as suggested [here](https://github.com/nclarius/KWin-window-positioning-scripts/issues/11#issuecomment-1091979196): *System Settings* > *Window Management* > *Window Rules* > *Add New...* > enter the window class of the application and possibly restrict the window type to normal windows > *Add Property..* > *Ignore requested geometry* > *Force*, *Yes* > *Apply*. | ||
- - It has been suggested that the script might not work for snap applications; if this appears to be the case for you, consider using native packages instead. | ||
- On X11: If KDE applications open on the wrong screen, consider disabling applications requesting their own window geometry: *System Settings* > *Window Management* > *Window Behavior* > *Advanced* > *Window placement* > *Allow apps to remember the positions of their own windows, if they support it*. | ||
- On Wayland: Some XWayland applications may attempt to remember their window position; this can be prevented with a window rule: *System Settings* > *Window Management* > *Window Rules* > *Add New...* > enter the window class of the application and possibly restrict the window type to normal windows > *Add Property..* > *Ignore requested geometry* > *Force*, *Yes* > *Apply*. | ||
- It has been suggested that the script might not work for snap applications; if this appears to be the case for you, consider using the native packages instead. | ||
- For notifications to appear on the primary screen, make sure you have the notification applet present and enabled on your primary screen, and not present or disabled on any secondary screens. | ||
- Some applications (e.g. Spotify) may still open on the wrong screen despite these workarounds. I have not yet figured out how to fix this. If you do, please let me know! | ||
- If some applications still open on the wrong screen despite these workarounds, please report it, even more so if you have an idea what the problem might be or how to fix it. | ||
|
||
|
||
## Small Print | ||
|
||
© 2021 Natalie Clarius \<[email protected]\> | ||
© 2021-2022 Natalie Clarius \<[email protected]\> | ||
|
||
with contributions by [Joe Defenderfer](https://github.com/joedefen). | ||
with contributions by [Joe Defenderfer](https://github.com/joedefen) and [Tamim Baschour](https://github.com/tam1m). | ||
|
||
This work is licensed under the GNU General Public License v3.0. | ||
This program comes with absolutely no warranty. | ||
|
Binary file added
BIN
+20.8 KB
always-open-on-primary-screen/always-open-on-primary-screen_v3.0.kwinscript
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 | ||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > | ||
<kcfgfile name=""/> | ||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 | ||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"> | ||
<kcfgfile name="" /> | ||
<group name=""> | ||
<entry name="classlist" type="String"> | ||
<entry name="classList" type="String"> | ||
<label>Effected window class names</label> | ||
<default></default> | ||
</entry> | ||
<entry name="allowmode" type="Bool"> | ||
<default>false</default> | ||
</entry> | ||
<entry name="denymode" type="Bool"> | ||
<entry name="allowMode" type="Bool"> | ||
<default>true</default> | ||
</entry> | ||
<entry name="denyMode" type="Bool"> | ||
<default>false</default> | ||
</entry> | ||
<entry name="debugMode" type="Bool"> | ||
<label>Whether to log debug information</label> | ||
<default>false</default> | ||
<default>true</default> | ||
</entry> | ||
</group> | ||
</kcfg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,74 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>AlwaysOpenOnPrimaryScreenConfigForm</class> | ||
<widget class="QWidget" name="AlwaysOpenOnPrimaryScreenConfigForm"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>451</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="whatsThis"> | ||
<string notr="true">Effected window class names. One per line</string> | ||
</property> | ||
<property name="text"> | ||
<string notr="true">Effected window class names. One per line</string> | ||
</property> | ||
<class>AlwaysOpenOnPrimaryScreenConfigForm</class> | ||
<widget class="QWidget" name="AlwaysOpenOnPrimaryScreenConfigForm"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>451</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Always Open on Primary Screen</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label_1"> | ||
<property name="text"> | ||
<string>Apply to windows belonging to</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QSplitter" name="splitter"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<widget class="QRadioButton" name="kcfg_allowMode"> | ||
<property name="text"> | ||
<string notr="true">all except the follwing</string> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">matchTypeGroup</string> | ||
</attribute> | ||
</widget> | ||
<widget class="QRadioButton" name="kcfg_denyMode"> | ||
<property name="text"> | ||
<string notr="true">none except the following</string> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">matchTypeGroup</string> | ||
</attribute> | ||
</widget> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string>applications:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPlainTextEdit" name="kcfg_classList"> | ||
<property name="placeholderText"> | ||
<string>List of window classes (example: dolphin), one per line</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPlainTextEdit" name="kcfg_classlist"/> | ||
</item> | ||
<item> | ||
<widget class="QSplitter" name="splitter"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<widget class="QRadioButton" name="kcfg_allowmode"> | ||
<property name="text"> | ||
<string notr="true">Allow matching windows</string> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">matchTypeGroup</string> | ||
</attribute> | ||
</widget> | ||
<widget class="QRadioButton" name="kcfg_denymode"> | ||
<property name="text"> | ||
<string notr="true">Deny matching windows</string> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">matchTypeGroup</string> | ||
</attribute> | ||
</widget> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QCheckBox" name="kcfg_debugMode"> | ||
<property name="text"> | ||
<string notr="true">DebugMode</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
<buttongroups> | ||
<buttongroup name="matchTypeGroup"/> | ||
</buttongroups> | ||
<resources /> | ||
<connections /> | ||
<buttongroups> | ||
<buttongroup name="matchTypeGroup" /> | ||
</buttongroups> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters