dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Compare Notes Search feat(nuguland): idle is a toggle, not a popout 64d42d0e469da8ec8be833fe5dfd703cbf0482ed
Oliver Jan Krylow <oliver@bugabinga.net > · 26 Jun 2026
unsigned
Browse files Compare with HEAD
Keep-awake never had a real timer — the inhibit always followed a single
bool. So drop the duration options (10/30/60m), the activity/reason
bookkeeping, and the whole idle popout (panel, loader case, content-size,
catalog entry, openIdle IPC). The bar chip now toggles infinite inhibit
on click; its prominent active treatment is the only state UI needed.
Hover-switch skips idle since it has no popout.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Changed files (5) quickshell/nuguland/Bar.qml Modified 281 281 networkService: root.networkService
282 282 bluetoothService: root.bluetoothService
283 283 powerService: root.powerService
284 - idleService: root.idleService
285 284 lockService: root.lockService
600 599 checked: chip.selected
603 + if (chip.popoutName
=== "idle" )
603 606 if (root.surfaces)
604 607 root.surfaces.hoverRegisteredPopout(chip.popoutName);
611 + if (chip.popoutName
=== "idle" ) {
612 + if (root.usageService)
613 + root.usageService.record(
"idle" );
615 + if (root.idleService)
616 + root.idleService.toggle();
608 620 if (root.surfaces)
609 621 root.activatePopout(chip.popoutName);
quickshell/nuguland/Idle.qml Modified 4 4 import Quickshell.Wayland
9 11 property bool
enabled :
false 10 - property int
durationMinutes :
0 11 - property int
remainingMinutes :
0 12 - property string
reason :
"" 13 - property string
activity :
"" 14 - property string
enabledSince :
"" 15 - property
var lastAction: ({
17 - readonly property int
defaultDurationMinutes :
30 18 - readonly property
var availableDurations: [
15 ,
30 ,
60 ,
120 ]
19 - readonly property
var boundedActions: [
"enable" ,
"disable" ,
"toggle" ,
"set-activity" ,
"expire" ]
21 - function clampDuration (minutes) {
22 - const value
= Number (minutes);
23 - if (
! isFinite (value)
|| value
<= 0 )
24 - return defaultDurationMinutes;
26 - return Math .
max (
1 ,
Math .
round (value));
29 - function nowStamp () {
30 - return new Date ().toISOString();
33 - function compactObject () {
35 - "label" : enabled
? "awake" : "normal" ,
36 - "role" : enabled
? "ui.accent" : "ui.minor" ,
37 - "tooltip" : enabled
? `Keep awake: ${reason}
` : "Normal idle behavior" 41 - function idlePanelContract () {
43 - "source" :
"Nuguland IdleInhibit.qml plus Nuguland Privacy.qml" ,
44 - "ownedBy" :
"PopoutHost.qml inline IdlePanel" ,
45 - "keepAwakePanel" :
true ,
46 - "activeSinceChip" :
true ,
47 - "durationChips" :
true ,
48 - "activityRows" :
true ,
49 - "privacyStatusRows" :
true ,
50 - "nativeIdleInhibitorRoute" :
true ,
51 - "serviceActionsOnly" :
true ,
52 - "durations" : availableDurations,
53 - "quickActivities" : [
"focus" ,
"video-call" ,
"presentation" ,
"break" ],
54 - "privacySignals" : [
"idleInhibited" ,
"activity" ]
58 - function stateObject () {
60 - "backend" :
"Idle.qml" ,
61 - "usesNativeIdleInhibitor" :
true ,
62 - "helperProcesses" : [],
63 - "serviceOwnedActions" :
true ,
64 - "boundedActions" : boundedActions,
65 - "idlePanelContract" : idlePanelContract(),
66 - "defaultDurationMinutes" : defaultDurationMinutes,
67 - "availableDurations" : availableDurations,
68 - "surface" :
"zero-size-idle-inhibitor-window" ,
70 - "durationMinutes" : durationMinutes,
71 - "remainingMinutes" : enabled
? remainingMinutes
: 0 ,
73 - "activity" : activity,
74 - "enabledSince" : enabledSince,
75 - "compact" : compactObject(),
77 - "idleInhibited" : enabled,
78 - "activity" : activity
80 - "lastAction" : lastAction
84 13 function stateJson () {
85 - return JSON .
stringify (stateObject());
14 + return JSON .
stringify ({
15 + "backend" :
"Idle.qml" ,
16 + "usesNativeIdleInhibitor" :
true ,
19 + "label" : enabled
? "awake" : "normal" ,
20 + "role" : enabled
? "ui.accent" : "ui.minor" ,
21 + "tooltip" : enabled
? "Keep awake — on until toggled off" : "Normal idle behavior" 88 - function enable (minutes, why) {
89 - const duration
= clampDuration(minutes);
91 - durationMinutes
= duration;
92 - remainingMinutes
= duration;
93 - reason
= String (why
|| "manual" );
94 - enabledSince
= nowStamp();
97 - "minutes" : duration,
100 28 return stateJson();
103 31 function disable () {
105 - remainingMinutes
= 0 ;
109 33 return stateJson();
112 - function toggle (minutes, why) {
113 - const duration
= clampDuration(minutes);
114 - const next
= ! enabled;
117 - durationMinutes
= duration;
118 - remainingMinutes
= duration;
119 - reason
= String (why
|| "manual" );
120 - enabledSince
= nowStamp();
123 - remainingMinutes
= 0 ;
128 - "minutes" : duration,
129 - "reason" :
String (why
|| "manual" )
131 - return stateJson();
134 - function setActivity (name) {
135 - activity
= String (name);
137 - "kind" :
"set-activity" ,
138 - "activity" : activity
140 - return stateJson();
143 - function expire () {
145 - remainingMinutes
= 0 ;
149 38 return stateJson();
quickshell/nuguland/PopoutHost.qml Modified 21 21 required property
QtObject networkService
22 22 required property
QtObject bluetoothService
23 23 required property
QtObject powerService
24 - required property
QtObject idleService
25 24 required property
QtObject lockService
26 25 required property
var barWindow
27 26 readonly property var contentSize: surfaces
? surfaces.popoutContentSize(surfaces.popoutName)
: ({
73 72 return connectivityContent;
75 74 return powerContent;
79 76 return helpContent;
656 - idleService : root.idleService
657 - width : parent
? parent.width
: 0 1689 - component
IdlePanel :
Column {
1692 - required property QtObject theme
1693 - required property QtObject idleService
1694 - property
var state: idleService
? Util .parseJson(idleService.stateJson(), {
1697 - "remainingSeconds" :
0 ,
1698 - "idlePanelContract" : {
1703 - "remainingSeconds" :
0 ,
1704 - "idlePanelContract" : {
1707 - readonly property
var panel: state.idlePanelContract
|| ({
1712 - width : parent
? parent.width
: 0 1717 - text : root.state.active
? "Idle inhibited" : "Idle allowed" 1718 - width : parent.width
1719 - elide :
Text .ElideRight
1724 - text : root.state.reason
|| "No keep-awake request" 1725 - width : parent.width
1726 - elide :
Text .ElideRight
1730 - width : parent.width
1734 - model : [
15 ,
30 ,
60 ]
1736 - delegate : Rectangle {
1737 - required property int modelData
1739 - width :
Math .
floor ((root.width
- 16 )
/ 3 )
1742 - color : root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.12 )
: "transparent" 1744 - border.color: root.theme
? root.theme.ui.accent
: "transparent" 1747 - anchors.centerIn: parent
1750 - text :
` ${parent.modelData}
m` 1754 - anchors.fill: parent
1756 - if (root.idleService)
1757 - root.state
= Util .parseJson(root.idleService.toggle(parent.modelData,
"manual" ), root.state);
1770 1674 component
ClipboardPanel :
Column {
quickshell/nuguland/SurfaceManager.qml Modified 116 116 "height" :
heightBudget (
480 )
121 - "height" : heightBudget(
340 )
214 209 "component" :
"power-battery" , 215 210 "source" :
"Power.qml" , 216 211 "visual" : [
"battery" ,
"profile" ,
"session" ,
"confirmation" ]
219 - "component" :
"idle-privacy" , 220 - "source" :
"Idle.qml" , 221 - "visual" : [
"inhibit" ,
"duration" ,
"activity" ,
"privacy" ]
quickshell/nuguland/shell.qml Modified 704 704 return idle.stateJson();
707 - function idleEnable (minutes: real, reason: string) : string {
708 - return idle.enable(minutes, reason);
707 + function idleToggle () : string {
708 + return idle.toggle();
711 711 function idleDisable () : string {
712 712 return idle.disable();
715 - function idleToggle (minutes: real, reason: string) : string {
716 - return idle.toggle(minutes, reason);
719 - function idleSetActivity (name: string) : string {
720 - return idle.setActivity(name);
723 - function idleExpire () : string {
724 - return idle.expire();
727 - function openIdle () : string {
728 - return surfaceManager.openRegisteredPopout(
"idle" );
731 715 function privilegeState () : string {
732 716 return privilege.stateJson();