Created
April 26, 2017 12:29
-
-
Save cat-in-136/fc035d093b02bac5a014e4b8ee52165c to your computer and use it in GitHub Desktop.
Nautilus Script of "Copy as Path"
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
#!/bin/sh | |
# Dependency check : zenity, xclip | |
if which zenity > /dev/null 2> /dev/null; then | |
: | |
else | |
xmessage -nearmouse zenity is required but not installed. | |
exit 1 | |
fi | |
if which xclip > /dev/null 2> /dev/null; then | |
: | |
else | |
zenity --error --text="xclip is required but not installed." | |
fi | |
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then | |
echo -n $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | xclip -i -selection clipboard | |
elif [ -n "$NEMO_SCRIPT_SELECTED_FILE_PATHS" ]; then | |
echo -n $NEMO_SCRIPT_SELECTED_FILE_PATHS | xclip -i -selection clipboard | |
else | |
zenity --error --text="No path selected." | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment