Created
December 29, 2018 09:48
-
-
Save amitkeret/dabe6466fcd4c35c0b09b1d7848e4efa to your computer and use it in GitHub Desktop.
Nautilus script - Toggle .dot notation
This file contains 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
for file in $NAUTILUS_SCRIPT_SELECTED_URIS; do | |
file_name=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g' -e 's/.*\///g') | |
file_folder=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g' -e "s/$file_name//g") | |
case "$file_name" in | |
.*) | |
new_file_name=$(echo $file_name | sed -e 's/\.//') | |
;; | |
*) | |
new_file_name=".$file_name" | |
;; | |
esac | |
mv -v "$file_folder"/"$file_name" "$file_folder"/"$new_file_name" | |
done | |
notify-send "Toggle .dot notation complete" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment