aboutsummaryrefslogtreecommitdiff
path: root/.local/share
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-03-12 08:21:05 +0100
committerlonkaars <loek@pipeframe.xyz>2024-03-12 08:21:05 +0100
commit24a351df42c4805efe27d38256b4c6e3e07f84c4 (patch)
tree14522668876f3928a0e89cdfedb565f608d127bf /.local/share
parent43f821b2450aacfc818a4b8ffec52acfc6bc799f (diff)
fix more POSIX sh compatibility
Diffstat (limited to '.local/share')
-rwxr-xr-x.local/share/bin/ccpreview1
-rwxr-xr-x.local/share/bin/decsync2plain2
-rwxr-xr-x.local/share/bin/installbd10
-rwxr-xr-x.local/share/bin/khal4
-rwxr-xr-x.local/share/bin/lights2
-rwxr-xr-x.local/share/bin/nodisconnect5
6 files changed, 8 insertions, 16 deletions
diff --git a/.local/share/bin/ccpreview b/.local/share/bin/ccpreview
index 7ae1f53..d0f8525 100755
--- a/.local/share/bin/ccpreview
+++ b/.local/share/bin/ccpreview
@@ -37,7 +37,6 @@ mpv --demuxer-lavf-format=video4linux2 \
--no-osc \
--no-input-default-bindings \
"av://v4l2:$DEVICE"
- # &> /dev/null & disown
pw-link -d "$CAPTURE_FL" "$OUTPUT_FL"
pw-link -d "$CAPTURE_FR" "$OUTPUT_FR"
diff --git a/.local/share/bin/decsync2plain b/.local/share/bin/decsync2plain
index 5cb7eec..745a1c2 100755
--- a/.local/share/bin/decsync2plain
+++ b/.local/share/bin/decsync2plain
@@ -21,7 +21,7 @@ if no file extension is found and none is explicitly provided, $EXEC_NAME will e
EOF
}
-if [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then
+if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
usage
exit 0
fi
diff --git a/.local/share/bin/installbd b/.local/share/bin/installbd
index eefe92a..ae17002 100755
--- a/.local/share/bin/installbd
+++ b/.local/share/bin/installbd
@@ -4,15 +4,7 @@ discord_version="$(echo "$discord_path" | tr '/' '\n' | tac | sed -n '/^[0-9.]\+
betterdiscord_path="$XDG_CONFIG_HOME/BetterDiscord/data/betterdiscord.asar"
cache_file="$XDG_CACHE_HOME/bdversion"
-# download betterdiscord.asar by default
-download=1
-# do not do download if discord hasn't been updated since the last time this
-# script was run
-[ -e "$cache_file" ] && [ "$discord_version" = "$(cat "$cache_file")" ] && download=0
-# always download if betterdiscord.asar does not exist
-[ ! -e "$betterdiscord_path" ] && download=1
-
-if [ $download -eq 1 ] ; then
+if [ "$discord_path" -nt "$betterdiscord_path" ] ; then
echo "download betterdiscord.asar"
curl -sLo - 'https://betterdiscord.app/Download/betterdiscord.asar' > "$betterdiscord_path"
fi
diff --git a/.local/share/bin/khal b/.local/share/bin/khal
index d417469..71e5392 100755
--- a/.local/share/bin/khal
+++ b/.local/share/bin/khal
@@ -9,8 +9,8 @@ EOF
fi
# aliases
-[ "$1" == "i" ] && { shift ; set -- interactive "$@" ; }
-[ "$1" == "l" ] && { shift ; set -- list "$@" ; }
+[ "$1" = "i" ] && { shift ; set -- interactive "$@" ; }
+[ "$1" = "l" ] && { shift ; set -- list "$@" ; }
exec /usr/bin/khal "$@"
diff --git a/.local/share/bin/lights b/.local/share/bin/lights
index d76782f..69ea06c 100755
--- a/.local/share/bin/lights
+++ b/.local/share/bin/lights
@@ -1,5 +1,5 @@
#!/bin/sh
cmd="$1"
-[[ -z "$cmd" ]] && cmd="toggle"
+[ -z "$cmd" ] && cmd="toggle"
curl -X POST "$HASS_SERVER/api/webhook/$cmd"
diff --git a/.local/share/bin/nodisconnect b/.local/share/bin/nodisconnect
index b4fb2c3..a5819d1 100755
--- a/.local/share/bin/nodisconnect
+++ b/.local/share/bin/nodisconnect
@@ -2,7 +2,7 @@
# use sox to play very quiet noise for keeping bluetooth headphones connected
# kill any previously running processes
-killall -u "$LOGNAME" play
+killall -qu "$LOGNAME" play
# arguments used:
# -q quiet mode (don't output progress bar)
@@ -13,4 +13,5 @@ killall -u "$LOGNAME" play
# synth whitenoise start with white noise
# band -n 650 1300 bandpass filter between 650-1300 Hz
# vol 0.01 very quiet
-play -q -n -r 44100 -b 32 -e signed -c 2 synth whitenoise band -n 650 1300 vol 0.01 & disown
+fork play -q -n -r 44100 -b 32 -e signed -c 2 synth whitenoise band -n 650 1300 vol 0.01
+