Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created September 5, 2023 04:15
Show Gist options
  • Save naranyala/ddab521f587264d6034a92d97dfc84da to your computer and use it in GitHub Desktop.
Save naranyala/ddab521f587264d6034a92d97dfc84da to your computer and use it in GitHub Desktop.
best experience
-- ultimate productivity
for i = 1, 9 do
global_keys = gears.table.join(
global_keys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9, function()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end, { description = "view tag #" .. i, group = "tag" }),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9, function()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end, { description = "toggle tag #" .. i, group = "tag" }),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9, function()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end, { description = "move focused client to tag #" .. i, group = "tag" }),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end, { description = "toggle focused client on tag #" .. i, group = "tag" })
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment