mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-09 14:19:43 +00:00
Changed units in networkup/down modules
This commit is contained in:
parent
21d96d4758
commit
fe7633cd1b
3 changed files with 4 additions and 8 deletions
2
TODO.org
2
TODO.org
|
@ -12,8 +12,6 @@ Each module writes to stdout.
|
|||
* Todo List
|
||||
- Delay in archupdates module (if minutes divisible by 5/4)
|
||||
- Add dependencies like bc
|
||||
- Networkup/down modules in kb instead of mb? and change sleep to 1s so that
|
||||
output is XMb/s
|
||||
|
||||
Bugs to fix:
|
||||
None
|
||||
|
|
|
@ -6,7 +6,6 @@ PREFIX=' '
|
|||
|
||||
get_down_traffic()
|
||||
{
|
||||
DELTA=2
|
||||
RECIEVE1=0
|
||||
RECIEVE2=0
|
||||
|
||||
|
@ -17,7 +16,7 @@ get_down_traffic()
|
|||
fi
|
||||
done
|
||||
|
||||
sleep $DELTA
|
||||
sleep 1
|
||||
|
||||
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
|
||||
for IFACE in $IFACES; do
|
||||
|
@ -26,7 +25,7 @@ get_down_traffic()
|
|||
fi
|
||||
done
|
||||
|
||||
echo "$PREFIX$(expr $(expr $RECIEVE2 - $RECIEVE1 ) / 1000000)MB"
|
||||
echo "$PREFIX$(expr $(expr $RECIEVE2 - $RECIEVE1 ) / 1000)KB/s"
|
||||
}
|
||||
|
||||
get_down_traffic
|
||||
|
|
|
@ -6,7 +6,6 @@ PREFIX=' '
|
|||
|
||||
get_up_traffic()
|
||||
{
|
||||
DELTA=2
|
||||
TRANSMIT1=0
|
||||
TRANSMIT2=0
|
||||
|
||||
|
@ -17,7 +16,7 @@ get_up_traffic()
|
|||
fi
|
||||
done
|
||||
|
||||
sleep $DELTA
|
||||
sleep 1
|
||||
|
||||
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
|
||||
for IFACE in $IFACES; do
|
||||
|
@ -26,7 +25,7 @@ get_up_traffic()
|
|||
fi
|
||||
done
|
||||
|
||||
echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000000)MB"
|
||||
echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000)KB/s"
|
||||
}
|
||||
|
||||
get_up_traffic
|
||||
|
|
Loading…
Reference in a new issue