Browse Source

Rename dwm_networkmanager. Add dwm_wpa to readme

main
joestandring 4 years ago
parent
commit
a04e827ac3
4 changed files with 17 additions and 8 deletions
  1. +10
    -3
      README.md
  2. +3
    -3
      bar-functions/dwm_networkmanager.sh
  3. +2
    -0
      bar-functions/dwm_wpa.sh
  4. +2
    -2
      dwm_bar.sh

+ 10
- 3
README.md View File

@ -16,7 +16,8 @@ A modular statusbar for dwm
- [dwm_date](#dwm_date)
- [dwm_mail](#dwm_mail)
- [dwm_weather](#dwm_weather)
- [dwm_network](#dwm_network)
- [dwm_networkmanager](#dwm_networkmanager)
- [dwm_wpa](#dwm_wpa)
- [dwm_vpn](#dwm_vpn)
- [dwm_ccurse](#dwm_ccurse)
- [dwm_transmission](#dwm_transmission)
@ -102,12 +103,18 @@ Displays the current weather provided by [wttr.in](https://wttr.in)
```
[☀ +20°C]
```
### dwm_network
Displays the current network connection, private IP, and public IP
### dwm_networkmanager
Displays the current network connection, private IP, and public IP using NetworkManager
```
[🌐 enp7s0: 192.168.0.1/24 | 185.199.109.153]
```
Dependencies: ```NetworkManager, curl```
### dwm_wpa
Displays the current network connection and private IP using wpa_cli
```
[襤 My-Wifi 192.168.0.3]
```
Dependancies: ```wpa_cli```
### dwm_vpn
Displays the current VPN connection
```


bar-functions/dwm_network.sh → bar-functions/dwm_networkmanager.sh View File

@ -1,12 +1,12 @@
#!/bin/sh
# A dwm_bar function to show the current network connection/SSID, private IP, and public IP
# A dwm_bar function to show the current network connection/SSID, private IP, and public IP using NetworkManager
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: NetworkManager, curl
dwm_network () {
dwm_networkmanager () {
CONNAME=$(nmcli -a | grep 'Wired connection' | awk 'NR==1{print $1}')
if [ "$CONNAME" = "" ]; then
CONNAME=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -c 5-)
@ -24,4 +24,4 @@ dwm_network () {
printf "%s\n" "$SEP2"
}
dwm_network
dwm_networkmanager

+ 2
- 0
bar-functions/dwm_wpa.sh View File

@ -1,5 +1,7 @@
#!/bin/sh
# Dependancies: wpa_cli
dwm_wpa() {
CONSTATE=$(wpa_cli status | sed -n '/wpa_state/s/^.*=//p')


+ 2
- 2
dwm_bar.sh View File

@ -36,7 +36,7 @@ export SEP2="]"
. "$DIR/bar-functions/dwm_pulse.sh"
. "$DIR/bar-functions/dwm_weather.sh"
. "$DIR/bar-functions/dwm_vpn.sh"
. "$DIR/bar-functions/dwm_network.sh"
. "$DIR/bar-functions/dwm_networkmanager.sh"
. "$DIR/bar-functions/dwm_keyboard.sh"
. "$DIR/bar-functions/dwm_ccurse.sh"
. "$DIR/bar-functions/dwm_date.sh"
@ -44,6 +44,6 @@ export SEP2="]"
# Update dwm status bar every second
while true
do
xsetroot -name "$(dwm_countdown)$(dwm_alarm.sh)$(dwm_transmission)$(dwm_cmus)$(dwm_mpc)$(dwm_spotify)$(dwm_resources)$(dwm_battery)$(dwm_mail)$(dwm_backlight)$(dwm_alsa)$(dwm_pulse)$(dwm_weather)$(dwm_vpn)$(dwm_network)$(dwm_keyboard)$(dwm_ccurse)$(dwm_date)"
xsetroot -name "$(dwm_countdown)$(dwm_alarm.sh)$(dwm_transmission)$(dwm_cmus)$(dwm_mpc)$(dwm_spotify)$(dwm_resources)$(dwm_battery)$(dwm_mail)$(dwm_backlight)$(dwm_alsa)$(dwm_pulse)$(dwm_weather)$(dwm_vpn)$(dwm_networkmanager)$(dwm_keyboard)$(dwm_ccurse)$(dwm_date)"
sleep 1
done

Loading…
Cancel
Save