r/mpv • • 12d ago

Issue on Linux Changing context menu background and text.

Post image

As the title: With the update I'm trying to bring the context menu in line with all my other colors. I've already done some configuration through the script options in a ~/.config/mpv/script-opts/context_menu.conf file, but it doesn't address the main background and text color. I'm a little lost digging through documentation and source files, so any help would be appreciated.

25 Upvotes

10 comments sorted by

5

u/Frigorific_ 12d ago

Figured out it's inherited from mpv.conf, so now I have this:

# Text color.
osd-color="#d8afd3"

# Also serves as the bg color for menus.
osd-outline-color="#211d29"

Obviously, part of mpv's merit is its extensibility, but it's also hard to know what controls what with this much decentralization. I tried out a bunch of other color config options and I couldn't tell what they do... I would say I'm happy for now, but I feel like I need to figure out the rest before I'm satisfied, heh.

1

u/ipsirc 12d ago

https://github.com/mpv-player/mpv/blob/master/player/lua/context_menu.lua#L409

    local back_color = mpv_color_to_ass(mp.get_property(
        border_style == "background-box" and "osd-back-color" or "osd-outline-color"))

    -- Don't make the background pure black in the default configuration
    -- because it causes eye strain. It is fine for other UI elements because
    -- they have background transparency, but the context menu doesn't.
    if back_color == "000000" then
        back_color = "222222"
    end

    local background_style = "{\\1c&H" .. back_color ..
                       "&\\1a&H" .. string.format("%x", options.background_alpha) ..
                       "&\\bord" .. options.menu_outline_size .. "\\3c&H" ..
                       color_option_to_ass(options.menu_outline_color) ..
                       "\\blur0&}"

1

u/Kaalamadan69 12d ago

I am not getting the context menu at right click on my new Ubuntu pc. I installed mpv through default package manager and its 0.41. can anyone help me?

2

u/otheyhigh 10d ago

- Check if the input binding is correctly setup.
- Ensure that the `menu.conf` has the correct encoding (I had issues because of tabs vs spaces). You can print the menu data in the console to confirm it was loaded correctly.
- Try both config values in `mpv.conf` for the context menu.

2

u/Nalien23 10d ago

You need mpv 0.42.

1

u/Kaalamadan69 10d ago

I was lazy to compile it from source, so I just installed flatpak version. It's working now.

1

u/otheyhigh 8d ago

There are two GH repos listed on the official mpv website that do regular builds. I use one of those to get the latest changes without needing to build locally.