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
|
@ -17,6 +17,8 @@
|
||||||
# MBSYNC_POST="/bin/usr/cmd-to-run"
|
# MBSYNC_POST="/bin/usr/cmd-to-run"
|
||||||
# MBSYNC_NOTIFY=1
|
# MBSYNC_NOTIFY=1
|
||||||
|
|
||||||
|
PASSWORD_FILE="$HOME/.local/share/pass/misc/aerc-gmail-app-password.gpg"
|
||||||
|
|
||||||
prehook() {
|
prehook() {
|
||||||
if [ -n "$MBSYNC_PRE" ]; then
|
if [ -n "$MBSYNC_PRE" ]; then
|
||||||
eval "$MBSYNC_PRE"
|
eval "$MBSYNC_PRE"
|
||||||
|
@ -64,7 +66,7 @@ checkonline() {
|
||||||
# warn user that he has to enter his password in a moment
|
# warn user that he has to enter his password in a moment
|
||||||
# to stop catching him offguard or entering something by accident
|
# to stop catching him offguard or entering something by accident
|
||||||
checkwarnuser() {
|
checkwarnuser() {
|
||||||
agt=$(gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode cancel ~/.local/share/pass/misc/aerc-gmail-app-password.gpg 2>&1)
|
agt=$(gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode cancel "$PASSWORD_FILE" 2>&1)
|
||||||
if echo "$agt" | grep -qE 'No secret key'; then
|
if echo "$agt" | grep -qE 'No secret key'; then
|
||||||
notify "Mail: Password phrase needed!"
|
notify "Mail: Password phrase needed!"
|
||||||
sleep 2.5
|
sleep 2.5
|
||||||
|
|
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)
|
|
@ -71,14 +71,6 @@ c.tabs.title.format = "{index} {audio}{perc}{current_title}"
|
||||||
c.tabs.position = "right"
|
c.tabs.position = "right"
|
||||||
c.tabs.width = "15%"
|
c.tabs.width = "15%"
|
||||||
|
|
||||||
# give the browser nice theme colors
|
|
||||||
config.source("colorscheme.py")
|
|
||||||
|
|
||||||
# Status bar
|
|
||||||
# should be visible to prevent 'jumping' bug,
|
|
||||||
# see https://github.com/qutebrowser/qutebrowser/issues/2236
|
|
||||||
c.statusbar.show = "always"
|
|
||||||
|
|
||||||
c.colors.webpage.bg = "#555555"
|
c.colors.webpage.bg = "#555555"
|
||||||
|
|
||||||
# FUNCTION
|
# FUNCTION
|
||||||
|
@ -182,3 +174,6 @@ c.url.searchengines = {
|
||||||
"hn": "https://hn.algolia.com/?q={}",
|
"hn": "https://hn.algolia.com/?q={}",
|
||||||
"kb": "https://soeg.kb.dk/discovery/search?query=any,contains,{}&tab=Everything&search_scope=MyInst_and_CI&vid=45KBDK_KGL:KGL&offset=0&lang=en",
|
"kb": "https://soeg.kb.dk/discovery/search?query=any,contains,{}&tab=Everything&search_scope=MyInst_and_CI&vid=45KBDK_KGL:KGL&offset=0&lang=en",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# give the browser nice theme colors
|
||||||
|
config.source("colorscheme.py")
|
||||||
|
|
|
@ -120,6 +120,7 @@ mark d ~/downloads/
|
||||||
mark p ~/projects/
|
mark p ~/projects/
|
||||||
mark s ~/projects/studentassistant/
|
mark s ~/projects/studentassistant/
|
||||||
mark i ~/pictures/
|
mark i ~/pictures/
|
||||||
|
mark v ~/videos/
|
||||||
mark n ~/documents/notes/
|
mark n ~/documents/notes/
|
||||||
mark N ~/Nextcloud/
|
mark N ~/Nextcloud/
|
||||||
mark l ~/documents/library/academia/pdf/
|
mark l ~/documents/library/academia/pdf/
|
||||||
|
|
Loading…
Reference in a new issue