summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-03-25 20:35:50 -0500
committerzachir <zachir@librem.one>2023-03-25 20:35:50 -0500
commit0cbcbcd52d23acd096afac3e9b1309a897129d87 (patch)
treecdbfd7b19769c925fed585e001d9aea597185458
parenta3327f50765604274eb25b080798d7b07b0f4d1e (diff)
add bling for window swallowing (plus eventually scratchpads!)
-rw-r--r--.gitmodules3
m---------awesome/bling0
-rw-r--r--awesome/rc.lua55
3 files changed, 50 insertions, 8 deletions
diff --git a/.gitmodules b/.gitmodules
index 5c2ba09..80e6b9d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -13,3 +13,6 @@
[submodule "awesome/awesome-scratch"]
path = awesome/awesome-scratch
url = https://github.com/notnew/awesome-scratch
+[submodule "awesome/bling"]
+ path = awesome/bling
+ url = https://github.com/BlingCorp/bling.git
diff --git a/awesome/bling b/awesome/bling
new file mode 160000
+Subproject 677917056d118d02feaa5c21ecf5a50375ef123
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