*.sh: Fix some shellcheck issues
This commit is contained in:
@@ -15,17 +15,17 @@ module_flags=(
|
||||
[vpn_click_left]="$BASE_DIR/scripts/pub_ipv4.sh &"
|
||||
)
|
||||
for module in "${!module_flags[@]}"; do
|
||||
export POLYBAR_${module^^}="${module_flags[$module]}"
|
||||
export POLYBAR_"${module^^}=${module_flags[$module]}"
|
||||
done
|
||||
|
||||
# if there is no running instance
|
||||
if ! pgrep -ax polybar >/dev/null 2>&1; then
|
||||
# launch Polybar on every monitor
|
||||
# https://github.com/polybar/polybar/issues/763
|
||||
while read m; do
|
||||
while read -r m; do
|
||||
export MONITOR="${m%%:*}"
|
||||
polybar --reload -c "$BASE_DIR/config" main &
|
||||
done <<<$(polybar --list-monitors)
|
||||
done <<<"$(polybar --list-monitors)"
|
||||
|
||||
echo "Polybar launched..."
|
||||
else
|
||||
|
||||
@@ -9,7 +9,6 @@ low=20
|
||||
|
||||
red='%{F#f00}'
|
||||
green='%{F#0f0}'
|
||||
end='%{F-}'
|
||||
|
||||
bat="$(cat /sys/class/power_supply/BAT0/capacity 2>/dev/null)" || exit
|
||||
ac="$(cat /sys/class/power_supply/AC/online 2>/dev/null)"
|
||||
@@ -21,8 +20,8 @@ ramp=( )
|
||||
# display in green when over $full and a charger is connected
|
||||
[[ "$bat" -lt "$full" || "$ac" -eq 0 ]] || color="$green"
|
||||
|
||||
let "icon_index = $bat / (${#ramp[@]} - 1)"
|
||||
[[ $icon_index -lt ${#ramp[@]} ]] || icond_index=10
|
||||
icon_index="$((bat / (${#ramp[@]} - 1)))"
|
||||
[[ $icon_index -lt ${#ramp[@]} ]] || icon_index=10
|
||||
icon="${ramp[$icon_index]}"
|
||||
[[ "$ac" -eq 0 ]] || charge=""
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo $(curl -s https://ipinfo.io/ip)
|
||||
curl -s https://ipinfo.io/ip
|
||||
|
||||
Reference in New Issue
Block a user