Skip to content

Commit

Permalink
add shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nclarius committed Feb 14, 2022
1 parent 1b07339 commit 174f118
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 67 deletions.
107 changes: 107 additions & 0 deletions CHANGELOG.bbcode
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
[h2]v5.4[/h2]
[list]
[*] fix configuration menu not available
[*] fix error in logging function
[*] update package structure
[*] add install/uninstall scripts
[*] make script automatically enabled on install
[*] add changelog in BBCode format
[/list]

[h2]v5.3[/h2]
[list]
[*] fix minimize and restore on manual move/resize not working
[/list]

[h2]v5.2[/h2]
[list]
[*] fix restore on geometry change not working
[/list]

[h2]v5.1[/h2]
[list]
[*] fix trigger on geometry change not working
[/list]

[h1]v5.0[/h1]
[list]
[*] more fine-grained filter by window type
[*] improve parsing of window classes in configuration
[/list]

[h2]v4.1[/h2]
[list]
[*] improve focus restoration behavior
[*] improve efficiency
[/list]

[h1]v4.0[/h1]
[list]
[*] filter by application
[/list]

[h2]v3.9[/h2]
[list]
[*] ensure focus is assigned to the correct window when minimizing and restoring
[/list]

[h2]v3.8[/h2]
[list]
[*] fix script not working
[/list]

[h2]v3.7[/h2]
[list]
[*] add Dutch and German translations of metadata
[/list]

[h2]v3.6[/h2]
[list]
[*] fix newly opened windows covered by old windows
[/list]

[h2]v3.5[/h2]
[list]
[*] fix floating tiles not properly applied on system startup or screen layout change
[*] fix order of restoration sometimes incorrect
[/list]

[h2]v3.4[/h2]
[list]
[*] rewrite for clearer code
[/list]

[h2]v3.3[/h2]

[*] rewrite for clearer code
[*] add debug mode

[h2]v3.2[/h2]
[list]
[*] fix a bug with autorestore
[/list]

[h2]v3.1[/h2]
[list]
[*] fix an error with autorestore
[/list]

[h1]v3.0[/h1]
[list]
[*] rewrite for compatibility with older KWin versions
[/list]

[h2]v2.1[/h2]
[list]
[*] set default for ignore special to true
[/list]

[h1]v2.0[/h1]
[list]
[*] fix config button not working
[/list]

[h1]v1.0[/h1]
[list]
[*] initial release
[/list]
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v5.4
- fix configuration menu not available
- fix error in logging function
- update package structure
- add install/uninstall scripts
- make script automatically enabled on install
- add changelog in BBCode format

## v5.3

- fix minimize and restore on manual move/resize not working
Expand Down
8 changes: 4 additions & 4 deletions README.bbcode
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The windows to be affected can be filtered by window type and application.

By default, any window that has been automatically minimized will be automatically restored once the space above it is free again; this can be disabled in the configuration.

[b]In order for the configuration menu to be available, you may have to activate it first.[/b] For more information on installation, configuration and usage as well as any requests, please visit [url=https://github.com/nclarius/floating-tiles]the GitHub page[/url].
For more information on installation, configuration and usage as well as any requests, please visit [url=https://github.com/nclarius/floating-tiles]the GitHub page[/url].

© 2021 Natalie Clarius ‹[email protected]

This work is licensed under the GNU General Public License v3.0.
This program comes with absolutely no warranty.
This is free software, and you are welcome to redistribute and/or modify it under certain conditions.
This work is licensed under the GNU General Public License v3.0.
This program comes with absolutely no warranty.
This is free software, and you are welcome to redistribute and/or modify it under certain conditions.

If you would like to thank me, you can always make me happy with a review or a cup of coffee:
[url="https://www.paypal.com/donate/?hosted_button_id=7LUUJD83BWRM4"][img height="30"]https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif[/img][/url] [url="https://www.buymeacoffee.com/nclarius"][img height="30"]https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png[/img][/url]
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ By default, any window that has been automatically minimized will be automatical

`kwin` version ≥ 5.21.

### Method 1: via graphical interface
### Installation via graphical interface

1. Install the script via *System Settings* > *Window Management* > *KWin Scripts* > *Get New Scripts …* > search for *Floating Tiles* > *Install*.
2. Activate the script by selecting the checkbox in the *Floating Tiles* entry.
*System Settings* > *Window Management* > *KWin Scripts* > *Get New Scripts …* > search for *Floating Tiles* > *Install*.

### Method 2: via command line
### Installation via command line

```bash
git clone https://github.com/nclarius/floating-tiles.git
plasmapkg2 --type kwinscript -i floating-tiles
kwriteconfig5 --file kwinrc --group Plugins --key floatingtilesEnabled true
qdbus org.kde.KWin /KWin reconfigure
cd floating-tiles
./install.sh
```

## Configuration
Expand All @@ -40,13 +38,6 @@ qdbus org.kde.KWin /KWin reconfigure

You may have to disable the script, apply, reenable, and reapply in order for the changes to take effect.

If the configuration button is missing (this is due to a central limitation with the KWin script installation component), try the following:

````bash
mkdir -p ~/.local/share/kservices5
ln -sf ~/.local/share/kwin/scripts/floatingtiles/metadata.desktop ~/.local/share/kservices5/floatingtiles.desktop
````

## Usage

### Known issues
Expand Down
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
kpackagetool5 --type=KWin/Script --install package || kpackagetool5 --type=KWin/Script --upgrade package
qdbus org.kde.KWin /KWin reconfigure
45 changes: 45 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#/bin/bash

# get plugin info
name=$(basename "$PWD")
version=$(grep -oP '(?<=X-KDE-PluginInfo-Version=).*' package/metadata.desktop)
echo "$name v$version"

# generate changelog in markdown format
heading_md=$([[ $version == *.0 ]] && echo "#" || echo "##")
caption_md="${heading_md} v${version}"
changes_md=$(cat CHANGELOG.txt)
echo "$caption_md"$'\n'"$changes_md"$'\n\n'"$(cat CHANGELOG.md)" > "CHANGELOG.md"
echo "generated changelog markdown"

# generate changelog in bbcode format
heading_bb=$([[ $version == *.0 ]] && echo "h1" || echo "h2")
caption_bb="[$heading_bb]v$version[/$heading_bb]"
changes_bb=$'[list]\n'"$(cat CHANGELOG.txt | sed "s/- /[*] /g")"$'\n[/list]'
echo "$caption_bb"$'\n'"$changes_bb"$'\n\n'"$(cat CHANGELOG.bbcode)" > "CHANGELOG.bbcode"
echo "generated changelog bbcode"

# generate GitHub release
gh release create "${name}_v${version}" -F CHANGELOG.txt
echo "generated GitHub release"

# generate KDE store release
find . -name "*.kwinscript" -type f -delete
zip -rq "${name}_v${version}.kwinscript" \
package \
install.sh \
uninstall.sh \
README.md \
README.bbcode \
CHANGELOG.md \
CHANGELOG.bbcode \
LICENSE
echo "generated KDE Store release"

# commit changes to GitHub
git add *
git commit -q -m "release $name v$version"
git push -q
echo "commited changes to git"

echo "done"
Loading

0 comments on commit 174f118

Please sign in to comment.