Estou tentando usar devilspie2 para detectar quando uma janela do Firefox é aberta e remover suas decorações de janela quando isso acontecer.
Isso funciona, mas somente se a janela já estiver aberta quando o devilspie2 for iniciado; abrindo novas janelas enquanto devilspie2 está rodando não faz nada.
Minha teoria é que o Firefox está mudando o nome do aplicativo rapidamente após a abertura; o problema é que não consigo encontrar uma maneira de monitorar o nome de um aplicativo com rapidez suficiente para descobrir qual é o nome inicial na abertura; Usando as instruções debug incluídas abaixo, ele mostra apenas o 'Nome do Aplicativo' para novas janelas do Firefox, que corresponde ao que eu tenho no meu script.
Aqui está o meu script devilspie2:
-- Matching by application name:
if (get_application_name()=="Firefox") then
undecorate_window();
end
-- Matching by windows that end in "Mozilla Firefox" :
if (End=='' or string.sub(get_window_name(),-string.len("Mozilla Firefox"))=="Mozilla Firefox") then
undecorate_window();
end
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
E aqui está a saída de xprop -spy
:
Benguin ~>xprop -spy
GDK_TIMESTAMP_PROP(GDK_TIMESTAMP_PROP) = 0x61
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x94ca5200
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MOVE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_STICK
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 0, 0
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x2e00023
bitmap id # of mask for icon: 0x2e00029
window id # of group leader: 0x2e00001
_GTK_THEME_VARIANT(UTF8_STRING) =
WM_WINDOW_ROLE(STRING) = "browser"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
XdndAware(ATOM) = BITMAP
_NET_WM_ICON(CARDINAL) = Icon (32 x 32):
---SNIP ASCII GRAPHICS---
Icon (192 x 192):
(not shown)
_NET_WM_OPAQUE_REGION(CARDINAL) =
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 48234529, 48234530
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x2e00020
WM_CLIENT_LEADER(WINDOW): window id # 0x2e00001
_NET_WM_PID(CARDINAL) = 4039
WM_LOCALE_NAME(STRING) = "en_GB.UTF-8"
WM_CLIENT_MACHINE(STRING) = "C0mputer"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified minimum size: 300 by 87
program specified maximum size: 32767 by 32767
program specified base size: 300 by 87
window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "Navigator", "Firefox"
WM_ICON_NAME(STRING) = "Devilspie2 only detects Firefox windows on a restart; how can I fix this? - Unix & Linux Stack Exchange - Mozilla Firefox"
_NET_WM_ICON_NAME(UTF8_STRING) = "Devilspie2 only detects Firefox windows on a restart; how can I fix this? - Unix & Linux Stack Exchange - Mozilla Firefox"
WM_NAME(STRING) = "Devilspie2 only detects Firefox windows on a restart; how can I fix this? - Unix & Linux Stack Exchange - Mozilla Firefox"
_NET_WM_NAME(UTF8_STRING) = "Devilspie2 only detects Firefox windows on a restart; how can I fix this? - Unix & Linux Stack Exchange - Mozilla Firefox"