-
-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: add exec-shutdown for running commands on shutdown #7683
Conversation
@Trimutex I tried it. doesnt really work(I tried hyprctl clients > ~/asdf, which reads "Couldn't read (5)". I think But anyways. I don't know how would I continue this... But, I hope we can add a exec-pre-shutdown and a exec-post-shutdown. the pre one for first immediate action before any window gets destroyed or anything(e.g. to save info like hyprctl clients, but im not sure if this not working is becuz the IPC shuts down?). But thank you for giving it a go! Hope we can find a solution soon |
@littleblack111 this should provide what you are looking for now I think |
@Trimutex is there any way to make it execute it when is shutdown not via hyprctl dispatch exit? I tried sigterm, it doenst execute it. |
I'm a little confused about this. Are you asking for it to be handled post-hyprland-shutdown or as its resetting the variables? |
so, if I shut off hyprland via the the exit dispatcher. it will execute. but any other way(reboot, soft-reboot, restart display manager) will not trigger it. |
The closest you can come to that is a wrapper for Hyprland in a script I think. This seems like a bit of an XY problem to me tho |
If you want stuff to run on reboot or similar a bash script attached to a restart button inside of Hyprland that is run which calls reboot at end of script is my best guess of what you actually want |
I don't think Hyprland itself is capable of stopping reboot for updates. You can defer the reboot/shutdown call though by using a script that is called to replace shutdown by whatever method you prefer. |
is the shutdown process if linux un-pausable? |
theoretically yes but realistically only if its scheduled for later. attempting to pause it for updates seems unnecessary anyways as other solutions make more sense (e.g. wrapper script for shutdown that checks if a file contains a "1", skipping shutdown if it does) |
Describe your PR, what does it fix/add?
Adds a config option for executing programs on shutdown.
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Nothing that could crash Hyprland while running immediately found.
Is it ready for merging, or does it need work?
Ready, but want tested by #7671 for any edge cases I might be able to fix