diff --git a/.gitignore b/.gitignore
index 9d9e0d3..885ec0d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,6 @@ wofi/style.css
# Stub Hyprland writes on first run; the real config is hyprland.lua
hypr/hyprland.conf
+
+# Python bytecode
+__pycache__/
diff --git a/CLAUDE.md b/CLAUDE.md
index f10906f..15d45e8 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -9,6 +9,7 @@ This is a dotfiles/config repository for Arch Linux (Manjaro) using `yay` as the
## Repository Structure
- **Window managers**: `hyprland/`, `sway/`, `i3/` - config files for each WM
+- **KDE Plasma (Steam Deck)**: `kde/` - `apply.sh` installs Krohnkite and runs `shortcuts.py`, which sets Hyprland-style global shortcuts live via kglobalaccel D-Bus (don't hand-edit `kglobalshortcutsrc`; edit the `BINDINGS` table). Avoid `KGlobalAccel.globalShortcutsByKey` over D-Bus because a malformed call crashes kwin_wayland
- **Waybar**: `waybar/` - separate config JSONs per WM (`waybar_hyprland_config.json`, `waybar_sway_config.json`) plus shared `waybar_style.css`
- **Shell**: `bashrc`, `zshrc` - sourced from the user's dotfiles, not used directly
- **Terminal**: `alacritty.toml` (imported via alacritty's import system), `kitty.conf`
diff --git a/README.md b/README.md
index 86485a0..ea57bdf 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,9 @@ yay -S $(grep -v '^\s*$' ~/scripts/packages.txt | tr '\n' ' ')
~/scripts/uninstall.sh --backup ~/scripts/backups/20260319_120000 all
```
-Available targets: `hyprland`, `sway`, `i3`, `cursor`, `shell`, `alacritty`, `tmux`, `nvim`, `vim`, `all`.
+Available targets: `hyprland`, `sway`, `i3`, `cursor`, `shell`, `alacritty`, `tmux`, `nvim`, `vim`, `kde`, `all`.
+
+`kde` is for KDE Plasma 6 (Steam Deck desktop mode) and is not part of `all`. See [KDE Plasma (Steam Deck)](#kde-plasma-steam-deck).
### tmux prerequisite
@@ -180,6 +182,30 @@ All window managers and tmux use vim-style hjk<
| `e` | Exit session |
| `Return` / `Esc` | Cancel |
+### KDE Plasma (Steam Deck)
+
+`install.sh kde` runs `kde/apply.sh`. It installs the [Krohnkite](https://github.com/anametologin/krohnkite) tiling script into `~/.local/share/kwin/scripts`, so it survives SteamOS updates, creates 8 virtual desktops, and sets the shortcuts live through kglobalaccel's D-Bus API (`kde/shortcuts.py`). KWin owns `kglobalshortcutsrc` while it's running, so editing that file by hand doesn't stick. To change a binding, edit the `BINDINGS` table in `kde/shortcuts.py` and press `$mod + Shift + c`. `uninstall.sh kde` (or `kde/apply.sh --reset`) puts every touched shortcut back to its KDE default.
+
+Bindings match the shared table above, with these differences:
+
+| Key | KDE behaviour |
+| ---------------------------- | ------------------------------------------------------------ |
+| `$mod + Return` / `d` | Konsole / KRunner |
+| `$mod + F2` / `F3` | Firefox (flatpak) / Dolphin |
+| `$mod + t` | Cycle Krohnkite layout: spiral (dwindle) → tile (master) → monocle |
+| `$mod + w` | Monocle layout (instead of a tab group) |
+| `$mod + e` / `v` | Rotate layout / rotate the focused part |
+| `$mod + r` | Interactive resize; `$mod + Ctrl + h/j/k/l` resizes tiles |
+| `$mod + Space` | Switch to the last window |
+| `$mod + Shift + s` | Keep window on all desktops |
+| `$mod + Shift + -` | Minimize (no scratchpad in KDE) |
+| `$mod + 0` / `Shift + e` | Plasma logout/shutdown screen |
+| `$mod + Ctrl + x` | Kill window (xkill) |
+| `$mod + Shift + w` | KDE Overview |
+| `Print` / `$mod + Print` / `$mod + Shift + Print` | Spectacle region → GUI / clipboard / `~/screenshot.png` |
+
+Not mapped: `$mod + b` (KWin has no "last desktop" action), `$mod + m` (bar toggle), `$mod + g`, `$mod + c`, `$mod + F5`.
+
### tmux
Prefix is Ctrl + f.
diff --git a/install.sh b/install.sh
index 79a3185..7b65aae 100755
--- a/install.sh
+++ b/install.sh
@@ -18,6 +18,7 @@ usage() {
echo " tmux Source tmux.conf"
echo " nvim Neovim (LazyVim) config"
echo " vim Source vimrc"
+ echo " kde KDE Plasma (Steam Deck): Krohnkite + Hyprland-style shortcuts"
echo " all Everything (uses hyprland as WM)"
echo
echo "Options:"
@@ -133,6 +134,14 @@ install_vim() {
append_if_missing "$HOME/.vimrc" "source ~/scripts/vimrc"
}
+install_kde() {
+ echo "Installing KDE (Hyprland-style) config..."
+ backup "$CONFIG_DIR/kglobalshortcutsrc"
+ backup "$CONFIG_DIR/kwinrc"
+ backup "$CONFIG_DIR/kxkbrc"
+ "$SCRIPTS_DIR/kde/apply.sh"
+}
+
if [ $# -eq 0 ]; then
usage
exit 1
@@ -163,6 +172,7 @@ for target in "${targets[@]}"; do
tmux) install_tmux ;;
nvim) install_nvim ;;
vim) install_vim ;;
+ kde) install_kde ;;
*)
echo "Unknown target: $target"
usage
diff --git a/kde/apply.sh b/kde/apply.sh
new file mode 100755
index 0000000..7e83223
--- /dev/null
+++ b/kde/apply.sh
@@ -0,0 +1,96 @@
+#!/usr/bin/env bash
+# Make KDE Plasma 6 (Steam Deck desktop mode) behave like hypr/base.lua:
+# Krohnkite tiling, 8 virtual desktops, Hyprland-style global shortcuts.
+# Safe to re-run. Undo with: kde/apply.sh --reset (or uninstall.sh kde)
+set -euo pipefail
+
+KDE_DIR="$(cd "$(dirname "$0")" && pwd)"
+APPS_DIR="$HOME/.local/share/applications"
+KROHNKITE_VERSION="0.9.9.2"
+KROHNKITE_URL="https://github.com/anametologin/krohnkite/releases/download/$KROHNKITE_VERSION/krohnkite.kwinscript"
+
+kwin_reconfigure() { qdbus org.kde.KWin /KWin reconfigure >/dev/null 2>&1 || true; }
+
+if [ "${1:-}" = "--reset" ]; then
+ echo "Resetting KDE shortcuts and tiling..."
+ python3 "$KDE_DIR/shortcuts.py" --reset
+ rm -f "$APPS_DIR"/hyprkeys-*.desktop
+ kwriteconfig6 --file kwinrc --group Plugins --key krohnkiteEnabled false
+ kwin_reconfigure
+ kbuildsycoca6 >/dev/null 2>&1 || true
+ echo "Done. (Virtual desktops and Krohnkite itself are left in place.)"
+ exit 0
+fi
+
+# ---- Krohnkite -----------------------------------------------------------------
+installed=$(kpackagetool6 --type KWin/Script --show krohnkite 2>/dev/null | sed -n 's/.*Version *: *//p' || true)
+if [ "$installed" != "$KROHNKITE_VERSION" ]; then
+ echo "Installing Krohnkite $KROHNKITE_VERSION..."
+ tmp=$(mktemp -d)
+ curl -fsSL -o "$tmp/krohnkite.kwinscript" "$KROHNKITE_URL"
+ if [ -n "$installed" ]; then
+ kpackagetool6 --type KWin/Script -u "$tmp/krohnkite.kwinscript"
+ else
+ kpackagetool6 --type KWin/Script -i "$tmp/krohnkite.kwinscript"
+ fi
+ rm -rf "$tmp"
+fi
+
+kw() { kwriteconfig6 --file kwinrc --group "$1" --key "$2" "$3"; }
+kw Plugins krohnkiteEnabled true
+# gaps: hyprland gaps_in = 5, gaps_out = 0
+kw Script-krohnkite screenGapBetween 5
+for side in Left Right Top Bottom; do kw Script-krohnkite "screenGap$side" 0; done
+# layouts cycled by Super+T: spiral (~dwindle), tile (~master), monocle. 0 disables.
+for l in threeColumn quarter stacked columns spread floating stair binaryTree cascade; do
+ kw Script-krohnkite "${l}LayoutOrder" 0
+done
+kw Script-krohnkite spiralLayoutOrder 1
+kw Script-krohnkite tileLayoutOrder 2
+kw Script-krohnkite monocleLayoutOrder 3
+# hyprland: hyprpwcenter / pavucontrol float
+kw Script-krohnkite floatingClass "org.pulseaudio.pavucontrol,pavucontrol,org.kde.spectacle,krunner"
+
+# Super + left/right drag moves/resizes (KWin default, set explicitly)
+kw MouseBindings CommandAllKey Meta
+
+# caps:swapescape, as in hyprland input.kb_options
+kwriteconfig6 --file kxkbrc --group Layout --key ResetOldOptions true
+kwriteconfig6 --file kxkbrc --group Layout --key Options caps:swapescape
+
+kwin_reconfigure
+
+# ---- 8 virtual desktops -------------------------------------------------------
+count=$(qdbus org.kde.KWin /VirtualDesktopManager org.kde.KWin.VirtualDesktopManager.count 2>/dev/null || echo 8)
+while [ "$count" -lt 8 ]; do
+ qdbus org.kde.KWin /VirtualDesktopManager org.kde.KWin.VirtualDesktopManager.createDesktop "$count" "$((count + 1))" >/dev/null
+ count=$((count + 1))
+done
+
+# ---- launchers for commands that have no KDE action ---------------------------
+mkdir -p "$APPS_DIR"
+launcher() {
+ local id="$1" name="$2" exec="$3"
+ cat >"$APPS_DIR/hyprkeys-$id.desktop" </dev/null 2>&1 || true
+
+# ---- shortcuts ------------------------------------------------------------------
+sleep 1 # let Krohnkite register its actions after the reconfigure
+echo "Applying shortcuts..."
+python3 "$KDE_DIR/shortcuts.py"
+
+echo "Done. If caps:swapescape doesn't take effect, log out and back in."
diff --git a/kde/move-follow b/kde/move-follow
new file mode 100755
index 0000000..ed11227
--- /dev/null
+++ b/kde/move-follow
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+# Move the active window to desktop N and switch there (hyprland: SUPER+SHIFT+N)
+n="$1"
+qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "Window to Desktop $n"
+qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "Switch to Desktop $n"
diff --git a/kde/shortcuts.py b/kde/shortcuts.py
new file mode 100755
index 0000000..76c18a0
--- /dev/null
+++ b/kde/shortcuts.py
@@ -0,0 +1,220 @@
+#!/usr/bin/env python3
+"""Apply Hyprland-style global shortcuts to KDE Plasma 6 through kglobalaccel's D-Bus API.
+
+kglobalaccel lives inside kwin_wayland and keeps shortcuts in memory, writing them
+back to ~/.config/kglobalshortcutsrc itself, so editing that file by hand while the
+session is running does not stick. This sets them live instead.
+
+Usage: shortcuts.py apply the bindings below
+ shortcuts.py --reset put every action we touched back to its KDE default
+"""
+
+import json
+import os
+import sys
+
+import dbus
+
+STATE_FILE = os.path.expanduser("~/.local/state/hyprkeys/cleared.json")
+
+# ---- key encoding (Qt6 QKeyCombination as int) -------------------------------
+
+MODS = {"Meta": 0x10000000, "Shift": 0x02000000, "Ctrl": 0x04000000, "Alt": 0x08000000}
+NAMED = {
+ "Return": 0x01000004, "Esc": 0x01000000, "Tab": 0x01000001, "Print": 0x01000009,
+ "Left": 0x01000012, "Up": 0x01000013, "Right": 0x01000014, "Down": 0x01000015,
+ "PgUp": 0x01000016, "PgDown": 0x01000017, "Space": 0x20,
+}
+NAMED.update({f"F{n}": 0x0100002F + n for n in range(1, 13)})
+# US-layout symbols typed with Shift+digit / Shift+minus
+SHIFTED = {"1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", "8": "*", "-": "_"}
+
+
+def key(spec):
+ """'Meta+Shift+Q' -> int. The final part is a key name or a single character."""
+ *mods, k = spec.split("+")
+ code = sum(MODS[m] for m in mods)
+ return code | (NAMED[k] if k in NAMED else ord(k.upper()))
+
+
+def keys(*specs):
+ """Expand specs into key ints. Meta+Shift+ also adds the shifted symbol
+ (Meta+!), because on Wayland the keysym carries the Shift."""
+ out = []
+ for s in specs:
+ out.append(key(s))
+ mods, _, k = s.rpartition("+")
+ if "Shift" in mods.split("+") and k in SHIFTED:
+ out.append(key(f"{mods}+{SHIFTED[k]}"))
+ return out
+
+
+# ---- binding table -------------------------------------------------------------
+# (component, action, keys, mode) mode: "set" replaces the keys, "add" keeps existing ones
+
+K = "kwin"
+BINDINGS = [
+ # apps
+ ("org.kde.konsole.desktop", "_launch", keys("Meta+Return"), "add"),
+ ("org.kde.krunner.desktop", "_launch", keys("Meta+D"), "add"),
+ ("org.mozilla.firefox.desktop", "_launch", keys("Meta+F2"), "set"),
+ ("org.kde.dolphin.desktop", "_launch", keys("Meta+F3", "Meta+Shift+F3"), "set"),
+ ("org.pulseaudio.pavucontrol.desktop", "_launch", keys("Meta+Ctrl+M"), "set"),
+ # screenshots
+ ("org.kde.spectacle.desktop", "RectangularRegionScreenShot", keys("Print"), "set"),
+ ("hyprkeys-screenshot-clip.desktop", "_launch", keys("Meta+Print"), "set"),
+ ("hyprkeys-screenshot-save.desktop", "_launch", keys("Meta+Shift+Print"), "set"),
+ # window actions
+ (K, "Window Close", keys("Meta+Shift+Q"), "add"),
+ (K, "Kill Window", keys("Meta+Ctrl+X"), "add"),
+ (K, "Window Fullscreen", keys("Meta+F"), "set"),
+ (K, "Window Resize", keys("Meta+R"), "set"),
+ (K, "Window On All Desktops", keys("Meta+Shift+S"), "set"),
+ (K, "Window Minimize", keys("Meta+Shift+-"), "add"),
+ (K, "Walk Through Windows", keys("Meta+Space"), "add"),
+ (K, "Overview", keys("Meta+Shift+W"), "set"),
+ # session
+ ("ksmserver", "Lock Session", keys("Meta+9"), "add"),
+ ("ksmserver", "Log Out", keys("Meta+0", "Meta+Shift+E"), "add"),
+ ("hyprkeys-reload.desktop", "_launch", keys("Meta+Shift+C"), "set"),
+ # Krohnkite tiling
+ (K, "KrohnkiteFocusLeft", keys("Meta+H", "Meta+Left"), "set"),
+ (K, "KrohnkiteFocusDown", keys("Meta+J", "Meta+Down"), "set"),
+ (K, "KrohnkiteFocusUp", keys("Meta+K", "Meta+Up"), "set"),
+ (K, "KrohnkiteFocusRight", keys("Meta+L", "Meta+Right"), "set"),
+ (K, "KrohnkiteShiftLeft", keys("Meta+Shift+H", "Meta+Shift+Left"), "set"),
+ (K, "KrohnkiteShiftDown", keys("Meta+Shift+J", "Meta+Shift+Down"), "set"),
+ (K, "KrohnkiteShiftUp", keys("Meta+Shift+K", "Meta+Shift+Up"), "set"),
+ (K, "KrohnkiteShiftRight", keys("Meta+Shift+L", "Meta+Shift+Right"), "set"),
+ (K, "KrohnkiteShrinkWidth", keys("Meta+Ctrl+H"), "set"),
+ (K, "KrohnkiteGrowHeight", keys("Meta+Ctrl+J"), "set"),
+ (K, "KrohnkiteShrinkHeight", keys("Meta+Ctrl+K"), "set"),
+ (K, "KrohnkitegrowWidth", keys("Meta+Ctrl+L"), "set"),
+ (K, "KrohnkiteToggleFloat", keys("Meta+Shift+Space"), "set"),
+ (K, "KrohnkiteNextLayout", keys("Meta+T"), "set"),
+ (K, "KrohnkiteMonocleLayout", keys("Meta+W"), "set"),
+ (K, "KrohnkiteRotate", keys("Meta+E"), "set"),
+ (K, "KrohnkiteRotatePart", keys("Meta+V"), "set"),
+ (K, "KrohnkiteTileLayout", [], "set"),
+ (K, "KrohnkiteSetMaster", [], "set"),
+ (K, "KrohnkiteDecrease", [], "set"),
+]
+for n in range(1, 9):
+ BINDINGS += [
+ (K, f"Switch to Desktop {n}", keys(f"Meta+{n}"), "set"),
+ (K, f"Window to Desktop {n}", keys(f"Meta+Ctrl+{n}"), "set"),
+ (f"hyprkeys-move-follow-{n}.desktop", "_launch", keys(f"Meta+Shift+{n}"), "set"),
+ ]
+
+# ---- D-Bus helpers ---------------------------------------------------------------
+
+bus = dbus.SessionBus()
+ka = dbus.Interface(bus.get_object("org.kde.kglobalaccel", "/kglobalaccel"), "org.kde.KGlobalAccel")
+
+
+def to_dbus(key_ints):
+ return dbus.Array(
+ [dbus.Struct((dbus.Array([k, 0, 0, 0], signature="i"),), signature=None) for k in key_ints],
+ signature="(ai)",
+ )
+
+
+def actions_of(comp):
+ try:
+ return {str(a[1]): [str(x) for x in a] for a in ka.allActionsForComponent([comp])}
+ except dbus.DBusException:
+ return {}
+
+
+def current(action_id):
+ return [int(s[0][0]) for s in ka.shortcutKeys(action_id) if int(s[0][0])]
+
+
+def set_keys(action_id, key_ints):
+ ka.setForeignShortcutKeys(action_id, to_dbus(key_ints))
+
+
+def action_id(comp, action):
+ known = actions_of(comp).get(action)
+ if known:
+ return known
+ # not registered yet (our own .desktop launchers, or Krohnkite before it loads)
+ aid = [comp, action, comp.removesuffix(".desktop"), action]
+ ka.doRegister(aid)
+ return aid
+
+
+def all_actions():
+ for comp in ka.allMainComponents():
+ for aid in actions_of(str(comp[0])).values():
+ yield aid
+
+
+# ---- main ---------------------------------------------------------------------------
+
+
+def apply():
+ own = {(c, a): ks for c, a, ks, _ in BINDINGS}
+ wanted = {k for ks in own.values() for k in ks}
+
+ # 1. strip our keys from every action that holds one it isn't meant to have
+ cleared = set()
+ for aid in all_actions():
+ mine = own.get((aid[0], aid[1]), [])
+ have = current(aid)
+ keep = [k for k in have if k not in wanted or k in mine]
+ if keep != have:
+ set_keys(aid, keep)
+ if (aid[0], aid[1]) not in own:
+ cleared.add((aid[0], aid[1]))
+ print(f" freed keys from {aid[0]} / {aid[1]}")
+
+ # remember what we freed so --reset can put it back
+ os.makedirs(os.path.dirname(STATE_FILE), exist_ok=True)
+ prev = set()
+ if os.path.exists(STATE_FILE):
+ prev = {tuple(x) for x in json.load(open(STATE_FILE))}
+ json.dump(sorted(prev | cleared), open(STATE_FILE, "w"))
+
+ # 2. assign
+ failed = []
+ for comp, action, ks, mode in BINDINGS:
+ aid = action_id(comp, action)
+ new = ks
+ if mode == "add":
+ new = [k for k in current(aid) if k not in ks] + ks
+ set_keys(aid, new)
+ got = current(aid)
+ if any(k not in got for k in ks):
+ failed.append(f"{comp} / {action}")
+ if failed:
+ print(" WARNING: some keys were not accepted:\n " + "\n ".join(failed))
+ print(f" {len(BINDINGS)} shortcuts applied")
+
+
+def reset():
+ entries = [(c, a) for c, a, _, _ in BINDINGS]
+ if os.path.exists(STATE_FILE):
+ entries += [tuple(x) for x in json.load(open(STATE_FILE))]
+ # Krohnkite and our own launchers go away entirely; clear them first so the
+ # KDE defaults below don't collide with them.
+ for comp, action in entries:
+ if action.startswith("Krohnkite") or comp.startswith("hyprkeys-"):
+ aid = actions_of(comp).get(action)
+ if aid:
+ set_keys(aid, [])
+ if comp.startswith("hyprkeys-"):
+ ka.unregister(comp, action)
+ for comp, action in entries:
+ if action.startswith("Krohnkite") or comp.startswith("hyprkeys-"):
+ continue
+ aid = actions_of(comp).get(action)
+ if aid:
+ set_keys(aid, [int(s[0][0]) for s in ka.defaultShortcutKeys(aid) if int(s[0][0])])
+ if os.path.exists(STATE_FILE):
+ os.remove(STATE_FILE)
+ print(" shortcuts reset to KDE defaults")
+
+
+if __name__ == "__main__":
+ reset() if "--reset" in sys.argv else apply()
diff --git a/uninstall.sh b/uninstall.sh
index b919e9b..4d40f61 100755
--- a/uninstall.sh
+++ b/uninstall.sh
@@ -161,6 +161,11 @@ uninstall_vim() {
remove_line "$HOME/.vimrc" "source ~/scripts/vimrc"
}
+uninstall_kde() {
+ echo "Uninstalling KDE (Hyprland-style) config..."
+ "$SCRIPTS_DIR/kde/apply.sh" --reset
+}
+
if [ $# -eq 0 ]; then
usage
exit 1
@@ -205,6 +210,7 @@ for target in "${targets[@]}"; do
tmux) uninstall_tmux ;;
nvim) uninstall_nvim ;;
vim) uninstall_vim ;;
+ kde) uninstall_kde ;;
*)
echo "Unknown target: $target"
usage