【问题标题】:how to focus on specific client window如何专注于特定的客户端窗口
【发布时间】:2016-08-30 03:05:29
【问题描述】:

我如何通过按 Alt-1 到第一个窗口、Alt-2 到第二个窗口等等来专注于真棒窗口管理器中的特定客户端?我制作了这个脚本,但它不能正常工作,它会选择随机窗口:

awful.key({"Mod1"            }, "1",
    function ()
        awful.client.focus.byidx(1)
        if client.focus then
            client.focus:raise()
        end
    end         ),
awful.key({"Mod1"            }, "2",
    function ()
        awful.client.focus.byidx(2)
        if client.focus then
            client.focus:raise()
        end
    end         ),
awful.key({"Mod1"            }, "3",
    function ()
        awful.client.focus.byidx(3)
        if client.focus then
            client.focus:raise()
        end
    end         ),

【问题讨论】:

    标签: awesome-wm


    【解决方案1】:

    对于 3.5.6

    awful.key({"Mod1"            }, "2",
        function ()
            local cc = {}
            for _, c in ipairs(client.get()) do
                if awful.widget.tasklist.filter.currenttags(c, mouse.screen) then cc[#cc + 1] = c end
            end
            local new_focused = cc[2]
            if new_focused then client.focus = new_focused; new_focused:raise() end
        end
    ),
    

    【讨论】:

      猜你喜欢
      • 2019-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-20
      • 1970-01-01
      • 2011-04-21
      • 2014-12-26
      相关资源
      最近更新 更多