Skip to content
Snippets Groups Projects
Commit b86d7a7f authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Decide on license and add the rest of keybindings

parent b6d3aa9e
No related branches found
No related tags found
No related merge requests found
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
---- @author AfoHT ---- @author AfoHT
---- @copyright 2020 AfoHT ---- @copyright 2020 AfoHT
---- @license MIT/Apache ---- @license MIT
---- @module taggrid ---- @module taggrid
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
...@@ -89,13 +89,13 @@ end ...@@ -89,13 +89,13 @@ end
-- Jump to the row below in the grid -- Jump to the row below in the grid
function taggrid.viewdown() function taggrid.viewdown()
local tag_offset = taggrid.tag_offset local tag_offset = taggrid.tag_offset
awful.tag.viewidx(-tag_offset) awful.tag.viewidx(tag_offset)
end end
-- Jump to the row above in the grid -- Jump to the row above in the grid
function taggrid.viewup() function taggrid.viewup()
local tag_offset = taggrid.tag_offset local tag_offset = taggrid.tag_offset
awful.tag.viewidx(tag_offset) awful.tag.viewidx(-tag_offset)
end end
-- Shift the currently focused client left -- Shift the currently focused client left
...@@ -170,6 +170,7 @@ end ...@@ -170,6 +170,7 @@ end
-- Shift the focused tag "upwards" in the grid -- Shift the focused tag "upwards" in the grid
function taggrid.shiftup() function taggrid.shiftup()
if client.focus then if client.focus then
local tag_offset = taggrid.tag_offset
local t = awful.screen.focused().selected_tag local t = awful.screen.focused().selected_tag
local curidx = t.index local curidx = t.index
local tag local tag
......
---------------------------------------------------------------------------- --------------------------------------------------------------------------
---- @author AfoHT ---- @author AfoHT
---- @copyright 2020 AfoHT ---- @copyright 2020 AfoHT
---- @license MIT/Apache ---- @license MIT
---- @module globalkeys ---- @module taggridkeys
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Package envronment -- Package envronment
...@@ -22,22 +22,53 @@ function _M.get(globalkeys) ...@@ -22,22 +22,53 @@ function _M.get(globalkeys)
globalkeys = gears.table.join(globalkeys, globalkeys = gears.table.join(globalkeys,
-- View tag only. -- View tag only.
awful.key({ modkey }, "#" .. i + 9, awful.key({ modkey }, "#" .. i + 9,
function () function () taggrid.numviewtag(i) end,
taggrid.numviewtag(i)
end,
{description = "view tag #"..i, group = "tag"}), {description = "view tag #"..i, group = "tag"}),
-- Toggle tag display. -- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9, taggrid.numviewtoggle(i), awful.key({ modkey, "Control" }, "#" .. i + 9,
function () taggrid.numviewtoggle(i) end,
{description = "toggle tag #" .. i, group = "tag"}), {description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag. -- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9, taggrid.numshifttag(i), awful.key({ modkey, "Shift" }, "#" .. i + 9,
function () taggrid.numshifttag(i) end,
{description = "move focused client to tag #"..i, group = "tag"}), {description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client. -- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, taggrid.numtoggletag(i), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function () taggrid.numtoggletag(i) end,
{description = "toggle focused client on tag #" .. i, group = "tag"}) {description = "toggle focused client on tag #" .. i, group = "tag"})
) )
end end
globalkeys = gears.table.join(globalkeys,
-- Switch tag up or down
-- Move down a column
awful.key({ modkey, }, "Down", taggrid.viewdown,
{description = "Jump down one column", group = "tag"}),
-- Move up a column
awful.key({ modkey, }, "Up", taggrid.viewup,
{description = "Jump up one column", group = "tag"}),
-- Shift windows to left or right
-- Shift left
awful.key({ modkey, "Shift" }, ",", taggrid.shiftleft,
{description = "Move tag left", group = "tag"}),
-- Shift right
awful.key({ modkey, "Shift" }, ".", taggrid.shiftright,
{description = "Move tag right", group = "tag"}),
-- Shift left
awful.key({ modkey, "Shift" }, "Left", taggrid.shiftleft,
{description = "Move tag left", group = "tag"}),
-- Shift right
awful.key({ modkey, "Shift" }, "Right", taggrid.shiftright,
{description = "Move tag right", group = "tag"}),
-- Shift windows up or down
awful.key({ modkey, "Shift" }, "Down", taggrid.shiftdown,
{description = "Move tag down", group = "tag"}),
awful.key({ modkey, "Shift" }, "Up", taggrid.shiftup,
{description = "Move tag up", group = "tag"})
)
return globalkeys return globalkeys
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment