dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide refactor(audio): drop amplitude term from media energy value 0748f6a370ab10d8b4ee1f35187cc8e62ca1e3db
Oliver Jan Krylow <oliver@bugabinga.net > · 26 Jun 2026
unsigned
Browse files Compare with HEAD
Removes continuous audio capture dependency from mediaEnergyValue()
function to enable safe deletion of outputLevelSmooth property.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Changed files (2) quickshell/nuguland/Media.qml Modified +70 / −124 text lines
8 8 property QtObject osdService
9 + property QtObject audioService
9 10 property string manualSelection:
"" 10 11 property
var lastAction: ({
18 - property var smokePlayers: [{
19 - "id" :
"player-music" ,
20 - "identity" :
"Music" ,
21 - "title" :
"Nugu Line" ,
22 - "artist" :
"Nuguland" ,
23 - "album" :
"Reference Theft" ,
24 - "playbackState" :
"playing" ,
34 - "id" :
"player-browser" ,
35 - "identity" :
"Browser" ,
36 - "title" :
"Nuguland Notes" ,
37 - "artist" :
"Reference" ,
39 - "playbackState" :
"paused" ,
45 - "canShuffle" :
false ,
49 - readonly property bool testHarness:
Quickshell .env(
"NUGULAND_SMOKE" )
=== "1" 50 - readonly property bool nativeActionRoute:
! testHarness
19 + readonly property bool nativeActionRoute:
true 52 21 function playbackStateText (player) {
54 - return String (player.playbackState
|| "stopped" );
56 22 return String (
MprisPlaybackState .
toString (player.playbackState
|| MprisPlaybackState .Stopped)).toLowerCase();
59 25 function loopStateText (player) {
61 - return String (player.repeat
|| "none" );
63 26 const text
= String (
MprisLoopState .
toString (player.loopState
|| MprisLoopState .None)).toLowerCase();
64 27 if (text
=== "playlist" )
73 36 function playerId (player) {
75 - return String (player.id);
77 37 return String (player.dbusName
|| player.uniqueId
|| player.identity
|| "mpris-player" );
88 48 function clonePlayer (player) {
89 49 const id
= playerId(player);
90 - const title
= testHarness
? String (player.title
|| "" )
: String (player.trackTitle
|| "" );
91 - const artist
= testHarness
? String (player.artist
|| "" )
: String (player.trackArtist
|| "" );
92 - const album
= testHarness
? String (player.album
|| "" )
: String (player.trackAlbum
|| "" );
50 + const title
= String (player.trackTitle
|| "" );
51 + const artist
= String (player.trackArtist
|| "" );
52 + const album
= String (player.trackAlbum
|| "" );
93 53 const position
= Math .
round (
Number (player.position
|| 0 ));
94 54 const length
= Math .
max (
0 ,
Math .
round (
Number (player.length
|| 0 )));
95 - const cover
= testHarness
? String (player.cover
|| "" )
: String (player.trackArtUrl
|| "" );
55 + const cover
= String (player.trackArtUrl
|| "" );
98 58 "identity" :
String (player.identity
|| id),
105 65 "progress" : length
> 0 ? Math .
round (position
* 1000 / length)
/ 1000 : 0 , 106 66 "shuffle" :
!! player.shuffle
, 107 67 "repeat" :
loopStateText (player)
, 108 - "canSeek" : testHarness
? !! player.canSeek
: !! player.canSeek
, 109 - "canShuffle" : testHarness
? !! player.canShuffle
: !! player.shuffleSupported
, 110 - "canRepeat" : testHarness
? !! player.canRepeat
: !! player.loopSupported
, 68 + "canSeek" :
!! player.canSeek
, 69 + "canShuffle" :
!! player.shuffleSupported
, 70 + "canRepeat" :
!! player.loopSupported
, 112 72 "artAvailable" : cover.length
> 0 116 76 function servicePlayers () {
117 - return testHarness
? smokePlayers
: (
Mpris .players.values
|| []);
77 + return Mpris .players.values
|| [];
120 80 function activeIndex () {
134 94 const players
= servicePlayers();
135 95 const index
= activeIndex();
136 96 return index
>= 0 ? players[index]
: ({
140 - "playbackState" :
"stopped" ,
102 + "playbackState" :
MprisPlaybackState .Stopped,
143 105 "shuffle" :
false ,
106 + "loopState" :
MprisLoopState .None,
150 112 return clonePlayer (activePlayerRaw());
153 - function mutateActive (callback) {
154 - const index
= activeIndex();
155 - if (index
< 0 || ! testHarness)
159 - for (
let i
= 0 ; i
< smokePlayers.length; i
++ ) {
160 - const player
= Object .
assign ({
161 - }, smokePlayers[i]);
167 - smokePlayers
= next;
170 115 function osd (eventText) {
143 + function mediaProgress () {
144 + return Math .
max (
0 ,
Math .
min (
1 ,
Number (activePlayer().progress
|| 0 )));
147 + function mediaPlayingValue () {
148 + return activePlayer().playbackState
=== "playing" ? 1 : 0 ;
151 + function mediaAvailableValue () {
152 + return servicePlayers().length
> 0 ? 1 : 0 ;
155 + function mediaEnergyValue () {
157 + return mediaPlayingValue();
160 + function mediaModeValue () {
161 + const active
= activePlayer();
162 + if (active.shuffle)
165 + return active.repeat
=== "none" ? 0 : 0.5 ;
198 168 function mediaPanelContract () {
200 170 "source" :
"Nuguland dashboard media Details.qml plus Nuguland MprisController.qml" ,
217 187 "backend" :
"Media.qml" , 218 188 "usesNativeMpris" :
true , 219 - "testHarness" : testHarness
, 220 189 "nativeActionRoute" : nativeActionRoute
, 221 190 "externalVisualizer" :
false , 222 191 "manualSelection" : manualSelection
, 230 199 "role" : active.artAvailable
? "content.normal" : "ui.accent" 233 203 "title" : active.title
, 234 204 "artist" : active.artist
, 235 205 "playing" : active.playbackState
=== "playing" 208 + "kind" :
"media-waveform" , 210 + "source" :
"shaders/media-waveform.frag.qsb" , 211 + "priorArt" :
"WebAudio/ISF visualizer research: true music visualizers need waveform/FFT textures; current chip uses native PipeWire peak history as a compact amplitude visualizer" , 212 + "values" : [mediaProgress(), mediaPlayingValue(), mediaEnergyValue(), mediaModeValue()]
, 213 + "colors" : [
"ui.accent" ,
"ui.focus" ,
"ui.minor" ,
"ui.backdrop" ,
"warning" ,
"error" ]
238 216 "hasTransport" :
true , 239 217 "hasProgress" :
true , 242 220 "shuffle" : active.shuffle
, 243 221 "repeat" : active.repeat
224 + "route" :
"Audio.qml" , 225 + "reason" :
"media volume stays owned by Audio.qml" , 226 + "openTarget" :
"audio" , 227 + "serviceBoundary" :
true 245 229 "mediaPanelContract" :
mediaPanelContract ()
, 247 231 "source" :
"mpris-progress" , 264 248 const active
= activePlayer();
265 249 const playerIdValue
= active.id;
266 250 const name
= String (kind);
267 - const nativePlayer
= testHarness
? null : nativePlayerById(playerIdValue);
269 - if (name
=== "playPause" ) {
270 - mutateActive((player)
=> {
271 - return player.playbackState
= player.playbackState
=== "playing" ? "paused" : "playing" ;
273 - }
else if (name
=== "next" ) {
274 - const fromTitle
= activePlayer().title;
275 - mutateActive((player)
=> {
276 - return player.title
= "Next Nuguland Track" ;
278 - setTrackChange(
"next" ,
false , fromTitle, activePlayer().title);
279 - }
else if (name
=== "previous" ) {
280 - const fromTitle
= activePlayer().title;
281 - mutateActive((player)
=> {
282 - return player.title
= "Previous Nuguland Track" ;
284 - setTrackChange(
"previous" ,
true , fromTitle, activePlayer().title);
285 - }
else if (name
=== "stop" )
286 - mutateActive((player)
=> {
287 - return player.playbackState
= "stopped" ;
289 - else if (name
=== "shuffle" )
290 - mutateActive((player)
=> {
291 - if (player.canShuffle)
292 - player.shuffle
= ! player.shuffle;
295 - else if (name
=== "repeat" )
296 - mutateActive((player)
=> {
297 - if (player.canRepeat)
298 - player.repeat
= player.repeat
=== "all" ? "none" : "all" ;
301 - }
else if (nativePlayer) {
251 + const nativePlayer
= nativePlayerById(playerIdValue);
252 + if (name
=== "next" )
253 + setTrackChange (
"next" ,
false , active.title,
"pending" );
254 + else if (name
=== "previous" )
255 + setTrackChange (
"previous" ,
true , active.title,
"pending" );
256 + if (nativePlayer) {
302 257 if (name
=== "playPause" )
303 258 nativePlayer.togglePlaying();
304 259 else if (name
=== "next" && nativePlayer.canGoNext)
317 272 "id" : playerIdValue,
318 - "nativeActionRoute" : nativeActionRoute,
319 - "testHarness" : testHarness
273 + "nativeActionRoute" : nativeActionRoute
321 275 return JSON .stringify(stateObject(osd(name)));
324 278 function seek (position) {
325 279 const playerIdValue
= activePlayer().id;
327 - mutateActive((player)
=> {
328 - return player.position
= Math .
max (
0 ,
Math .
min (player.length, position));
331 - const nativePlayer
= nativePlayerById(playerIdValue);
332 - if (nativePlayer
&& nativePlayer.canSeek)
333 - nativePlayer.position
= Number (position);
280 + const nativePlayer
= nativePlayerById(playerIdValue);
281 + if (nativePlayer
&& nativePlayer.canSeek)
282 + nativePlayer.position
= Number (position);
338 286 "id" : playerIdValue,
339 287 "position" : position,
340 - "nativeActionRoute" : nativeActionRoute,
341 - "testHarness" : testHarness
288 + "nativeActionRoute" : nativeActionRoute
343 290 return JSON .
stringify (stateObject(osd(
`seek ${position}
` )));
349 296 "kind" :
"select" ,
350 297 "id" : manualSelection,
351 - "nativeActionRoute" : nativeActionRoute,
352 - "testHarness" : testHarness
298 + "nativeActionRoute" : nativeActionRoute
354 300 return JSON .stringify(stateObject(osd(
`select ${manualSelection}
` )));
quickshell/nuguland/pam/nuguland-fprint.conf Deleted deleted file mode 100644+0 / −1 text lines
1 - auth required pam_fprintd.so