簡體   English   中英

很棒的 wm,保持應用程序的焦點異常

[英]Awesome wm, keep focus exception for an application

在很棒的 wm 中,我使用 gmrun,一個小型應用程序啟動器。

{ rule = { class = "Gmrun" },
  properties = { floating = true, ontop = true, focus = true }, callback = function(c) c:geometry({x=30, y=45}) end},

這是我對所有客戶部分的規則

awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
  properties = { border_width = beautiful.border_width,
                 border_color = beautiful.border_normal,
                 focus = awful.client.focus.filter,
                 raise = true,
                 keys = clientkeys,
                 size_hints_honor = false,
                 buttons = clientbuttons }, callback = awful.client.setslave },

我希望 gmrun 始終保持焦點(規則的一個例外,通常是新打開的客戶端獲得焦點)我已經閱讀了這個頁面,但沒有找到解決方案, 始終在頂部窗口並保持焦點,在AwesomeWM提前致謝

創建自定義焦點過濾器功能

local free_focus = true
local function custom_focus_filter(c) return free_focus and awful.client.focus.filter(c) end

編輯您的主要規則

awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { ....
                     focus = custom_focus_filter,
                     .... } },

和 gmrun 規則

{ rule = { class = "Gmrun" },
  properties = { floating = true, ontop = true, focus = true },
  callback = function(c)
      c:geometry({x=30, y=45})
      free_focus = false
      c:connect_signal("unmanage", function() free_focus = true end)
  end },

此外,您可能需要編輯配置中使用client.focus =每個位置(例如,草率焦點、客戶端按鈕)。 例如

clientbuttons = awful.util.table.join(
    awful.button({ }, 1, function (c) if custom_focus_filter(c) then client.focus = c; c:raise() end end),
    ....

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM