add back cmus - dotfiles - 🍚 personal arsenal of "rice"
HTML git clone https://git.drkhsh.at/dotfiles.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit eb30fcc211e8357899dfb98e6e85a0084eacee44
DIR parent 5f97f33cbaf245a681e07c986767d7d4813e057a
HTML Author: drkhsh <me@drkhsh.at>
Date: Mon, 30 Jun 2025 20:57:07 +0200
add back cmus
Diffstat:
A cmus/.config/cmus/rc | 2 ++
A cmus/.local/bin/cmus-cover | 41 +++++++++++++++++++++++++++++++
M conky/.config/conky/conky.conf | 1 +
A conky/.local/bin/conky-cmus | 16 ++++++++++++++++
M fvwm/.fvwm/config | 1 +
5 files changed, 61 insertions(+), 0 deletions(-)
---
DIR diff --git a/cmus/.config/cmus/rc b/cmus/.config/cmus/rc
@@ -0,0 +1,2 @@
+colorscheme night
+set status_display_program=cmus-cover
DIR diff --git a/cmus/.local/bin/cmus-cover b/cmus/.local/bin/cmus-cover
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+## 'status_display_program' for Cmus. Shows album art in a fixed size window.
+## Use your window manager to automatically manipulate the window.
+## There are several album art viewers for Cmus but this I believe is the most
+## compatible with different setups as it is simpler. No weird hacks.
+
+## Requires feh (light no-gui image viewer).
+
+FOLDER=$( cmus-remote -Q | grep "file" | sed "s/file //" | rev | \
+cut -d"/" -f2- | rev )
+
+FLIST=$( find "$FOLDER" -type f )
+
+if echo "$FLIST" | grep -i ".jpeg\|.png\|.jpg" &>/dev/null; then
+ ART=$( echo "$FLIST" | grep -i "cover.jpg\|cover.png\|front.jpg\|front.png\
+ \|folder.jpg\|folder.png" | head -n1 )
+
+ if [[ -z "$ART" ]]; then
+ ART=$( echo "$FLIST" | grep -i ".png\|.jpg\|.jpeg" | head -n1 )
+ fi
+
+ PROC=$( ps -eF | grep "feh" | grep -v "cmus\|grep" | cut -d"/" -f2- )
+
+ if [[ "/$PROC" == "$ART" ]]; then
+ exit
+ fi
+
+ [ -f $XDG_RUNTIME_DIR/cmus-feh.pid ] && \
+ kill $(cat $XDG_RUNTIME_DIR/cmus-feh.pid) 2> /dev/null
+
+ # '200x200' is the window size for the artwork. '+1160+546' is the offset.
+ # For example, if you want a 250 by 250 window on the bottom right hand corner of a 1920 by 1080 screen: "250x250+1670+830"
+ setsid feh --class cmus-cover -g 250x250+5+450 -x -Z --scale-down "$ART" &
+ FEH_PID=$!
+ echo $FEH_PID > $XDG_RUNTIME_DIR/cmus-feh.pid
+else
+ killall -q feh
+ [ -f $XDG_RUNTIME_DIR/cmus-feh.pid ] && \
+ kill $(cat $XDG_RUNTIME_DIR/cmus-feh.pid) 2> /dev/null
+ exit
+fi
DIR diff --git a/conky/.config/conky/conky.conf b/conky/.config/conky/conky.conf
@@ -40,6 +40,7 @@ conky.config = {
conky.text = [[
${font Xirod:Bold:size=28}${color1}${alignr}${execi 65536 cat /etc/os-release | grep -e NAME | head -n1 | cut -d "=" -f 2}
${font Terminus:Bold:pixelsize=12}${color}$nodename${alignr}linux-$kernel
+${execi 3 conky-cmus}
# LOAD
${font Terminus:Bold:size=12}${color1}LOAD ${hr 2}${font Terminus:Regular:pixelsize=12}
DIR diff --git a/conky/.local/bin/conky-cmus b/conky/.local/bin/conky-cmus
@@ -0,0 +1,16 @@
+#!/bin/sh
+if [ ! -x /usr/bin/cmus-remote ];
+then
+echo "cmus is not installed."
+exit
+fi
+
+ARTIST=$( cmus-remote -Q 2>/dev/null | grep artist | head -n 1 | cut -d " " -f 3- )
+TITLE=$( cmus-remote -Q 2>/dev/null | grep title | head -n 1 | cut -d " " -f 3- )
+
+if [ -z "$ARTIST" ];
+then
+exit 0
+else
+echo "now playing: $ARTIST - $TITLE"
+fi
DIR diff --git a/fvwm/.fvwm/config b/fvwm/.fvwm/config
@@ -391,6 +391,7 @@ Style wmSpaceWeather WindowListSkip, ClickToFocus, StaysOnBottom
Style xeyes WindowListSkip, ClickToFocus, StaysOnBottom
Style FvwmIdent WindowListSkip
Style *lock Sticky, WindowListSkip, !Iconifiable, NoHandles, StaysOnTop
+Style cmus-cover WindowListSkip, NeverFocus, FixedPosition, StaysOnBottom
Style qemu* !Closable
# ignore size hints for terminals