无需重新启动 awesome 就可以更改标签名称吗?
至少,我可以运行某些程序来改变名称并重新加载。
答案1
您可以绑定这样的键(将其添加到globalkeys
部分):
awful.key({ modkey, "Shift", }, "F2", function ()
awful.prompt.run({ prompt = "Rename tab: ", text = awful.tag.selected().name, },
mypromptbox[mouse.screen].widget,
function (s)
awful.tag.selected().name = s
end)
end),
还可以创建一个 shell 脚本,使用 zenity 来请求新标签:https://gist.github.com/blueyed/9404320 (这有点尴尬,我希望从外部访问这个很棒的 API 会更容易一些)。
答案2
改编自 blueyed 的答案,但对于 awesome 4 ,请将其添加到全局键部分:
awful.key({ modkey, "Shift", }, "F2",
function ()
awful.prompt.run {
prompt = "rename current tag: ",
text = awful.tag.selected().name,
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = function (s) awful.tag.selected().name = s end,
}
end,
{description = "rename tag", group = "awesome"}),