fix shellcheck SC2236
parent
a283a1bb4a
commit
f27ee79a20
|
@ -5,12 +5,12 @@ CITY=""
|
|||
|
||||
API="https://api.waqi.info/feed"
|
||||
|
||||
if [ ! -z $CITY ]; then
|
||||
if [ -n "$CITY" ]; then
|
||||
aqi=$(curl -sf "$API/$CITY/?token=$TOKEN")
|
||||
else
|
||||
location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
|
||||
|
||||
if [ ! -z "$location" ]; then
|
||||
if [ -n "$location" ]; then
|
||||
location_lat="$(echo "$location" | jq '.location.lat')"
|
||||
location_lon="$(echo "$location" | jq '.location.lng')"
|
||||
|
||||
|
@ -18,7 +18,7 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z "$aqi" ]; then
|
||||
if [ -n "$aqi" ]; then
|
||||
if [ "$(echo "$aqi" | jq -r '.status')" = "ok" ]; then
|
||||
aqi=$(echo "$aqi" | jq '.data.aqi')
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
sessions="$(lsof -Pi | grep ":22")"
|
||||
|
||||
if [ ! -z "$sessions" ]; then
|
||||
if [ -n "$sessions" ]; then
|
||||
count=$(echo "$sessions" | wc -l)
|
||||
echo "# ($count): $(echo "$sessions" | cut -d ">" -f 2 | cut -d " " -f 1 | cut -d ":" -f 1 | tail -n 1)"
|
||||
else
|
||||
|
|
|
@ -20,7 +20,7 @@ if [ "$(echo "$wifionice" | jq .connection)" = "true" ]; then
|
|||
station_arrival=$(date --date="@$((station_arrival / 1000))" +%H:%M)
|
||||
|
||||
station_delay=$(echo "$station" | jq -r '.timetable.arrivalDelay')
|
||||
if [ ! -z "$station_delay" ]; then
|
||||
if [ -n "$station_delay" ]; then
|
||||
station_delay=" %{F#d60606}($station_delay)%{F-}"
|
||||
else
|
||||
station_delay=""
|
||||
|
|
|
@ -5,8 +5,8 @@ USERAGENT="polybar-scripts/notification-reddit:v1.0 u/reddituser"
|
|||
|
||||
notifications=$(curl -sf --user-agent "$USERAGENT" "$URL" | jq '.["data"]["children"] | length')
|
||||
|
||||
if [ ! -z "$notifications" ] && [ "$notifications" -gt 0 ]; then
|
||||
echo "#1 $notifications"
|
||||
if [ -n "$notifications" ] && [ "$notifications" -gt 0 ]; then
|
||||
echo "#1 $notifications"
|
||||
else
|
||||
echo "#2"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue