Configuration

讓 KeepassX 在 i3wm 中浮動

  • February 7, 2017

我想在 i3wm 中以浮動模式啟動 keepassX。我的.config/i3/config包含該行

for_window [class="keepassx"] floating enable

和 xprop

xprop 
_NET_WM_USER_TIME(CARDINAL) = 7578932
WM_STATE(WM_STATE):
       window state: Normal
       icon window: 0x0
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 29360143
_NET_WM_ICON(CARDINAL) =    Icon (64 x 64):


XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
_NET_WM_NAME(UTF8_STRING) = "myKeys.kdbx - KeePassX"
WM_CLIENT_LEADER(WINDOW): window id # 0x1c00005
_NET_WM_PID(CARDINAL) = 26787
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NAME(STRING) = "Keys.kdbx - KeePassX"
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "keepassx", "Keepassx"
WM_HINTS(WM_HINTS):
       Client accepts input or input focus: True
       Initial state is Normal State.
       bitmap id # to use for icon: 0x1c0000b
       window id # of group leader: 0x1c00005
WM_NORMAL_HINTS(WM_SIZE_HINTS):
       user specified location: 960, 22
       program specified location: 960, 22
       user specified size: 956 by 1033
       program specified size: 956 by 1033
       program specified minimum size: 640 by 517
       window gravity: NorthWest
WM_CLIENT_MACHINE(STRING) = "nautilus"
WM_COMMAND(STRING) = { "keepassx" }

我也試過命令

 for_window [instance="keepassx"] floating enable

如何使 keepassX 始終以浮動模式執行?

正如 Adaephon 所說,您只是看錯了字元串。其他一切都應該沒問題。

您想按類區分,所以讓我們看看您的 xprop:

WM_CLASS(STRING) = "keepassx", "Keepassx"

該行定義如下:

WM_CLASS(STRING) = instance, class

如您所見,您想 float keepassx,但課程是Keepassx

有兩種解決方案適合您:

  1. 使用for_window [class="Keepassx"] floating enable, 因為這指的是正確的類名。
  2. 使用for_window [class="(?i)keepassx"] floating enable,這意味著搜尋的字元串將區分大小寫。

請記住,您還可以for_window與其他屬性一起使用,例如name,instance等。

編輯:我再次閱讀了他的評論,是的,他應該是對的:再次查看您的配置以刪除該行之後,另一個可能會禁用特定或每個視窗的浮動模式的配置。

引用自:https://unix.stackexchange.com/questions/342715