diff --git a/home/wm/waybar/src/ice_fetch.sh b/home/wm/waybar/src/ice_fetch.sh index d35d683..066907d 100755 --- a/home/wm/waybar/src/ice_fetch.sh +++ b/home/wm/waybar/src/ice_fetch.sh @@ -41,10 +41,18 @@ fi # Create the tooltip text tooltip="${train_type} ${line_number} (${train_number} - Br${train_series})\n\n" tooltip+="Next stop: ${next_stop_name}\n" -tooltip+="${next_stop_arrival_time} (${next_stop_arrival_delay}) - ${distance_km} km" +if [[ $next_stop_arrival_delay == "" ]]; then + tooltip+="${next_stop_arrival_time} - ${distance_km} km" +else + tooltip+="${next_stop_arrival_time} (${next_stop_arrival_delay}) - ${distance_km} km" +fi # Create the JSON object -text="${speed} km/h - ${next_stop_arrival_time} (${next_stop_arrival_delay})" +if [[ $next_stop_arrival_delay == "" ]]; then + text="${speed} km/h - ${next_stop_arrival_time}" +else + text="${speed} km/h - ${next_stop_arrival_time} (${next_stop_arrival_delay})" +fi alt="Current speed" class="icestats" percentage=0