Open shadow-absorber opened 1 year ago
This will not insert newline and title, but just clear lyrics from previous song, as clyrics does outside tmux.
The problem is here:
reset -Q
clears terminal but not tmux's buffer.
Tmux buffer is cleared with tmux clear-history
but there also must be specified on what pane to clear
So the command becomes: tmux clear-history -t $TMUX_PANE
Now if tmux is not installed $TMUX_PANE
variable will not exist, so to skip error messages:
if [ -z ${TMUX_PANE} ]; then :; else tmux clear-history -t $TMUX_PANE; fi
Finally this line should be changed to:
system('reset -Q; if [ -z ${TMUX_PANE} ]; then :; else tmux clear-history -t $TMUX_PANE; fi') == 0 or print "\e[H\e[J\e[H";
This command will patch clyrics script in /usr/bin:
sudo find /usr/bin/clyrics -type f -exec sed -i "s/system('reset -Q')/system('reset -Q; if [ -z \${TMUX_PANE} ]; then :; else tmux clear-history -t \$TMUX_PANE; fi')/g" {} \;
thanks @mzivic7 this solves the problem decently for now... still would be nice to get a title output
@shadow-absorber I made my own cmus-only lyrics display in python with ncurses, check it out if you want, its called cmus-auto-lyrics on github. It even scrolls lyrics automatically, and can read them from tags.
currently if you run clyrics in tmux the new lyrics gets kinda merged with the old lyrics when a new song starts/changes to a new song meaning it gets quickly confusing to find where the lyrics start and where it ends for songs