move netdevice setting to configuration file

This commit is contained in:
Emily Daemon 2022-04-09 18:28:13 +03:00
parent ea722302ac
commit 57d99e9a72
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,9 @@
# modules location
. "$HOME/.config/candybar/modules.sh"
# network device, needed for upload and download modules
export netdevice=""
# module list. uncomment to enable.
# re-arrange to change order.
# module name icon/prefix suffix

View File

@ -60,8 +60,6 @@ module_todo() {
[ "$todooutput" = "" ] || export bar="${bar}${1}${todooutput}${2}"
}
export netdevice=""
module_upload() {
# https://github.com/speediegamer/xshbar-plugins/blob/main/netstat.plugin
up="$(cat /sys/class/net/${netdevice}/statistics/rx_bytes | awk '{$1=$1/1024000; print $1"B";}' | tail -n 1)"