From c2d2b61e3945ecc64bffd18cb24fbc0f57d1ef82 Mon Sep 17 00:00:00 2001 From: sufficientpast <252132621+sufficientpast@users.noreply.github.com> Date: Thu, 14 May 2026 05:27:22 +0000 Subject: [PATCH 01/13] changing dispatchers --- modules/bar/Bar.qml | 4 ++-- modules/bar/components/workspaces/SpecialWorkspaces.qml | 4 ++-- modules/bar/components/workspaces/Workspaces.qml | 4 ++-- modules/windowinfo/Buttons.qml | 6 +++--- plugin/src/Caelestia/Config/generalconfig.hpp | 4 ++-- services/Hypr.qml | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index a2ed060e7..8bad0b370 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -83,9 +83,9 @@ ColumnLayout { const mon = (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor); const specialWs = mon?.lastIpcObject.specialWorkspace.name; if (specialWs?.length > 0) - Hypr.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`); + Hypr.dispatch(`hl.dsp.workspace.toggle_special({ "${specialWs.slice(8)}"})`); else if (angleDelta.y < 0 || (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hypr.activeWsId) > 1) - Hypr.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`); + Hypr.dispatch(`hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})`); } else if (y < screen.height / 2 && Config.bar.scrollActions.volume) { // Volume scroll on top half if (angleDelta.y > 0) diff --git a/modules/bar/components/workspaces/SpecialWorkspaces.qml b/modules/bar/components/workspaces/SpecialWorkspaces.qml index 3ed382e90..8df8c6f54 100644 --- a/modules/bar/components/workspaces/SpecialWorkspaces.qml +++ b/modules/bar/components/workspaces/SpecialWorkspaces.qml @@ -223,9 +223,9 @@ Item { const ws = view.itemAt(event.x, event.y) as SpecialWsDelegate; if (ws?.modelData) - Hypr.dispatch(`togglespecialworkspace ${ws.modelData.name.slice(8)}`); + Hypr.dispatch(`hl.dsp.workspace.toggle_special({ "${ws.modelData.name.slice(8)}" })`); else - Hypr.dispatch("togglespecialworkspace special"); + Hypr.dispatch('hl.dsp.workspace.toggle_special("special")'); } } diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index 2030bf80e..ff23b1e09 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -97,9 +97,9 @@ StyledClippingRect { onClicked: event => { const ws = (layout.childAt(event.x, event.y) as Workspace)?.ws; if (Hypr.activeWsId !== ws) - Hypr.dispatch(`workspace ${ws}`); + Hypr.dispatch(`hl.dsp.focus({ workspace= "${ws}"})`); else - Hypr.dispatch("togglespecialworkspace special"); + Hypr.dispatch(`hl.dsp.workspace.toggle_special("special")`); } } diff --git a/modules/windowinfo/Buttons.qml b/modules/windowinfo/Buttons.qml index c4fbbd53a..da07403f4 100644 --- a/modules/windowinfo/Buttons.qml +++ b/modules/windowinfo/Buttons.qml @@ -81,7 +81,7 @@ ColumnLayout { readonly property bool isCurrent: root.client?.workspace.id === wsId onClicked: { - Hypr.dispatch(`movetoworkspace ${wsId},address:0x${root.client?.address}`); + Hypr.dispatch(`hl.dsp.window.move({ workspace = "${wsId}" , follow = "address:0x${root.client?.address}"})`); } color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer @@ -109,7 +109,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float") - onClicked: Hypr.dispatch(`togglefloating address:0x${root.client?.address}`) + onClicked: Hypr.dispatch(`hl.dsp.window.float({ window = "address:0x${root.client?.address}" })`) } Loader { @@ -123,7 +123,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin") - onClicked: Hypr.dispatch(`pin address:0x${root.client?.address}`) + onClicked: Hypr.dispatch(`hl.dsp.window.pin({ window = "address:0x${root.client?.address}" })`) } } diff --git a/plugin/src/Caelestia/Config/generalconfig.hpp b/plugin/src/Caelestia/Config/generalconfig.hpp index 859302fef..17619208b 100644 --- a/plugin/src/Caelestia/Config/generalconfig.hpp +++ b/plugin/src/Caelestia/Config/generalconfig.hpp @@ -38,8 +38,8 @@ class GeneralIdle : public ConfigObject { }), vmap({ { u"timeout"_s, 300 }, - { u"idleAction"_s, u"dpms off"_s }, - { u"returnAction"_s, u"dpms on"_s }, + { u"idleAction"_s, u"hl.dsp.dpms({ action = off })"_s }, + { u"returnAction"_s, u"hl.dsp.dpms({ action = on })"_s }, }), vmap({ { u"timeout"_s, 600 }, diff --git a/services/Hypr.qml b/services/Hypr.qml index 181967e78..f037a1578 100644 --- a/services/Hypr.qml +++ b/services/Hypr.qml @@ -57,11 +57,11 @@ Singleton { if (lastSpecialWorkspace) { const workspace = workspaces.values.find(w => w.name === lastSpecialWorkspace); if (workspace && workspace.lastIpcObject.windows > 0) { - dispatch(`workspace ${lastSpecialWorkspace}`); + dispatch(`hl.dsp.focus({ workspace = "${lastSpecialWorkspace}"})`); return; } } - dispatch(`workspace ${openSpecials[0].name}`); + dispatch(`hl.dsp.focus({ workspace = "${openSpecials[0].name}" })`); return; } @@ -75,7 +75,7 @@ Singleton { nextIndex = (currentIndex - 1 + openSpecials.length) % openSpecials.length; } - dispatch(`workspace ${openSpecials[nextIndex].name}`); + dispatch(`hl.dsp.focus({ workspace = "${openSpecials[nextIndex].name}"})`); } function monitorNames(): list { From eaf5a4cca0479d126a2a3949685eebf28e1c66ef Mon Sep 17 00:00:00 2001 From: sufficientpast <252132621+sufficientpast@users.noreply.github.com> Date: Fri, 15 May 2026 11:25:13 +0000 Subject: [PATCH 02/13] gating dispatchers for non-lua config --- modules/bar/Bar.qml | 5 +++-- .../bar/components/workspaces/SpecialWorkspaces.qml | 4 ++-- modules/bar/components/workspaces/Workspaces.qml | 5 +++-- modules/windowinfo/Buttons.qml | 11 +++++------ services/Colours.qml | 3 ++- services/Hypr.qml | 10 ++++++---- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 8bad0b370..5ddf138d6 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -6,6 +6,7 @@ import "components/workspaces" import QtQuick import QtQuick.Layouts import Quickshell +import Quickshell.Hyprland import Caelestia.Config import qs.components import qs.services @@ -83,9 +84,9 @@ ColumnLayout { const mon = (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor); const specialWs = mon?.lastIpcObject.specialWorkspace.name; if (specialWs?.length > 0) - Hypr.dispatch(`hl.dsp.workspace.toggle_special({ "${specialWs.slice(8)}"})`); + Hyprland.usingLua ? Hypr.dispatch(`hl.dsp.workspace.toggle_special( "${specialWs.slice(8)}" )`) : Hypr.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`); else if (angleDelta.y < 0 || (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hypr.activeWsId) > 1) - Hypr.dispatch(`hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})`); + Hyprland.usingLua ? Hypr.dispatch(`hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})`) : Hypr.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`); } else if (y < screen.height / 2 && Config.bar.scrollActions.volume) { // Volume scroll on top half if (angleDelta.y > 0) diff --git a/modules/bar/components/workspaces/SpecialWorkspaces.qml b/modules/bar/components/workspaces/SpecialWorkspaces.qml index 8df8c6f54..b9c4b2fa8 100644 --- a/modules/bar/components/workspaces/SpecialWorkspaces.qml +++ b/modules/bar/components/workspaces/SpecialWorkspaces.qml @@ -223,9 +223,9 @@ Item { const ws = view.itemAt(event.x, event.y) as SpecialWsDelegate; if (ws?.modelData) - Hypr.dispatch(`hl.dsp.workspace.toggle_special({ "${ws.modelData.name.slice(8)}" })`); + Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special( "${ws.modelData.name.slice(8)}" )` : `togglespecialworkspace ${ws.modelData.name.slice(8)}`); else - Hypr.dispatch('hl.dsp.workspace.toggle_special("special")'); + Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special( "special" )` : `togglespecialworkspace special`); } } diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index ff23b1e09..a3e17eee2 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -4,6 +4,7 @@ import QtQuick import QtQuick.Effects import QtQuick.Layouts import Quickshell +import Quickshell.Hyprland import Caelestia.Config import qs.components import qs.services @@ -97,9 +98,9 @@ StyledClippingRect { onClicked: event => { const ws = (layout.childAt(event.x, event.y) as Workspace)?.ws; if (Hypr.activeWsId !== ws) - Hypr.dispatch(`hl.dsp.focus({ workspace= "${ws}"})`); + Hyprland.dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace= "${ws}"})` : `workspace ${ws}`); else - Hypr.dispatch(`hl.dsp.workspace.toggle_special("special")`); + Hyprland.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special({ "special" })` : `togglespecialworkspace special`); } } diff --git a/modules/windowinfo/Buttons.qml b/modules/windowinfo/Buttons.qml index da07403f4..c729a5c87 100644 --- a/modules/windowinfo/Buttons.qml +++ b/modules/windowinfo/Buttons.qml @@ -6,6 +6,7 @@ import Quickshell.Widgets import Caelestia.Config import qs.components import qs.services +import Quickshell.Hyprland ColumnLayout { id: root @@ -80,9 +81,7 @@ ColumnLayout { readonly property int wsId: Math.floor((Hypr.activeWsId - 1) / 10) * 10 + index + 1 readonly property bool isCurrent: root.client?.workspace.id === wsId - onClicked: { - Hypr.dispatch(`hl.dsp.window.move({ workspace = "${wsId}" , follow = "address:0x${root.client?.address}"})`); - } + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.move({ workspace = "${wsId}" , follow = "address:0x${root.client?.address}" })` : `movetoworkspace ${wsId}, address:0x${root.client?.address}`); color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer onColor: isCurrent ? Colours.palette.m3onSurface : Colours.palette.m3onTertiaryContainer @@ -109,7 +108,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float") - onClicked: Hypr.dispatch(`hl.dsp.window.float({ window = "address:0x${root.client?.address}" })`) + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.float({ window = "address:0x${root.client?.address}" })` : `togglefloating address:0x${root.client?.address}`); } Loader { @@ -123,7 +122,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin") - onClicked: Hypr.dispatch(`hl.dsp.window.pin({ window = "address:0x${root.client?.address}" })`) + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.pin({ window = "address:0x${root.client?.address}" })` : `pin address:0x${root.client?.address}`); } } @@ -131,7 +130,7 @@ ColumnLayout { color: Colours.palette.m3errorContainer onColor: Colours.palette.m3onErrorContainer text: qsTr("Kill") - onClicked: Hypr.dispatch(`killwindow address:0x${root.client?.address}`) + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.kill({ window = "address:0x${root.client?.address}" })` : `killwindow address:0x${root.client?.address}`); } } diff --git a/services/Colours.qml b/services/Colours.qml index 922b51dbc..4258a4e0b 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -8,6 +8,7 @@ import Caelestia import Caelestia.Config import qs.services import qs.utils +import Quickshell.Hyprland Singleton { id: root @@ -80,7 +81,7 @@ Singleton { } function reloadHyprRules(): void { - const str = "keyword layerrule %1 %2, match:namespace caelestia-drawers"; + const str = Hyprland.usingLua ? `eval 'hl.layer_rule({ match = { namespace = "caelestia-drawers" }, %1 = true, %2 = true })'` : "keyword layerrule %1 %2, match:namespace caelestia-drawers"; Hypr.extras.batchMessage([str.arg("blur").arg(transparency.enabled ? 1 : 0), str.arg("ignore_alpha").arg(transparency.base - 0.03)]); } diff --git a/services/Hypr.qml b/services/Hypr.qml index f037a1578..0bef46161 100644 --- a/services/Hypr.qml +++ b/services/Hypr.qml @@ -57,11 +57,11 @@ Singleton { if (lastSpecialWorkspace) { const workspace = workspaces.values.find(w => w.name === lastSpecialWorkspace); if (workspace && workspace.lastIpcObject.windows > 0) { - dispatch(`hl.dsp.focus({ workspace = "${lastSpecialWorkspace}"})`); + dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${lastSpecialWorkspace}" })` : `workspace ${lastSpecialWorkspace}`); return; } } - dispatch(`hl.dsp.focus({ workspace = "${openSpecials[0].name}" })`); + dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[0].name}" })` : `workspace ${openSpecials[0].name}`); return; } @@ -75,7 +75,7 @@ Singleton { nextIndex = (currentIndex - 1 + openSpecials.length) % openSpecials.length; } - dispatch(`hl.dsp.focus({ workspace = "${openSpecials[nextIndex].name}"})`); + dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[nextIndex].name}" })` : `workspace ${openSpecials[nextIndex].name}`); } function monitorNames(): list { @@ -87,7 +87,9 @@ Singleton { } function reloadDynamicConfs(): void { - extras.batchMessage(["keyword bindlni ,Caps_Lock,global,caelestia:refreshDevices", "keyword bindlni ,Num_Lock,global,caelestia:refreshDevices"]); + Hyprland.usingLua + ? extras.batchMessage([`eval hl.bind("Caps_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`, `eval hl.bind("Num_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`]) + : extras.batchMessage(["keyword bindlni ,Caps_Lock,global,caelestia:refreshDevices", "keyword bindlni ,Num_Lock,global,caelestia:refreshDevices"]); } Component.onCompleted: reloadDynamicConfs() From b03c0cb4df179f8b3c2f5dcfda48b1ff8c040cfe Mon Sep 17 00:00:00 2001 From: sufficientpast <252132621+sufficientpast@users.noreply.github.com> Date: Wed, 27 May 2026 02:25:12 +0530 Subject: [PATCH 03/13] refractoring? --- modules/bar/Bar.qml | 4 ++-- modules/windowinfo/Buttons.qml | 8 ++++---- services/Hypr.qml | 10 ++++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 5ddf138d6..a8b65e8c2 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -84,9 +84,9 @@ ColumnLayout { const mon = (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor); const specialWs = mon?.lastIpcObject.specialWorkspace.name; if (specialWs?.length > 0) - Hyprland.usingLua ? Hypr.dispatch(`hl.dsp.workspace.toggle_special( "${specialWs.slice(8)}" )`) : Hypr.dispatch(`togglespecialworkspace ${specialWs.slice(8)}`); + Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special( "${specialWs.slice(8)}" )` : `togglespecialworkspace ${specialWs.slice(8)}`); else if (angleDelta.y < 0 || (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hypr.activeWsId) > 1) - Hyprland.usingLua ? Hypr.dispatch(`hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})`) : Hypr.dispatch(`workspace r${angleDelta.y > 0 ? "-" : "+"}1`); + Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})` : `workspace r${angleDelta.y > 0 ? "-" : "+"}1`); } else if (y < screen.height / 2 && Config.bar.scrollActions.volume) { // Volume scroll on top half if (angleDelta.y > 0) diff --git a/modules/windowinfo/Buttons.qml b/modules/windowinfo/Buttons.qml index c729a5c87..8dfbb47c3 100644 --- a/modules/windowinfo/Buttons.qml +++ b/modules/windowinfo/Buttons.qml @@ -81,7 +81,7 @@ ColumnLayout { readonly property int wsId: Math.floor((Hypr.activeWsId - 1) / 10) * 10 + index + 1 readonly property bool isCurrent: root.client?.workspace.id === wsId - onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.move({ workspace = "${wsId}" , follow = "address:0x${root.client?.address}" })` : `movetoworkspace ${wsId}, address:0x${root.client?.address}`); + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.move({ workspace = "${wsId}" , follow = "address:0x${root.client?.address}" })` : `movetoworkspace ${wsId}, address:0x${root.client?.address}`) color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer onColor: isCurrent ? Colours.palette.m3onSurface : Colours.palette.m3onTertiaryContainer @@ -108,7 +108,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float") - onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.float({ window = "address:0x${root.client?.address}" })` : `togglefloating address:0x${root.client?.address}`); + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.float({ window = "address:0x${root.client?.address}" })` : `togglefloating address:0x${root.client?.address}`) } Loader { @@ -122,7 +122,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin") - onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.pin({ window = "address:0x${root.client?.address}" })` : `pin address:0x${root.client?.address}`); + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.pin({ window = "address:0x${root.client?.address}" })` : `pin address:0x${root.client?.address}`) } } @@ -130,7 +130,7 @@ ColumnLayout { color: Colours.palette.m3errorContainer onColor: Colours.palette.m3onErrorContainer text: qsTr("Kill") - onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.kill({ window = "address:0x${root.client?.address}" })` : `killwindow address:0x${root.client?.address}`); + onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.kill({ window = "address:0x${root.client?.address}" })` : `killwindow address:0x${root.client?.address}`) } } diff --git a/services/Hypr.qml b/services/Hypr.qml index 0bef46161..b74adbf03 100644 --- a/services/Hypr.qml +++ b/services/Hypr.qml @@ -61,7 +61,7 @@ Singleton { return; } } - dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[0].name}" })` : `workspace ${openSpecials[0].name}`); + dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[0].name}" })` : `workspace ${openSpecials[0].name}`); return; } @@ -87,9 +87,11 @@ Singleton { } function reloadDynamicConfs(): void { - Hyprland.usingLua - ? extras.batchMessage([`eval hl.bind("Caps_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`, `eval hl.bind("Num_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`]) - : extras.batchMessage(["keyword bindlni ,Caps_Lock,global,caelestia:refreshDevices", "keyword bindlni ,Num_Lock,global,caelestia:refreshDevices"]); + if (Hyprland.usingLua) { + extras.batchMessage([`eval hl.bind("Caps_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`, `eval hl.bind("Num_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`]); + } else { + extras.batchMessage(["keyword bindlni ,Caps_Lock,global,caelestia:refreshDevices", "keyword bindlni ,Num_Lock,global,caelestia:refreshDevices"]); + } } Component.onCompleted: reloadDynamicConfs() From e9da303945abe0e54792d3a026f758cfa7e3bc71 Mon Sep 17 00:00:00 2001 From: Mestane <67807483+Mestane@users.noreply.github.com> Date: Thu, 11 Jun 2026 14:42:32 +0300 Subject: [PATCH 04/13] fix: added usingLua property to HyprExtras for Lua config detection #1478 --- modules/IdleMonitors.qml | 2 +- plugin/src/Caelestia/Config/generalconfig.hpp | 4 ++-- plugin/src/Caelestia/Internal/hyprextras.cpp | 17 +++++++++++++++++ plugin/src/Caelestia/Internal/hyprextras.hpp | 5 +++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml index 417b0e8ae..b4bbc59f8 100644 --- a/modules/IdleMonitors.qml +++ b/modules/IdleMonitors.qml @@ -22,7 +22,7 @@ Scope { else if (action === "unlock") lock.lock.locked = false; else if (typeof action === "string") - Hypr.dispatch(action); + Hypr.dispatch(Hypr.extras.usingLua ? `hl.dsp.dpms({ action = "${action === "dpms off" ? "disable" : "enable"}" })` : action); else Quickshell.execDetached(action); } diff --git a/plugin/src/Caelestia/Config/generalconfig.hpp b/plugin/src/Caelestia/Config/generalconfig.hpp index 17619208b..859302fef 100644 --- a/plugin/src/Caelestia/Config/generalconfig.hpp +++ b/plugin/src/Caelestia/Config/generalconfig.hpp @@ -38,8 +38,8 @@ class GeneralIdle : public ConfigObject { }), vmap({ { u"timeout"_s, 300 }, - { u"idleAction"_s, u"hl.dsp.dpms({ action = off })"_s }, - { u"returnAction"_s, u"hl.dsp.dpms({ action = on })"_s }, + { u"idleAction"_s, u"dpms off"_s }, + { u"returnAction"_s, u"dpms on"_s }, }), vmap({ { u"timeout"_s, 600 }, diff --git a/plugin/src/Caelestia/Internal/hyprextras.cpp b/plugin/src/Caelestia/Internal/hyprextras.cpp index c73b6e0ba..a6c938f96 100644 --- a/plugin/src/Caelestia/Internal/hyprextras.cpp +++ b/plugin/src/Caelestia/Internal/hyprextras.cpp @@ -39,6 +39,7 @@ HyprExtras::HyprExtras(QObject* parent) refreshOptions(); refreshDevices(); + detectConfigProvider(); m_socket = new QLocalSocket(this); @@ -69,6 +70,21 @@ void HyprExtras::message(const QString& message) { }); } +bool HyprExtras::usingLua() const { + return m_usingLua; +} + +void HyprExtras::detectConfigProvider() { + makeRequest("systeminfo", [this](bool success, const QByteArray& res) { + if (!success) return; + const bool lua = QString::fromUtf8(res).contains("configProvider: lua"); + if (m_usingLua != lua) { + m_usingLua = lua; + emit usingLuaChanged(); + } + }); +} + void HyprExtras::batchMessage(const QStringList& messages) { if (messages.isEmpty()) { return; @@ -176,6 +192,7 @@ void HyprExtras::readEvent() { void HyprExtras::handleEvent(const QString& event) { if (event == "configreloaded") { refreshOptions(); + detectConfigProvider(); } else if (event == "activelayout") { refreshDevices(); } diff --git a/plugin/src/Caelestia/Internal/hyprextras.hpp b/plugin/src/Caelestia/Internal/hyprextras.hpp index 48eceea92..8539fe408 100644 --- a/plugin/src/Caelestia/Internal/hyprextras.hpp +++ b/plugin/src/Caelestia/Internal/hyprextras.hpp @@ -17,12 +17,14 @@ class HyprExtras : public QObject { Q_PROPERTY(QVariantHash options READ options NOTIFY optionsChanged) Q_PROPERTY(caelestia::internal::hypr::HyprDevices* devices READ devices CONSTANT) + Q_PROPERTY(bool usingLua READ usingLua NOTIFY usingLuaChanged) public: explicit HyprExtras(QObject* parent = nullptr); [[nodiscard]] QVariantHash options() const; [[nodiscard]] HyprDevices* devices() const; + [[nodiscard]] bool usingLua() const; Q_INVOKABLE void message(const QString& message); Q_INVOKABLE void batchMessage(const QStringList& messages); @@ -33,6 +35,7 @@ class HyprExtras : public QObject { signals: void optionsChanged(); + void usingLuaChanged(); private: using SocketPtr = QSharedPointer; @@ -41,6 +44,7 @@ class HyprExtras : public QObject { QString m_eventSocket; QLocalSocket* m_socket; bool m_socketValid; + bool m_usingLua = false; QVariantHash m_options; HyprDevices* const m_devices; @@ -52,6 +56,7 @@ class HyprExtras : public QObject { void socketStateChanged(QLocalSocket::LocalSocketState state); void readEvent(); void handleEvent(const QString& event); + void detectConfigProvider(); SocketPtr makeRequestJson(const QString& request, const std::function& callback); SocketPtr makeRequest(const QString& request, const std::function& callback); From c9478668188cc8543d8fcd886bfb2565b3e0f278 Mon Sep 17 00:00:00 2001 From: Mestane <67807483+Mestane@users.noreply.github.com> Date: Thu, 11 Jun 2026 20:55:24 +0300 Subject: [PATCH 05/13] refactor(internal): pass usingLua from QML instead of detecting in C++ --- modules/bar/Bar.qml | 5 ++--- .../workspaces/SpecialWorkspaces.qml | 4 ++-- .../bar/components/workspaces/Workspaces.qml | 5 ++--- modules/windowinfo/Buttons.qml | 9 ++++----- plugin/src/Caelestia/Internal/hyprextras.cpp | 20 ------------------- plugin/src/Caelestia/Internal/hyprextras.hpp | 4 +--- services/Colours.qml | 3 +-- services/Hypr.qml | 3 +++ 8 files changed, 15 insertions(+), 38 deletions(-) diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 7a3842aa9..fef91a808 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -6,7 +6,6 @@ import "components/workspaces" import QtQuick import QtQuick.Layouts import Quickshell -import Quickshell.Hyprland import Caelestia.Config import qs.components import qs.services @@ -84,9 +83,9 @@ ColumnLayout { const mon = (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor); const specialWs = mon?.lastIpcObject.specialWorkspace.name; if (specialWs?.length > 0) - Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special( "${specialWs.slice(8)}" )` : `togglespecialworkspace ${specialWs.slice(8)}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special( "${specialWs.slice(8)}" )` : `togglespecialworkspace ${specialWs.slice(8)}`); else if (angleDelta.y < 0 || (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hypr.activeWsId) > 1) - Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})` : `workspace r${angleDelta.y > 0 ? "-" : "+"}1`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})` : `workspace r${angleDelta.y > 0 ? "-" : "+"}1`); } else if (y < screen.height / 2 && Config.bar.scrollActions.volume) { // Volume scroll on top half if (angleDelta.y > 0) diff --git a/modules/bar/components/workspaces/SpecialWorkspaces.qml b/modules/bar/components/workspaces/SpecialWorkspaces.qml index 92140e4c9..ce4fb18f7 100644 --- a/modules/bar/components/workspaces/SpecialWorkspaces.qml +++ b/modules/bar/components/workspaces/SpecialWorkspaces.qml @@ -227,9 +227,9 @@ Item { const ws = view.itemAt(event.x, event.y) as SpecialWsDelegate; if (ws?.modelData) - Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special( "${ws.modelData.name.slice(8)}" )` : `togglespecialworkspace ${ws.modelData.name.slice(8)}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special( "${ws.modelData.name.slice(8)}" )` : `togglespecialworkspace ${ws.modelData.name.slice(8)}`); else - Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special( "special" )` : `togglespecialworkspace special`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special( "special" )` : `togglespecialworkspace special`); } } diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index e87817561..cb239867c 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -4,7 +4,6 @@ import QtQuick import QtQuick.Effects import QtQuick.Layouts import Quickshell -import Quickshell.Hyprland import Caelestia.Config import qs.components import qs.services @@ -98,9 +97,9 @@ StyledClippingRect { onClicked: event => { const ws = (layout.childAt(event.x, event.y) as Workspace)?.ws; if (Hypr.activeWsId !== ws) - Hyprland.dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace= "${ws}"})` : `workspace ${ws}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace= "${ws}"})` : `workspace ${ws}`); else - Hyprland.dispatch(Hyprland.usingLua ? `hl.dsp.workspace.toggle_special({ "special" })` : `togglespecialworkspace special`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special({ "special" })` : `togglespecialworkspace special`); } } diff --git a/modules/windowinfo/Buttons.qml b/modules/windowinfo/Buttons.qml index 52a858537..7aef2f144 100644 --- a/modules/windowinfo/Buttons.qml +++ b/modules/windowinfo/Buttons.qml @@ -2,7 +2,6 @@ pragma ComponentBehavior: Bound import QtQuick import QtQuick.Layouts -import Quickshell.Hyprland import Caelestia.Config import qs.components import qs.services @@ -96,7 +95,7 @@ ColumnLayout { readonly property bool isCurrent: root.client?.workspace.id === wsId onClicked: { - Hypr.dispatch(`movetoworkspace ${wsId},address:0x${root.client?.address}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.window.move({ workspace = "${wsId}", follow = true })` : `movetoworkspace ${wsId},address:0x${root.client?.address}`); } color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer @@ -119,7 +118,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float") - onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.float({ window = "address:0x${root.client?.address}" })` : `togglefloating address:0x${root.client?.address}`) + onClicked: Hypr.dispatch(Hypr.usingLua ? `hl.dsp.window.float({ window = "address:0x${root.client?.address}" })` : `togglefloating address:0x${root.client?.address}`) } Loader { @@ -133,7 +132,7 @@ ColumnLayout { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer text: root.client?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin") - onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.pin({ window = "address:0x${root.client?.address}" })` : `pin address:0x${root.client?.address}`) + onClicked: Hypr.dispatch(Hypr.usingLua ? `hl.dsp.window.pin({ window = "address:0x${root.client?.address}" })` : `pin address:0x${root.client?.address}`) } } @@ -141,7 +140,7 @@ ColumnLayout { color: Colours.palette.m3errorContainer onColor: Colours.palette.m3onErrorContainer text: qsTr("Kill") - onClicked: Hypr.dispatch(Hyprland.usingLua ? `hl.dsp.window.kill({ window = "address:0x${root.client?.address}" })` : `killwindow address:0x${root.client?.address}`) + onClicked: Hypr.dispatch(Hypr.usingLua ? `hl.dsp.window.kill({ window = "address:0x${root.client?.address}" })` : `killwindow address:0x${root.client?.address}`) } } diff --git a/plugin/src/Caelestia/Internal/hyprextras.cpp b/plugin/src/Caelestia/Internal/hyprextras.cpp index d728a3911..c73b6e0ba 100644 --- a/plugin/src/Caelestia/Internal/hyprextras.cpp +++ b/plugin/src/Caelestia/Internal/hyprextras.cpp @@ -39,7 +39,6 @@ HyprExtras::HyprExtras(QObject* parent) refreshOptions(); refreshDevices(); - detectConfigProvider(); m_socket = new QLocalSocket(this); @@ -70,24 +69,6 @@ void HyprExtras::message(const QString& message) { }); } -bool HyprExtras::usingLua() const { - return m_usingLua; -} - -void HyprExtras::detectConfigProvider() { - makeRequest("systeminfo", [this](bool success, const QByteArray& res) { - if (!success) { - return; - } - - const bool lua = QString::fromUtf8(res).contains("configProvider: lua"); - if (m_usingLua != lua) { - m_usingLua = lua; - emit usingLuaChanged(); - } - }); -} - void HyprExtras::batchMessage(const QStringList& messages) { if (messages.isEmpty()) { return; @@ -195,7 +176,6 @@ void HyprExtras::readEvent() { void HyprExtras::handleEvent(const QString& event) { if (event == "configreloaded") { refreshOptions(); - detectConfigProvider(); } else if (event == "activelayout") { refreshDevices(); } diff --git a/plugin/src/Caelestia/Internal/hyprextras.hpp b/plugin/src/Caelestia/Internal/hyprextras.hpp index 8539fe408..3e0757add 100644 --- a/plugin/src/Caelestia/Internal/hyprextras.hpp +++ b/plugin/src/Caelestia/Internal/hyprextras.hpp @@ -17,14 +17,13 @@ class HyprExtras : public QObject { Q_PROPERTY(QVariantHash options READ options NOTIFY optionsChanged) Q_PROPERTY(caelestia::internal::hypr::HyprDevices* devices READ devices CONSTANT) - Q_PROPERTY(bool usingLua READ usingLua NOTIFY usingLuaChanged) + Q_PROPERTY(bool usingLua MEMBER m_usingLua NOTIFY usingLuaChanged) public: explicit HyprExtras(QObject* parent = nullptr); [[nodiscard]] QVariantHash options() const; [[nodiscard]] HyprDevices* devices() const; - [[nodiscard]] bool usingLua() const; Q_INVOKABLE void message(const QString& message); Q_INVOKABLE void batchMessage(const QStringList& messages); @@ -56,7 +55,6 @@ class HyprExtras : public QObject { void socketStateChanged(QLocalSocket::LocalSocketState state); void readEvent(); void handleEvent(const QString& event); - void detectConfigProvider(); SocketPtr makeRequestJson(const QString& request, const std::function& callback); SocketPtr makeRequest(const QString& request, const std::function& callback); diff --git a/services/Colours.qml b/services/Colours.qml index 575ca2089..9022a7438 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -3,7 +3,6 @@ pragma ComponentBehavior: Bound import QtQuick import Quickshell -import Quickshell.Hyprland import Quickshell.Io import Caelestia import Caelestia.Config @@ -84,7 +83,7 @@ Singleton { } function reloadHyprRules(): void { - const str = Hyprland.usingLua ? `eval 'hl.layer_rule({ match = { namespace = "caelestia-drawers" }, %1 = true, %2 = true })'` : "keyword layerrule %1 %2, match:namespace caelestia-drawers"; + const str = Hypr.usingLua ? `eval 'hl.layer_rule({ match = { namespace = "caelestia-drawers" }, %1 = true, %2 = true })'` : "keyword layerrule %1 %2, match:namespace caelestia-drawers"; Hypr.extras.batchMessage([str.arg("blur").arg(transparency.enabled ? 1 : 0), str.arg("ignore_alpha").arg(transparency.base - 0.03)]); } diff --git a/services/Hypr.qml b/services/Hypr.qml index b74adbf03..556aae5c4 100644 --- a/services/Hypr.qml +++ b/services/Hypr.qml @@ -15,6 +15,7 @@ Singleton { readonly property var toplevels: Hyprland.toplevels readonly property var workspaces: Hyprland.workspaces readonly property var monitors: Hyprland.monitors + readonly property bool usingLua: Hyprland.usingLua readonly property HyprlandToplevel activeToplevel: { const t = Hyprland.activeToplevel; @@ -222,5 +223,7 @@ Singleton { HyprExtras { id: extras + + usingLua: Hyprland.usingLua } } From 3f2f664952a4e9d5470351ec08099a8d70f40865 Mon Sep 17 00:00:00 2001 From: Mestane <67807483+Mestane@users.noreply.github.com> Date: Thu, 11 Jun 2026 22:27:50 +0300 Subject: [PATCH 06/13] fix(workspaces): resolve undefined workspace id in Lua dispatch --- modules/bar/components/workspaces/Workspaces.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index cb239867c..9ef9faf2a 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -97,7 +97,7 @@ StyledClippingRect { onClicked: event => { const ws = (layout.childAt(event.x, event.y) as Workspace)?.ws; if (Hypr.activeWsId !== ws) - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace= "${ws}"})` : `workspace ${ws}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace= "${ws?.id ?? ws}"})` : `workspace ${ws}`); else Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special({ "special" })` : `togglespecialworkspace special`); } From 63795e0d414f64aa34ed79e9bd30cf783f824bfe Mon Sep 17 00:00:00 2001 From: Mestane <67807483+Mestane@users.noreply.github.com> Date: Thu, 11 Jun 2026 22:51:09 +0300 Subject: [PATCH 07/13] fix(workspaces): guard against undefined workspace and fix Lua dispatch --- modules/bar/components/workspaces/Workspaces.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index 9ef9faf2a..0855d69ea 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -96,10 +96,12 @@ StyledClippingRect { anchors.fill: layout onClicked: event => { const ws = (layout.childAt(event.x, event.y) as Workspace)?.ws; + if (ws === undefined || ws === null) + return; if (Hypr.activeWsId !== ws) - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace= "${ws?.id ?? ws}"})` : `workspace ${ws}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace= "${ws}"})` : `workspace ${ws}`); else - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special({ "special" })` : `togglespecialworkspace special`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special("special")` : `togglespecialworkspace special`); } } From a498253218abda8c8036a185a4f61917c0580dd5 Mon Sep 17 00:00:00 2001 From: Mestane <67807483+Mestane@users.noreply.github.com> Date: Fri, 12 Jun 2026 01:05:44 +0300 Subject: [PATCH 08/13] fix: use Lua syntax in applyOptions when usingLua is set --- plugin/src/Caelestia/Internal/hyprextras.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin/src/Caelestia/Internal/hyprextras.cpp b/plugin/src/Caelestia/Internal/hyprextras.cpp index c73b6e0ba..3ebe234e6 100644 --- a/plugin/src/Caelestia/Internal/hyprextras.cpp +++ b/plugin/src/Caelestia/Internal/hyprextras.cpp @@ -90,7 +90,14 @@ void HyprExtras::applyOptions(const QVariantHash& options) { request.reserve(12 + options.size() * 40); request += QLatin1String("[[BATCH]]"); for (auto it = options.constBegin(); it != options.constEnd(); ++it) { - request += QLatin1String("keyword ") + it.key() + QLatin1Char(' ') + it.value().toString() + QLatin1Char(';'); + if (!m_usingLua) { + request += + QLatin1String("keyword ") + it.key() + QLatin1Char(' ') + it.value().toString() + QLatin1Char(';'); + } else { + auto parts = it.key().split(':'); + request += "eval hl.config({ " + parts.join(" = { ") + " = " + it.value().toString() + + QString(" }").repeated(parts.size() - 1) + " });"; + } } makeRequest(request, [this](bool success, const QByteArray& res) { From f9b5d2c88d456a98bb3c9b7f963eddcc2ea0d040 Mon Sep 17 00:00:00 2001 From: Mestane <67807483+Mestane@users.noreply.github.com> Date: Fri, 12 Jun 2026 01:58:10 +0300 Subject: [PATCH 09/13] refactor(hypr): use local usingLua over Hyprland.usingLua --- services/Hypr.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/Hypr.qml b/services/Hypr.qml index 556aae5c4..d31c40327 100644 --- a/services/Hypr.qml +++ b/services/Hypr.qml @@ -58,11 +58,11 @@ Singleton { if (lastSpecialWorkspace) { const workspace = workspaces.values.find(w => w.name === lastSpecialWorkspace); if (workspace && workspace.lastIpcObject.windows > 0) { - dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${lastSpecialWorkspace}" })` : `workspace ${lastSpecialWorkspace}`); + dispatch(usingLua ? `hl.dsp.focus({ workspace = "${lastSpecialWorkspace}" })` : `workspace ${lastSpecialWorkspace}`); return; } } - dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[0].name}" })` : `workspace ${openSpecials[0].name}`); + dispatch(usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[0].name}" })` : `workspace ${openSpecials[0].name}`); return; } @@ -76,7 +76,7 @@ Singleton { nextIndex = (currentIndex - 1 + openSpecials.length) % openSpecials.length; } - dispatch(Hyprland.usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[nextIndex].name}" })` : `workspace ${openSpecials[nextIndex].name}`); + dispatch(usingLua ? `hl.dsp.focus({ workspace = "${openSpecials[nextIndex].name}" })` : `workspace ${openSpecials[nextIndex].name}`); } function monitorNames(): list { @@ -88,7 +88,7 @@ Singleton { } function reloadDynamicConfs(): void { - if (Hyprland.usingLua) { + if (usingLua) { extras.batchMessage([`eval hl.bind("Caps_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`, `eval hl.bind("Num_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`]); } else { extras.batchMessage(["keyword bindlni ,Caps_Lock,global,caelestia:refreshDevices", "keyword bindlni ,Num_Lock,global,caelestia:refreshDevices"]); From 67df389c6b382d5950891000c4f8a8df6fd9ed9e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 14 Jun 2026 04:18:48 +1000 Subject: [PATCH 10/13] chore: format --- modules/bar/Bar.qml | 4 ++-- modules/bar/components/workspaces/SpecialWorkspaces.qml | 4 ++-- modules/bar/components/workspaces/Workspaces.qml | 6 +++--- services/Hypr.qml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index fef91a808..e0f17c01e 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -83,9 +83,9 @@ ColumnLayout { const mon = (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? Hypr.monitorFor(screen) : Hypr.focusedMonitor); const specialWs = mon?.lastIpcObject.specialWorkspace.name; if (specialWs?.length > 0) - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special( "${specialWs.slice(8)}" )` : `togglespecialworkspace ${specialWs.slice(8)}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special("${specialWs.slice(8)}")` : `togglespecialworkspace ${specialWs.slice(8)}`); else if (angleDelta.y < 0 || (GlobalConfig.bar.workspaces.perMonitorWorkspaces ? mon.activeWorkspace?.id : Hypr.activeWsId) > 1) - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1"})` : `workspace r${angleDelta.y > 0 ? "-" : "+"}1`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace = "r${angleDelta.y > 0 ? "-" : "+"}1" })` : `workspace r${angleDelta.y > 0 ? "-" : "+"}1`); } else if (y < screen.height / 2 && Config.bar.scrollActions.volume) { // Volume scroll on top half if (angleDelta.y > 0) diff --git a/modules/bar/components/workspaces/SpecialWorkspaces.qml b/modules/bar/components/workspaces/SpecialWorkspaces.qml index ce4fb18f7..6937fb814 100644 --- a/modules/bar/components/workspaces/SpecialWorkspaces.qml +++ b/modules/bar/components/workspaces/SpecialWorkspaces.qml @@ -227,9 +227,9 @@ Item { const ws = view.itemAt(event.x, event.y) as SpecialWsDelegate; if (ws?.modelData) - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special( "${ws.modelData.name.slice(8)}" )` : `togglespecialworkspace ${ws.modelData.name.slice(8)}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special("${ws.modelData.name.slice(8)}")` : `togglespecialworkspace ${ws.modelData.name.slice(8)}`); else - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special( "special" )` : `togglespecialworkspace special`); + Hypr.dispatch(Hypr.usingLua ? 'hl.dsp.workspace.toggle_special("special")' : "togglespecialworkspace special"); } } diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index 0855d69ea..75cd54d60 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -96,12 +96,12 @@ StyledClippingRect { anchors.fill: layout onClicked: event => { const ws = (layout.childAt(event.x, event.y) as Workspace)?.ws; - if (ws === undefined || ws === null) + if (!ws) return; if (Hypr.activeWsId !== ws) - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace= "${ws}"})` : `workspace ${ws}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.focus({ workspace = "${ws}" })` : `workspace ${ws}`); else - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.workspace.toggle_special("special")` : `togglespecialworkspace special`); + Hypr.dispatch(Hypr.usingLua ? 'hl.dsp.workspace.toggle_special("special")' : "togglespecialworkspace special"); } } diff --git a/services/Hypr.qml b/services/Hypr.qml index d31c40327..d890f0981 100644 --- a/services/Hypr.qml +++ b/services/Hypr.qml @@ -89,7 +89,7 @@ Singleton { function reloadDynamicConfs(): void { if (usingLua) { - extras.batchMessage([`eval hl.bind("Caps_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`, `eval hl.bind("Num_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true})`]); + extras.batchMessage(['eval hl.bind("Caps_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true })', 'eval hl.bind("Num_Lock", hl.dsp.global("caelestia:refreshDevices"), { locked = true, non_consuming = true, ignore_mods = true, release = true })']); } else { extras.batchMessage(["keyword bindlni ,Caps_Lock,global,caelestia:refreshDevices", "keyword bindlni ,Num_Lock,global,caelestia:refreshDevices"]); } From 2782c57d85a69fa6f8fca58d85e12e41f07f214e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 14 Jun 2026 04:27:25 +1000 Subject: [PATCH 11/13] fix: only change action if it is dpms on/off --- modules/IdleMonitors.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml index b4bbc59f8..1a5e25ba5 100644 --- a/modules/IdleMonitors.qml +++ b/modules/IdleMonitors.qml @@ -22,7 +22,7 @@ Scope { else if (action === "unlock") lock.lock.locked = false; else if (typeof action === "string") - Hypr.dispatch(Hypr.extras.usingLua ? `hl.dsp.dpms({ action = "${action === "dpms off" ? "disable" : "enable"}" })` : action); + Hypr.dispatch(Hypr.extras.usingLua && ["dpms off", "dpms on"].includes(action) ? `hl.dsp.dpms({ action = "${action === "dpms off" ? "disable" : "enable"}" })` : action); else Quickshell.execDetached(action); } From c490d5fef67ec49b96131e1806fc35639c5139b5 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 14 Jun 2026 04:36:42 +1000 Subject: [PATCH 12/13] more fixes --- modules/IdleMonitors.qml | 2 +- modules/windowinfo/Buttons.qml | 2 +- services/Colours.qml | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml index 1a5e25ba5..2ac49fca2 100644 --- a/modules/IdleMonitors.qml +++ b/modules/IdleMonitors.qml @@ -22,7 +22,7 @@ Scope { else if (action === "unlock") lock.lock.locked = false; else if (typeof action === "string") - Hypr.dispatch(Hypr.extras.usingLua && ["dpms off", "dpms on"].includes(action) ? `hl.dsp.dpms({ action = "${action === "dpms off" ? "disable" : "enable"}" })` : action); + Hypr.dispatch(Hypr.usingLua && ["dpms off", "dpms on"].includes(action) ? `hl.dsp.dpms({ action = "${action === "dpms off" ? "disable" : "enable"}" })` : action); else Quickshell.execDetached(action); } diff --git a/modules/windowinfo/Buttons.qml b/modules/windowinfo/Buttons.qml index 7aef2f144..7a4fb7431 100644 --- a/modules/windowinfo/Buttons.qml +++ b/modules/windowinfo/Buttons.qml @@ -95,7 +95,7 @@ ColumnLayout { readonly property bool isCurrent: root.client?.workspace.id === wsId onClicked: { - Hypr.dispatch(Hypr.usingLua ? `hl.dsp.window.move({ workspace = "${wsId}", follow = true })` : `movetoworkspace ${wsId},address:0x${root.client?.address}`); + Hypr.dispatch(Hypr.usingLua ? `hl.dsp.window.move({ window = "address:0x${root.client?.address}", workspace = "${wsId}", follow = true })` : `movetoworkspace ${wsId},address:0x${root.client?.address}`); } color: isCurrent ? Colours.tPalette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer diff --git a/services/Colours.qml b/services/Colours.qml index 9022a7438..4b52dc921 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -83,8 +83,13 @@ Singleton { } function reloadHyprRules(): void { - const str = Hypr.usingLua ? `eval 'hl.layer_rule({ match = { namespace = "caelestia-drawers" }, %1 = true, %2 = true })'` : "keyword layerrule %1 %2, match:namespace caelestia-drawers"; - Hypr.extras.batchMessage([str.arg("blur").arg(transparency.enabled ? 1 : 0), str.arg("ignore_alpha").arg(transparency.base - 0.03)]); + if (Hypr.usingLua) { + const rule = `eval 'hl.layer_rule({ match = { namespace = "caelestia-drawers" }, %1 })'`; + Hypr.extras.batchMessage([rule.arg(`blur = ${transparency.enabled}`), rule.arg(`ignore_alpha = ${transparency.base - 0.03}`)]); + } else { + const str = "keyword layerrule %1 %2, match:namespace caelestia-drawers"; + Hypr.extras.batchMessage([str.arg("blur").arg(transparency.enabled ? 1 : 0), str.arg("ignore_alpha").arg(transparency.base - 0.03)]); + } } function requestReloadHyprRules(): void { From 89c5d654c8afc8456e53a7680dfe90ecf62095e0 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 14 Jun 2026 18:52:48 +1000 Subject: [PATCH 13/13] fix: lua dispatcher syntax fail thank you karin --- services/Colours.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/Colours.qml b/services/Colours.qml index 4b52dc921..1ba56d5ea 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -84,7 +84,7 @@ Singleton { function reloadHyprRules(): void { if (Hypr.usingLua) { - const rule = `eval 'hl.layer_rule({ match = { namespace = "caelestia-drawers" }, %1 })'`; + const rule = `eval hl.layer_rule({ match = { namespace = "caelestia-drawers" }, %1 })`; Hypr.extras.batchMessage([rule.arg(`blur = ${transparency.enabled}`), rule.arg(`ignore_alpha = ${transparency.base - 0.03}`)]); } else { const str = "keyword layerrule %1 %2, match:namespace caelestia-drawers";