make POSIX sh compliant
This commit is contained in:
@ -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
|
||||
|
||||
8
bin/displayctl
Executable file
8
bin/displayctl
Executable file
@ -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
|
||||
27
bin/espdev
Executable file
27
bin/espdev
Executable file
@ -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
|
||||
8
bin/gsr
8
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 :
|
||||
|
||||
@ -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&
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
7
bin/sync_music
Executable file
7
bin/sync_music
Executable file
@ -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
|
||||
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user