dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Compare Notes Search osd: redesign in the notification-card visual language e3aa110c5d337200319f62f9299a94a2e88f10ef
Oliver Jan Krylow <oliver@bugabinga.net > · 27 Jun 2026
unsigned
Browse files Compare with HEAD
Apply what the notification work established. Was: a 2-letter text slice of
an abstract role string ('au', 'br') in a heavy bordered pill, lowercase raw
event name as title, and a microphone path that never matched (checked
'active' while Audio sends 'unmuted', and numeric mic levels drew no bar).
Now:
- real IconImage glyphs via freedesktop names resolved through
Quickshell.iconPath() (audio-volume-{muted,low,medium,high},
microphone-sensitivity-{muted,high}, display-brightness, media-playback-*,
applets-screenshooter, color-picker, dialog-error) — all verified present
in the Adwaita theme.
- card idiom shared with notifications: backdrop alpha 0.92, radius 14, left
accent strip, IBM Plex, accent-coloured hero meter that animates.
- clean capitalised label + glance value ('72%' / 'muted' / 'on' / hex);
errors render their message in the body line.
- microphone joins volume/brightness as a metered event; mute toggles and
non-numeric events correctly hide the bar instead of drawing it empty.
- window height now derives from content instead of a fixed 88px.
Model changes are additive — iconName/displayLabel/displayValue added to the
OSD state JSON, existing keys untouched (IPC contract preserved). The empty
mask is kept deliberately: the OSD is non-interactive and must pass clicks
through — the inverse of the toast mask, which needed an item.
Verified: every event type driven through osdTrigger resolves the right
icon/label/value/bar with a clean journal; notifications selftest green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changed files (2) quickshell/nuguland/Osd.qml Modified 30 + function isNumeric (value) {
31 + const text
= String (value).replace(
"%" ,
"" ).trim();
32 + return text.length
> 0 && isFinite (
Number (text));
30 38 function normalizedValue (event, value) {
31 39 const name
= String (event);
32 - if (name
!== "volume" && name
!== "brightness" )
40 + if (name
!== "volume" && name
!== "brightness" && name
!== "microphone" )
42 + if (
! isNumeric(value))
44 + return Math .
max (
0 ,
Math .
min (
1 ,
Number (
String (value).replace(
"%" ,
"" ))
/ 100 ));
35 - const number
= Number (
String (value).replace(
"%" ,
"" ));
36 - if (
! isFinite (number))
49 + function iconName (event, value) {
50 + const name
= String (event);
51 + const text
= String (value);
52 + const muted
= text
=== "muted" || (isNumeric(text)
&& Number (text.replace(
"%" ,
"" ))
<= 0 );
53 + if (name
=== "volume" )
54 + return muted
? "audio-volume-muted" : (
Number (text.replace(
"%" ,
"" ))
< 34 ? "audio-volume-low" : (
Number (text.replace(
"%" ,
"" ))
< 67 ? "audio-volume-medium" : "audio-volume-high" ));
55 + if (name
=== "microphone" )
56 + return muted
? "microphone-sensitivity-muted" : "microphone-sensitivity-high" ;
57 + if (name
=== "brightness" )
58 + return "display-brightness-symbolic" ;
59 + if (name
=== "media" )
60 + return text.indexOf(
"pause" )
>= 0 ? "media-playback-pause" : "media-playback-start" ;
61 + if (name
=== "screenshot" )
62 + return "applets-screenshooter" ;
63 + if (name
=== "color" )
64 + return "color-picker" ;
65 + if (name
=== "error" )
66 + return "dialog-error" ;
67 + return "dialog-information" ;
39 - return Math .
max (
0 ,
Math .
min (
1 , number
/ 100 ));
70 + function displayLabel (event) {
71 + const name
= String (event);
74 + "microphone" :
"Microphone" ,
75 + "brightness" :
"Brightness" ,
77 + "screenshot" :
"Screenshot" ,
81 + return labels[name]
|| (name.length
> 0 ? name
: "OSD" );
87 + function displayValue (event, value) {
88 + const name
= String (event);
89 + const text
= String (value);
90 + const normalized
= normalizedValue(name, text);
91 + if (normalized
>= 0 )
92 + return ` ${
Math .
round (normalized
* 100 )}
%` ;
93 + if (text
=== "muted" )
95 + if (text
=== "unmuted" )
97 + if (name
=== "error" )
42 102 function iconRole (event, value) {
66 126 function numericText (event, value) {
67 - const name
= String (event);
68 - if (name
!== "volume" && name
!== "brightness" )
71 - return ` ${
Math .
round (normalizedValue(name, value)
* 100 )}
` ;
127 + const normalized
= normalizedValue(event, value);
128 + return normalized
>= 0 ? ` ${
Math .
round (normalized
* 100 )}
` : "" ;
74 131 function valueIndicator (event, value) {
80 137 "source" :
"Nuguland OsdValueIndicator.qml plus Nuguland OSD sliders" , 81 138 "layout" :
"icon-left-value-right" , 82 139 "iconRole" :
iconRole (name, text)
, 140 + "iconName" :
iconName (name, text)
, 141 + "displayLabel" :
displayLabel (name)
, 142 + "displayValue" :
displayValue (name, text)
, 84 144 "normalizedValue" : hasProgress
? normalized
: null , 116 176 "event" : currentEvent
, 117 177 "value" : currentValue
, 118 178 "role" : currentRole
, 179 + "iconName" :
iconName (currentEvent, currentValue)
, 180 + "displayLabel" :
displayLabel (currentEvent)
, 181 + "displayValue" :
displayValue (currentEvent, currentValue)
, 119 182 "lifetimeMs" : lifetimeMs
, 120 183 "restartCount" : restartCount
, 121 184 "supportedEvents" : supportedEvents
, quickshell/nuguland/shell.qml Modified 5 5 import Quickshell.Wayland
6 + import Quickshell.Widgets
124 125 objectName:
"osdOverlaySurface" 125 126 screen: modelData
126 127 visible: osd.visibleState
129 + implicitHeight: osdCard.implicitHeight
+ 16 129 130 color:
"transparent" 130 131 exclusionMode:
ExclusionMode .Ignore
131 132 WlrLayershell .layer:
WlrLayer .Overlay
148 154 readonly property
var indicator: osd.valueIndicator(osd.currentEvent, osd.currentValue)
149 155 readonly property string
roleColor : osd.currentRole
=== "error" ? nuguTheme.error
: (osd.currentRole
=== "warning" ? nuguTheme.warning
: nuguTheme.ui.accent)
156 + readonly property bool
hasBar : indicator.progressBar
&& indicator.progressBar.visible
157 + readonly property bool
isError : osd.currentRole
=== "error" 158 + readonly property string
resolvedIcon :
Quickshell .iconPath(
String (osd.iconName(osd.currentEvent, osd.currentValue)),
true )
151 - anchors.fill: parent
160 + anchors.left: parent.left
161 + anchors.right: parent.right
162 + anchors.top: parent.top
152 163 anchors.margins:
8 154 - color : nuguTheme.withAlpha(nuguTheme.ui.backdrop,
0.94 )
156 - border.color: roleColor
164 + implicitHeight : osdRow.implicitHeight
+ 24 166 + color : nuguTheme.withAlpha(nuguTheme.ui.backdrop,
0.92 )
157 167 opacity : osd.visibleState
? 1 : 0 162 171 anchors.left: parent.left
163 - anchors.leftMargin:
14 164 - anchors.verticalCenter: parent.verticalCenter
168 - color : nuguTheme.withAlpha(osdCard.roleColor,
0.2 )
170 - border.color: osdCard.roleColor
173 - anchors.centerIn: parent
174 - color : nuguTheme.content.normal
175 - font.family:
"IBM Plex Mono" 178 - text :
String (osdCard.indicator.iconRole
|| "osd" ).slice(
0 ,
2 )
172 + anchors.top: parent.top
173 + anchors.bottom: parent.bottom
176 + color : osdCard.roleColor
184 - anchors.left: osdIcon.right
185 - anchors.leftMargin:
12 181 + anchors.left: parent.left
186 182 anchors.right: parent.right
183 + anchors.leftMargin:
14 187 184 anchors.rightMargin:
14 188 185 anchors.verticalCenter: parent.verticalCenter
192 - width : parent.width
196 - color : nuguTheme.content.normal
197 - font.family:
"IBM Plex Sans" 200 - text : osd.currentEvent.length
> 0 ? osd.currentEvent
: "osd" 201 - width : parent.width
- valueText.width
- parent.spacing
202 - elide :
Text .ElideRight
208 - color : nuguTheme.ui.normal
209 - font.family:
"IBM Plex Mono" 211 - text : osd.currentValue
217 - width : parent.width
218 - height : osdCard.indicator.progressBar
&& osdCard.indicator.progressBar.visible
? 8 : 0 219 - visible : height
> 0 221 - color : nuguTheme.withAlpha(nuguTheme.ui.minor,
0.3 )
189 + anchors.verticalCenter: parent.verticalCenter
193 + color : nuguTheme.withAlpha(osdCard.roleColor,
0.18 )
224 - anchors.left: parent.left
225 - anchors.top: parent.top
226 - anchors.bottom: parent.bottom
227 - width : parent.width
* Math .
max (
0 ,
Math .
min (
1 , osdCard.indicator.normalizedValue
|| 0 ))
228 - radius : parent.radius
229 - color : osdCard.roleColor
196 + anchors.centerIn: parent
199 + source : osdCard.resolvedIcon
200 + visible : source.
toString ().length
> 0 205 + width : parent.width
- 40 - parent.spacing
206 + anchors.verticalCenter: parent.verticalCenter
210 + width : parent.width
215 + color : nuguTheme.content.normal
216 + font.family:
"IBM Plex Sans" 219 + text :
String (osdCard.indicator.displayLabel
|| "OSD" )
220 + width : parent.width
- osdValue.width
- parent.spacing
221 + elide :
Text .ElideRight
226 + anchors.baseline: osdLabel.baseline
227 + color : osdCard.hasBar
? osdCard.roleColor
: nuguTheme.ui.normal
228 + font.family:
"IBM Plex Mono" 229 + font.pixelSize: osdCard.hasBar
? 14 : 13 230 + font.bold: osdCard.hasBar
231 + text : osdCard.isError
? "" : String (osdCard.indicator.displayValue
|| "" )
237 + width : parent.width
238 + height : osdCard.hasBar
? 5 : 0 239 + visible : osdCard.hasBar
241 + color : nuguTheme.withAlpha(nuguTheme.ui.minor,
0.28 )
235 - visible : osd.currentRole
=== "error" 236 - color : nuguTheme.error
237 - font.family:
"IBM Plex Sans" 239 - text : osd.currentValue
240 - width : parent.width
241 - elide :
Text .ElideRight
244 + anchors.left: parent.left
245 + anchors.top: parent.top
246 + anchors.bottom: parent.bottom
247 + width : parent.width
* Math .
max (
0 ,
Math .
min (
1 , osdCard.indicator.normalizedValue
|| 0 ))
248 + radius : parent.radius
249 + color : osdCard.roleColor
250 + Behavior on width {
251 + NumberAnimation {
duration : nuguTheme.lowPowerMode
? 0 : 160 ; easing.type:
Easing .OutCubic }
258 + visible : osdCard.isError
259 + color : nuguTheme.error
260 + font.family:
"IBM Plex Sans" 262 + text : osd.currentValue
263 + width : parent.width
264 + wrapMode :
Text .WordWrap
265 + maximumLineCount :
2 266 + elide :
Text .ElideRight
246 271 Behavior on opacity {