Skip to content

Commit

Permalink
feat: use script message to control the osc logo display
Browse files Browse the repository at this point in the history
ref: mpv-player/mpv@ec236f7, #55
This will allow automatic control the logo display of osc scripts with have the `osc-idlesereen` feature.
However, since this feature is a recently added function, let's keep `utils.shared_script_property_set`.
  • Loading branch information
dyphire committed Oct 10, 2022
1 parent 16dccba commit 46897c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions file-browser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ local o = {
--directory to load external modules - currently just user-input-module
module_directory = "~~/script-modules",

--turn the OSC idle screen off and on when opening and closing the browser
toggle_idlescreen = false,

--force file-browser to use a specific text alignment (default: top-left)
--uses ass tag alignment numbers: https://aegi.vmoe.info/docs/3.0/ASS_Tags/#index23h3
--set to 0 to use the default mpv osd-align options
Expand Down Expand Up @@ -1120,6 +1123,7 @@ local function open()
end

utils.shared_script_property_set("file_browser-open", "yes")
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'no', 'no_osd') end
state.hidden = false
if state.directory == nil then
local path = mp.get_property('path')
Expand All @@ -1142,6 +1146,7 @@ local function close()
end

utils.shared_script_property_set("file_browser-open", "no")
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'yes', 'no_osd') end
state.hidden = true
ass:remove()
end
Expand Down
3 changes: 3 additions & 0 deletions file_browser.conf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ addon_directory=~~/script-modules/file-browser-addons
#directory to load external modules - currently just user-input-module
module_directory=~~/script-modules

#turn the OSC idle screen off and on when opening and closing the browser
toggle_idlescreen=no

####################################
######### style settings ###########
####################################
Expand Down

0 comments on commit 46897c2

Please sign in to comment.