grimshot: add notify action to open file or directory#36
Open
willnorris wants to merge 1 commit into
Open
Conversation
OctopusET
reviewed
Sep 10, 2024
Comment on lines
+85
to
+89
| if [ "$action" = "file" ]; then | ||
| xdg-open "$FILE" | ||
| elif [ "$action" = "dir" ]; then | ||
| xdg-open "$(dirname "$FILE")" | ||
| fi |
Owner
There was a problem hiding this comment.
Suggested change
| if [ "$action" = "file" ]; then | |
| xdg-open "$FILE" | |
| elif [ "$action" = "dir" ]; then | |
| xdg-open "$(dirname "$FILE")" | |
| fi | |
| if [ "$action" = "dir" ]; then | |
| xdg-open "$(dirname "$FILE")" | |
| else | |
| xdg-open "$FILE" | |
| fi |
With notification programs like mako, you can't select the action. So make opening file as default would be better.
Owner
There was a problem hiding this comment.
Oh this suggestion makes it always open the file, ignore that.
Author
There was a problem hiding this comment.
finally getting back to this. I think for notification programs like mako that don't support actions, we simply don't take any actions. So for them, this change is a noop. I tested with mako and it seems that is the current behavior as written, so I don't think any changes would be necessary for that?
If grimshot is called with --notify and the file was saved to disk, provide two notification actions to open the file or the containing directory. Use xdg-open to open the file/directory, so also add that to the check command.
e0110f8 to
6f4fe8f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If grimshot is called with --notify and the file was saved to disk, provide two notification actions to open the file or the containing directory. Use xdg-open to open the file/directory, so also add that to the check command.