From bee423d15287eb1908773fa3e92a8ee8792fae75 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 9 Oct 2024 17:04:50 +0200 Subject: some of the scripts i use --- clicker.sh | 8 ++++++++ import-cam-photos | 4 ++++ screenrec | 15 +++++++++++++++ sshot | 2 ++ 4 files changed, 29 insertions(+) create mode 100755 clicker.sh create mode 100755 import-cam-photos create mode 100755 screenrec create mode 100755 sshot diff --git a/clicker.sh b/clicker.sh new file mode 100755 index 0000000..e6b1b49 --- /dev/null +++ b/clicker.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Uses xdotool to perform keypresses. In this case it types a letter, sleeps and then deletes it + +while true; do + xdotool key a + sleep 3 + xdotool key BackSpace +done diff --git a/import-cam-photos b/import-cam-photos new file mode 100755 index 0000000..d95f66f --- /dev/null +++ b/import-cam-photos @@ -0,0 +1,4 @@ +#!/bin/bash + +cd "$HOME/pic/CANON" +yes | gphoto2 -P diff --git a/screenrec b/screenrec new file mode 100755 index 0000000..31c6720 --- /dev/null +++ b/screenrec @@ -0,0 +1,15 @@ +#!/bin/dash + +stop_ffmpeg() { + pkill -f "ffmpeg -v quiet -f x11grab -video_size 1920x1080 -i :0.0" + exit +} + + +# Check if argument is provided +if [ "$1" = "stop" ]; then + stop_ffmpeg +fi + +# Start ffmpeg screen recording +ffmpeg -v quiet -f x11grab -video_size 1920x1080 -i :0.0 "$HOME/pic/screenrec_$(date +"%Y%m%d_%H%M").mp4" diff --git a/sshot b/sshot new file mode 100755 index 0000000..f5583dd --- /dev/null +++ b/sshot @@ -0,0 +1,2 @@ +#!/bin/dash +ffmpeg -f x11grab -video_size 1920x1080 -i :0.0 -pix_fmt rgba "$HOME/pic/screenshot_$(date +%Y%m%d_%H%M%S).png" -- cgit v1.2.3