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

grimshot: add notify action to open file or directory #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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

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