diff options
-rwxr-xr-x | keyboard/mnt | 7 | ||||
-rwxr-xr-x | keyboard/umnt | 4 | ||||
-rwxr-xr-x | keyboard/virt | 28 | ||||
-rwxr-xr-x | misc/tserv | 13 | ||||
-rwxr-xr-x | sync/sink | 5 | ||||
-rw-r--r-- | video/.transtape.swp | 0 | ||||
-rwxr-xr-x | video/rectape | 15 | ||||
-rwxr-xr-x | video/rectapevaapi | 12 | ||||
-rwxr-xr-x | video/slideshow | 15 | ||||
-rwxr-xr-x | video/transtape | 11 | ||||
-rwxr-xr-x | video/viewintensitypro | 4 | ||||
-rwxr-xr-x | video/webcamffplay | 2 |
12 files changed, 108 insertions, 8 deletions
diff --git a/keyboard/mnt b/keyboard/mnt index 5f82aa4..7547912 100755 --- a/keyboard/mnt +++ b/keyboard/mnt @@ -1,10 +1,11 @@ #!/bin/sh -if partition=`lsblk --noheadings --paths --raw | awk '/part $/ { print $1, "(" $4 ")" }' | dmenu -p "Choose drive to mount: " | sed 's/ .*//'` \ +# '/part\s*$\|rom\s*$/!d; s/\s*[^[:space:]]*\s*$/\)/; s/\s/ \(/' # More correct in my opinion, but slower +if partition=`lsblk -npro "name,size,type,mountpoint" | sed '/part $\|rom $/!d; s/ [a-z]* $/\)/; s/ / \(/' | dmenu -p "Choose drive to mount: " | cut -d' ' -f1` \ && [ -n "$partition" ] \ -&& mountpoint=`ls --directory /media/mnt/*/ | dmenu -p "Choose mountpoint: "` \ +&& mountpoint=`ls -d /media/mnt/slot*/ | dmenu -p "Choose mountpoint: "` \ && [ -n "$mountpoint" ] then - doas mount "$partition" "$mountpoint" \ + doas mount "$partition" "$mountpoint"; user="$(whoami)"; ug="$(groups | cut -d' ' -f1)"; doas chown "$user":"$ug" "$mountpoint" \ && notify-send --urgency low "Device Successfully Mounted" "Successfully Mounted partition \"$partition\" to mountpoint \"$mountpoint\"" \ || notify-send --urgency low "Error Mounting Device" "Could not mount partition \"$partition\" to mountpoint \"$mountpoint\"" fi diff --git a/keyboard/umnt b/keyboard/umnt index a77dc65..8191047 100755 --- a/keyboard/umnt +++ b/keyboard/umnt @@ -2,7 +2,7 @@ exclude='\/efi$|\/boot$|\/home$|tbhdd$|\/$' if mountedpartition=`lsblk --noheadings --paths --raw | awk "/part .+/ && !/$exclude/ "'{ print $1, "(on", $7 ")" }' | dmenu -p "Unmount Device... "` then - doas umount "`echo $mountedpartition | sed 's/ .*//'`" \ - && notify-send --urgency low "Device Successfully Unmounted" "Partition \"$mountedpartition\" successfully unmounted" \ + doas umount -A "`echo $mountedpartition | sed 's/ .*//'`" \ + && notify-send --urgency low "Device Successfully Unmounted" "Partition \"$mountedpartition\" successfully unmounted" --time 120000 \ || notify-send --urgency low "Error Unmounting Device" "Could not unmount partition \"$mountedpartition\"" fi diff --git a/keyboard/virt b/keyboard/virt new file mode 100755 index 0000000..446bfb3 --- /dev/null +++ b/keyboard/virt @@ -0,0 +1,28 @@ +#!/bin/sh +virtdir=~/.local/share/virt + +halfram() { awk '/^MemTotal/ { printf "%dM\n", $2/2/1024 }' /proc/meminfo; } # Needs to be either in M or G according to man page +halfthreads() { awk '/^processor/ { cpus++ } END{ print cpus/2 }' /proc/cpuinfo; } +startvm() { + qemu-system-x86_64 \ + -enable-kvm \ + -cpu host \ + -m $(halfram) \ + -smp $(halfthreads) \ + -vga virtio \ + -display sdl,gl=on \ + -audiodev pa,id=pa1,server=/run/user/1000/pulse/native \ + -soundhw all \ + -boot menu=on \ + -drive file="$virtdir/$1.img" \ +; } + +vms="$(ls $virtdir)" + +[ -n "$1" ] && vm="$1" || vm=$(echo "$vms" | sed 's/\.img//' | dmenu -p "Choose Virtual Machine Image or Enter Name for New Virtual Machine") + +if echo "$vms" | grep "^$vm.img$" >/dev/null; then + startvm "$vm" +else + qemu-img create -f qcow2 "$virtdir/$vm.img" $(echo -n "4G\n8G\n16G\n32G" | dmenu -p "Choose Size of Virtual Machine \"$vm\"") +fi diff --git a/misc/tserv b/misc/tserv new file mode 100755 index 0000000..5e0d072 --- /dev/null +++ b/misc/tserv @@ -0,0 +1,13 @@ +#!/bin/sh +server=~/.local/share/Terraria/server/TerrariaServer.bin.x86_64 +#wldnum=1 + +$server +#$server << CMDS +#$wldnum +#16 +#7777 +#n +# +#say hello +#CMDS @@ -2,7 +2,7 @@ printusage() { echo "Usage: $0 [<repos> ...] (repos: all,`echo $repos | tr ' ' ','`) [up|down]" && exit; } -repos="docs sites patches" +repos="docs patches" oper=`echo $@ | sed 's/.* //'` # Get last argument ([ -z $2 ] || ([ "$oper" != "up" ] && [ "$oper" != "down" ])) && printusage @@ -31,10 +31,9 @@ sync() { } # arg1 = options + containing directory path, arg2 = file/directory name -syncdocs() { destdir="" && sync "/home/timmy/" "docs"; } +syncdocs() { destdir="" && sync "/home/timmy/docs/" "school"; } #syncsites() { destdir="" && sync "--exclude=pass /home/timmy/.local/src/" "sites"; } # Excludes password file syncpatches() { destdir="" && sync "--exclude=.git /home/timmy/.local/src/programs/" "patches"; } # Excludes git files -syncsite() { destdir="/var/www/tjkeller/" && sync "/home/timmy/.local/src/sites/" "tjkeller"; } for arg in "$@"; do case $arg in diff --git a/video/.transtape.swp b/video/.transtape.swp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/video/.transtape.swp diff --git a/video/rectape b/video/rectape new file mode 100755 index 0000000..f6e7a01 --- /dev/null +++ b/video/rectape @@ -0,0 +1,15 @@ +#!/bin/sh +if [ -z "$1" ]; then + $1=untitled_$(ls | wc -l) +fi + +# All hevc_amf ffmpeg options: $ ffmpeg -h encoder=hevc_amf + +ffmpeg \ +-f decklink -format_code ntsc -i "Intensity Pro" \ +-c:v libx264 \ +-qmin 6 -qmax 26 -qdiff 4 \ +-vf yadif \ +-c:a aac -b:a 384k \ +-metadata "title"="$1" \ +"$1.mkv" diff --git a/video/rectapevaapi b/video/rectapevaapi new file mode 100755 index 0000000..16bd190 --- /dev/null +++ b/video/rectapevaapi @@ -0,0 +1,12 @@ +#!/bin/sh +if [ -z "$1" ]; then + title="untitled_$(ls | wc -l)" +fi + +ffmpeg -hwaccel auto -vaapi_device /dev/dri/renderD128 \ +-f decklink -format_code ntsc -i "Intensity Pro" \ +-c:v hevc_vaapi \ +-vf "yadif,format=nv12,hwupload" \ +-c:a libopus -b:a 384k \ +-metadata "title"="$1$title" \ +"$1$title.mkv" diff --git a/video/slideshow b/video/slideshow new file mode 100755 index 0000000..94c530e --- /dev/null +++ b/video/slideshow @@ -0,0 +1,15 @@ +#!/bin/sh +cat *.JPG | ffmpeg -y \ +-framerate 0.20 -loop 1 \ +-f image2pipe \ +-i - \ +-c:v h264_amf -quality quality -tune stillimage \ +-qp_i 12 -qp_p 28 -qp_b 28 \ +-vf \ +fps=1,\ +framerate=25:\ +interp_start=0:\ +interp_end=255:\ +scene=100 \ +-metadata "title"="$(pwd | sed "s/.*\///")" \ +output.mkv diff --git a/video/transtape b/video/transtape new file mode 100755 index 0000000..a0eaaee --- /dev/null +++ b/video/transtape @@ -0,0 +1,11 @@ +#!/bin/sh +if [ -z "$1" ]; then + exit +fi + +ffmpeg -hwaccel auto -vaapi_device /dev/dri/renderD128 \ +-i "$1" \ +-c:v hevc_vaapi \ +-vf "yadif,format=nv12,hwupload" \ +-metadata "title"="$1" \ +"$1as.mkv" diff --git a/video/viewintensitypro b/video/viewintensitypro new file mode 100755 index 0000000..1b1f77c --- /dev/null +++ b/video/viewintensitypro @@ -0,0 +1,4 @@ +#!/bin/sh +ffplay \ +-f decklink -format_code ntsc -i "Intensity Pro" \ +-vf yadif diff --git a/video/webcamffplay b/video/webcamffplay new file mode 100755 index 0000000..c56d879 --- /dev/null +++ b/video/webcamffplay @@ -0,0 +1,2 @@ +#!/bin/sh +ffplay -f v4l2 -input_format mjpeg -video_size 1920x1080 -framerate 30 -i /dev/video0 |