repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

feat(nuguland): subtle active-state dot on bar widgets

d482c1ef3fd8a45a99739ef001a8608a0957182f

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Widgets with 'something active inside' get a small accent dot top-right:
media playing, notifications unread, tray attention, idle inhibited,
audio mic/cam in use. Adds a cheap reactive Media.playing signal and a
Bar.chipActive() resolver. Dot hides when the chip is selected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Changed files (2)

quickshell/nuguland/Bar.qml

Modified
86 86 return 60;
89 + // "something active inside" — drives a super subtle active dot on the chip
90 + function chipActive(name) {
91 + switch (String(name)) {
92 + case "media":
93 + return !!(root.mediaService && root.mediaService.playing);
94 + case "notifications":
95 + return !!(root.notificationService && root.notificationService.unreadCount > 0);
96 + case "tray":
97 + return !!(root.trayService && root.trayService.attentionCount > 0);
98 + case "idle":
99 + return !!(root.idleService && root.idleService.enabled);
100 + case "audio":
101 + return !!(root.audioService && root.audioService.privacyActive());
103 + return false;
89 106 function itemRectInBar(item) {
90 107 let x = 0;
91 108 let y = 0;
513 530 required property string label
514 531 property int preferredWidth: Math.max(52, labelText.implicitWidth + 18)
515 532 readonly property bool selected: root.surfaces && root.surfaces.popoutName === popoutName
533 + readonly property bool active: root.chipActive(popoutName)
517 535 Layout.preferredWidth: preferredWidth
518 536 Layout.preferredHeight: 26
567 + Rectangle {
568 + id: activeDot
570 + visible: chip.active && !chip.selected
571 + width: 5
572 + height: 5
573 + radius: 2.5
574 + anchors.top: parent.top
575 + anchors.right: parent.right
576 + anchors.topMargin: 4
577 + anchors.rightMargin: 5
578 + color: root.theme ? root.theme.ui.accent : "white"
579 + opacity: 0.9
580 + z: 4
582 + Behavior on opacity {
583 + NumberAnimation {
584 + duration: root.theme && root.theme.lowPowerMode ? 0 : 160
585 + easing.type: Easing.OutCubic
549 592 StateLayer {
550 593 theme: root.theme
551 594 checked: chip.selected

quickshell/nuguland/Media.qml

Modified
17 17 "toTitle": ""
19 19 readonly property bool nativeActionRoute: true
20 + // cheap reactive "something playing" signal for the bar chip active dot
21 + readonly property bool playing: {
22 + const players = Mpris.players.values || [];
23 + for (let i = 0; i < players.length; i++) if (players[i].playbackState === MprisPlaybackState.Playing)
24 + return true;
26 + return false;
27 + }
21 29 function playbackStateText(player) {
22 30 return String(MprisPlaybackState.toString(player.playbackState || MprisPlaybackState.Stopped)).toLowerCase();