Last active
December 2, 2019 12:17
-
-
Save hugows/b0e8be2c9a2fede12b65bd8abf9a3983 to your computer and use it in GitHub Desktop.
nemo file manager - set it to open zip files with this script by default = quick way to handle zip files
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
#!/usr/bin/bash | |
parentdir=$(dirname "$@") | |
cd $parentdir | |
if [[ $@ == *.zip ]]; then | |
outputdir=$(basename "$@" ".zip") | |
fi | |
if [[ $@ == *.rar ]]; then | |
outputdir=$(basename "$@" ".rar") | |
fi | |
if [[ $@ == *.tar.gz ]]; then | |
outputdir=$(basename "$@" ".tar.gz") | |
fi | |
if [[ -v outputdir ]]; then | |
if 7z x "$@" -o"$outputdir"; then | |
rm -f "$@" | |
fi | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment