54 lines
1.4 KiB
QML
54 lines
1.4 KiB
QML
import Quickshell.Io
|
|
|
|
import "./IdleInhibitor.qml"
|
|
|
|
IpcHandler {
|
|
property var appLauncherPanel
|
|
property var lockScreen
|
|
property IdleInhibitor idleInhibitor
|
|
property var notificationPopupVariants
|
|
|
|
target: "globalIPC"
|
|
|
|
function toggleIdleInhibitor(): void {
|
|
idleInhibitor.toggle()
|
|
}
|
|
|
|
|
|
function toggleNotificationPopup(): void {
|
|
console.log("[IPC] NotificationPopup toggle() called")
|
|
|
|
if (notificationPopupVariants) {
|
|
for (let i = 0; i < notificationPopupVariants.count; i++) {
|
|
let popup = notificationPopupVariants.objectAt(i);
|
|
if (popup) {
|
|
popup.togglePopup();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function toggleLauncher(): void {
|
|
if (!appLauncherPanel) {
|
|
console.warn("AppLauncherIpcHandler: appLauncherPanel not set!");
|
|
return;
|
|
}
|
|
if (appLauncherPanel.visible) {
|
|
appLauncherPanel.hidePanel();
|
|
} else {
|
|
console.log("[IPC] Applauncher show() called");
|
|
appLauncherPanel.showAt();
|
|
}
|
|
}
|
|
|
|
|
|
function toggleLock(): void {
|
|
if (!lockScreen) {
|
|
console.warn("LockScreenIpcHandler: lockScreen not set!");
|
|
return;
|
|
}
|
|
console.log("[IPC] LockScreen show() called");
|
|
lockScreen.locked = true;
|
|
}
|
|
}
|