Skip to content
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

introduce single active scratchpad hook #837

Merged
merged 2 commits into from
Oct 24, 2023
Merged

Conversation

philib
Copy link
Contributor

@philib philib commented Oct 22, 2023

Description

I added a logHook that ensures that only the most recent scratchpad is active on the workspace at any given time. When opening a new scratchpad, the previous scratchpad is moved to the corresponding scratchpad workspace.

Motivation: I use floating scratchpad to open terminals, notes, etc. quickly. Since nsHideOnFocusLoss hides scratchpad more often, then i intended to, the scratchpads can pile up very fast, which leads to the fact that I have to "dismantle" the stack of scratchpads manually. To prevent this, I now use this logHook. I thought I'd share it in case anyone has a similar workflow and is also interested.

I am a Haskell beginner, so please bear with me. I would be glad about feedback.

Checklist

  • I've read CONTRIBUTING.md

  • I've considered how to best test these changes (property, unit,
    manually, ...) and concluded: manually tested

  • I updated the CHANGES.md file

Copy link
Member

@slotThe slotThe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! May I ask how this is different from nsHideOnFocusLoss? To me, it seems that

only the most recent scratchpad is active on the workspace at any given time. When opening a new scratchpad, the previous scratchpad is moved to the corresponding scratchpad workspace.

is describing exactly the same functionality

EDIT: Ah, I guess the motive is different—one might well want the scratchpad to stay when it looses focus, as long as only one is on the current workspace. Ignore me :)

philib and others added 2 commits October 24, 2023 21:00
A logHook to allow only one active scratchpad per workspace.
@slotThe slotThe merged commit f654082 into xmonad:master Oct 24, 2023
17 checks passed
@slotThe
Copy link
Member

slotThe commented Oct 24, 2023

Thank you for the contribution 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants