From 5e3dfb6d4e2a33445bf49f25aa64325c7256a207 Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Tue, 10 Nov 2020 01:04:20 +0200 Subject: [PATCH] Backing up localbin changes --- bin/capturecard | 36 ++++++++++++++++++++++++++++++++++++ bin/extip | 2 ++ bin/scrot.sh | 1 + bin/vpn | 12 ++++++++++++ 4 files changed, 51 insertions(+) create mode 100755 bin/capturecard create mode 100755 bin/extip create mode 100755 bin/vpn diff --git a/bin/capturecard b/bin/capturecard new file mode 100755 index 0000000..878b09d --- /dev/null +++ b/bin/capturecard @@ -0,0 +1,36 @@ +#!/bin/sh +# This took me far too long to figure out how to do but +# I think I've learned a lot from it. What a great exercise! +# These comments are for my future-self and whomever else. +# -- Siina, 2020.11.09 +# +# Requirements: +# - alsa-utils +# - libv4l (brought in by USE=v4l) +# - mpv +# +# Tools I used to figure this shit out +# - arecord, aplay +# - ffmpeg +# - lspci +# - Lots of searching through ancient fragments of the 'net +# +# TODO: +# - Capture and retry to connect audio + +# Set our device to 1080p otherwise it defaults to 480p +v4l2-ctl --set-fmt-video=width=1920,height=1080 + +# Connect to capture card and display captured images immediately +# Send to background so we can initiate the loop below +mpv av://v4l2:/dev/video0 --profile=low-latency --untimed & + +# audio can't connect until video is established due to a constant +# powercycle when inactive, likely due to lack of proper driver +sleep 3 + +# Run a loop for the capture card digital audio to be sent to my desktop audio +alsaloop -C hw:2,0 -P hw:1,0 + +# Let's exit this shit when done +exit diff --git a/bin/extip b/bin/extip new file mode 100755 index 0000000..a2bc943 --- /dev/null +++ b/bin/extip @@ -0,0 +1,2 @@ +#!/bin/sh +curl wgetip.net/n diff --git a/bin/scrot.sh b/bin/scrot.sh index 0ddb5ff..169b0c7 100755 --- a/bin/scrot.sh +++ b/bin/scrot.sh @@ -9,3 +9,4 @@ fi # Unable to use $dest and still need to figure out why scrot '%Y%m%d-%H.%M.%S_$wx$h.png' $@ -e 'mv $f ~/Screenshots' + diff --git a/bin/vpn b/bin/vpn new file mode 100755 index 0000000..d95f2ae --- /dev/null +++ b/bin/vpn @@ -0,0 +1,12 @@ +#!/bin/sh +if [ "$1" == "on" ]; then + cmd="c --p2p" +elif [ "$1" == "off" ]; then + cmd="d" +elif [ "$1" == "status" ]; then + cmd="s" +else + echo "Please pass an argument: on, off, status" + exit +fi +doas protonvpn $cmd