-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] mpv osc.lua theme #13
Comments
Progress Update I've managed to iron out the custom button icons. Needed to heavily modify the slider code to support multiple colors for the handle/bg/progress. I've just noticed the cache color is the progress color instead of a gray/white when taking the screenshot. Since I haven't uploaded a screenshot, here's what the blurred hover effect and tooltip looks like: https://gist.github.com/Zren/53afba67b4c6cd27eabe47d11a729815 TODO:
Anything else besides those will probably just get modified when I grow bored. The existing icons aren't rounded like tethys but most are fine for now. |
I just figured out that I can add More can be found out in the Zren/mpv-osc-tethys@master...iconrefactor branch. |
Ever since my GPU died, I've been using mpv since my super-old GPU has terrible OpenGL support (so I'm stuck with
vo=x11
). Past few days I've been trying to turn the bomi/mpvz look into anosc.lua
theme which can be used with mpv itself. It'll be far more complicated to code, but it'll work for anyone who just want's it to look nice without losing mpv's feature set.Here's the base
osc.lua
we can copy to~/.config/mpv/scripts/osc.lua
.osc_tethys.lua
WIP: https://gist.github.com/Zren/53afba67b4c6cd27eabe47d11a729815Then I added this to
~/.config/mpv/mpv.conf
Layout
I created a new layout section based on
bottombar
.I basically ended doing the buttons like so:
an
stands for alignment, which adds{\\an(5)}
to the ass text.1
means the (x,y) is the bottom-left,4
iscenter-left
,7
is top-left.5
is center and9
is top-right.Icons
mpv-osd-symbols
font is bundled, and basically forced for the OSD.{\\fn(tethys-osd-symbols)}}
in front of the playpause icon contents. It doesn't appear to have worked. Creating a custom font and distributing it is too complicated anyways, but was an annoying setback.Eventually I noticed the mpv icon (and santa hat during December) when mpv is launched with no video is drawn using a path!
I tried taking the path in the SVG and placing it there. Unfortunately, the SVG path is a little different. I noticed that mpv used the
b
command which doesn't appear in the mozilla docs.However even if we assume the
b
is the same as a bezier curve, the SVG path uses deltac
coordinates instead of absoluteC
coordinates which is what theb
seems to be using.I ended up needing to export the svg as an
.html
file with Inkscape, then manually convertto the following path:
As a final note, it seems the
{\\p1}
stands for scale. The mpv/santa hat icons use{\\p6}
which I assume stands for 1/6th scale since the coordinates given are huge (401 10 0 410 0 905
). I needed to change it to 1/1 scale to even see my 44x44 icon.I still need to adjust the icon position a little, so it's not a drop in replacement.
Hover Effect
mpv doesn't have any hover animations, the only hover effect is for the seekbar timestamp.
I Managed to create a hover effect by adding the following to the bottom of
render_elements()
under thebutton
section.{{\\blur0}}
formatting accepts a value between0
and20
.Tooltips
I added rough tooltips by adding this to
render_elements()
under thebutton
section.and the following setter to adjust the tooltip based on how close to the window edge it is.
Right now, the tooltips are very basic. I'll need to work improving them to have a rounded bg and support multiple lines of text since MPV has multiple actions like
Left
navigating 10s andShift+Left
navigating 1s.Track Selection
It would be coo to create a merged audio/subtitle button with a popup like Netflix. Might be too complicated to have multiple generated lists of buttons though.
Playlist
Since mpv has seek fwd/back and chapter next/prev buttons, I've moved the playlist next/prev buttons to the right side like Netflix.
Seekbar Thumbnails
This is probably the most unlikely feature to add. I do remember a lua script that would call
ffmpeg
to generate a cache of thumbnails every 10sec or so. However that would be an ugly approach.The text was updated successfully, but these errors were encountered: