diff options
| author | Blista Kanjo | 2023-08-22 12:46:39 -0400 |
|---|---|---|
| committer | Blista Kanjo | 2023-08-22 12:46:39 -0400 |
| commit | 781c466d0de30fe252f2c58e556133d79c3b1b13 (patch) | |
| tree | 8a2f6b1a186f4a03416eb526594e733a3823c995 | |
| parent | fa5747117aea36f914d90b24580416922589fdc9 (diff) | |
refactor: remove redundant comments, move a few keybinds around
| -rw-r--r-- | .config/awesome/rc.lua | 63 |
1 files changed, 29 insertions, 34 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index d79373e..9601d05 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -162,16 +162,12 @@ end) -- }}} -- {{{ wibar - -- keyboard map indicator and switcher mykeyboardlayout = awful.widget.keyboardlayout() - --- {{{ wibar -- create a textclock widget mytextclock = wibox.widget.textclock(" %m/%d (%a) %H%M ") screen.connect_signal("request::desktop_decoration", function(s) - -- Each screen has its own tag table. -- each screen has its own tag table. awful.tag({ " 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 " }, s, awful.layout.layouts[1]) @@ -230,9 +226,8 @@ awful.mouse.append_global_mousebindings({ -- }}} -- {{{ key bindings - --- general awesome keys awful.keyboard.append_global_keybindings({ + -- general awesome keys awful.key({ modkey, }, "s", hotkeys_popup.show_help, { description = "show shortcuts", group = "awesome" }), awful.key({ "Control", "Mod1" }, "Left", awful.tag.viewprev, @@ -249,34 +244,6 @@ awful.keyboard.append_global_keybindings({ { description = "toggle wibar", group = "awesome" } ), - -- move client to prev/next tag and switch to it - awful.key({ modkey, "Shift" }, "Left", - function() - -- get current tag - local t = client.focus and client.focus.first_tag or nil - if t == nil then - return - end - -- get previous tag (modulo 9 excluding 0 to wrap from 1 to 9) - local tag = client.focus.screen.tags[(t.name - 2) % 9 + 1] - client.focus:move_to_tag(tag) - awful.tag.viewprev() - end, - { description = "move client to previous tag and switch to it", group = "tag" }), - awful.key({ modkey, "Shift" }, "Right", - function() - -- get current tag - local t = client.focus and client.focus.first_tag or nil - if t == nil then - return - end - -- get next tag (modulo 9 excluding 0 to wrap from 9 to 1) - local tag = client.focus.screen.tags[(t.name % 9) + 1] - client.focus:move_to_tag(tag) - awful.tag.viewnext() - end, - { description = "move client to next tag and switch to it", group = "tag" }), - -- change window focus in maximized layout awful.key({ modkey, }, "Tab", function() @@ -569,6 +536,34 @@ awful.keyboard.append_global_keybindings({ end, { description = "show the menubar", group = "launcher" }), + -- move client to prev/next tag and switch to it + awful.key({ modkey, "Shift" }, "Left", + function() + -- get current tag + local t = client.focus and client.focus.first_tag or nil + if t == nil then + return + end + -- get previous tag (modulo 9 excluding 0 to wrap from 1 to 9) + local tag = client.focus.screen.tags[(t.name - 2) % 9 + 1] + client.focus:move_to_tag(tag) + awful.tag.viewprev() + end, + { description = "move client to previous tag and switch to it", group = "tag" }), + awful.key({ modkey, "Shift" }, "Right", + function() + -- get current tag + local t = client.focus and client.focus.first_tag or nil + if t == nil then + return + end + -- get next tag (modulo 9 excluding 0 to wrap from 9 to 1) + local tag = client.focus.screen.tags[(t.name % 9) + 1] + client.focus:move_to_tag(tag) + awful.tag.viewnext() + end, + { description = "move client to next tag and switch to it", group = "tag" }), + -- tags manipulation via keyboard number row awful.keyboard.append_global_keybindings({ awful.key { |
