Dispatchers
I'm here to show interest in dispatchers being added.
I was thinking a good start might be adding a instance.dispatch() that takes in a string using the same syntax as hyprctl. This would allow users to access all dispatchers whether or not hyprpy has them implemented yet.
If this plan sounds good and I have time I may shoot over a PR.
Hey @mbpowers, apologies for the late reply, life got in the way. That sounds like a great start, feel free to implement and shoot it over if you are still interested in this! Would be much appreciated.
no worries at all, just got some free time myself :] #12
The proposed instance.dispatch() method was merged as of 82acd79, which allows sending generic disptachers to the hyprland instance:
from hyprpy import Hyprland
instance = Hyprland()
most_recent_window = instance.get_windows()[-1]
instance.dispatch(["closewindow", f"address:{most_recent_window.address}"]) # Closes the window
I'd love to flesh out dispatchers more in the future, such that the above example becomes:
from hyprpy import Hyprland
instance = Hyprland()
most_recent_window = instance.get_windows()[-1]
most_recent_window.close() # Closes the window
I currently don't have much time to implement this myself, so any help would be greatly appreciated if anyone's interested!