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

grimblast: only allow one instance #113

Merged
merged 1 commit into from
Aug 2, 2024
Merged

grimblast: only allow one instance #113

merged 1 commit into from
Aug 2, 2024

Conversation

fufexan
Copy link
Member

@fufexan fufexan commented Jul 29, 2024

Description of changes

Allow only one instance of grimblast to be active at a time. Fixes #112

Things done

  • For new programs

    • Add the program to the README table, with yourself as the
      maintainer
    • Add a README for the program itself
    • Add Makefile (and Nix derivation optionally, otherwise @fufexan will do
      it)
    • If the program is a script, add it to the
      CI checks matrix
  • For changes

@fufexan
Copy link
Member Author

fufexan commented Jul 29, 2024

@DHDcc can you test this?

@DHDcc
Copy link
Contributor

DHDcc commented Jul 29, 2024

@fufexan it works IF I don't spam my keybind:

No spaming:
https://github.com/user-attachments/assets/ad69f75a-9d44-4c5d-ace3-ffff9a93f179

Spaming:
https://github.com/user-attachments/assets/9d0e3d44-38ff-41e9-9197-4a531beb1246

Insted of having 10+ instances, I have 2 instances max (if I spam my keybind)

@fufexan
Copy link
Member Author

fufexan commented Jul 30, 2024

Looks like I can't make grimblast only allow one instance of itself to be running from within itself. I've tried using lockfiles, but that doesn't work either. And pgrep seems too slow to be useful when called from within the script.

However, I have these binds in my hyprland config which work exceptionally well, even when spamming the key:

bind=, Print, exec, pgrep grimblast || grimblast --notify copysave area
bind=CTRL, Print, exec, pgrep grimblast || grimblast --notify --cursor copysave output
bind=ALT, Print, exec, pgrep grimblast || grimblast --notify --cursor copysave screen

@fufexan fufexan merged commit 9d67858 into main Aug 2, 2024
14 checks passed
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.

Make sure there's only one instance of grimblast running
2 participants