diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index f71c6fc55..fb4edb7c3 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -235,8 +235,7 @@ function client.tiled(screen) end --- Get a client by its relative index to the focused window. --- @usage Set i to 1 to get next, -1 to get previous. --- @param i The index. +-- @param i The index. Use 1 to get next, -1 to get previous. -- @param c Optional client. -- @return A client, or nil if no client is available. function client.next(i, c) @@ -928,16 +927,15 @@ end -- index of the currently focused client. -- @param s which screen to use. nil means all screens. -- --- @usage e.g.: un-minimize all urxvt instances ---
--- local urxvt = function (c)
--- return awful.rules.match(c, {class = "URxvt"})
--- end
---
--- for c in awful.client.iterate(urxvt) do
--- c.minimized = false
--- end
---
Switch to a client matching the given condition if running, else spawn it. +-- Switch to a client matching the given condition if running, else spawn it. +-- -- If multiple clients match the given condition then the next one is --- focussed.
+-- focussed. -- -- @param cmd the command to execute -- @param matcher a function that returns true to indicate a matching client -- @param merge if true then merge tags when clients are not visible -- --- @usage run or raise urxvt (perhaps, with tabs) on modkey + semicolon ---
--- awful.key({ modkey, }, 'semicolon', function ()
--- local matcher = function (c)
--- return awful.rules.match(c, {class = 'URxvt'})
--- end
+-- @usage
+-- -- run or raise urxvt (perhaps, with tabs) on modkey + semicolon
+-- awful.key({ modkey, }, 'semicolon', function ()
+-- local matcher = function (c)
+-- return awful.rules.match(c, {class = 'URxvt'})
+-- end
-- awful.client.run_or_raise('urxvt', matcher)
-- end);
---
false
to pass the events to the next
+-- keygrabber in the stack.
-- @param g The key grabber callback that will get the key events until it will be deleted or a new grabber is added.
--- @return the given callback `g`
--- @usage The following function can be bound to a key, and used to resize a client
--- using keyboard.
+-- @return the given callback g
.
+-- @usage
+-- -- The following function can be bound to a key, and be used to resize a
+-- -- client using the keyboard.
--
-- function resize(c)
-- local grabber = awful.keygrabber.run(function(mod, key, event)
-- if event == "release" then return end
--
--- if key == 'Up' then awful.client.moveresize(0, 0, 0, 5, c)
--- elseif key == 'Down' then awful.client.moveresize(0, 0, 0, -5, c)
+-- if key == 'Up' then awful.client.moveresize(0, 0, 0, 5, c)
+-- elseif key == 'Down' then awful.client.moveresize(0, 0, 0, -5, c)
-- elseif key == 'Right' then awful.client.moveresize(0, 0, 5, 0, c)
-- elseif key == 'Left' then awful.client.moveresize(0, 0, -5, 0, c)
-- else awful.keygrabber.stop(grabber)
-- end
---
-- end)
-- end
function keygrabber.run(g)
diff --git a/lib/awful/menu.lua.in b/lib/awful/menu.lua.in
index 6d3a403ca..eccf3e882 100644
--- a/lib/awful/menu.lua.in
+++ b/lib/awful/menu.lua.in
@@ -593,30 +593,29 @@ end
-- match_any
instead of match
, menu of clients with
--- different classes can also be build.
+-- @usage -- The following function builds and shows a menu of clients that match
+-- -- a particular rule.
+-- -- Bound to a key, it can be used to select from dozens of terminals open on
+-- -- several tags.
+-- -- When using @{awful.rules.match_any} instead of @{awful.rules.match},
+-- -- a menu of clients with different classes could be build.
--
---
--- function terminal_menu ()
--- terms = {}
--- for i, c in pairs(client.get()) do
--- if awful.rules.match(c, {class = "URxvt"}) then
--- terms[i] =
--- {c.name,
--- function()
--- awful.tag.viewonly(c:tags()[1])
--- client.focus = c
--- end,
--- c.icon
--- }
--- end
--- end
--- awful.menu(terms):show()
--- end
---
The following readline keyboard shortcuts are implemented as expected:
+-- CTRL+A, CTRL+B, CTRL+C, CTRL+D, +-- CTRL+E, CTRL+J, CTRL+M, CTRL+F, +-- CTRL+H, CTRL+K, CTRL+U, CTRL+W, +-- CTRL+BACKSPACE, SHIFT+INSERT, HOME, +-- END and arrow keys. +--The following shortcuts implement additional history manipulation commands +-- where the search term is defined as the substring of the command from first +-- character to cursor position.
+--CTRL+R
: reverse history search, matches any history entry
+-- containing search term.CTRL+S
: forward history search, matches any history entry
+-- containing search term.CTRL+UP
: ZSH up line or search, matches any history entry
+-- starting with search term.CTRL+DOWN
: ZSH down line or search, matches any history
+-- entry starting with search term.CTRL+DELETE
: delete the currently visible history entry from
+-- history file.
+-- This does not delete new commands or history entries under user editing.fg_cursor
,
+-- bg_cursor
, ul_cursor
, prompt
,
+-- text
, selectall
, font
,
+-- autoexec
.
-- @param textbox The textbox to use for the prompt.
--- @param exe_callback The callback function to call with command as argument when finished.
+-- @param exe_callback The callback function to call with command as argument
+-- when finished.
-- @param completion_callback The callback function to call to get completion.
--- @param history_path Optional parameter: file path where the history should be saved, set nil to disable history
--- @param history_max Optional parameter: set the maximum entries in history file, 50 by default
--- @param done_callback Optional parameter: the callback function to always call without arguments, regardless of whether the prompt was cancelled.
--- @param changed_callback Optional parameter: the callback function to call with command as argument when a command was changed.
--- @param keypressed_callback Optional parameter: the callback function to call with mod table, key and command as arguments when a key was pressed.
--- @usage The following readline keyboard shortcuts are implemented as expected:
--- CTRL+A
CTRL+B
CTRL+C
CTRL+D
CTRL+E
CTRL+J
CTRL+M
CTRL+F
CTRL+H
CTRL+K
CTRL+U
CTRL+W
CTRL+BASKPACE
SHIFT+INSERT
HOME
END
CTRL+R
: reverse history search, matches any history entry containing search termCTRL+S
: forward history search, matches any history entry containing search termCTRL+UP
: ZSH up line or search, matches any history entry starting with search termCTRL+DOWN
: ZSH down line or search, matches any history entry starting with search termCTRL+DELETE
: delete the currently visible history entry from history file.
--- function resize(c)
--- keygrabber.run(function(mod, key, event)
--- if event == "release" then return end
+-- @usage
+-- -- The following function can be bound to a key, and used to resize a client
+-- -- using the keyboard.
+-- function resize(c)
+-- keygrabber.run(function(mod, key, event)
+-- if event == "release" then return end
--
--- if key == 'Up' then awful.client.moveresize(0, 0, 0, 5, c)
--- elseif key == 'Down' then awful.client.moveresize(0, 0, 0, -5, c)
--- elseif key == 'Right' then awful.client.moveresize(0, 0, 5, 0, c)
--- elseif key == 'Left' then awful.client.moveresize(0, 0, -5, 0, c)
--- else keygrabber.stop()
--- end
---
--- end)
--- end
---