#!/bin/bash

get_name() {
    nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
}

# Output initial state
get_name

# Monitor network changes
nmcli monitor | while read -r line; do
    get_name
done
