Awesome wmから履歴の前のウィンドウに移動するには?

Awesome wmから履歴の前のウィンドウに移動するには?

Alt+Tab私はwmを初めて使用し、現在のタブ、他のタブ、または別の画面(GnomeやWindowsなど)にあっても、前のウィンドウ(履歴)に戻るショートカットを設定したいと思います。

デフォルトでは戻りは可能ですSuper+Tabが、同じタグのみが可能です。

Super+Esc前のアクティブタブに戻ることができます。

前のウィンドウに移動する(グローバル)関数がない場合rc.lua(Luaを知っている場合)、自分で書くことはできますか?

ベストアンサー1

以下を使用して履歴リストに直接アクセスできます。 awful.client.focus.history.list

テーブルの最初の要素は現在集中しているクライアントなので、2 は前の要素です。

クライアントから最初のタグを取得するこのタグの表示

その後、クライアントを持ち上げて一番上に来ます。

function ()                                                                                                  
    local c = awful.client.focus.history.list[2]                                                             
    client.focus = c                                                                                         
    local t = client.focus and client.focus.first_tag or nil                                                 
    if t then                                                                                                
        t:view_only()                                                                                        
    end                                                                                                      
    c:raise()                                                                                                
end  

したがって、rc.luaで変更できます

    awful.key({ modkey,           }, "Tab",
        function ()
            awful.client.focus.history.previous()
            if client.focus then
                client.focus:raise()
            end
        end,
        {description = "go back", group = "client"}),

到着

    awful.key({ modkey,           }, "Tab",
        function ()
            local c = awful.client.focus.history.list[2]
            client.focus = c
            local t = client.focus and client.focus.first_tag or nil
            if t then
                t:view_only()
            end
            c:raise()
        end,
        {description = "go back", group = "client"}),

おすすめ記事