X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/800d8089ce276ae1b2a3f9875a370b7e00a763db..refs/heads/master:/awesome/bindings.lua diff --git a/awesome/bindings.lua b/awesome/bindings.lua index 8d96009..be64d76 100644 --- a/awesome/bindings.lua +++ b/awesome/bindings.lua @@ -41,14 +41,33 @@ globalkeys = gears.table.join(globalkeys, {description = "show main menu", group = "awesome"}), -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( 1) end, {description = "swap with next client by index", group = "client"}), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( -1) end, {description = "swap with previous client by index", group = "client"}), awful.key({ modkey, }, "#49", function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (chronos) {description = "focus the next screen", group = "screen"}), awful.key({ modkey, }, "=", function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (kinesis) {description = "focus the next screen", group = "screen"}), + awful.key({ modkey, "Control" }, "=", + function () + -- swap tags in screens + local c = client.focus + local this_screen = awful.screen.focused(); + -- TODO: only works with two screens + local next_screen = this_screen:get_next_in_direction("right") or this_screen:get_next_in_direction("left") + local this_screen_tag = this_screen.selected_tag; + local next_screen_tag = next_screen.selected_tag; + + this_screen_tag:swap(next_screen_tag) + + this_screen_tag:view_only() + next_screen_tag:view_only() + + awful.screen.focus(this_screen) + c:jump_to(true) + end, + {description = "swap screens", group = "screen"}), awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative(-1) end, {description = "focus the next screen", group = "screen"}), awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_relative(-1) end, @@ -144,7 +163,16 @@ globalkeys = gears.table.join(globalkeys, -- VimWiki awful.key({ modkey }, "i", function () utils.spawn_terminal("vim -c 'call vimwiki#base#goto_index(v:count1)'", { instance = "vimwiki"}) - end) + end), + -- clipboard + -- requires a little sleep before simulating shift+Insert, otherwise I + -- believe the focus is still on awful and not the current window + awful.key({ modkey }, "\\", function () awful.spawn('xdotool sleep 0.2 key --clearmodifiers shift+Insert') end, + {description = "paste primary selection", group = "awesome"}), + -- utf8 picker + -- TODO: the mapping is similar to kitty's , but worth changing maybe? + awful.key({ modkey, "Shift"}, "u", function () awful.spawn('rofimoji') end, + { description = "select utf8 character", group = "awesome"}) ) -- Client keys {{{1