You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.1 KiB
62 lines
2.1 KiB
-- Static set of tags that you find in the default awesomewm config
|
|
local awful = require("awful")
|
|
local gears = require("gears")
|
|
awful.screen.connect_for_each_screen(function(s)
|
|
-- Clear tags
|
|
for _, tag in pairs(s.tags) do
|
|
tag:delete()
|
|
end
|
|
-- Add 9 default tags
|
|
awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, s,
|
|
awful.layout.suit.floating)
|
|
end)
|
|
-- keybindings for tags
|
|
local keys = root.keys()
|
|
keys = gears.table.join(keys,
|
|
awful.key({global.modkey}, "Left",
|
|
awful.tag.viewprev,
|
|
{description = "view next tag", group = "tag"}),
|
|
awful.key({global.modkey}, "Right",
|
|
awful.tag.viewnext,
|
|
{description = "view previous tag", group = "tag"}))
|
|
|
|
for i = 1,9 do
|
|
keys = gears.table.join(keys,
|
|
awful.key({global.modkey}, "#"..i+9,
|
|
function()
|
|
local tag = awful.screen.focused().tags[i]
|
|
if tag then
|
|
tag:view_only()
|
|
end
|
|
end,
|
|
{description = "view tag #"..i, group = "tag"}),
|
|
awful.key({global.modkey, "Control"}, "#"..i+9,
|
|
function()
|
|
local tag = awful.screen.focused().tags[i]
|
|
if tag then
|
|
awful.tag.viewtoggle(tag)
|
|
end
|
|
end,
|
|
{description = "toggle tag #"..i, group = "tag"}),
|
|
awful.key({global.modkey, "Shift"}, "#"..i+9,
|
|
function()
|
|
if client.focus then
|
|
local tag = awful.screen.focused().tags[i]
|
|
if tag then
|
|
client.focus:move_to_tag(tag)
|
|
end
|
|
end
|
|
end,
|
|
{description = "move client to tag #"..i, group = "tag"}),
|
|
awful.key({global.modkey, "Shift", "Control"}, "#"..i+9,
|
|
function()
|
|
if client.focus then
|
|
local tag = awful.screen.focused().tags[i]
|
|
if tag then
|
|
client.focus:move_to_tag(tag)
|
|
end
|
|
end
|
|
end,
|
|
{description = "toggle client on tag #"..i, group = "tag"}))
|
|
end
|
|
root.keys(keys)
|