Skip to content

Commit 857fb53

Browse files
committed
Initial commit
Time to clean out the cruft and reset all commits.
0 parents  commit 857fb53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+7690
-0
lines changed

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
emacs/.emacs.d/*
2+
!emacs/.emacs.d/init.el
3+
!emacs/.emacs.d/lisp
4+
mutt/.mutt/*
5+
!mutt/.mutt/sidebar.muttrc
6+
!mutt/.mutt/colors.muttrc
7+
!mutt/.mutt/mailcap
8+
ncmpcpp/.config/ncmpcpp/config.orig
9+
ncmpcpp/.config/ncmpcpp/error.log
10+
scripts/bin/flash
11+
scripts/bin/texcount.pl
12+
vim/.vim/backup/
13+
vim/.vim/bundle/
14+
vim/.vim/.netrwhist
15+
vim/.vim/swap/
16+
vim/.vim/spell/
17+
zsh/.config/zsh/cache/
18+
zsh/.config/zsh/.zcompdump
19+
zsh/.config/zsh/aliases_*
20+
zsh/.config/zsh/bookmarks
21+
zsh/.config/zsh/histfile
22+
23+
**/node_modules
24+
**/\#*\#

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "zsh/.config/zsh/scripts/zsh-plugins"]
2+
path = zsh/.config/zsh/scripts/zsh-plugins
3+
url = https://github.com/jsks/zsh-plugins.git
4+
[submodule "zsh/.config/zsh/scripts/zsh-hl"]
5+
path = zsh/.config/zsh/scripts/zsh-hl
6+
url = https://github.com/zsh-users/zsh-syntax-highlighting

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ~/
2+
3+
Collection of dotfiles and shell scripts. Deployment managed with GNU stow.
4+
5+
```sh
6+
$ git clone --recurse-submodules git://github.com/jsks/dotfiles.git
7+
8+
# Assuming zsh and noglob_dots
9+
$ cd dotfiles; stow -R *(/)
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# revelation.lua
2+
3+
Provides Mac OSX like 'Expose' view of all clients.
4+
5+
## Use
6+
7+
### Installation
8+
(From user's awesome configuration directory, usually ~/.config/awesome)
9+
10+
1. Clone repository:
11+
12+
git clone https://[email protected]/bioe007/awesome-revelation.git
13+
14+
2. put near the top of your rc.lua require("revelation")
15+
3. Make a global keybinding for revelation in your rc.lua:
16+
17+
awful.key({modkey}, "e", revelation)
18+
19+
**NOTE:** Always double check this key binding syntax against the version of
20+
Awesome that you are using.
21+
22+
4. Reload rc.lua and try the keybinding.
23+
24+
It should bring all clients to the current tag and set the layout to fair. You
25+
can focus clients with __cursor__ or __hjkl__ keys then press __Enter__ or
26+
press the mouse right button to select or __Escape__ to abort.
27+
28+
This is a modification of the original awesome library that implemented
29+
expose like behavior.
30+
31+
### Configuration
32+
Revelation's configuration is done through direct access to the module's
33+
`config` table.
34+
35+
There are two basic settings, shown with default values:
36+
37+
-- The name of the tag created for the 'exposed' view
38+
revelation.config.tag_name = 'Revelation'
39+
40+
-- A table of matcher functions (used in client filtering)
41+
revelation.match.exact = awful.rules.match
42+
revelation.match.any = awful.rules.match_any
43+
44+
The rule matching functions must conform to `awful.rules.match` prototypes.
45+
46+
For client matching rules, we follow the same syntax as awful.rules with one
47+
perk; if `rule.any == true`, then we call the `config.match.any` function.
48+
49+
### Examples
50+
All clients:
51+
52+
awful.key({modkey}, "e", revelation)
53+
54+
To match all urxvt terminals:
55+
56+
awful.key({modkey}, "e", function()
57+
revelation({class="URxvt"})
58+
end)
59+
To match clients with class 'foo' or 'bar':
60+
61+
awful.key({modkey}, "e", function()
62+
revelation({
63+
class={"foo", "bar"},
64+
any=true
65+
})
66+
end)
67+
68+
## Credits
69+
70+
### Maintenance
71+
* Perry Hargrave <[email protected]>
72+
73+
### Contributions, many thanks!
74+
* Nikola Petrov <[email protected]>
75+
76+
### Original authors
77+
* Espen Wiborg <[email protected]>
78+
* Julien Danjou <[email protected]>
79+
80+
## License
81+
(c) 2008 Espen Wiborg, Julien Danjou
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
-- revelation.lua
2+
--
3+
-- Library that implements Expose like behavior.
4+
--
5+
-- @author Perry Hargrave [email protected]
6+
-- @author Espen Wiborg [email protected]
7+
-- @author Julien Danjou [email protected]
8+
--
9+
-- @copyright 2008 Espen Wiborg, Julien Danjou
10+
--
11+
12+
local awful = awful
13+
local aw_rules = require('awful.rules')
14+
local pairs = pairs
15+
local setmetatable = setmetatable
16+
local table = table
17+
local capi = {
18+
tag = tag,
19+
client = client,
20+
keygrabber = keygrabber,
21+
mousegrabber = mousegrabber,
22+
mouse = mouse,
23+
screen = screen
24+
}
25+
26+
module("revelation")
27+
28+
config = {
29+
-- Name of expose tag.
30+
tag_name = "Revelation",
31+
32+
-- Match function can be defined by user.
33+
-- Must accept a `rule` and `client` and return `boolean`.
34+
-- The rule forms follow `awful.rules` syntax except we also check the
35+
-- special `rule.any` key. If its true, then we use the `match.any` function
36+
-- for comparison.
37+
match = {
38+
exact = aw_rules.match,
39+
any = aw_rules.match_any
40+
},
41+
}
42+
43+
-- Executed when user selects a client from expose view.
44+
--
45+
-- @param restore Function to reset the current tags view.
46+
function selectfn(restore)
47+
return function(c)
48+
restore()
49+
-- Pop to client tag
50+
awful.tag.viewonly(c:tags()[1], c.screen)
51+
-- Focus and raise
52+
capi.client.focus = c
53+
c:raise()
54+
end
55+
end
56+
57+
-- Tags all matching clients with tag t
58+
-- @param rule The rule. Conforms to awful.rules syntax.
59+
-- @param clients A table of clients to check.
60+
-- @param t The tag to give matching clients.
61+
function match_clients(rule, clients, t)
62+
local mf = rule.any and config.match.any or config.match.exact
63+
for _, c in pairs(clients) do
64+
if mf(c, rule) then
65+
awful.client.toggletag(t, c)
66+
c.minimized = false
67+
end
68+
end
69+
return clients
70+
end
71+
72+
-- Arrow keys and 'hjkl' move focus, Return selects, Escape cancels. Ignores
73+
-- modifiers.
74+
--
75+
-- @param restore a function to call if the user presses escape
76+
-- @return keyboardhandler
77+
function keyboardhandler (restore)
78+
return function (mod, key, event)
79+
if event ~= "press" then return true end
80+
-- translate vim-style home keys to directions
81+
if key == "j" or key == "k" or key == "h" or key == "l" then
82+
if key == "j" then
83+
key = "Down"
84+
elseif key == "k" then
85+
key = "Up"
86+
elseif key == "h" then
87+
key = "Left"
88+
elseif key == "l" then
89+
key = "Right"
90+
end
91+
end
92+
93+
--
94+
if key == "Escape" then
95+
restore()
96+
return false
97+
elseif key == "Return" then
98+
selectfn(restore)(capi.client.focus)
99+
return false
100+
elseif key == "Left" or key == "Right" or
101+
key == "Up" or key == "Down" then
102+
awful.client.focus.bydirection(key:lower())
103+
end
104+
return true
105+
end
106+
end
107+
108+
-- Implement Exposé (ala Mac OS X).
109+
--
110+
-- @param rule A table with key and value to match. [{class=""}]
111+
-- @param s The screen to consider clients of. [mouse.screen].
112+
function expose(rule, s)
113+
local rule = rule or {class=""}
114+
local scr = s or capi.mouse.screen
115+
116+
local t = awful.tag.new({config.tag_name},
117+
scr,
118+
awful.layout.suit.fair)[1]
119+
awful.tag.viewonly(t, t.screen)
120+
match_clients(rule, capi.client.get(scr), t)
121+
local function restore()
122+
awful.tag.history.restore()
123+
t.screen = nil
124+
capi.keygrabber.stop()
125+
capi.mousegrabber.stop()
126+
end
127+
128+
capi.keygrabber.run(keyboardhandler(restore))
129+
130+
capi.mousegrabber.run(function(mouse)
131+
if mouse.buttons[1] == true then
132+
local c = awful.mouse.client_under_pointer()
133+
selectfn(restore)(c)
134+
return false
135+
end
136+
return true
137+
--Strange but on my machine only fleur worked as a string.
138+
--stole it from
139+
--https://github.com/Elv13/awesome-configs/blob/master/widgets/layout/desktopLayout.lua#L175
140+
end,"fleur")
141+
end
142+
143+
setmetatable(_M, { __call = function(_, ...) return expose(...) end })

0 commit comments

Comments
 (0)