mail,mpv,qutebrowser,vifm: Fix small issues
Added videos directory to vifm quick marks (`v`). Fixed (hopefully) qutebrowser statusbar hiding and showing. Improved mail checking script password file handling by switching the hard-coded path to one still somewhat hard-coded, but encapsulated in a variable to make changing it later on easier. The script is a bit slap-dash anyway, so when refactored should be refactored overall. Added `gallery-dl` handling by mpv, whenever a link starting with `gdl://` is passed in.
This commit is contained in:
parent
15f5f0b5c9
commit
41bfe2df69
4 changed files with 39 additions and 9 deletions
32
mpv/.config/mpv/scripts/gallery-dl.lua
Normal file
32
mpv/.config/mpv/scripts/gallery-dl.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
-- gallery-dl_hook.lua
|
||||
--
|
||||
-- load online image galleries as playlists using gallery-dl
|
||||
-- https://github.com/mikf/gallery-dl
|
||||
--
|
||||
-- to use, prepend the gallery url with: gallery-dl://
|
||||
-- e.g.
|
||||
-- `mpv gallery-dl://https://imgur.com/....`
|
||||
|
||||
local utils = require 'mp.utils'
|
||||
local msg = require 'mp.msg'
|
||||
|
||||
local function exec(args)
|
||||
local ret = utils.subprocess({args = args})
|
||||
return ret.status, ret.stdout, ret
|
||||
end
|
||||
|
||||
mp.add_hook("on_load", 15, function()
|
||||
local url = mp.get_property("stream-open-filename", "")
|
||||
if (url:find("gdl://") ~= 1) then
|
||||
msg.debug("not a gdl:// url: " .. url)
|
||||
return
|
||||
end
|
||||
local url = string.gsub(url,"gdl://","")
|
||||
|
||||
local es, urls, result = exec({"gallery-dl", "-g", url})
|
||||
if (es < 0) or (urls == nil) or (urls == "") then
|
||||
msg.error("failed to get album list.")
|
||||
end
|
||||
|
||||
mp.commandv("loadlist", "memory://" .. urls)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue