From 55b7cf10e452783b6ee11cd8a03fafd85792afd7 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 26 Feb 2023 01:40:15 +0100 Subject: =?UTF-8?q?Add=20ghost=20workspace=20=F0=9F=91=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rc.lua | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) (limited to 'rc.lua') diff --git a/rc.lua b/rc.lua index 5e2ec1d..7194651 100644 --- a/rc.lua +++ b/rc.lua @@ -114,7 +114,7 @@ end awful.screen.connect_for_each_screen(function(s) - awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1]) + awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", " " }, s, awful.layout.layouts[1]) s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(awful.util.table.join( @@ -769,9 +769,31 @@ awful.key({ modkey, "Shift" }, "s", hotkeys_popup.show_help, {descriptio {description = "Screenshot selection", group = "awesome"}), - awful.key({ modkey, }, "Left", awful.tag.viewprev, + awful.key({ modkey, }, "Left", + function () + local screen = awful.screen.focused() + local tag = screen.tags[1] + local lastTag = screen.tags[9] + + if tag == awful.tag.selected(1) then + lastTag:view_only() + else + awful.tag.viewprev() + end + end, {description = "Previous", group = "tag"}), - awful.key({ modkey, }, "Right", awful.tag.viewnext, + awful.key({ modkey, }, "Right", + function () + local screen = awful.screen.focused() + local tag = screen.tags[9] + local firstTag = screen.tags[1] + + if tag == awful.tag.selected(1) then + firstTag:view_only() + else + awful.tag.viewnext() + end + end, {description = "Next", group = "tag"}), awful.key({ modkey, "Control" }, "Left", function() awful.screen.focus_relative(-1) end, {description = "Next screen", group = "awesome"}), @@ -1131,11 +1153,38 @@ for i = 1, 9 do end end end --[[, {description = "toggle focused client on tag #" .. i, group = "tag"}--]]), + + awful.key({ modkey, "Mod1"}, "p", function () pomodoro:toggle() end), awful.key({ modkey, "Shift" }, "p", function () pomodoro:finish() end) ) end +globalkeys = awful.util.table.join(globalkeys, + -- Move only last tag. + awful.key({ modkey }, "Delete", + function () + local screen = awful.screen.focused() + local tag = screen.tags[10] + if tag then + tag:view_only() + end + end + ), + -- Move client to tag. + awful.key({ modkey, "Shift" }, "Delete", + function () + if client.focus then + local tag = client.focus.screen.tags[10] + if tag then + client.focus:move_to_tag(tag) + end + end + end + ) +) + + -- cgit v1.2.3