Created
October 16, 2025 14:05
-
-
Save yaasita/43791e4005ddf14eb03ac842ee536492 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash | |
| set -euo pipefail | |
| if type slop &> /dev/null && type scrot &> /dev/null && type xdotool &> /dev/null && type zenity &> /dev/null; then | |
| echo "必要なコマンドはインストールされています" | |
| else | |
| echo "必要なコマンドがインストールされていません" | |
| echo "以下のコマンドを実行してインストールしてください" | |
| echo "sudo apt install slop scrot xdotool zenity" | |
| exit 1 | |
| fi | |
| if [ -r range.txt ];then | |
| echo "範囲指定済み" | |
| else | |
| echo "範囲指定してください 5秒後に開始します" | |
| sleep 5 | |
| slop -f "%x,%y,%w,%h" > range.txt | |
| fi | |
| echo "キャプチャを開始します" | |
| echo -n "ページ数を入力してください (例: 10) > " | |
| read -r PAGE | |
| echo -n "次ページに行くキーを入力してください (例: Right/Left) > " | |
| read -r NEXTKEY | |
| echo "5秒後に開始します" | |
| sleep 5 | |
| mkdir -p img | |
| while [ $PAGE -gt 0 ]; do | |
| PAGE=$((PAGE - 1)) | |
| sleep 5 | |
| scrot -a $(cat range.txt) 'img/%Y%m%d%H%M%S.jpg' | |
| xdotool key $NEXTKEY | |
| done | |
| zenity --info --text="終了しました" --width=400 --height=400 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment