qs: streamline IPC function names

This commit is contained in:
2026-03-08 14:43:09 +01:00
parent 0d13a02e29
commit 12529a4c3c
7 changed files with 37 additions and 35 deletions
+10 -10
View File
@@ -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; }
@@ -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 {
@@ -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();
}
@@ -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;
}
@@ -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"
@@ -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
}
@@ -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