mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-30 23:17:51 -04:00
1 parent
d439991219
commit
0a84c14a19
2 files changed
+22
-4
No files matched your search
@@ -94,6 +94,12 @@ binds {
|
||||
XF86TouchpadToggle allow-when-locked=true repeat=false {
|
||||
spawn "niri" "msg" "action" "toggle-touchpad";
|
||||
}
|
||||
XF86TouchpadOn allow-when-locked=true repeat=false {
|
||||
spawn "dms" "ipc" "call" "niri" "showTouchpadOsd" "true";
|
||||
}
|
||||
XF86TouchpadOff allow-when-locked=true repeat=false {
|
||||
spawn "dms" "ipc" "call" "niri" "showTouchpadOsd" "false";
|
||||
}
|
||||
|
||||
// === Window Management ===
|
||||
Mod+Q repeat=false { close-window; }
|
||||
|
||||
@@ -462,15 +462,19 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
function handleTouchpadToggled(data) {
|
||||
// Each subscription starts with a snapshot; only later changes show the OSD.
|
||||
const showOsd = _touchpadStateInitialized && touchpadEnabled !== data.on;
|
||||
touchpadEnabled = data.on;
|
||||
function updateTouchpadState(enabled, forceOsd) {
|
||||
const showOsd = forceOsd || (_touchpadStateInitialized && touchpadEnabled !== enabled);
|
||||
touchpadEnabled = enabled;
|
||||
_touchpadStateInitialized = true;
|
||||
if (showOsd)
|
||||
touchpadToggled();
|
||||
}
|
||||
|
||||
function handleTouchpadToggled(data) {
|
||||
// Each subscription starts with a snapshot; only later changes show the OSD.
|
||||
updateTouchpadState(data.on, false);
|
||||
}
|
||||
|
||||
function handleWorkspacesChanged(data) {
|
||||
const newWorkspaces = {};
|
||||
|
||||
@@ -1923,6 +1927,14 @@ window-rule {
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
function showTouchpadOsd(enabled: bool): string {
|
||||
if (!CompositorService.isNiri)
|
||||
return "NIRI_NOT_AVAILABLE";
|
||||
|
||||
root.updateTouchpadState(enabled, true);
|
||||
return "TOUCHPAD_OSD_SHOWN";
|
||||
}
|
||||
|
||||
function screenshot(): string {
|
||||
if (!CompositorService.isNiri) {
|
||||
return "NIRI_NOT_AVAILABLE";
|
||||
|
||||
Reference in new issue
Block a user