diff --git a/config.yml b/config.yml index 2fe480a6..358bd058 100644 --- a/config.yml +++ b/config.yml @@ -72,11 +72,11 @@ wtf: position: top: 4 left: 0 - height: 1 + height: 2 width: 1 refreshInterval: 3600 status: - enabled: true + enabled: false position: top: 5 left: 0 diff --git a/newrelic/widget.go b/newrelic/widget.go index 7ad64584..7a1695e2 100644 --- a/newrelic/widget.go +++ b/newrelic/widget.go @@ -71,7 +71,7 @@ func (widget *Widget) contentFrom(deploys []nr.ApplicationDeployment) string { str = str + fmt.Sprintf( " [green]%s[white] %s %-16s\n", deploy.Revision[0:8], - deploy.Timestamp.Format("Jan 02, 15:04"), + deploy.Timestamp.Format("Jan 02, 15:04 MST"), wtf.NameFromEmail(deploy.User), ) diff --git a/security/client.go b/security/client.go index 582c9afe..7dee9215 100644 --- a/security/client.go +++ b/security/client.go @@ -5,10 +5,11 @@ import () func Fetch() map[string]string { data := make(map[string]string) + data["Dns"] = DnsServers() data["Enabled"] = FirewallState() - data["Stealth"] = FirewallStealthState() data["Encryption"] = WifiEncryption() data["Network"] = WifiName() + data["Stealth"] = FirewallStealthState() return data } diff --git a/security/dns.go b/security/dns.go new file mode 100644 index 00000000..c57a202b --- /dev/null +++ b/security/dns.go @@ -0,0 +1,14 @@ +package security + +import ( + "os/exec" + + "github.com/senorprogrammer/wtf/wtf" +) + +const dnsCmd = "networksetup" + +func DnsServers() string { + cmd := exec.Command(dnsCmd, "-getdnsservers", "Wi-Fi") + return wtf.ExecuteCommand(cmd) +} diff --git a/security/widget.go b/security/widget.go index ac6fe576..ae1cf70a 100644 --- a/security/widget.go +++ b/security/widget.go @@ -2,7 +2,7 @@ package security import ( "fmt" - //"sort" + "strings" "time" "github.com/gdamore/tcell" @@ -66,6 +66,11 @@ func (widget *Widget) contentFrom(data map[string]string) string { str = str + fmt.Sprintf(" %8s: %s\n", "Enabled", data["Enabled"]) str = str + fmt.Sprintf(" %8s: %s\n", "Stealth", data["Stealth"]) str = str + "\n" + str = str + " [red]DNS[white]\n" + + for _, record := range strings.Split(data["Dns"], "\n") { + str = str + fmt.Sprintf(" %8s\n", record) + } return str }