[dwm][ncmpcpp] Custom setup with tmux and ueberzug for displaying cover art

hi all

i hope that you are all well

i found something that i would like to get working but i’m not sure what i’m doing wrong and i’m hoping someone can help

i found a post in reddit [dwm][ncmpcpp] Custom setup with tmux and ueberzug for displaying cover art

currently my network share music is mounted on boot in fstab to /srv/nfs/music/

the person also has put together a guide on how to do it that is here

i will post all that i have done as per the guide for comparison in hope of a lead to where i need to fix

my cover.sh in ~/.ncmcpp/

#!/bin/bash

source “ueberzug library

COVER="/tmp/album_cover.png"

function add_cover {
ImageLayer::add [identifier]=“img” [x]=“2” [y]=“1” [path]="$COVER"
}

ImageLayer 0< <(
if [ ! -f “$COVER” ]; then
cp “$HOME/.ncmpcpp/default_cover.png” “$COVER”
fi
#rerender image when changed
while inotifywait -q -q -e close_write “$COVER”; do
add_cover
done
)

my cover_obs.sh

#!/bin/bash

COVER="/tmp/album_cover.png"
COVER_SIZE=“500”

#path to current song
file="$MUSIC_DIR/$(mpc --format %file% current)"
album="${file%/}"
#search for cover image
art=$(find “$album” -maxdepth 1 | grep -m 1 ".
.(jpg|png|gif|bmp)")
if [ “$art” = “” ]; then
art="$HOME/.ncmpcpp/default_cover.png"
fi
#copy and resize image to destination
ffmpeg -loglevel 0 -y -i “$art” -vf “scale=$COVER_SIZE:-1” “$COVER”

my tsession in ~/.ncmpcpp/ to define a tmux session

neww
set -g status off

#image pane; run cover script, disable text output and remove prompt
send-keys “stty -echo” C-m
send-keys “tput civis – invisible” C-m
send-keys “export PS1=’’” C-m
send-keys “clear” C-m
send-keys "~/.ncmpcpp/cover.sh " C-m

#catalog pane; run instance of ncmpcpp
split-window -v
select-pane -t 1
send-keys “ncmpcpp --config=’~/.ncmpcpp/catalog.conf’” C-m
send-keys 1

#visualizer pane; run instance of ncmpcpp in visualizer mode
#select-pane -t 0
#split-window -h
#send-keys “ncmpcpp --config=’~/.ncmpcpp/visualizer.conf’” C-m
#send-keys 8
#send-keys u

#resize image and visualizer pane to fit image
resize-pane -t 0 -x 49 -y 23
resize-pane -t 1 -y 23

#hook for keeping the image pane size constant
set-hook client-resized ‘resize-pane -t 0 -x 49 -y 23’

#focus on catalog pane
select-pane -t 2

my .bashrc

[[ $- != i ]] && return

[[ -f ~/.welcome_screen ]] && . ~/.welcome_screen

_set_my_PS1() {
PS1=’[\u@\h \W]$ ’
if [ “$(whoami)” = “liveuser” ] ; then
local iso_version="$(grep ^VERSION= /usr/lib/endeavouros-release 2>/dev/null | cut -d ‘=’ -f 2)"
if [ -n “$iso_version” ] ; then
local prefix=“eos-”
local iso_info="$prefix$iso_version"
PS1="[\u@$iso_info \W]$ "
fi
fi
}
_set_my_PS1
unset -f _set_my_PS1

ShowInstallerIsoInfo() {
local file=/usr/lib/endeavouros-release
if [ -r $file ] ; then
cat $file
else
echo “Sorry, installer ISO info is not available.” >&2
fi
}

alias ls=‘ls --color=auto’
alias ll=‘ls -lav --ignore=…’ # show long listing of all except “…”
alias l=‘ls -lav --ignore=.?*’ # show long listing but no hidden dotfiles except “.”
alias music=‘tmux new-session -s $$ “tmux source-file ~/.ncmpcpp/tsession”’
_trap_exit() { tmux kill-session -t $$; }

[[ “$(whoami)” = “root” ]] && return

[[ -z “$FUNCNEST” ]] && export FUNCNEST=100 # limits recursive functions, see ‘man bash’

bind ‘"\e[A":history-search-backward’
bind ‘"\e[B":history-search-forward’

_GeneralCmdCheck() {
# A helper for functions UpdateArchPackages and UpdateAURPackages.

echo "$@" >&2
"$@" || {
    echo "Error: '$*' failed." >&2
    exit 1
}

}

_CheckInternetConnection() {
# curl --silent --connect-timeout 8 https://8.8.8.8 >/dev/null
eos-connection-checker
local result=$?
test $result -eq 0 || echo “No internet connection!” >&2
return $result
}

_CheckArchNews() {
local conf=/etc/eos-update-notifier.conf

if [ -z "$CheckArchNewsForYou" ] && [ -r $conf ] ; then
    source $conf
fi

if [ "$CheckArchNewsForYou" = "yes" ] ; then
    local news="$(yay -Pw)"
    if [ -n "$news" ] ; then
        echo "Arch news:" >&2
        echo "$news" >&2
        echo "" >&2
        # read -p "Press ENTER to continue (or Ctrl-C to stop): "
    else
        echo "No Arch news." >&2
    fi
fi

}

UpdateArchPackages() {
# Updates Arch packages.

_CheckInternetConnection || return 1

_CheckArchNews

#local updates="$(yay -Qu --repo)"
local updates="$(checkupdates)"
if [ -n "$updates" ] ; then
    echo "Updates from upstream:" >&2
    echo "$updates" | sed 's|^|    |' >&2
    _GeneralCmdCheck sudo pacman -Syu "$@"
    return 0
else
    echo "No upstream updates." >&2
    return 1
fi

}

UpdateAURPackages() {
# Updates AUR packages.

_CheckInternetConnection || return 1

local updates
if [ -x /usr/bin/yay ] ; then
    updates="$(yay -Qua)"
    if [ -n "$updates" ] ; then
        echo "Updates from AUR:" >&2
        echo "$updates" | sed 's|^|    |' >&2
        _GeneralCmdCheck yay -Syua "$@"
    else
        echo "No AUR updates." >&2
    fi
else
    echo "Warning: /usr/bin/yay does not exist." >&2
fi

}

UpdateAllPackages() {
# Updates all packages in the system.
# Upstream (i.e. Arch) packages are updated first.
# If there are Arch updates, you should run
# this function a second time to update
# the AUR packages too.

UpdateArchPackages || UpdateAURPackages

}

_open_files_for_editing() {
# Open any given document file(s) for editing (or just viewing).
# Note1: Do not use for executable files!
# Note2: uses mime bindings, so you may need to use
# e.g. a file manager to make some file bindings.

local progs="xdg-open exo-open"     # One of these programs is used.
local prog
for prog in $progs ; do
    if [ -x /usr/bin/$xx ] ; then
        $prog "$@" >& /dev/null &
        return
    fi
done
echo "Sorry, none of programs [$progs] is found." >&2
echo "Tip: install one of packages" >&2
for prog in $progs ; do
    echo "    $(pacman -Qqo "$prog")" >&2
done

}

Edit ;

ok i got mpd and ncmpcpp working well the database is updating sooooo yayyyyyyyy … now just got to see how and why the other parts of this post arent working yet :thinking:

edit ;

lol iam on a roll got it all going now to see why it not seeing my covers :grin:

edit ;
ok so i think the alias is working because if i type the alias in terminal it opens ncmpcpp like this

and then if i play a song this happens


the sad face is my default cover for missing covers and i’m trying to get that on the left side of the artists column. this song example has a cover though in the same dir but isnt named cover.jpg but for some reason i cant rename on the mount point. even if there are covers in the dir of the album they dont show, so not sure if the name of the file is relevant or not or maybe the execute_on_song_change isnt working or maybe something wrong in the cover.sh or cover_obs.sh :man_shrugging: