summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-07 00:45:05 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-07 00:45:05 +0100
commitdf10685e7194cd6061f5701348d6537c36abcca0 (patch)
treeddce5a351042249b6718a0fe695d8b6d0e9a4ac3
parent9e636b99872e67306bac493632560e29576753e5 (diff)
downloadawesome-configs-df10685e7194cd6061f5701348d6537c36abcca0.tar.xz
scratchpad: add some syntactic sugar
-rw-r--r--scratchpad.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/scratchpad.lua b/scratchpad.lua
index 019bd05..b5daca9 100644
--- a/scratchpad.lua
+++ b/scratchpad.lua
@@ -73,34 +73,34 @@ function set(c, width, height, sticky, screen)
end
-- Prepare a table for storing clients,
- if not scratch["pad"] then scratch["pad"] = {}
+ if not scratch.pad then scratch.pad = {}
-- add unmanage signal for scratchpad clients
capi.client.add_signal("unmanage", function (c)
- local oc = scratch["pad"][screen]
+ local oc = scratch.pad[screen]
if oc == c then
- scratch["pad"][screen] = nil
+ scratch.pad[screen] = nil
end
end)
end
-- If the scratcphad is emtpy, store the client,
- if not scratch["pad"][screen] then
- scratch["pad"][screen] = c
+ if not scratch.pad[screen] then
+ scratch.pad[screen] = c
-- then apply geometry and properties
setscratch(c)
else -- If a client is already scratched,
- local oc = scratch["pad"][screen]
+ local oc = scratch.pad[screen]
-- compare it with the focused client
if oc == c then
-- If it matches then unscratch and clear the table
awful.client.floating.toggle(oc); oc.sticky = false
oc.ontop = false; oc.above = false
- scratch["pad"][screen] = nil
+ scratch.pad[screen] = nil
else -- If they don't match, unscratch and replace it
oc.hidden = false; oc.sticky = false
oc.ontop = false; oc.above = false
awful.client.floating.toggle(oc)
- scratch["pad"][screen] = c
+ scratch.pad[screen] = c
setscratch(c)
end
end
@@ -112,10 +112,10 @@ function toggle(screen)
local screen = screen or capi.mouse.screen
-- Check if we have a client on storage,
- if scratch["pad"] and
- scratch["pad"][screen] ~= nil
+ if scratch.pad and
+ scratch.pad[screen] ~= nil
then -- and get it out, to play
- local c = scratch["pad"][screen]
+ local c = scratch.pad[screen]
-- If it's visible on another tag hide it,
if c:isvisible() == false then c.hidden = true;