diff options
author | EuAndreh <eu@euandre.org> | 2024-06-16 11:06:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-06-16 11:07:32 -0300 |
commit | 04ad12241d3555d82b1a9265400ec0b8a7138ca2 (patch) | |
tree | 1ea6c4939ebfd9fc1d561765017b30d02e2a717f | |
parent | etc/xmonad/xmonad.hs: Add keybindings for switching monitors setup (diff) | |
download | dotfiles-04ad12241d3555d82b1a9265400ec0b8a7138ca2.tar.gz dotfiles-04ad12241d3555d82b1a9265400ec0b8a7138ca2.tar.xz |
Simplify code used by xmobar
Remove the endless loop, and stop polling the system while doing
nothing.
-rwxr-xr-x | bin/player | 4 | ||||
-rw-r--r-- | etc/xmobar/velhinho | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -24,6 +24,7 @@ help() { - play-pause: play/pause - rotate: rotate across available MPRIS players - synopsis: show the current MPRIS player and title + - synopsis-f: show the current MPRIS player and title Manipulate the MPRIS audio player. @@ -156,6 +157,9 @@ case "$ACTION" in "$(printf '%s\n' "$CURRENT_PLAYER" | format_player_name)" \ "$(formatted_player_title)" ;; + synopsis-f) + tail -f "$CURRENT_PLAYER_PATH" 2>/dev/null | format_player_name + ;; *) printf 'Bad ACTION: "%s".\n\n' "$ACTION" >&2 usage >&2 diff --git a/etc/xmobar/velhinho b/etc/xmobar/velhinho index bfcfcf1..1581b7d 100644 --- a/etc/xmobar/velhinho +++ b/etc/xmobar/velhinho @@ -18,7 +18,7 @@ Config { "-h", "green", "-l", "red"] 10 - , Run CommandReader "forever -q x sleep 1 AND player synopsis" "mpris" + , Run CommandReader "player synopsis-f" "mpris" ] , template = " %default:Master%| %mpris% } { %wlp1s0wi% | %cpu% | %battery% | %disku% | %memory% * %swap% | <fc=#5ea2a4>%date%</fc> " } |