ctrl+super+shift+d for dark/light toggle (like powertoys)

This commit is contained in:
end-4
2026-05-14 10:43:23 +02:00
parent d1daedc6d2
commit 239b532ec6
2 changed files with 27 additions and 3 deletions
@@ -5,6 +5,7 @@ import qs.modules.common
import QtQuick
import Quickshell
import Quickshell.Io
import Quickshell.Hyprland
/**
* Automatically reloads generated material colors.
@@ -71,4 +72,26 @@ Singleton {
}
onLoadFailed: root.resetFilePathNextTime();
}
function toggleLightDark() {
const currentlyDark = Appearance.m3colors.darkmode;
Quickshell.execDetached([Directories.wallpaperSwitchScriptPath, "--mode", currentlyDark ? "light" : "dark", "--noswitch"]);
}
GlobalShortcut {
name: "toggleLightDark"
description: "Toggles between dark theme and light theme"
onPressed: {
root.toggleLightDark();
}
}
IpcHandler {
target: "theme"
function toggleLightDark(): void {
root.toggleLightDark();
}
}
}