Merge branch 'master' into develop

Conflicts:
	init.lua
This commit is contained in:
Quan Guo 2014-03-02 22:33:23 +01:00
commit 71f8972809
2 changed files with 52 additions and 40 deletions

View File

@ -5,6 +5,9 @@ Provides Mac OSX like 'Expose' view of all clients.
This is a fork from [revelation](https://github.com/bioe007/awesome-revelation)
It is modified from the original revelation.lua for incorperating with awesome 3.5 or later.
It also have some features.
## Changes since 2014-02-19
* Now the revlation is able to handle the special clients(float, fullscreen or maximized etc.)
* When you select an minimized client, the revelation will un-minimized it and then focuse on it.
## Changes after 2013-12-30
* Now it is possible, in revelation.init({...}), to change the default settings of
@ -47,21 +50,22 @@ is_excluded=true})`.
### Installation
(From user's awesome configuration directory, usually ~/.config/awesome)
1. Clone repository:
1. Clone the repository:
git clone https://github.com/guotsuan/awesome-revelation.git
git clone https://github.com/guotsuan/awesome-revelation revelation
2. put near the top of your rc.lua `local revelation=require("revelation")`
2. Include it at the top of your rc.lua file:
`local revelation=require("revelation")`
3. put the `revelation.init()` after the `beautiful.init()`
3. Add `revelation.init()` after `beautiful.init()`
3. Make a global keybinding (ModKey + e) for revelation in your rc.lua:
3. Define a global keybinding (e. g. `ModKey + e`) for revelation in your rc.lua:
globalkeys = awful.util.table.join(
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
awful.key({ modkey}, "e", revelation), -- Insert this line
==> awful.key({ modkey, }, "e", revelation),
awful.key({ modkey, }, "j",
function ()
@ -69,16 +73,15 @@ is_excluded=true})`.
if client.focus then client.focus:raise() end
end),
**NOTE:** Always double check this key binding syntax against the version of
Awesome that you are using.
**NOTE:** Always double check the key binding syntax against the version of
Awesome which you are using.
4. Reload rc.lua and try the keybinding __Modkey + e__
4. Restart Awesome (usually __Modkey + Control + r__) and try the keybinding __Modkey + e__.
It should bring all clients to the current tags on all screens and set the layout to fair.
You can focus clients with __cursor__ then press the __left__ button to select, or you can
direct focus on the client by pressing the corresponding key shown in the hint box.
Press the mouse right button to zoom the client
or __Escape__ to abort.
It should bring up all clients from the current tags on all screens and set the layout to fair.
You can focus clients with the __cursor__ keys, and then press the __left__ button to select,
or you can directly focus a client by pressing the corresponding key shown in the hint box.
Press the right mouse button to zoom the client or __Escape__ to abort.
### Configuration
Revelation's configuration is done through the init() function

View File

@ -132,22 +132,12 @@ function revelation.expose(args)
local t={}
local zt={}
local tags_status
local k,v
for scr=1,capi.screen.count() do
all_tags = awful.tag.gettags(scr)
tags_status={}
local k,v
for k,v in pairs(all_tags) do
tags_status[v] = v.activated
--debuginfo(v)
end
revelation.tags_status[scr] = tags_status
t[scr] = awful.tag.new({revelation.tag_name},
scr,
awful.layout.suit.fair)[1]
@ -162,10 +152,6 @@ function revelation.expose(args)
match_clients(rule, capi.client.get(scr), t[scr], is_excluded)
end
for k,v in pairs(all_tags) do
v.activated =false
--debuginfo(v)
end
awful.tag.viewonly(t[scr], t.screen)
end
@ -186,20 +172,14 @@ function revelation.expose(args)
local function restore()
local k,v
for scr=1, capi.screen.count() do
for k,v in pairs(revelation.tags_status[scr]) do
k.activated = v
--debuginfo(v)
end
awful.tag.history.restore(scr)
t[scr].screen = nil
--zt[scr].screen = nil
end
capi.keygrabber.stop()
capi.mousegrabber.stop()
for scr=1, capi.screen.count() do
t[scr].activated = false
zt[scr].activated = false
end
local clients
@ -230,14 +210,48 @@ function revelation.expose(args)
for i,j in pairs(hintindex) do
hintbox[i].visible = false
end
end
local zoomed = false
local zoomedClient = nil
local keyPressed = false
capi.keygrabber.run(function (mod, key, event)
local c = nil
local keyPressed = false
if event == "release" then return true end
--if awful.util.table.hasitem(mod, "Shift") then
--debuginfo("dogx")
--debuginfo(string.lower(key))
--end
if awful.util.table.hasitem(mod, "Shift") then
if keyPressed then
keyPressed = false
else
c = hintindex[string.lower(key)]
if not zoomed and c ~= nil then
awful.tag.viewonly(zt[capi.mouse.screen], capi.mouse.screen)
awful.client.toggletag(zt[capi.mouse.screen], c)
zoomedClient = c
zoomed = true
elseif zoomedClient ~= nil then
awful.tag.history.restore(capi.mouse.screen)
awful.client.toggletag(zt[capi.mouse.screen], zoomedClient)
zoomedClient = nil
zoomed = false
end
end
end
if hintindex[key] then
--client.focus = hintindex[key]
--hintindex[key]:raise()
selectfn(restore)(hintindex[key])
for i,j in pairs(hintindex) do
@ -261,8 +275,6 @@ function revelation.expose(args)
local pressedMiddle = false
local pressedRight = false
local zoomed = false
local zoomedClient = nil
capi.mousegrabber.run(function(mouse)
local c = awful.mouse.client_under_pointer()
@ -295,10 +307,6 @@ function revelation.expose(args)
end
end
--for i,j in pairs(hintindex) do
--hintbox[i].visible = false
--end
return true
--Strange but on my machine only fleur worked as a string.
--stole it from
@ -307,6 +315,7 @@ function revelation.expose(args)
end
-- Create the wiboxes, but don't show them
--
function revelation.init(args)
hintsize = 60
local fontcolor = beautiful.fg_normal