Skip to content

Commit

Permalink
Merge pull request #70 from dyphire/patch-1
Browse files Browse the repository at this point in the history
feat: use script message to toggle the osc idle screen when opening and closing the browser
  • Loading branch information
CogentRedTester authored Oct 10, 2022
2 parents 4a9fe29 + 46897c2 commit 6763594
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 @@ -1121,6 +1124,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 @@ -1143,6 +1147,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 6763594

Please sign in to comment.