Skip to content

Commit

Permalink
add default layout (v0.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
gerritdevriese committed Sep 22, 2022
1 parent 7c52a8f commit 3f35a48
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
Binary file modified KZones.kwinscript
Binary file not shown.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ cd kzones && ./build

## Setup
### Layouts
To start using the script you'll need to have at least one layout. There are none by default.
You can define layouts by putting them in the **Layouts** tab in the script settings, here are some examples to get you started:
#### Examples
<details open>
Expand Down
30 changes: 29 additions & 1 deletion contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,35 @@
</entry>

<entry name="layoutsJson" type="String">
<default></default>
<default>[
{
&quot;name&quot;: &quot;Layout 1&quot;,
&quot;padding&quot;: 0,
&quot;zones&quot;: [
{
&quot;name&quot;: &quot;1&quot;,
&quot;x&quot;: 0,
&quot;y&quot;: 0,
&quot;height&quot;: 100,
&quot;width&quot;: 25
},
{
&quot;name&quot;: &quot;2&quot;,
&quot;x&quot;: 25,
&quot;y&quot;: 0,
&quot;height&quot;: 100,
&quot;width&quot;: 50
},
{
&quot;name&quot;: &quot;3&quot;,
&quot;x&quot;: 75,
&quot;y&quot;: 0,
&quot;height&quot;: 100,
&quot;width&quot;: 25
}
]
}
]</default>
</entry>

<entry name="pollingRate" type="Int">
Expand Down
2 changes: 1 addition & 1 deletion contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ PlasmaCore.Dialog {
filterList: KWin.readConfig("filterList", ""), // filter list
fadeDuration: KWin.readConfig("fadeDuration", 150), // animation duration in milliseconds
osdTimeout: KWin.readConfig("osdTimeout", 2000), // timeout in milliseconds for hiding the OSD after switching layouts
layouts: JSON.parse(KWin.readConfig("layoutsJson", '[]')) // layouts
layouts: JSON.parse(KWin.readConfig("layoutsJson", '[{"name": "Layout 1","padding": 0,"zones": [{"name": "1","x": 0,"y": 0,"height": 100,"width": 25},{"name": "2","x": 25,"y": 0,"height": 100,"width": 50},{"name": "3","x": 75,"y": 0,"height": 100,"width": 25}]}]')) // layouts
}

console.log("KZones: Config loaded: " + JSON.stringify(config))
Expand Down
2 changes: 1 addition & 1 deletion metadata.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ X-KDE-ConfigModule=kwin/effects/configs/kcm_kwin4_genericscripted

X-KDE-PluginInfo-Author=gerritdevriese
X-KDE-PluginInfo-Name=kzones
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Version=0.2
X-KDE-PluginInfo-Website=https://kde.org
X-KDE-PluginInfo-Category=Utilities
X-KDE-PluginInfo-License=GPL-3.0+
Expand Down

0 comments on commit 3f35a48

Please sign in to comment.