Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Support sourcing configuration files after plugins have been loaded

Open ginzberg opened this issue 11 months ago • 4 comments

Description

The problem: Keybindings are loaded before plugins have fully been loaded, resulting in many erroneous "invalid dispatcher" errors on initial load. This can safely be ignored by the user, but it could also have a 'boy that cried wolf' effect where actually important warnings or errors are ignored by sheer habit.

Proposal: Allow for an exec-after and/or source-after feature. At the most basic level, this could be delayed until after all plugins have been loaded. At the more complex level, it could be per-plugin specific, and only execute upon success and provide warning on failure.

Real world example: I use a plugin that provides per-monitor workspace list (hyprsplit), which brings a more dwm-like experience to Hyprland. In order to use this plugin, one needs to revise their keybindings and use the plugin-provided equivalents for workspace, movetoworkspace, and movetoworkspacesilent (split:workspace, split:movetoworkspace, and split:movetoworkspacesilent).

In an ideal world, I would maintain keybindings for the Hyprland inbuilt commands, hyprpm would load the plugin, and then upon successful loading of the plugin, a new set of keybindings would replace the default dispatch keybinds with the plugin-specific equivalents.

This would fail gracefully (fallback on default behavior if for any reason the plugin fails), and reduce erroneous errors.

I suspect that this is not an uncommon issue with other plugins, but these have been my experiences.

ginzberg avatar Mar 24 '24 16:03 ginzberg