Add hook for after startup? #131
-
From scouring StackOverflow I know that I am not the only person with this problem: you have some program you want to run that depends on your login flow actually being complete, or you have a startup program that insists on opening a window and you just want EXWM to close that buffer rather than having to press Neither Is it possible to detect at which point in time EXWM is actually done "doing" stuff and is ready for user input? In which case, can we add a hook for us to use? If not, how do other people solve this problem without resorting to a hard coded five second timer after login? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The If you need to wait for your entire "login flow" to complete, that's not something EXWM is going to be able to do. It doesn't know when autostarted apps are going to be done launching. If you just want to close an app when it first opens a window, you'll have to hook into |
Beta Was this translation helpful? Give feedback.
-
For anyone who might come across this in the future:
Regrettably, EXWM is convinced that the buffer containing the X window is attached to a process and tries to send a SIGHUP to that process. This fails, because As far as I can tell, EXWM provides no utility to force-close a window, so I had to hack the source itself. I actually use something very close to the snippet above:
And then I have simply modified the last few lines of
Not pretty, and it flashes a bunch upon login (especially if you do this to more than one startup program), but it keeps my buffer list clean. |
Beta Was this translation helpful? Give feedback.
The
exwm-init-hook
runs after setting everything up and right before managing existing windows. That should be late enough to start something.If you need to wait for your entire "login flow" to complete, that's not something EXWM is going to be able to do. It doesn't know when autostarted apps are going to be done launching.
If you just want to close an app when it first opens a window, you'll have to hook into
exwm-manage-finish-hook
. At that point, you can look at the current buffer'sexwm-class-name
,exwm-title
, etc. and delete the offending buffer. If you only want this to happen "on startup", you can have the hook delete the buffer then remove itself fromexwm-manage-finish-hook
.