ENH make network choose default interface
This commit is contained in:
parent
860f54b7ca
commit
8bb8671cc0
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
iface="$1"
|
cmd="$1"
|
||||||
cmd="$2"
|
iface="$(ip route show default | head -n 1 | awk '{print $5}')"
|
||||||
|
|
||||||
net_format="%3d"
|
net_format="%3d"
|
||||||
|
|
||||||
|
|
|
@ -125,21 +125,8 @@ set -g status-right ""
|
||||||
set -g status-right-length 0
|
set -g status-right-length 0
|
||||||
{{- else }}
|
{{- else }}
|
||||||
|
|
||||||
# TODO this is super annoying
|
down="#($XDG_CONFIG_HOME/tmux/plugins/network down)"
|
||||||
{{- if eq .chezmoi.hostname "portnoy4prez" }}
|
up="#($XDG_CONFIG_HOME/tmux/plugins/network up)"
|
||||||
iface="enp0s31f6"
|
|
||||||
{{- else if eq .chezmoi.hostname "mangini4mayor" }}
|
|
||||||
iface="enp3s0"
|
|
||||||
{{- else if eq .chezmoi.hostname "harrison4hegemon" }}
|
|
||||||
iface="eth0"
|
|
||||||
{{- else if eq .chezmoi.hostname "peart4prez" }}
|
|
||||||
iface="ens3"
|
|
||||||
{{- else if eq .chezmoi.hostname "myung4mayor" }}
|
|
||||||
iface="extern1"
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
down="#($XDG_CONFIG_HOME/tmux/plugins/network $iface down)"
|
|
||||||
up="#($XDG_CONFIG_HOME/tmux/plugins/network $iface up)"
|
|
||||||
net="NET(↑/↓): $up$down"
|
net="NET(↑/↓): $up$down"
|
||||||
cpu="CPU: #($XDG_CONFIG_HOME/tmux/plugins/cpu_perc)"
|
cpu="CPU: #($XDG_CONFIG_HOME/tmux/plugins/cpu_perc)"
|
||||||
mem="RAM: #($XDG_CONFIG_HOME/tmux/plugins/mem_perc)"
|
mem="RAM: #($XDG_CONFIG_HOME/tmux/plugins/mem_perc)"
|
||||||
|
|
Loading…
Reference in New Issue