// Power & Lock. // // hypridle has no IPC for reconfiguration, so these values reach it by // regenerating its config and restarting the daemon (services/IdleLock.qml). // That only happens when Panama manages the daemon, and the card below says // plainly which state you are in rather than presenting sliders that silently // do nothing. import QtQuick import Quickshell import qs.config import qs.services SettingsPage { id: root title: "Power & Lock" lede: "When the screen turns off, when the session locks, and whether it ever sleeps." SettingsCard { title: "Idle behaviour" subtitle: IdleLock.managed ? "Panama is managing hypridle. Changes take effect immediately." : "hypridle is running Panama's shipped configuration. Turn on management below to make these adjustable." SliderRow { setting: "screenBlankMinutes"; zeroLabel: "Never" } SliderRow { setting: "lockMinutes"; zeroLabel: "Never" } SliderRow { setting: "suspendMinutes"; zeroLabel: "Never" } ToggleRow { setting: "lockOnSleep"; divider: false } } // Only shown when the numbers are actually contradictory, rather than as a // permanent warning nobody reads. SettingsCard { visible: IdleLock.lockBeforeBlank title: "Lock happens before the screen turns off" subtitle: "The session will lock at " + IdleLock.lockMinutes + " minutes and the display will not blank until " + IdleLock.blankMinutes + ". That works, but the screen stays lit on the lock screen for the difference." } SettingsCard { title: "Management" subtitle: "Panama generates hypridle's configuration into your state directory and points the service at it with a systemd drop-in. ~/.config/hypr is a symlink into the Panama repository, so the shipped configuration cannot be rewritten in place." SettingRow { label: "Let Panama manage idle timings" detail: IdleLock.serviceState === "active" ? "hypridle is running" : "hypridle is " + IdleLock.serviceState controlWidth: 48 SettingsToggle { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter checked: IdleLock.managed enabled: !IdleLock.busy onToggled: value => IdleLock.setManaged(value) } } ActionRow { label: "Lock the screen now" detail: "Same as the Super+L shortcut" action: "Lock" divider: false onTriggered: Quickshell.execDetached(["loginctl", "lock-session"]) } } SettingsCard { visible: IdleLock.lastError !== "" title: "Idle configuration problem" subtitle: IdleLock.lastError ActionRow { label: "Read the idle configuration again" action: "Retry" divider: false onTriggered: IdleLock.refresh() } } }