mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
i3status: Use default route for ethernet address first.
This commit is contained in:
@@ -45,6 +45,17 @@ function wireless {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wired {
|
function wired {
|
||||||
|
local def_iface="$(ip route get 1.1.1.1 2>&1 | grep -oP 'dev \K\S+')"
|
||||||
|
if test -n "${def_iface}" ; then
|
||||||
|
cat <<-EOF
|
||||||
|
ethernet "${def_iface}" {
|
||||||
|
format_up = "E: %ip"
|
||||||
|
format_down = "E: down"
|
||||||
|
}
|
||||||
|
order += "ethernet ${def_iface}"
|
||||||
|
EOF
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
ethernet _first_ {
|
ethernet _first_ {
|
||||||
format_up = "E: %ip"
|
format_up = "E: %ip"
|
||||||
|
|||||||
Reference in New Issue
Block a user