hyprland-community / pyprland

Scratchpads & many goodies for Hyprland [maintainer=@fdev31]
MIT License
339 stars 16 forks source link

[FEAT] Scratchpad: "Excluded Stash" option #123

Closed axelKeizoStahl closed 1 month ago

axelKeizoStahl commented 1 month ago

Is your feature request related to a problem? Please describe. If I have 3 scratchpads open, then I open one excludes="8" scratchpad, I now need to reopen all those other scratchpads.

Describe the solution you'd like Instead of closing the other scratchpads, how about "stashing" them? So once the "excludes="*"" scratchpad is closed, the other scratch pads are reopened.

Create a new attr for the Scratch class in object.py for scratchpads called excludes_stash or something. This gets updated when run_show is called on a scratchpad with an excludes option. Then, when said scratchpad is passed to run_hide, do a run_show command for each of those scratchpads.

This implementation is pretty heavy (on run_show's), it may be better to see if we can run a succinct version of the run_show command, given that we know it is a scratchpad that is running, and other stuff.

We might also want the excludes_stash attr somewhere else. The thing is, this attr needs to specify what closed it, because that is what will open it, meaning we can't just have one big list in the actual Extension class for _init.py. I think in the Scratch class makes most sense.

LMK if you have a better idea for the implementation.

Describe alternatives you've considered My current implementation for this stores closed scratchpads in a excluded_scratchpads attr of the FocusTracker class (for the "excludy" scratchpad). Then, it runs the run_show function on each of those scratchpads inside of the _handle_focus_tracker for smart focus.

axelKeizoStahl commented 1 month ago

If you think this would be a good feature, I can submit a pr, adding it to the docs/wiki as well (under the advanced part for scratchpads config).

fdev31 commented 1 month ago

I think this is an interesting feature, could be enabled using something like stash_excluded = true.

fdev31 commented 1 month ago

After seeing the PR, restore_excluded sounds more easy to explicit to me.

fdev31 commented 1 month ago

126 merged, closing.