Update 2022-12-23 09:36 OpenBSD/amd64

This commit is contained in:
c0dev0id 2022-12-23 09:36:12 +01:00
parent e15731b711
commit 278d422977
3 changed files with 50 additions and 1 deletions

View 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

View File

@ -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

2
.kshrc
View File

@ -67,7 +67,7 @@ export CDPATH
### SOFTWARE PREFERENCES
EDITOR="vim"
VISUAL="vim"
BROWSER="luakit"
BROWSER="luakit -un"
TUIR_BROWSER="$BROWSER"
PAGER="less"
export EDITOR VISUAL BROWSER TUIR_BROWSER PAGER