I often find myself updating my music library, which can cause CMUS to go out sync. So I began looking for a solution to help me update the CMUS cache on the fly! I found a post on Github by c0llision that guided me to the script below!
All it does is bind a few commands to the
u key in CMUS. So every time you need to update your CMUS library, just press the
u key on your keyboard!
Create the following file:
#!/bin/bash cmus-remote -C clear cmus-remote -C "add ~/Music" cmus-remote -C "update-cache -f"
update-library.shand save it somewhere. I’ve saved mine at
Change the permissions to make the script executable:
chmod +x ~/Applications/cmus-osx/update-library.sh
Enter the following within
CMUSto bind the update script to the
:bind -f common u shell ~/Applications/cmus-osx/update-library.sh
There you go! You can new press the
ukey to update your entire library when within