diff --git a/README.md b/README.md index e6e11bc..25b5d78 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ max_proximity=120 color_foreground=FFFFFF # BBGGRR - BLUE GREEN RED hex code color_background=000000 +# hide proximity based elements when mpv autohides the cursor +autohide=no ``` Terminology: diff --git a/uosc.conf b/uosc.conf index ff67e80..9318d0f 100644 --- a/uosc.conf +++ b/uosc.conf @@ -33,3 +33,5 @@ max_proximity=120 color_foreground=FFFFFF # BBGGRR - BLUE GREEN RED hex code color_background=000000 +# hide proximity based elements when mpv autohides the cursor +autohide=no diff --git a/uosc.lua b/uosc.lua index d353356..08b8b2a 100644 --- a/uosc.lua +++ b/uosc.lua @@ -51,6 +51,8 @@ max_proximity=120 color_foreground=FFFFFF # BBGGRR - BLUE GREEN RED hex code color_background=000000 +# hide proximity based elements when mpv autohides the cursor +autohide=no ``` Available keybindings (place into `input.conf`): @@ -85,10 +87,11 @@ local options = { progressbar_chapters = "dots", -- progressbar chapters indicator style: dots, lines, lines-top, lines-bottom progressbar_chapters_opacity = 0.3, -- progressbar chapters indicator opacity - min_proximity = 40, -- proximity below which opacity equals 1 - max_proximity = 120, -- proximity above which opacity equals 0 + min_proximity = 40, -- proximity below which opacity equals 1 + max_proximity = 120, -- proximity above which opacity equals 0 color_foreground = "FFFFFF", -- BBGGRR - BLUE GREEN RED hex code color_background = "000000", -- BBGGRR - BLUE GREEN RED hex code + autohide = false, -- hide proximity based elements when mpv autohides the cursor } opt.read_options(options, "uosc") local config = { @@ -124,6 +127,7 @@ local state = { render_timer = nil, render_last_time = 0, cursor_autohide_timer = mp.add_timeout(mp.get_property_native("cursor-autohide") / 1000, function() + if not options.autohide then return end cursor.hidden = true update_proximities() request_render() @@ -707,8 +711,10 @@ function handle_mouse_move() request_render() -- Restart timer that hides UI when mouse is autohidden - state.cursor_autohide_timer:kill() - state.cursor_autohide_timer:resume() + if options.autohide then + state.cursor_autohide_timer:kill() + state.cursor_autohide_timer:resume() + end end function handle_toggle_progress()