darkrc/devilspie2/thunderbird.lua

22 lines
541 B
Lua
Raw Permalink Normal View History

2020-11-24 09:46:59 +00:00
local function opacity(value)
2020-12-08 12:54:55 +00:00
os.execute(string.format(
"xprop -id %s -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0x%xffffff",
get_window_xid(), math.max(math.min(value, 255), 0)
))
2020-11-24 09:46:59 +00:00
end
local function rep(n, value)
2020-12-08 12:54:55 +00:00
if n>0 then return value, rep(n-1, value) end
2020-11-24 09:46:59 +00:00
end
local margin = { rep(4, 16) }
if get_application_name():find("Thunderbird$") then
2020-12-08 12:54:55 +00:00
if get_window_type():find("NORMAL$") then
set_window_workspace(get_workspace_count())
unmaximize()
set_window_fullscreen(true)
maximize()
opacity(230)
end
2020-11-24 09:46:59 +00:00
end