some mishaps fixed; scratch.pad removed; new lain version
This commit is contained in:
parent
b8281fb526
commit
96bc8e2034
|
@ -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
|
||||
=====
|
||||
|
|
2
lain
2
lain
|
@ -1 +1 @@
|
|||
Subproject commit 27a388f374e06b637138b088c956d81fe740a325
|
||||
Subproject commit 2c6a5794b20e757292825450557750df595d1868
|
|
@ -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
|
||||
-- }}}
|
||||
|
||||
|
|
|
@ -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")
|
||||
-- }}}
|
||||
|
|
|
@ -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")
|
||||
-- }}}
|
||||
|
||||
|
|
|
@ -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
|
||||
-- }}}
|
||||
|
||||
|
|
|
@ -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")
|
||||
-- }}}
|
||||
|
||||
|
|
|
@ -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")
|
||||
-- }}}
|
||||
|
||||
|
|
|
@ -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")
|
||||
-- }}}
|
||||
|
||||
|
|
|
@ -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")
|
||||
-- }}}
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
---------------------------------------------------------------
|
||||
-- Drop-down applications and scratchpad manager for awesome wm
|
||||
---------------------------------------------------------------
|
||||
-- Coded by: * Adrian C. (anrxc) <anrxc@sysphere.org>
|
||||
-- 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
|
136
scratch/pad.lua
136
scratch/pad.lua
|
@ -1,136 +0,0 @@
|
|||
---------------------------------------------------------------
|
||||
-- Basic scratchpad manager for the awesome window manager
|
||||
---------------------------------------------------------------
|
||||
-- Coded by: * Adrian C. (anrxc) <anrxc@sysphere.org>
|
||||
-- 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
|
|
@ -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 })
|
Loading…
Reference in New Issue