What software have you made to improve your workflow or rice? - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
Halfwit
Members
Yeah, it's pretty much what I have in my hooks.lua, I do a bit of window management to handle resizes when the video switches (the tiling I use maintains video aspect ratio for no black bars anywhere) but basically it's all status bar code
Code:
• cat hooks.lua
local RUNTIME_DIR = os.getenv("XDG_RUNTIME_DIR")
RUNTIME_DIR = RUNTIME_DIR or os.getenv("HOME").."/.local/run"

function update_bar(name)
        title = mp.get_property("media-title")
        local f = io.open(RUNTIME_DIR.."/statusbar/media", "w")
        f:write(title.." ")
        f:flush()
        f:close()
        os.execute('/usr/local/share/hwwm/wshuf | xe -s \'wtp $1 $2 $3 $4 $5\' &')
end

function clean_bar(reason)
        local f = io.open(RUNTIME_DIR.."/statusbar/media", "w")
        f:write("")
        f:flush()
        f:close()
end
mp.register_event("start-file", update_bar)
mp.observe_property("media-title", "string", update_bar)
mp.register_event("end-file", clean_bar)

The lua API is really nice though, you can do a lot of things with it that I haven't bothered to do yet.


Messages In This Thread
RE: What software have you made to improve your workflow or rice? - by Halfwit - 22-09-2019, 05:02 PM