keybind update

This commit is contained in:
anakha 2021-06-11 01:28:10 -04:00
parent acd45beef5
commit 9a74ba0622
2 changed files with 43 additions and 18 deletions

View File

@ -27,8 +27,8 @@ root.keys(gears.table.join(config.globalkeys, machina.keys))
default shortcuts are:
```lua
modkey + p : next in region
modkey + o : prev in region
modkey + [ : prev in region
modkey + ] : next in region
modkey + insert : move top left
modkey + delete : move bottom left

View File

@ -3,6 +3,7 @@
local gears = require("gears")
local awful = require("awful")
local modkey = "Mod4"
local show_desktop = true
local function tablelength(T)
local count = 0
@ -10,6 +11,7 @@ local function tablelength(T)
return count
end
--------------------------------------------------------------> methods -- ;
local function region_tablist()
@ -65,7 +67,20 @@ local keys = gears.table.join(
----------------------> SHUFFLE <----------------------
awful.key({modkey}, "p", function ()
awful.key({modkey}, "[", function ()
local tablist = region_tablist()
local prev_client = nil
for i = #tablist, 1, -1 do
prev_client = tablist[i]
prev_client:emit_signal("request::activate", "mouse_enter",{raise = true})
break
--+ activate previous client
end
end),
----+ shortcut: shuffle back
awful.key({modkey}, "]", function ()
local tablist = region_tablist()
local next_client = nil
@ -77,20 +92,8 @@ local keys = gears.table.join(
--+ activate next client
end
end),
----+ shortcut: shuffle down
----+ shortcut: shuffle forward
awful.key({modkey}, "o", function ()
local tablist = region_tablist()
local prev_client = nil
for i = #tablist, 1, -1 do
prev_client = tablist[i]
prev_client:emit_signal("request::activate", "mouse_enter",{raise = true})
break
--+ activate previous client
end
end),
----+ shortcut: shuffle up
----------------------> PLACEMENT <----------------------
@ -101,7 +104,7 @@ local keys = gears.table.join(
awful.placement.top_right(client.focus)
client.focus:raise()
end),
----+ shortcut: align top-right
----+ shortcut: align top-right
awful.key({modkey}, "Page_Down", function ()
if not client.focus then return false end
@ -168,6 +171,24 @@ local keys = gears.table.join(
client.focus:raise()
end)
----+ shortcut: stack friendly up
----------------------> MISC <----------------------
-- awful.key({modkey}, "F9", function ()
-- if show_desktop then
-- awful.tag.viewnone()
-- show_desktop = false
-- return false
-- end
-- if not show_desktop then
-- awful.tag.viewtoggle()
-- return false
-- end
-- end)
----+ shortcut: stack friendly up
)
--------------------------------------------------------------> exports -- ;
@ -177,4 +198,8 @@ local module = {
tablist = tablist
}
return module
return module
-- todo: add show desktop either via viewnone or this other one
-- https://www.reddit.com/r/awesomewm/comments/nvz3cn/show_desktop_function/