Hide wezterm window while some (usually gui) app runs and show after that.
- Wezterm (well, duh)
- A window manager that processes minimization requests (probably). Works in cosmic-comp ootb, doesn't work in qtile (can probably be done with some configuration, tho)
wezterm.on('user-var-changed', function(window, pane, name, value)
-- to see the logs use wezterm blocking-start
-- to set a var use
-- ` bash -c "printf '\\033]1337;SetUserVar=$(basename "name")=$(echo value | base64)\\007'; sleep 0.1" `
wezterm.log_info('var', name, value)
-- "window swallowing"
if name == 'whide' then
window:perform_action(
wezterm.action.Hide,
pane
)
elseif name == 'wshow' then
wezterm.log_info("here")
window:maximize()
window:restore()
-- some unsuccessful (as in they don't restore the window) attempts. May work in other wm-s/de-s, tho.
--window:perform_action(
-- -- wezterm.action.Show,
-- wezterm.action.SetWindowLevel 'AlwaysOnTop',
-- pane
--)
end
end)In case of fish, I made the following functions:
setUserVar:function setUserVar bash -c "printf '\\033]1337;SetUserVar=$(basename $argv[1])=$(echo $argv[2] | base64)\\007'; sleep 0.1" end
swallow:function swallow setUserVar whide eval $argv # save the exit status to be returned later # since neither does setUserVar fail like ever, # nor we need its exit code set -l res $status setUserVar wshow return $res end