From 12529a4c3cb694c0c5b9953134ec5e433b8f88fb Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sun, 8 Mar 2026 14:43:09 +0100 Subject: [PATCH] qs: streamline IPC function names --- config/niri/.config/niri/config/binds.kdl | 20 ++++++++--------- .../.config/quickshell/Modules/Bar/Bar.qml | 11 +++++++--- .../quickshell/Services/IPCService.qml | 22 +++++++++---------- .../.config/quickshell/Services/NukeKded6.qml | 2 +- .../quickshell/.config/quickshell/apply-color | 2 +- .../quickshell/.config/quickshell/shell.qml | 7 ++---- config/wallpaper/.config/wallreel/config.json | 8 +++---- 7 files changed, 37 insertions(+), 35 deletions(-) diff --git a/config/niri/.config/niri/config/binds.kdl b/config/niri/.config/niri/config/binds.kdl index 7b3c90e..b558ce7 100644 --- a/config/niri/.config/niri/config/binds.kdl +++ b/config/niri/.config/niri/config/binds.kdl @@ -13,8 +13,6 @@ binds { Mod+C { spawn "code"; } Mod+E { spawn "dolphin" "--new-window"; } Mod+W { spawn-sh "zen || zen-browser"; } - Mod+X { spawn "qs" "ipc" "call" "notes" "openRecent"; } - Mod+Shift+X { spawn "qs" "ipc" "call" "notes" "createNote"; } Mod+B { spawn-sh "pkill -x -n btop || wezterm -e btop"; } Mod+Shift+T { spawn "wezterm"; } Mod+Shift+Return { spawn "wezterm"; } @@ -29,9 +27,11 @@ binds { Mod+N { spawn "qs" "ipc" "call" "bars" "toggleRight"; } Mod+Shift+L { spawn "qs" "ipc" "call" "bars" "toggleLyrics"; } Mod+Shift+K { spawn-sh "quickshell-kill || quickshell"; } - Mod+I { spawn "qs" "ipc" "call" "idleInhibitor" "toggleInhibitor"; } - Mod+Alt+R { spawn "qs" "ipc" "call" "recording" "startOrStopRecording"; } - Mod+Shift+E { spawn "qs" "ipc" "call" "sunset" "toggleSunset"; } + Mod+I { spawn "qs" "ipc" "call" "idleInhibitor" "toggle"; } + Mod+Alt+R { spawn "qs" "ipc" "call" "recording" "startOrStop"; } + Mod+Shift+E { spawn "qs" "ipc" "call" "sunset" "toggle"; } + Mod+X { spawn "qs" "ipc" "call" "notes" "openRecent"; } + Mod+Shift+X { spawn "qs" "ipc" "call" "notes" "create"; } // Rofi Mod+D { spawn-sh "pkill -x rofi || rofi -show run"; } @@ -40,9 +40,9 @@ binds { // Actions Mod+V { spawn-sh "fzfclip-wrap"; } Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; } - Print { spawn "niri" "msg" "action" "screenshot-screen"; } - Mod+Shift+S { spawn "niri" "msg" "action" "screenshot"; } - Mod+Ctrl+Shift+S { spawn "niri" "msg" "action" "screenshot-window"; } + Print { screenshot-screen; } + Mod+Shift+S { screenshot; } + Mod+Ctrl+Shift+S { screenshot-window; } Mod+Shift+C { spawn "hyprpicker" "-a"; } // Session @@ -59,8 +59,8 @@ binds { XF86AudioPrev allow-when-locked=true { spawn "qs" "ipc" "call" "media" "previous"; } // Brightness - XF86MonBrightnessUp allow-when-locked=true { spawn "qs" "ipc" "call" "brightness" "brightnessUp"; } - XF86MonBrightnessDown allow-when-locked=true { spawn "qs" "ipc" "call" "brightness" "brightnessDown"; } + XF86MonBrightnessUp allow-when-locked=true { spawn "qs" "ipc" "call" "brightness" "up"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "qs" "ipc" "call" "brightness" "down"; } // Window management Mod+Tab repeat=false { toggle-overview; } diff --git a/config/quickshell/.config/quickshell/Modules/Bar/Bar.qml b/config/quickshell/.config/quickshell/Modules/Bar/Bar.qml index 08fec9e..8b609ba 100644 --- a/config/quickshell/.config/quickshell/Modules/Bar/Bar.qml +++ b/config/quickshell/.config/quickshell/Modules/Bar/Bar.qml @@ -270,9 +270,14 @@ Variants { Layout.fillHeight: true spacing: Style.marginS - TrayExpander { - screen: modelData - baseSize: rightLayout.height - Style.marginXS * 2 + Loader { + active: NukeKded6.done + + sourceComponent: TrayExpander { + screen: modelData + baseSize: rightLayout.height - Style.marginXS * 2 + } + } UIconButton { diff --git a/config/quickshell/.config/quickshell/Services/IPCService.qml b/config/quickshell/.config/quickshell/Services/IPCService.qml index dbbdc16..0178f1d 100644 --- a/config/quickshell/.config/quickshell/Services/IPCService.qml +++ b/config/quickshell/.config/quickshell/Services/IPCService.qml @@ -6,7 +6,7 @@ import qs.Services Item { IpcHandler { - function startOrStopRecording() { + function startOrStop() { RecordService.startOrStop(); } @@ -22,11 +22,11 @@ Item { } IpcHandler { - function previewWallpaper(path: string) { + function preview(path: string) { BackgroundService.previewWallpaper(path); } - function setWallpaper(path: string) { + function set(path: string) { BackgroundService.setWallpaper(path); } @@ -66,15 +66,15 @@ Item { } IpcHandler { - function setColor(name: string, value: color) { + function set(name: string, value: color) { Colors.setColor(name, value); } - function unsetColor(name: string) { + function unset(name: string) { Colors.unsetColor(name); } - function getColor(name: string) : string { + function get(name: string) : string { const hex = String(Colors[name]); if (hex.startsWith("#") && hex.length === 9) return "#" + hex.substring(3); @@ -102,7 +102,7 @@ Item { } IpcHandler { - function toggleInhibitor() { + function toggle() { Caffeine.manualToggle(); } @@ -110,7 +110,7 @@ Item { } IpcHandler { - function toggleSunset() { + function toggle() { SunsetService.toggleSunset(); } @@ -118,11 +118,11 @@ Item { } IpcHandler { - function brightnessUp() { + function up() { BrightnessService.getMonitorForScreen(Niri.focusedScreen).increaseBrightness(); } - function brightnessDown() { + function down() { BrightnessService.getMonitorForScreen(Niri.focusedScreen).decreaseBrightness(); } @@ -134,7 +134,7 @@ Item { NotesService.openRecent(); } - function createNote() { + function create() { NotesService.createNote(); } diff --git a/config/quickshell/.config/quickshell/Services/NukeKded6.qml b/config/quickshell/.config/quickshell/Services/NukeKded6.qml index 9e502f4..a185e68 100644 --- a/config/quickshell/.config/quickshell/Services/NukeKded6.qml +++ b/config/quickshell/.config/quickshell/Services/NukeKded6.qml @@ -10,7 +10,7 @@ Singleton { id: process running: true - command: ["sh", "-c", "pgrep -x kded6 && { { type kquitapp6 && kquitapp6 kded6 || killall -9 kded6; }; sleep 0.5; } >/dev/null 2>&1"] + command: ["sh", "-c", "pgrep -x kded6 && { { type kquitapp6 && kquitapp6 kded6 || pkill -9 -x kded6; }; sleep 0.5; }"] onExited: (code, status) => { done = true; } diff --git a/config/quickshell/.config/quickshell/apply-color b/config/quickshell/.config/quickshell/apply-color index 2381631..fc2b81b 100755 --- a/config/quickshell/.config/quickshell/apply-color +++ b/config/quickshell/.config/quickshell/apply-color @@ -6,7 +6,7 @@ } . "$HOME/.local/snippets/apply-color-helper" -qs ipc call colors setColor mPrimary "$colorHex" +qs ipc call colors set mPrimary "$colorHex" log_success "quickshell" diff --git a/config/quickshell/.config/quickshell/shell.qml b/config/quickshell/.config/quickshell/shell.qml index f1f6b0c..7ee0304 100644 --- a/config/quickshell/.config/quickshell/shell.qml +++ b/config/quickshell/.config/quickshell/shell.qml @@ -12,18 +12,15 @@ ShellRoot { Component.onCompleted: { ImageCacheService.init(); + SunsetService; } Loader { id: loader - active: Init.loaded && NukeKded6.done && ImageCacheService.initialized && ShellState.isLoaded + active: Init.loaded && ImageCacheService.initialized && ShellState.isLoaded sourceComponent: Item { - Component.onCompleted: { - SunsetService; - } - IPCService { id: ipcService } diff --git a/config/wallpaper/.config/wallreel/config.json b/config/wallpaper/.config/wallreel/config.json index f122301..7dbe9d7 100644 --- a/config/wallpaper/.config/wallreel/config.json +++ b/config/wallpaper/.config/wallreel/config.json @@ -16,17 +16,17 @@ ] }, "action": { - "onSelected": "qs ipc call background setWallpaper '{{ path }}'; change-colortheme -c '{{ colorHex }}'", - "onPreview": "qs ipc call background previewWallpaper '{{ path }}'; touch '{{ path }}'; change-colortheme -c '{{ colorHex }}' quickshell niri", + "onSelected": "qs ipc call background set '{{ path }}'; touch '{{ path }}'; change-colortheme -c '{{ colorHex }}'", + "onPreview": "qs ipc call background preview '{{ path }}'; change-colortheme -c '{{ colorHex }}' quickshell niri", "quitOnSelected": true, "saveState": [ { "key": "flavor", "fallback": "#89b4fa", - "command": "qs ipc call colors getColor mPrimary" + "command": "qs ipc call colors get mPrimary" } ], - "onRestore": "qs ipc call background previewWallpaper ''; change-colortheme -c '{{ flavor }}' quickshell niri" + "onRestore": "qs ipc call background preview ''; change-colortheme -c '{{ flavor }}' quickshell niri" }, "cache": { "maxImageEntries": 300