Merge branch 'main' into hefty-hype

This commit is contained in:
end-4
2026-05-14 14:32:52 +02:00
10 changed files with 317 additions and 173 deletions
@@ -15,6 +15,7 @@ import Quickshell.Hyprland
Singleton {
id: root
property var keybinds: []
property var keybindCategories: []
Connections {
target: Hyprland
@@ -35,6 +36,15 @@ Singleton {
onStreamFinished: {
try {
root.keybinds = JSON.parse(text)
var groups = []
for (var i = 0; i < root.keybinds.length; i++) {
var bind = root.keybinds[i].description
var group = bind.substring(0, bind.indexOf(":"))
if (!groups.includes(group) && group.length > 0) {
groups.push(group)
}
}
root.keybindCategories = groups
} catch (e) {
console.error("[CheatsheetKeybinds] Error parsing keybinds:", e)
}
@@ -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();
}
}
}