mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
ctrl+super+shift+d for dark/light toggle (like powertoys)
This commit is contained in:
@@ -23,9 +23,8 @@ hl.bind("SUPER_R", hl.dsp.global("quickshell:workspaceNumber"), { ignore_mods =
|
||||
hl.bind("SUPER_L", hl.dsp.global("quickshell:workspaceNumber"), { ignore_mods = true, transparent = true, release = true })
|
||||
hl.bind("SUPER_R", hl.dsp.global("quickshell:workspaceNumber"), { ignore_mods = true, transparent = true, release = true })
|
||||
hl.bind("SUPER + Tab", hl.dsp.global("quickshell:overviewWorkspacesToggle"), { description = "Shell: Toggle overview" })
|
||||
hl.bind("SUPER + V", hl.dsp.global("quickshell:overviewClipboardToggle"),
|
||||
{ description = "Shell: Clipboard history >> clipboard" })
|
||||
hl.bind("SUPER + Period", hl.dsp.global("quickshell:overviewEmojiToggle"), { description = "Shell: Emoji >> clipboard" })
|
||||
hl.bind("SUPER + V", hl.dsp.global("quickshell:overviewClipboardToggle"))
|
||||
hl.bind("SUPER + Period", hl.dsp.global("quickshell:overviewEmojiToggle"))
|
||||
hl.bind("SUPER + A", hl.dsp.global("quickshell:sidebarLeftToggle"), { description = "Shell: Toggle left sidebar" })
|
||||
hl.bind("SUPER + ALT + A", hl.dsp.global("quickshell:sidebarLeftToggleDetach"))
|
||||
hl.bind("SUPER + B", hl.dsp.global("quickshell:sidebarLeftToggle"))
|
||||
@@ -53,6 +52,8 @@ hl.bind("CTRL + SUPER + T", hl.dsp.global("quickshell:wallpaperSelectorToggle"),
|
||||
{ description = "Shell: Toggle wallpaper selector" })
|
||||
hl.bind("CTRL + SUPER + ALT + T", hl.dsp.global("quickshell:wallpaperSelectorRandom"),
|
||||
{ description = "Shell: Select random wallpaper" })
|
||||
hl.bind("CTRL + SUPER + SHIFT + D", hl.dsp.global("quickshell:toggleLightDark"),
|
||||
{ description = "Shell: Toggle light/dark mode" })
|
||||
hl.bind("CTRL + SUPER + T", hl.dsp.exec_cmd(qsIsAlive .. " || " .. qsScripts .. "/colors/switchwall.sh"))
|
||||
hl.bind("CTRL + SUPER + R", hl.dsp.exec_cmd("killall ydotool qs quickshell; qs -c $qsConfig &"),
|
||||
{ description = "Shell: Restart widgets" })
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user