diff options
author | zachir <zachir@librem.one> | 2023-03-25 20:35:50 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-03-25 20:35:50 -0500 |
commit | 0cbcbcd52d23acd096afac3e9b1309a897129d87 (patch) | |
tree | cdbfd7b19769c925fed585e001d9aea597185458 /awesome/rc.lua | |
parent | a3327f50765604274eb25b080798d7b07b0f4d1e (diff) |
add bling for window swallowing (plus eventually scratchpads!)
Diffstat (limited to 'awesome/rc.lua')
-rw-r--r-- | awesome/rc.lua | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/awesome/rc.lua b/awesome/rc.lua index 56c59ff..9a65cc7 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -17,6 +17,7 @@ local naughty = require("naughty") package.loaded["naughty.dbus"] = {} local menubar = require("menubar") local hotkeys_popup = require("awful.hotkeys_popup") +local bling = require("bling") -- Enable hotkeys help widget for VIM and other apps -- when client with a matching name is opened: require("awful.hotkeys_popup.keys") @@ -828,12 +829,23 @@ awful.rules.rules = { } -- }}} --- {{{ Window Swallowing functions ----[[ +--{{{ bling window swallowing +bling.module.window_swallowing.start() +theme.parent_filter_list = { "firefox", "Gimp" } -- class names list of parents that should not be swallowed +theme.child_filter_list = { "Dragon" } -- class names list that should not swallow their parents +theme.swallowing_filter = true -- whether the filters above should be active +--}}} + +-- {{{ Window Swallowing functions OLD/DEPRECATED +--[[ function is_terminal(c) return (c.class and (c.class:match("St") or c.class:match("Alacritty"))) and true or false end +function is_noswallow(c) + return false +end + function copy_size(c, parent_client) if not c or not parent_client then return @@ -857,7 +869,7 @@ function get_parent_pid(child_ppid, callback) awful.spawn.easy_async(ppid_cmd, function(stdout, stderr, reason, exit_code) -- primitive error checking if stderr and stderr ~= "" then - callback(nil, false) + callback(err, false) return end local ppid = stdout:gsub(" ", ""):gsub("\n", "") @@ -871,34 +883,61 @@ function if_client_and_parent(c1, c2, cl) end end +--]] +--[[ FULLY UNTESTED, UNVERIFIED. PLEASE DO NOT RUN. +function incall(err, ppid, cl) + if err then + return + end + if ppid and cl and cl.pid and (ppid:find('^' .. cl.pid)) then + return true + end + if ppid ~= 1 then + get_parent_pid(ppid, incall) + else + end +end + +function get_id_or_recurse(pid, err) + if pid == 1 then + return 1 + else + end +end +--]] +--[[ client.connect_signal("property::size", check_resize_client) client.connect_signal("property::position", check_resize_client) client.connect_signal("manage", function(c) - if is_terminal(c) then + if is_terminal(c) or is_noswallow(c) then return end + local procid = 0 + while (procid ~= 1) do + + end local parent_client=awful.client.focus.history.get(c.screen, 1) get_parent_pid(c.pid, function(err, ppid) if err then - error(err) + --error(err) return end parent_pid = ppid or false get_parent_pid(parent_pid, function(err, gppid) if err then - error(err) + --error(err) return end grand_parent_pid = gppid or false get_parent_pid(grand_parent_pid, function(err, ggppid) if err then - error(err) + --error(err) return end great_grand_parent_pid = ggppid or false get_parent_pid(great_grand_parent_pid, function(err, gggppid) if err then - error(err) + --error(err) return end great_great_grand_parent_pid = gggppid or false |