Update 2022-12-23 09:36 OpenBSD/amd64
This commit is contained in:
parent
e15731b711
commit
278d422977
46
.bin/website-add-image-to-gallery
Executable file
46
.bin/website-add-image-to-gallery
Executable file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
_imgpath="$(readlink -f "$1" || exit 2)"
|
||||
_imgname="$(basename "$_imgpath")"
|
||||
_imgnamenoext="${_imgname%%.*}"
|
||||
|
||||
cd $HOME/website/site/photos
|
||||
|
||||
gallerydir="$((echo NEW; find * -mindepth 0 -maxdepth 0 -type d; ) | fzf)"
|
||||
|
||||
if [ "$gallerydir" == "NEW" ]
|
||||
then
|
||||
|
||||
echo -n "Add new gallery name ($(date +"%Y-%m-%d_")): "
|
||||
read -r gallerydir
|
||||
|
||||
[ -z "$gallerydir" ] && exit 2
|
||||
|
||||
echo -n "Add gallery description [y/N]: "
|
||||
read -r gallerydescr
|
||||
case $gallerydescr in
|
||||
[yY]) cd $gallerydir && vim "index.txt"; ;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
mkdir -p "$gallerydir"
|
||||
cp "$_imgpath" "$gallerydir/"
|
||||
|
||||
echo -n "Add image description? [y/N]: "
|
||||
read -r imagedescr
|
||||
|
||||
case $imagedescr in
|
||||
[yY]) vim "${gallerydir}/${_imgnamenoext}.txt"; ;;
|
||||
esac
|
||||
|
||||
echo -n "Regenerate Website? [y/N]: "
|
||||
read -r regen
|
||||
|
||||
case $regen in
|
||||
[yY]) cd ~/website && make remote; ;;
|
||||
esac
|
||||
|
||||
echo
|
||||
echo "https://stefanhagen.de/photos/$gallerydir/${_imgnamenoext}.html"
|
||||
echo
|
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
# C-x + ?-?
|
||||
|
||||
set -x
|
||||
|
||||
copy_to_clipboard() {
|
||||
printf '%s\n' "Clipping $1"
|
||||
printf '%s' "$(readlink -f "$1")" \
|
||||
@ -72,6 +74,7 @@ do
|
||||
"p") printf '%s\n' "$(readlink -f "$file")" ;;
|
||||
"u") upload_to_paste "$file" ;;
|
||||
"x") save_image "$file" ;;
|
||||
"w") website-add-image-to-gallery $file ;;
|
||||
"Right") rotate_cw "$file" ;;
|
||||
"Left") rotate_ccw "$file" ;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user