aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-11-01 13:36:21 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2024-11-01 13:36:21 +0100
commit8094a09a90ea96965878b953531c5ad762a11d9a (patch)
treeb85ae351ca0d8ba00c05969d1c5784c472b60c16 /scripts
parent18638934dc6c88eaf9607a0f4659482f79269da0 (diff)
downloaddotfiles-8094a09a90ea96965878b953531c5ad762a11d9a.tar.gz
dotfiles-8094a09a90ea96965878b953531c5ad762a11d9a.zip
improve DE scripts to be more POSIX compliant
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/media_print_spotify_info.sh4
-rwxr-xr-xscripts/toggle_syn_touchpad.sh6
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/media_print_spotify_info.sh b/scripts/media_print_spotify_info.sh
index 5a53149..fcb367b 100755
--- a/scripts/media_print_spotify_info.sh
+++ b/scripts/media_print_spotify_info.sh
@@ -2,8 +2,8 @@
metadata=$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata')
-artist=$(echo "$metadata" | egrep -A 2 "artist" | egrep -v "artist" | egrep -v "array" | cut -b 27- | cut -d '"' -f 1 | egrep -v ^$)
+artist=$(echo "$metadata" | grep -A 2 -E "artist" | grep -v -E "artist" | grep -v -E "array" | cut -b 27- | cut -d '"' -f 1 | grep -v -E ^$)
-title=$(echo "$metadata" | egrep -A 1 "title" | egrep -v "title" | cut -b 44- | cut -d '"' -f 1| egrep -v ^$)
+title=$(echo "$metadata" | grep -A 1 -E "title" | grep -v -E "title" | cut -b 44- | cut -d '"' -f 1| grep -v -E ^$)
echo $artist - $title
diff --git a/scripts/toggle_syn_touchpad.sh b/scripts/toggle_syn_touchpad.sh
index 38dba25..4f9cdae 100755
--- a/scripts/toggle_syn_touchpad.sh
+++ b/scripts/toggle_syn_touchpad.sh
@@ -1,8 +1,8 @@
#!/bin/sh
-STATE=`synclient -l | grep TouchpadOff | awk '{ print $3 }'`;
+STATE="$(synclient -l | grep TouchpadOff | awk '{ print $3 }')";
-if [ "$STATE" == "0" ]; then
+if [ "$STATE" = "0" ]; then
synclient TouchpadOff=1; else
synclient TouchpadOff=0
fi
@@ -10,7 +10,7 @@ fi
# Forces break of touchpad functions while typing
# 1 second follow interval.
-if [ "$STATE" == "1" ]; then
+if [ "$STATE" = "1" ]; then
syndaemon -i 1 -d; else
killall syndaemon
fi