dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide notifications: progress bar from int:value hint 77c266d839cf0b9bbe7a0aa1c2371b9deecf6b41
Oliver Jan Krylow <oliver@bugabinga.net > · 27 Jun 2026
unsigned
Browse files Compare with HEAD
Support the KDE/Plasma de-facto progress hint (hints.value, 0-100). The
service reads it live off the native object so replace-in-place progress
updates flow through; the card renders a real progress bar (full card) and
the toast's bottom bar shows progress instead of the auto-dismiss drain
when a value is present.
Progress toasts persist while running rather than draining out, and
auto-dismiss ~1.5s after reaching 100% — aligning "done" with the toast
disappearing instead of leaving a mismatched countdown tail. History keeps
the completed notification.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changed files (3) quickshell/nuguland/NotificationCard.qml Modified 22 22 readonly property string photoSource:
! imageIsPhoto
? "" : (photoCandidate.indexOf(
"image://icon//" )
=== 0 ? "file://" + photoCandidate.substring(
13 )
: photoCandidate)
25 + readonly property int progress: modelData.value
!== undefined ? Number (modelData.value)
: - 1 26 + readonly property bool hasProgress: progress
>= 0 25 29 component
CardText :
Text {
26 30 required property QtObject theme
174 178 sourceSize.width:
220 184 + width : parent.width
185 + height : card.hasProgress
&& ! card.compact
? 8 : 0 186 + visible : card.hasProgress
&& ! card.compact
188 + anchors.verticalCenter: parent.verticalCenter
189 + width : parent.width
192 + color : card.theme
? card.theme.withAlpha(card.theme.ui.minor,
0.25 )
: "transparent" 194 + width : parent.width
* Math .
max (
0 ,
Math .
min (
100 , card.progress))
/ 100 195 + height : parent.height
197 + color : card.theme
? card.theme.ui.accent
: "transparent" 198 + Behavior on width { NumberAnimation {
duration : card.theme
&& card.theme.lowPowerMode
? 0 : 200 } }
178 204 width : parent.width
quickshell/nuguland/Notifications.qml Modified 103 103 "expireTimeout" :
Number (record.expireTimeout
!== undefined ? record.expireTimeout
: - 1 )
, 104 104 "transient" :
!! record.transient
, 105 105 "actions" : actions
, 107 + "value" :
Number (record.value
!== undefined ? record.value
: - 1 )
, 106 108 "popup" :
! (dnd
|| popupInhibition)
, 123 + function hintValue (notification) {
124 + const h
= notification
&& notification.hints
? notification.hints
: null ;
125 + return h
&& h.value
!== undefined && h.value
!== null ? Number (h.value)
: - 1 ;
119 128 function toastTimeoutMs (row) {
120 129 if (row.urgency
=== "critical" || Number (row.expireTimeout)
=== 0 )
196 205 "urgency" : notification.urgency
, 197 206 "expireTimeout" : notification.expireTimeout
, 198 207 "transient" : notification.transient
, 199 - "actions" : notification.actions
|| []
208 + "actions" : notification.actions
|| []
, 209 + "value" :
hintValue (notification)
201 211 const eligible
= toastEligible(row, dnd);
275 285 "appName" : n.appName
|| row.appName
, 276 286 "appIcon" : n.appIcon
|| row.appIcon
, 277 287 "image" : n.image
|| row.image
, 288 + "value" :
hintValue (n)
, 278 289 "urgency" :
urgencyName (n.urgency)
quickshell/nuguland/shell.qml Modified 322 322 readonly property real toastTotal: toastWrap.modelData.timeoutMs
|| 0 323 323 readonly property real toastExpiry: toastWrap.modelData.expiresAt
|| 0 324 324 readonly property real toastRemaining:
Math .max(
0 , toastExpiry
- Date .
now ())
325 + readonly property int toastProgress: toastWrap.modelData.value
!== undefined ? Number (toastWrap.modelData.value)
: - 1 326 + readonly property bool toastHasProgress: toastProgress
>= 0 326 - running : toastWrap.toastExpiry
> 0 331 + running : toastWrap.toastExpiry
> 0 && ! toastWrap.toastHasProgress
327 332 interval :
Math .
max (
1 , toastWrap.toastRemaining)
329 334 onTriggered : notifications.dismissToast(
String (toastWrap.modelData.id))
338 + running : toastWrap.toastHasProgress
&& toastWrap.toastProgress
>= 100 341 + onTriggered : notifications.dismissToast(
String (toastWrap.modelData.id))
336 - visible : toastWrap.toastExpiry
> 0 346 + visible : toastWrap.toastHasProgress
347 + anchors.left: toastCard.left
348 + anchors.bottom: toastCard.bottom
349 + anchors.leftMargin:
12 350 + anchors.bottomMargin:
4 353 + color : nuguTheme
? nuguTheme.ui.accent
: "transparent" 354 + width : (toastCard.width
- 24 )
* Math .
max (
0 ,
Math .
min (
100 , toastWrap.toastProgress))
/ 100 355 + Behavior on width { NumberAnimation {
duration : nuguTheme
&& nuguTheme.lowPowerMode
? 0 : 200 } }
358 + visible : toastWrap.toastExpiry
> 0 && ! toastWrap.toastHasProgress
337 359 anchors.left: toastCard.left
338 360 anchors.bottom: toastCard.bottom
339 361 anchors.leftMargin:
12 343 365 color: nuguTheme
? nuguTheme.withAlpha(nuguTheme.ui.accent,
0.55 )
: "transparent" 344 366 width: (toastCard.width
- 24 )
* (toastWrap.toastTotal
> 0 ? toastWrap.toastRemaining
/ toastWrap.toastTotal
: 1 )
345 367 NumberAnimation on width {
346 - running : toastWrap.toastExpiry
> 0 && ! (nuguTheme
&& nuguTheme.lowPowerMode)
368 + running : toastWrap.toastExpiry
> 0 && ! toastWrap.toastHasProgress
&& ! (nuguTheme
&& nuguTheme.lowPowerMode)
348 370 duration :
Math .
max (
1 , toastWrap.toastRemaining)