From b8fc75f962891aa7def3b1829d83534350dfe21d Mon Sep 17 00:00:00 2001 From: not_a_robot06 Date: Wed, 2 Jul 2025 14:36:09 +0100 Subject: initial commit works but little input sanitization and pretty inflexible; multiple scripts for no reason --- question_shot.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 question_shot.sh (limited to 'question_shot.sh') diff --git a/question_shot.sh b/question_shot.sh new file mode 100755 index 0000000..a511dec --- /dev/null +++ b/question_shot.sh @@ -0,0 +1,21 @@ +#!/bin/sh +mkdir -p /tmp/question_shots +photoname=$(ls /tmp/question_shots | cut -d_ -f1 | uniq | dmenu -i -p "name of screenshots? (no underscores or hyphens)") +echo "$photoname" +photonumber=$(basename -a $(ls /tmp/question_shots/"$photoname"*) | cut -d_ -f2 | cut -d- -f1 | uniq | tac | dmenu -i -p "number?") + +type=$(echo "question\nanswer" | dmenu -i -p "question or answer?") +if [ "$type" = "question" ]; then + type=q +else + type=a +fi + +partnumber=$(ls /tmp/question_shots/"$photoname"_"$photonumber"-"$type"-* | tail -n1 | cut -d- -f3 | cut -d. -f1) +if [ -z "$partnumber" ]; then + partnumber=0 +else + partnumber=$(echo "$partnumber"+1 | bc) +fi + +scrot -s /tmp/question_shots/"$photoname"_"$photonumber"-"$type"-"$partnumber".png -- cgit v1.2.3