在 awesome 3.5 中无法正常工作。有什么解决办法吗?
由于我对 awesome 和 lua 还不熟悉,我不知道该怎么做。而且我没有权利对答案发表评论。抱歉重新提出问题。
答案1
awful.key({ modkey, "Control" }, "Left",
function()
for i = 1, screen.count() do
awful.tag.viewprev(i)
end
end ),
awful.key({ modkey, "Control" }, "Right",
function()
for i = 1, screen.count() do
awful.tag.viewnext(i)
end
end ),
在 3.5 的原始帖子中发现。
答案2
为了完整性,这里是 1..9 键的更改:
awful.key({ modkey }, "#" .. i + 9,
function ()
for screen = 1, screen.count() do
local tag = awful.tag.gettags(screen)[i]
if tag then
awful.tag.viewonly(tag)
end
end
end
),
并处理标签列表上的点击:
mytaglist.buttons = awful.util.table.join(
awful.button({ }, 1, function(tag)
local i = awful.tag.getidx(tag)
for screen = 1, screen.count() do
local tag = awful.tag.gettags(screen)[i]
if tag then
awful.tag.viewonly(tag)
end
end
end),
[...]
答案3
对于现在 2023 年的 Awesome 版本 4.3,可以通过在 rc.lua 中进行以下更改来实现,以使用 modkey+# 一次在所有屏幕上切换标签:
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
for s in screen do
--local screen = awful.screen.focused()
local tag = screen[s].tags[i]
if tag then
tag:view_only()
end
end
end,
{description = "view tag #"..i, group = "tag"}),