]> git.madduck.net Git - etc/awesome.git/blob - Utilities.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Updated Utilities (markdown)
[etc/awesome.git] / Utilities.md
1 [<- home](https://github.com/copycat-killer/lain/wiki)
2
3 menu\_clients\_current\_tags
4 ----------------------------
5
6 Similar to `awful.menu.clients()`, but this menu only shows the clients
7 of currently visible tags. Use it with a key binding like this:
8
9     awful.key({ "Mod1" }, "Tab", function()
10         awful.menu.menu_keys.down = { "Down", "Alt_L", "Tab", "j" }
11         awful.menu.menu_keys.up = { "Up", "k" }
12         lain.util.menu_clients_current_tags({ width = 350 }, { keygrabber = true })
13     end),
14
15 magnify\_client
16 ---------------
17
18 Set a client to floating and resize it in the same way the "magnifier"
19 layout does it. Place it on the "current" screen (derived from the mouse
20 position). This allows you to magnify any client you wish, regardless of
21 the currently used layout. Use it with a client keybinding like this:
22
23         clientkeys = awful.util.table.join(
24                 ...
25                 awful.key({ modkey, "Control" }, "m", lain.util.magnify_client),
26                 ...
27         )
28
29 If you want to "de-magnify" it, just reset the clients floating state to
30 `false` (hit `Mod4`+`CTRL`+`Space`, for example).
31
32 niceborder\_{focus, unfocus}
33 ----------------------------
34
35 By default, your `rc.lua` contains something like this:
36
37         client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
38         client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
39
40 You can change it to this:
41
42         client.connect_signal("focus", lain.util.niceborder_focus(c))
43         client.connect_signal("unfocus", lain.util.niceborder_unfocus(c))
44
45 Now, when a client is focused or unfocused, Awesome will look up its
46 nice value in `/proc/<pid>/stat`. If it's less than 0, the client is
47 classified as "high priority"; if it's greater than 0, the client is
48 classified as "low priority". If it's equal to 0, nothing special
49 happens.
50
51 This requires to define additional colors in your `theme.lua`. For example:
52
53         theme.border_focus_highprio  = "#FF0000"
54         theme.border_normal_highprio = "#A03333"
55
56         theme.border_focus_lowprio   = "#3333FF"
57         theme.border_normal_lowprio  = "#333366"
58
59 tag\_view\_nonempty
60 -------------------
61
62 This function lets you jump to the next/previous non-empty tag.
63 It takes two arguments:
64
65 * `direction`: `1` for next non-empty tag, `-1` for previous.
66 * `sc`: Screen which the taglist is in. Default is `mouse.screen` or `1`. This
67   argument is optional.
68
69 You can use it with key bindings like these:
70
71     -- Non-empty tag browsing
72     awful.key({ altkey }, "Left", function () lain.util.tag_view_nonempty(-1) end),
73     awful.key({ altkey }, "Right", function () lain.util.tag_view_nonempty(1) end),
74
75 where `altkey = "Mod1"`.
76
77 prompt\_rename\_tag
78 -------------------
79
80 This function enables you to dynamically rename the current tag you have focused.
81
82 You can use it with a key binding like this:
83
84     awful.key({ modkey, "Shift" }, "r", function () lain.util.prompt_rename_tag(mypromptbox) end)
85
86 Credits goes to [minism](https://bbs.archlinux.org/viewtopic.php?pid=1315135#p1315135).