#!/bin/sh # ~/.local/share/nautilus/scripts/SelectLeft # Select an item and save it to /tmp for later _errorAccess() { notify-send -i error -h 'string:sound-name:bell' "Failed to access item at path:" "$file"; exit 1; } _errorSave() { notify-send -i error -h 'string:sound-name:bell' "Failed to save item path into:" "/tmp/SelectLeft-$USER"; exit 1; } file="$(pwd)/$1" test $HOME && cd $HOME || exit 1 test -e "$file" || _errorAccess echo -n "$file" > "/tmp/SelectLeft-$USER" || _errorSave notify-send -i info -h 'string:sound-name:camera-shutter' "Captured left file path into /tmp/SelectLeft-$USER as:" "$file"; exit 0