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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 2024-08-02

grimblast: changed method to check if another instance is running

### 2024-07-10

grimblast: recognize windows of special workspaces
Expand All @@ -26,15 +30,16 @@ grimblast: use fadeLayers to prevent visible borders

### 2024-03-18

scratchpad: Fixed -m command. Now it kills the preprocess of menu before starting it.
scratchpad: Fixed -m command. Now it kills the preprocess of menu before
starting it.

### 2024-03-13

scratchpad: allow supplying command flags in any order

### 2024-03-02

hdrop: 0.4.4 -> 0.5.0
hdrop: 0.4.4 -> 0.5.0\
Add --floating and associated options

### 2024-01-25
Expand All @@ -43,14 +48,14 @@ grimblast: fixed border still visible when taking screenshot of an area

### 2024-01-19

hdrop: -> 0.4.4
hdrop: -> 0.4.4\
Fix --class quoting

### 2024-01-14

hdrop: 0.3.0 -> 0.4.0
Add `-c | --class`
Improve Documentation
hdrop: 0.3.0 -> 0.4.0\
Add `-c | --class`\
Improve Documentation\
Refactor

### 2024-01-11
Expand Down
12 changes: 12 additions & 0 deletions grimblast/grimblast
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
## hyprctl equivalents.
## https://github.com/swaywm/sway/blob/master/contrib/grimshot

# Check whether another instance is running


grimblastInstanceCheck="${XDG_RUNTIME_DIR:-$XDG_CACHE_DIR:-$HOME/.cache}/grimblast.lock"
if [ -e "$grimblastInstanceCheck" ]; then
exit 2
else
touch "$grimblastInstanceCheck"
fi
trap "rm -f '$grimblastInstanceCheck'" EXIT


getTargetDirectory() {
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" &&
. "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
Expand Down
5 changes: 5 additions & 0 deletions grimblast/grimblast.1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ bind = SUPER ALT, p, exec, grimblast save output
bind = SUPER CTRL, p, exec, grimblast save screen
```

# EXIT CODES

0 - Normal exit++
2 - Another instance of grimblast is running

# SEE ALSO

*grim*(1)
Expand Down
Loading