From 5c6cd059e8395d7f24d4b199e59c8c2f562dc438 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 3 Nov 2013 21:21:21 +0100 Subject: New stow hierarchy --- .config/awesome/ext.lua | 81 ------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 .config/awesome/ext.lua (limited to '.config/awesome/ext.lua') diff --git a/.config/awesome/ext.lua b/.config/awesome/ext.lua deleted file mode 100644 index e7bdf00..0000000 --- a/.config/awesome/ext.lua +++ /dev/null @@ -1,81 +0,0 @@ -local client=client -local awful=awful -local pairs=pairs -local table=table - -module("ext") - --- Returns true if all pairs in table1 are present in table2 -function match(table1, table2) - for k, v in pairs(table1) do - if table[k] ~= v and not table2[k]:find(v) then - return false - end - end - - return true -end - ---- Spawns cmd if no client can be found matching properties --- If such a client can be found, pop to first tag where it is --- visible, and give it focus -function run_or_raise(cmd, properties) - local clients = client.get() - local focused = awful.client.next(0) - local findex = 0 - local matched_clients = { } - local n = 0 - - for i, c in pairs(clients) do - -- make an array of matched clients - if match(properties, c) then - n = n + 1 - matched_clients[n] = c - - if n == focused then - findex = n - end - end - end - - if n > 0 then - local c = matched_clients[1] - - -- if the focused window matched switch focus to next in list - if 0 < findex and findex < n then - c = matched_clients[findex + 1] - end - - local ctags = c:tags() - - if table.getn(ctags) == 0 then - -- ctags is empty, show client on current tag - local curtag = awful.tag.selected() - awful.client.movetotag(curtag, c) - else - -- Otherwise, pop to first tag client is visible on - awful.tag.viewonly(ctags[1]) - end - - -- And then focus the client - client.focus = c - c:raise() - awful.screen.focus(c.screen) - return - end - awful.util.spawn(cmd) -end - -function prev_client() - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end -end - -function next_client() - awful.client.focus.byidx(1) - if client.focus then - client.focus:raise() - end -end -- cgit v1.2.3-54-g00ecf