mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 11:47:09 -04:00
move net stuff to single script
This commit is contained in:
parent
83de97e20c
commit
676b63cd79
|
@ -4,11 +4,10 @@ Config
|
||||||
, bgColor = "#121212"
|
, bgColor = "#121212"
|
||||||
, fgColor = "#cccccc"
|
, fgColor = "#cccccc"
|
||||||
, position = Top
|
, position = Top
|
||||||
, template = " %XMonadLog% }{ <fc=#fc7932>%ip%</fc> @ %ssid% <fc=#777777>:</fc> VOL %volume% <fc=#777777>:</fc> %battery% <fc=#777777>:</fc> CPU %cpu% <fc=#777777>:</fc> RAM %memory% <fc=#777777>:</fc> %load% <fc=#777777>:</fc> <fc=#f7e83b>%date%</fc> "
|
, template = " %XMonadLog% }{ %network% <fc=#777777>:</fc> VOL %volume% <fc=#777777>:</fc> %battery% <fc=#777777>:</fc> CPU %cpu% <fc=#777777>:</fc> RAM %memory% <fc=#777777>:</fc> %load% <fc=#777777>:</fc> <fc=#f7e83b>%date%</fc> "
|
||||||
, commands =
|
, commands =
|
||||||
[ Run XMonadLog
|
[ Run XMonadLog
|
||||||
, Run Com "ipmon" [] "ip" 6000
|
, Run Com "netmon" [] "network" 6000
|
||||||
, Run Com "ssidmon" [] "ssid" 6000
|
|
||||||
, Run PipeReader "/tmp/pipe-volume" "volume"
|
, Run PipeReader "/tmp/pipe-volume" "volume"
|
||||||
, Run Com "batmon" [] "battery" 36000
|
, Run Com "batmon" [] "battery" 36000
|
||||||
, Run Com "cpumon" [] "cpu" 50
|
, Run Com "cpumon" [] "cpu" 50
|
||||||
|
|
21
.local/bin/netmon
Executable file
21
.local/bin/netmon
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ADAPTER="wlan0"
|
||||||
|
|
||||||
|
address=$(ip route get 1)
|
||||||
|
address=${address#* via * dev * src }
|
||||||
|
address=${address% uid *}
|
||||||
|
|
||||||
|
ssid=
|
||||||
|
while read -r line; do
|
||||||
|
case $line in
|
||||||
|
*Connected\ network*)
|
||||||
|
ssid=${line##*Connected network}
|
||||||
|
ssid="${ssid#"${ssid%%[![:space:]]*}"}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done <<EOF
|
||||||
|
$(iwctl station "$ADAPTER" show)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
printf '<fc=#fc7932>%s</fc> @ %s\n' "$address" "$ssid"
|
Loading…
Reference in a new issue