Compare commits

...

3 commits

Author SHA1 Message Date
Geoffrey Frogeye ae61f0c6d4 Merge remote-tracking branch 'origin/main' 2024-09-02 16:28:40 +02:00
Geoffrey Frogeye 532b3628d3
frobar: More pulseaudio device descriptions
Is there not a standard thing I can check?
2024-09-02 16:26:40 +02:00
Geoffrey Frogeye 83c24f2fb2
scripts: Fix overpdf in Nix 2024-09-02 16:26:21 +02:00
2 changed files with 17 additions and 5 deletions

View file

@ -274,9 +274,15 @@ class PulseaudioProvider(StatefulSection, ThreadedUpdater):
sinks = [] sinks = []
with pulsectl.Pulse("list-sinks") as pulse: with pulsectl.Pulse("list-sinks") as pulse:
for sink in pulse.sink_list(): for sink in pulse.sink_list():
if sink.port_active.name == "analog-output-headphones": if (
sink.port_active.name == "analog-output-headphones"
or sink.port_active.description == "Headphones"
):
icon = "" icon = ""
elif sink.port_active.name == "analog-output-speaker": elif (
sink.port_active.name == "analog-output-speaker"
or sink.port_active.description == "Speaker"
):
icon = "" if sink.mute else "" icon = "" if sink.mute else ""
elif sink.port_active.name in ("headset-output", "headphone-output"): elif sink.port_active.name in ("headset-output", "headphone-output"):
icon = "" icon = ""
@ -868,8 +874,7 @@ class MprisProvider(Section, ThreadedUpdater):
"{{ playerName }} {{ status }}", "{{ playerName }} {{ status }}",
"{{ album }}", "{{ album }}",
"{{ artist }}", "{{ artist }}",
"{{ duration(position) }}|{{ duration(mpris:length) }}" "{{ duration(position) }}|{{ duration(mpris:length) }}" " {{ title }}",
" {{ title }}",
] ]
# nf-fd icons don't work (UTF-16?) # nf-fd icons don't work (UTF-16?)
@ -942,3 +947,8 @@ class MprisProvider(Section, ThreadedUpdater):
while p.poll() is None: while p.poll() is None:
self.line = p.stdout.readline().decode().strip() self.line = p.stdout.readline().decode().strip()
self.refreshData() self.refreshData()
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
assert p.stdout
while p.poll() is None:
self.line = p.stdout.readline().decode().strip()
self.refreshData()

View file

@ -1,7 +1,9 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#! nix-shell -i bash --pure #! nix-shell -i bash
#! nix-shell -p bash pdftk inkscape gnused coreutils file #! nix-shell -p bash pdftk inkscape gnused coreutils file
set -euxo pipefail
# Utility to write over a PDF file pages # Utility to write over a PDF file pages
# TODO Inkscape vodoo: Put the original in its own layer and skip when merging # TODO Inkscape vodoo: Put the original in its own layer and skip when merging