diff --git a/bin/audioswitch b/bin/audioswitch index 217ce2e..85baded 100755 --- a/bin/audioswitch +++ b/bin/audioswitch @@ -1,7 +1,8 @@ #!/bin/sh CARD=$(pactl list cards short | grep '1f.3' | awk '{print $2}') CURRENT_SINK=$(pactl info | grep "Default Sink:") -if [[ "$CURRENT_SINK" == *"iec958"* ]]; then +dunstctl close-all +if [ "$CURRENT_SINK" = *"iec958"* ]; then pactl set-card-profile $CARD output:analog-stereo notify-send "analog out active" -i : else diff --git a/bin/displayctl b/bin/displayctl new file mode 100755 index 0000000..73cafed --- /dev/null +++ b/bin/displayctl @@ -0,0 +1,8 @@ +#!/bin/sh +DISPLAY_STATUS=$(xrandr | grep DP-2) + +if [ "$DISPLAY_STATUS" = *"1440x3440"* ]; then + xrandr --output DP-2 --off +else + init_displays +fi diff --git a/bin/espdev b/bin/espdev new file mode 100755 index 0000000..b19b72b --- /dev/null +++ b/bin/espdev @@ -0,0 +1,27 @@ +#!/bin/sh + +if [ $1 = "source" ]; then + echo "sourcing and exiting..." +. $HOME/esp/esp-idf/export.sh + exit +fi + +. $HOME/esp/esp-idf/export.sh +echo "cleaning up..." +idf.py fullclean +echo "done cleaning." +echo "building..." +idf.py build +echo "done building." +echo "flashing..." +idf.py -p /dev/ttyACM0 flash +echo "done flashing." +read -n 1 input -p "monitor serial output? [y/n]" +if [ $input = y ]; then + echo "monitoring..." + idf.py -p /dev/ttyACM0 monitor +else if [ $input = n ]; then + exit +else + echo "yes or no dude..." +fi diff --git a/bin/gsr b/bin/gsr index 0021395..fcd000f 100755 --- a/bin/gsr +++ b/bin/gsr @@ -2,20 +2,20 @@ GSRPID=$(pidof gpu-screen-recorder) DWMBLOCKSPID=$(pidof dwmblocks) -if [[ -n $GSRPID ]]; then +if [ -n $GSRPID ]; then kill -n 2 $GSRPID kill -n 36 $DWMBLOCKSPID notify-send "recording saved" -i : exit fi -if [[ $1 == 1 ]]; then - gpu-screen-recorder -w DP-0 -k hevc -c mkv -f 60 -bm cbr -q 12000 -ac opus -a "default_output" \ +if [ $1 = 1 ]; then + gpu-screen-recorder -w DP-4 -k hevc -c mkv -f 60 -bm cbr -q 12000 -ac opus -a "default_output" \ -o "$HOME/wdraidz/media/game-videos/$(date +%m-%d-%Y_%R:%S).mkv"& kill -n 36 $DWMBLOCKSPID notify-send "recording started with no mic" -i : else - gpu-screen-recorder -w DP-0 -k hevc -c mkv -f 60 -bm cbr -q 12000 -ac opus -a "default_output|default_input" \ + gpu-screen-recorder -w DP-4 -k hevc -c mkv -f 60 -bm cbr -q 12000 -ac opus -a "default_output|default_input" \ -o "$HOME/wdraidz/media/game-videos/$(date +%m-%d-%Y_%R:%S).mkv"& kill -n 36 $DWMBLOCKSPID notify-send "recording started" -i : diff --git a/bin/record b/bin/record index 008d2b6..7798c6d 100755 --- a/bin/record +++ b/bin/record @@ -2,11 +2,11 @@ SCREEN="ffmpeg -s 3440x1440 -f x11grab -r 60 -i :0.0+0,0" SYSTEM_AUDIO="-f pulse -i alsa_output.pci-0000_00_1f.3.iec958-stereo.monitor" MICROPHONE="-f pulse -i default:monitor" -COMPRESSION="-c:a flac -c:v hevc_nvenc -b:v 12M" +COMPRESSION="-c:a flac -c:v hevc_nvenc -b:v 10M" FILENAME="$HOME/wdraidz/media/game-videos/$(date +%m-%d-%Y_%R:%S).mkv" SIGSEND="kill -n 36 $(pidof dwmblocks)" -if [[ $1 == 1 ]]; then +if [ $1 = 1 ]; then $SCREEN $SYSTEM_AUDIO $MICROPHONE -filter_complex "[1:0][2:0]amerge=inputs=2[a]" -map 0:v -map "[a]" $COMPRESSION $FILENAME& else $SCREEN $SYSTEM_AUDIO $COMPRESSION $FILENAME& diff --git a/bin/screenshot b/bin/screenshot index 0bc1901..a03c077 100755 --- a/bin/screenshot +++ b/bin/screenshot @@ -3,7 +3,7 @@ YEAR=$(date +%Y) MONTH_DAY=$(date +%m-%d) FILENAME=$(date +%R:%S) mkdir -p ~/pictures/$YEAR/$MONTH_DAY -if [[ $1 == 1 ]]; then +if [ $1 = 1 ]; then import clipboard: notify-send "Screenshot taken" "copied to clipboard" -i : else diff --git a/bin/st-power b/bin/st-power index d2fcd6f..1477613 100755 --- a/bin/st-power +++ b/bin/st-power @@ -1,10 +1,10 @@ #!/bin/sh -# for UPS monitoring with pwrstatd +# for UPS monitoring with NUT # -#POWER="$(pwrstat -status | grep "Load" | awk '{print $2}')W" -#CHARGE=$(pwrstat -status | grep "Battery Capacity" | awk '{print $3$4}') -#if [[ "$CHARGE" == "100%" ]]; then +#POWER="$(upsc titanium-power@localhost | grep ups.realpower: | awk '{print $2}')W" +#CHARGE="$(upsc titanium-power@localhost | grep battery.charge: | awk '{print $2}')%" +#if [ "$CHARGE" = "100%" ]; then # echo $POWER #else # echo "$CHARGE $POWER" diff --git a/bin/st-rec b/bin/st-rec index 97ecdce..a620002 100755 --- a/bin/st-rec +++ b/bin/st-rec @@ -1,8 +1,8 @@ #!/bin/sh -sleep 1 -PID=$(pidof ffmpeg) +sleep 0.5 +PID=$(pidof gpu-screen-recorder) if [ -n "$PID" ]; then echo " REC" -elif [ -z "$PID" ]; then - echo " IDLE" +#elif [ -z "$PID" ]; then +# echo " - " fi diff --git a/bin/st-vol b/bin/st-vol index 861da36..078d4f9 100755 --- a/bin/st-vol +++ b/bin/st-vol @@ -1,6 +1,6 @@ #!/bin/sh VOLUME=$(wpctl get-volume @DEFAULT_SINK@) -if [[ $VOLUME =~ "MUTED" ]]; then +if [ $VOLUME =~ "MUTED" ]; then echo " MUTED" fi VOLUME=$(echo $VOLUME | sed s/"Volume: 0."//g) diff --git a/bin/sync_music b/bin/sync_music new file mode 100755 index 0000000..11fa799 --- /dev/null +++ b/bin/sync_music @@ -0,0 +1,7 @@ +#!/bin/sh +rsync -aP $HOME/wdraidz/media/music/ $HOME/music/ > $HOME/.sync_log && SUCCESS=1 +if [ $SUCCESS = 1 ]; then + notify-send "sync complete; logged to $HOME/.sync_log" -i : +else + notify-send "sync error..." -i : +fi diff --git a/bin/volumectl b/bin/volumectl index 82c6b3b..06ebe34 100755 --- a/bin/volumectl +++ b/bin/volumectl @@ -1,11 +1,11 @@ #!/bin/sh INCREMENT="2" -if [[ "$1" == "up" ]]; then +if [ "$1" = "up" ]; then wpctl set-volume @DEFAULT_SINK@ $INCREMENT%+ -elif [[ "$1" == "down" ]]; then +elif [ "$1" = "down" ]; then wpctl set-volume @DEFAULT_SINK@ $INCREMENT%- -elif [[ "$1" == "mute" ]]; then +elif [ "$1" = "mute" ]; then wpctl set-mute @DEFAULT_SINK@ toggle fi