How to replace a button icon in mpv - Rabcor/mpv-extended-osc GitHub Wiki

First browse to /usr/share/fonts where your fonts are stored. then pick a font (fontawesome/fa is often a good choice, there's also notosanssymbols)

Drop your selected font onto this page: https://fontdrop.info/?darkmode=true

This will allow you to view all the font glyphs and their associated unicode value.

Here's an example potential replacement for the loop symbol for instance:

25-06-0-chromium

Once you have this unicode value you can test it in a terminal to make sure it will look right.

25-06-4-kitty

After that, to get the mpv compatible decimal code run this (where F021 is the unicode value for our target glyph):

echo -e \uF021 | od -An -t u1 | sed 's: :\\\:g' | sed 's:\\\\\\\.*::g'
Alternate method for unicode values that contain more than 4 characters (like 01F5D8)

If the unicode value is more than 4 characters the bash command will not work. I have not been able to find a bash command that'll work with more than a 4 character unicode, therefore you will have to use a lua script to do it.

glyph='\u{01F5D8}' output=''
for i = 1, #glyph do output = output .. '\\' .. string.byte(glyph, i) end
print(output)

Which can be executed with lua script.lua

You should get a code like this: \239\128\161

Which you can then place in ~/.config/mpv/scripts/osc.lua under local icons = { to replace the icon for one of the buttons defined in there.

Like so: 25-06-2-featherpad

And now my loop icon has been replaced with the example icon: 25-06-3-mpv

⚠️ **GitHub.com Fallback** ⚠️