forked from cytopia/thunar-custom-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/sh | ||
# | ||
# Convert an image file to a jpg file. | ||
# | ||
# * Put this file into your home binary dir: ~/bin/ | ||
# * Make it executable: chmod +x | ||
# | ||
# | ||
# Required Software: | ||
# ------------------------- | ||
# * convert | ||
# | ||
# | ||
# Thunar Integration | ||
# ------------------------ | ||
# | ||
# Command: ~/bin/thunar-convert-to-jpg.sh -f %f | ||
# File Pattern: * | ||
# Appear On: Image Files | ||
# | ||
# | ||
# Usage: | ||
# ------------------------- | ||
# thunar-convert-to-jpg.sh -f <filename> | ||
# | ||
# required: | ||
# -f input filename | ||
# | ||
# Note: | ||
# ------------------------- | ||
# | ||
# Feel free to adjust/improve and commit back to: | ||
# https://github.com/pantu/thunar-custom-actions | ||
# | ||
|
||
|
||
usage() { | ||
echo "$0 -f <filename>" | ||
echo | ||
echo " required:" | ||
echo " -f input filename" | ||
echo | ||
exit 1 | ||
} | ||
|
||
|
||
while getopts ":f:" i; do | ||
case "${i}" in | ||
f) | ||
f=${OPTARG} | ||
;; | ||
*) | ||
echo "Error - unrecognized option $1" 1>&2; | ||
usage | ||
;; | ||
esac | ||
done | ||
shift $((OPTIND-1)) | ||
|
||
# Check if file is specified | ||
if [ -z "${f}" ]; then | ||
echo "Error - no file specified" 1>&2; | ||
usage | ||
fi | ||
|
||
convert "${f}" "${f}.jpg" | ||
|
||
exit 0 |
Empty file.