Skip to content

Conversation

@willnorris
Copy link

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.

grimshot Outdated
Comment on lines 85 to 89
if [ "$action" = "file" ]; then
xdg-open "$FILE"
elif [ "$action" = "dir" ]; then
xdg-open "$(dirname "$FILE")"
fi
Copy link
Owner

Choose a reason for hiding this comment

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

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.

Copy link
Owner

Choose a reason for hiding this comment

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

Oh this suggestion makes it always open the file, ignore that.

Copy link
Owner

Choose a reason for hiding this comment

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

Do you have an idea for this?

Copy link
Author

Choose a reason for hiding this comment

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

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.
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