Skip to content

Commit 5e23a9a

Browse files
committed
release always-open-on-primary-screen v2.3
1 parent 9f8719b commit 5e23a9a

File tree

9 files changed

+107
-13
lines changed

9 files changed

+107
-13
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[h2]v2.3[/h2]
2+
[list]
3+
[*] make script automatically enabled after install
4+
[*] update package structure
5+
[*] add install/uninstall scripts
6+
[*] add changelog in BB Code format
7+
[/list]
8+
9+
[h2]v2.3[/h2]
10+
[list]
11+
[*] fix incorrect geometry computation
12+
[/list]
13+
14+
[h2]v2.2[/h2]
15+
[list]
16+
[*] ensure adjusting window to screen dimensions is possible
17+
[/list]
18+
19+
[h2]v2.1[/h2]
20+
[list]
21+
[*] fix an error with fit window on screen
22+
[*] add Dutch and German translations of metadata
23+
[/list]
24+
25+
[h1]v2.0[/h1]
26+
[list]
27+
[*] adjust window dimensions to fit on screen (credits to @joedefen)
28+
[/list]
29+
30+
[h1]v1.0[/h1]
31+
[list]
32+
[*] initial release
33+
[/list]

always-open-on-primary-screen/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v2.3
2+
- make script automatically enabled after install
3+
- update package structure
4+
- add install/uninstall scripts
5+
- add changelog in BB Code format
6+
17
## v2.3
28

39
- fix incorrect geometry computation
@@ -18,4 +24,3 @@
1824
# v1.0
1925

2026
- initial release
21-
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- make script automatically enabled after install
2+
- update package structure
3+
- add install/uninstall scripts
4+
- add changelog in BB Code format

always-open-on-primary-screen/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@ Extension for KDE’s window manager to make new windows always open on the moni
1010

1111
### Dependencies
1212

13-
`kwin` (tested with v5.22 - v5.23 on X11).
13+
`kwin` (tested with v5.22 - v5.24 on X11).
1414

15-
### Method 1: via graphical interface
15+
### Installation via graphical interface
1616

17-
1. Install the script via *System Settings* > *Window Management* > *KWin Scripts* > *Get New Scripts …* > search for *Always Open on Primary Screen* > *Install*.
18-
2. Activate the script by selecting the checkbox in the respective entry.
17+
*System Settings* > *Window Management* > *KWin Scripts* > *Get New Scripts …* > search for *Always Open on Primary Screen* > *Install*.
1918

20-
### Method 2: via command line
19+
### Installation via command line
2120

2221
```bash
2322
git clone https://github.com/nclarius/KWin-window-positioning-scripts.git
24-
plasmapkg2 --type kwinscript -i KWin-window-positioning-scripts/always-open-on-primary-screen
25-
kwriteconfig5 --file kwinrc --group Plugins --key alwaysopenonprimaryscreenEnabled true
26-
qdbus org.kde.KWin /KWin reconfigure
23+
cd KWin-window-positioning-scripts/always-open-on-primary-screen
24+
./install.sh
2725
```
2826

2927

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
kpackagetool5 --type=KWin/Script --install package || kpackagetool5 --type=KWin/Script --upgrade package
3+
qdbus org.kde.KWin /KWin reconfigure
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#/bin/bash
2+
3+
# get plugin info
4+
name=$(basename "$PWD")
5+
version=$(grep -oP '(?<=X-KDE-PluginInfo-Version=).*' package/metadata.desktop)
6+
echo "$name v$version"
7+
8+
# generate changelog in markdown format
9+
heading_md=$([[ $version == *.0 ]] && echo "#" || echo "##")
10+
caption_md="${heading_md} v${version}"
11+
changes_md=$(cat CHANGELOG.txt)
12+
echo "$caption_md"$'\n'"$changes_md"$'\n\n'"$(cat CHANGELOG.md)" > "CHANGELOG.md"
13+
echo "generated changelog markdown"
14+
15+
# generate changelog in bbcode format
16+
heading_bb=$([[ $version == *.0 ]] && echo "h1" || echo "h2")
17+
caption_bb="[$heading_bb]v$version[/$heading_bb]"
18+
changes_bb=$'[list]\n'"$(cat CHANGELOG.txt | sed "s/- /[*] /g")"$'\n[/list]'
19+
echo "$caption_bb"$'\n'"$changes_bb"$'\n\n'"$(cat CHANGELOG.bbcode)" > "CHANGELOG.bbcode"
20+
echo "generated changelog bbcode"
21+
22+
# generate GitHub release
23+
gh release create "${name}_v${version}" -F CHANGELOG.txt
24+
echo "generated GitHub release"
25+
26+
# generate KDE store release
27+
find . -name "*.kwinscript" -type f -delete
28+
zip -rq "${name}_v${version}.kwinscript" \
29+
package \
30+
install.sh \
31+
uninstall.sh \
32+
README.md \
33+
README.bbcode \
34+
CHANGELOG.md \
35+
CHANGELOG.bbcode \
36+
LICENSE
37+
echo "generated KDE Store release"
38+
39+
# commit changes to GitHub
40+
git add *
41+
git commit -q -m "release $name v$version"
42+
git push -q
43+
echo "commited changes to git"
44+
45+
echo "done"

always-open-on-primary-screen/package/contents/code/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ GNU General Public License v3.0
66

77
// when a client is added
88
workspace.clientAdded.connect(function(client) {
9+
primaryScreen = 0;
910
// move client to primary (= 0'th) screen
1011
if (client == null || client.desktopWindow || client.dock) return;
11-
workspace.sendClientToScreen(client, 0);
12+
if (client.screen == primaryScreen) return;
13+
console.debug("sending client", client.caption, "to primary screen", primaryScreen);
14+
workspace.sendClientToScreen(client, primaryScreen);
1215

1316
// clip and move client into bounds of screen dimensions
1417
if (!(client.moveable && client.resizeable)) return;

always-open-on-primary-screen/package/metadata.desktop

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ X-KDE-PluginInfo-License=GPL v3.0
1919
X-KDE-PluginInfo-Website=https://store.kde.org/p/1617641/
2020

2121
Type=Service
22-
X-KDE-ServiceTypes=KWin/Script,KCModule
2322
X-Plasma-API=javascript
2423
X-Plasma-MainScript=code/main.js
25-
26-
X-KDE-Library=kwin/effects/configs/kcm_kwin4_genericscripted
24+
X-KDE-ServiceTypes=KWin/Script,KCModule
25+
X-KDE-ConfigModule=kwin/effects/configs/kcm_kwin4_genericscripted
2726
X-KDE-PluginKeyword=alwaysopenonprimaryscreen
2827
X-KDE-ParentComponents=alwaysopenonprimaryscreen
28+
X-KDE-PluginInfo-EnabledByDefault=true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
kpackagetool5 --type=KWin/Script --remove package
3+
qdbus org.kde.KWin /KWin reconfigure

0 commit comments

Comments
 (0)