mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-09 14:19:43 +00:00
Merge remote-tracking branch 'origin/parallel' into parallel
This commit is contained in:
commit
2785224db7
8 changed files with 133 additions and 2 deletions
|
@ -4,7 +4,7 @@
|
|||
# Requires an internet connection
|
||||
# Depends on yay and checkupdates (pacman-contrib)
|
||||
|
||||
PREFIX=' Updates:'
|
||||
PREFIX=' Updates: '
|
||||
|
||||
get_updates()
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ get_updates()
|
|||
|
||||
updates=$(("$updates_arch" + "$updates_aur"))
|
||||
|
||||
echo "$PREFIX $updates"
|
||||
echo "$PREFIX$updates"
|
||||
}
|
||||
|
||||
get_updates
|
||||
|
|
13
modules/fanspeed
Executable file
13
modules/fanspeed
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints the fan RPM
|
||||
# Depends on lm_sensors
|
||||
|
||||
PREFIX=' '
|
||||
|
||||
get_fan_speed()
|
||||
{
|
||||
echo "$PREFIX$(sensors | grep fan1 | cut -d " " -f 9) RPM"
|
||||
}
|
||||
|
||||
get_fan_speed
|
12
modules/kernel
Executable file
12
modules/kernel
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints out the kernel version
|
||||
|
||||
PREFIX=' '
|
||||
|
||||
get_kernel()
|
||||
{
|
||||
echo "$PREFIX$(uname -r)"
|
||||
}
|
||||
|
||||
get_kernel
|
12
modules/localip
Executable file
12
modules/localip
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints out your local IP
|
||||
|
||||
PREFIX='ﯱ '
|
||||
|
||||
get_local_ip()
|
||||
{
|
||||
echo "$PREFIX$(hostname -i)"
|
||||
}
|
||||
|
||||
get_local_ip
|
32
modules/networkdowntraffic
Executable file
32
modules/networkdowntraffic
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints out the current down network traffic in MB
|
||||
|
||||
PREFIX=' '
|
||||
|
||||
get_down_traffic()
|
||||
{
|
||||
DELTA=2
|
||||
RECIEVE1=0
|
||||
RECIEVE2=0
|
||||
|
||||
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
|
||||
for IFACE in $IFACES; do
|
||||
if [ $IFACE != "lo" ]; then
|
||||
RECIEVE1=$(($(ip -s -c link show wlan0 | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE1))
|
||||
fi
|
||||
done
|
||||
|
||||
sleep $DELTA
|
||||
|
||||
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
|
||||
for IFACE in $IFACES; do
|
||||
if [ $IFACE != "lo" ]; then
|
||||
RECIEVE2=$(($(ip -s -c link show wlan0 | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE2))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$PREFIX$(expr $(expr $RECIEVE2 - $RECIEVE1 ) / 1000000)MB"
|
||||
}
|
||||
|
||||
get_down_traffic
|
33
modules/networkuptraffic
Executable file
33
modules/networkuptraffic
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints out the current up network traffic in MB
|
||||
|
||||
PREFIX=' '
|
||||
|
||||
get_up_traffic()
|
||||
{
|
||||
DELTA=2
|
||||
TRANSMIT1=0
|
||||
TRANSMIT2=0
|
||||
|
||||
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
|
||||
for IFACE in $IFACES; do
|
||||
if [ $IFACE != "lo" ]; then
|
||||
TRANSMIT1=$(($(ip -s -c link show wlan0 | tail -n1 | cut -d " " -f5) + TRANSMIT1))
|
||||
fi
|
||||
done
|
||||
|
||||
sleep $DELTA
|
||||
|
||||
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
|
||||
for IFACE in $IFACES; do
|
||||
if [ $IFACE != "lo" ]; then
|
||||
TRANSMIT2=$(($(ip -s -c link show wlan0 | tail -n1 | cut -d " " -f5) + TRANSMIT2))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000000)MB"
|
||||
}
|
||||
|
||||
get_up_traffic
|
||||
|
13
modules/publicip
Executable file
13
modules/publicip
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints out your public IP adress
|
||||
# Depends on curl
|
||||
|
||||
PREFIX=' '
|
||||
|
||||
get_pub_ip()
|
||||
{
|
||||
echo "$PREFIX$(curl -s ifconfig.co)"
|
||||
}
|
||||
|
||||
get_pub_ip
|
16
modules/voidupdates
Executable file
16
modules/voidupdates
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints the number of updates for Void Linux
|
||||
|
||||
PREFIX=' Updates: '
|
||||
|
||||
get_updates()
|
||||
{
|
||||
if ! updates=$(xbps-install -Mun 2> /dev/null | wc -l ); then
|
||||
updates=0
|
||||
fi
|
||||
|
||||
echo "$PREFIX$updates"
|
||||
}
|
||||
|
||||
get_updates
|
Loading…
Reference in a new issue