From 96bc8e20349789d313215ef93ec3d7324ce60db5 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Sat, 21 Sep 2013 22:02:51 +0200 Subject: [PATCH] some mishaps fixed; scratch.pad removed; new lain version --- README.rst | 8 +- lain | 2 +- rc.lua.blackburn | 5 +- rc.lua.copland | 2 +- rc.lua.dremora | 2 +- rc.lua.holo | 6 +- rc.lua.multicolor | 2 +- rc.lua.powerarrow-darker | 2 +- rc.lua.rainbow | 2 +- rc.lua.steamburn | 2 +- scratch/init.lua | 14 --- scratch/pad.lua | 136 ----------------------- scratch/drop.lua => scratchdrop/init.lua | 8 +- 13 files changed, 20 insertions(+), 171 deletions(-) delete mode 100644 scratch/init.lua delete mode 100644 scratch/pad.lua rename scratch/drop.lua => scratchdrop/init.lua (95%) diff --git a/README.rst b/README.rst index 821de39..96aef33 100644 --- a/README.rst +++ b/README.rst @@ -20,10 +20,10 @@ Notable features ================ - Shadow widgets (*tell me only when you have to*) -- Autostart functionality +- Autostart applications - Fast mpd and volume shortcuts (first time you see this trick in Awesome) -- Other shortcuts for copying to the clipboard (goodbye clipboard managers!), toggle wiboxes, widgets popups, screenshots capture, moving clients -- Quake style dropdown terminal +- Other shortcuts for copying to the clipboard (goodbye clipboard managers!), toggle wiboxes, widgets popups, screenshots capture, moving and magnifying clients +- Quake drop-down terminal - Calendar with current day highlighted and months switch with a click - Elegant notifications for new mails, current song, volume level, hdd critical state, low battery - Yahoo! Weather integration @@ -98,7 +98,7 @@ Switch a theme this way: :: cd ~/.config/awesome cp rc.lua.theme rc.lua -then edit your ``rc.lua`` to suit your preferences and system configuration. +then customize your ``rc.lua`` and restart Awesome (``Mod4 + ctrl + r``). Notes ===== diff --git a/lain b/lain index 27a388f..2c6a579 160000 --- a/lain +++ b/lain @@ -1 +1 @@ -Subproject commit 27a388f374e06b637138b088c956d81fe740a325 +Subproject commit 2c6a5794b20e757292825450557750df595d1868 diff --git a/rc.lua.blackburn b/rc.lua.blackburn index b92be02..e355ec4 100755 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -13,7 +13,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") -- }}} @@ -318,8 +318,7 @@ for s = 1, screen.count() do mywibox[s]:set_widget(layout) -- Set proper background, instead of beautiful.bg_normal - mywibox[s]:set_bg(beautiful.topbar_path .. p.workarea.width .. ".png") - naughty.notify({text=p.workarea.width,timeout=10}) + mywibox[s]:set_bg(beautiful.topbar_path .. screen[mouse.screen].workarea.width .. ".png") end -- }}} diff --git a/rc.lua.copland b/rc.lua.copland index ad3ad66..b4e5325 100755 --- a/rc.lua.copland +++ b/rc.lua.copland @@ -13,7 +13,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") local eminent = require("eminent") -- }}} diff --git a/rc.lua.dremora b/rc.lua.dremora index ea7b5ff..e44d256 100755 --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -13,7 +13,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") -- }}} diff --git a/rc.lua.holo b/rc.lua.holo index 55437a1..e0cb02d 100755 --- a/rc.lua.holo +++ b/rc.lua.holo @@ -13,7 +13,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") -- }}} @@ -444,11 +444,11 @@ for s = 1, screen.count() do mybottomwibox[s]:set_widget(bottom_layout) -- Set proper backgrounds, instead of beautiful.bg_normal - mywibox[s]:set_bg(beautiful.topbar_path .. screen[1].workarea.width .. ".png") + mywibox[s]:set_bg(beautiful.topbar_path .. screen[mouse.screen].workarea.width .. ".png") mybottomwibox[s]:set_bg("#242424") -- Create a borderbox above the bottomwibox - lain.widgets.borderbox(mybottomwibox[s], s, { position = "above", color = "#0099CC" } ) + lain.widgets.borderbox(mybottomwibox[s], s, { position = "top", color = "#0099CC" } ) end -- }}} diff --git a/rc.lua.multicolor b/rc.lua.multicolor index 06bcb75..9b0deed 100755 --- a/rc.lua.multicolor +++ b/rc.lua.multicolor @@ -14,7 +14,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") -- }}} diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index 8714faf..7484f3a 100755 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -14,7 +14,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") -- }}} diff --git a/rc.lua.rainbow b/rc.lua.rainbow index e10f2af..8f15111 100755 --- a/rc.lua.rainbow +++ b/rc.lua.rainbow @@ -14,7 +14,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") -- }}} diff --git a/rc.lua.steamburn b/rc.lua.steamburn index 0bf8d01..22890ab 100755 --- a/rc.lua.steamburn +++ b/rc.lua.steamburn @@ -13,7 +13,7 @@ require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local drop = require("scratch.drop") +local drop = require("scratchdrop") local lain = require("lain") -- }}} diff --git a/scratch/init.lua b/scratch/init.lua deleted file mode 100644 index f3b3e7e..0000000 --- a/scratch/init.lua +++ /dev/null @@ -1,14 +0,0 @@ ---------------------------------------------------------------- --- Drop-down applications and scratchpad manager for awesome wm ---------------------------------------------------------------- --- Coded by: * Adrian C. (anrxc) --- Licensed under the WTFPL version 2 --- * http://sam.zoy.org/wtfpl/COPYING ---------------------------------------------------------------- - -local scratch = {} -- module scratch - -scratch.pad = require("scratch.pad") -scratch.drop = require("scratch.drop") - -return scratch diff --git a/scratch/pad.lua b/scratch/pad.lua deleted file mode 100644 index 6a61241..0000000 --- a/scratch/pad.lua +++ /dev/null @@ -1,136 +0,0 @@ ---------------------------------------------------------------- --- Basic scratchpad manager for the awesome window manager ---------------------------------------------------------------- --- Coded by: * Adrian C. (anrxc) --- Licensed under the WTFPL version 2 --- * http://sam.zoy.org/wtfpl/COPYING ---------------------------------------------------------------- --- To use this module add: --- local scratch = require("scratch") --- to the top of your rc.lua, and call: --- scratch.pad.set(c, width, height, sticky, screen) --- from a clientkeys binding, and: --- scratch.pad.toggle(screen) --- from a globalkeys binding. --- --- Parameters: --- c - Client to scratch or un-scratch --- width - Width in absolute pixels, or width percentage --- when <= 1 (0.50 (50% of the screen) by default) --- height - Height in absolute pixels, or height percentage --- when <= 1 (0.50 (50% of the screen) by default) --- sticky - Visible on all tags, false by default --- screen - Screen (optional), mouse.screen by default ---------------------------------------------------------------- - --- Grab environment -local pairs = pairs -local awful = require("awful") -local capi = { - mouse = mouse, - client = client, - screen = screen -} - --- Scratchpad: basic scratchpad manager for the awesome window manager -local pad = {} -- module scratch.pad - -local scratchpad = {} - --- Toggle a set of properties on a client. -local function toggleprop(c, prop) - c.ontop = prop.ontop or false - c.above = prop.above or false - c.hidden = prop.hidden or false - c.sticky = prop.stick or false - c.skip_taskbar = prop.task or false -end - --- Scratch the focused client, or un-scratch and tile it. If another --- client is already scratched, replace it with the focused client. -function pad.set(c, width, height, sticky, screen) - width = width or 0.50 - height = height or 0.50 - sticky = sticky or false - screen = screen or capi.mouse.screen - - -- Determine signal usage in this version of awesome - local attach_signal = capi.client.connect_signal or capi.client.add_signal - local detach_signal = capi.client.disconnect_signal or capi.client.remove_signal - - local function setscratch(c) - -- Scratchpad is floating and has no titlebar - awful.client.floating.set(c, true); awful.titlebar.remove(c) - - -- Scratchpad client properties - toggleprop(c, {ontop=true, above=true, task=true, stick=sticky}) - - -- Scratchpad geometry and placement - local screengeom = capi.screen[screen].workarea - if width <= 1 then width = screengeom.width * width end - if height <= 1 then height = screengeom.height * height end - - c:geometry({ -- Scratchpad is always centered on screen - x = screengeom.x + (screengeom.width - width) / 2, - y = screengeom.y + (screengeom.height - height) / 2, - width = width, height = height - }) - - -- Scratchpad should not loose focus - c:raise(); capi.client.focus = c - end - - -- Prepare a table for storing clients, - if not scratchpad.pad then scratchpad.pad = {} - -- add unmanage signal for scratchpad clients - attach_signal("unmanage", function (c) - for scr, cl in pairs(scratchpad.pad) do - if cl == c then scratchpad.pad[scr] = nil end - end - end) - end - - -- If the scratcphad is emtpy, store the client, - if not scratchpad.pad[screen] then - scratchpad.pad[screen] = c - -- then apply geometry and properties - setscratch(c) - else -- If a client is already scratched, - local oc = scratchpad.pad[screen] - -- unscratch, and compare it with the focused client - awful.client.floating.toggle(oc); toggleprop(oc, {}) - -- If it matches clear the table, if not replace it - if oc == c then scratchpad.pad[screen] = nil - else scratchpad.pad[screen] = c; setscratch(c) end - end -end - --- Move the scratchpad to the current workspace, focus and raise it --- when it's hidden, or hide it when it's visible. -function pad.toggle(screen) - screen = screen or capi.mouse.screen - - -- Check if we have a client on storage, - if scratchpad.pad and - scratchpad.pad[screen] ~= nil - then -- and get it out, to play - local c = scratchpad.pad[screen] - - -- If it's visible on another tag hide it, - if c:isvisible() == false then c.hidden = true - -- and move it to the current worskpace - awful.client.movetotag(awful.tag.selected(screen), c) - end - - -- Focus and raise if it's hidden, - if c.hidden then - awful.placement.centered(c) - c.hidden = false - c:raise(); capi.client.focus = c - else -- hide it if it's not - c.hidden = true - end - end -end - -return pad diff --git a/scratch/drop.lua b/scratchdrop/init.lua similarity index 95% rename from scratch/drop.lua rename to scratchdrop/init.lua index 3168640..e5d91c3 100644 --- a/scratch/drop.lua +++ b/scratchdrop/init.lua @@ -7,9 +7,9 @@ -- * http://sam.zoy.org/wtfpl/COPYING ------------------------------------------------------------------- -- To use this module add: --- local scratch = require("scratch") +-- local scratchdrop = require("scratchdrop") -- to the top of your rc.lua, and call it from a keybinding: --- scratch.drop(prog, vert, horiz, width, height, sticky, screen) +-- scratchdrop(prog, vert, horiz, width, height, sticky, screen) -- -- Parameters: -- prog - Program to run; "urxvt", "gmrun", "thunderbird" @@ -34,7 +34,7 @@ local capi = { } -- Scratchdrop: drop-down applications manager for the awesome window manager -local drop = {} -- module scratch.drop +local scratchdrop = {} -- module scratch.drop local dropdown = {} @@ -130,4 +130,4 @@ function toggle(prog, vert, horiz, width, height, sticky, screen) end end -return setmetatable(drop, { __call = function(_, ...) return toggle(...) end }) +return setmetatable(scratchdrop, { __call = function(_, ...) return toggle(...) end })