【问题标题】:How to keep focusing on the client after it's moved to a new tag in Awesome WM?在 Awesome WM 中移动到新标签后如何继续关注客户端?
【发布时间】:2022-02-23 01:12:28
【问题描述】:

如何使 Awesome 的窗口(客户端)移动行为类似于 DWM's ViewonTag patch

跟随一个窗口找到它被移动到的标签。

补丁 20210312 防止窗口在被移动时被跟随 到“全部”标签。

我应该在这里写什么代码?

        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)
                            ---   ???????? ---
                            ---   How to follow the client window? ---
                          end
                     end
                  end,
                  {description = "move focused client to tag #"..i, group = "tag"}),

【问题讨论】:

    标签: awesome-wm


    【解决方案1】:

    经过多次尝试,我解决了这个问题。但是不知道为什么需要声明变量screen和tag2。为什么不能使用tag:view_only()

    -- 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)
                    local screen = awful.screen.focused()
                    local tag2 = screen.tags[i]
                    tag2:view_only()
                end
            end
        end,
        { description = "move focused client to tag #"..i, group = "tag" }
    ),
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多