aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/archupdates27
-rwxr-xr-xmodules/backlight13
-rwxr-xr-xmodules/battery43
-rwxr-xr-xmodules/bluetooth21
-rwxr-xr-xmodules/cpuload32
-rwxr-xr-xmodules/cputemp25
-rwxr-xr-xmodules/date12
-rwxr-xr-xmodules/day_of_week12
-rwxr-xr-xmodules/daypercentage11
-rwxr-xr-xmodules/default_shell12
-rwxr-xr-xmodules/disksize16
-rwxr-xr-xmodules/ethernet16
-rwxr-xr-xmodules/fanspeed13
-rwxr-xr-xmodules/hostname12
-rwxr-xr-xmodules/internetbin0 -> 16536 bytes
-rwxr-xr-xmodules/kernel12
-rwxr-xr-xmodules/localip14
-rwxr-xr-xmodules/mail14
-rwxr-xr-xmodules/mpd25
-rwxr-xr-xmodules/networkdowntraffic31
-rwxr-xr-xmodules/networkuptraffic32
-rwxr-xr-xmodules/nvidia_gpu_temp22
-rwxr-xr-xmodules/os-release14
-rwxr-xr-xmodules/process_count14
-rwxr-xr-xmodules/publicip13
-rwxr-xr-xmodules/ram16
-rwxr-xr-xmodules/ram_perc13
-rwxr-xr-xmodules/redshift13
-rw-r--r--modules/src/internet.c10
-rwxr-xr-xmodules/sunmoon18
-rwxr-xr-xmodules/time12
-rwxr-xr-xmodules/todo15
-rwxr-xr-xmodules/tor23
-rwxr-xr-xmodules/uptime13
-rwxr-xr-xmodules/username14
-rwxr-xr-xmodules/voidupdates18
-rwxr-xr-xmodules/volume20
-rwxr-xr-xmodules/volumebar40
-rwxr-xr-xmodules/weather15
-rwxr-xr-xmodules/wifi24
40 files changed, 720 insertions, 0 deletions
diff --git a/modules/archupdates b/modules/archupdates
new file mode 100755
index 0000000..d4cbc44
--- /dev/null
+++ b/modules/archupdates
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Prints out the number of pacman updates (Arch Linux)
+# Requires an internet connection
+# Depends on yay and checkupdates (pacman-contrib)
+# Optional: add --devel flag to the yay cmd to check for *-git package updates.
+
+PREFIX=' Updates: '
+
+get_updates()
+{
+ if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
+ updates_arch=0
+ fi
+
+ if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
+ updates_aur=0
+ fi
+
+ updates=$(("$updates_arch" + "$updates_aur"))
+
+ echo "$PREFIX$updates"
+}
+
+if [ $(( 10#$(date '+%M') % 3 )) -eq 0 ] && [ $(( 10#$(date '+%S') )) -eq 5 ]; then
+ get_updates
+fi
diff --git a/modules/backlight b/modules/backlight
new file mode 100755
index 0000000..2e4fe88
--- /dev/null
+++ b/modules/backlight
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Prints the backlight percentage
+# Requires the light package
+
+PREFIX='ﯧ'
+
+get_backlight()
+{
+ echo "$PREFIX $(light | sed 's/\..*//g')%"
+}
+
+get_backlight
diff --git a/modules/battery b/modules/battery
new file mode 100755
index 0000000..9069c96
--- /dev/null
+++ b/modules/battery
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# Prints out battery percentage
+
+CHARGING_ICON='⚡ '
+WARNING_ICON='⚠️ '
+BATTERY_FULL_ICON=''
+BATTERY_2_ICON=''
+BATTERY_3_ICON=''
+BATTERY_4_ICON=''
+
+FULL_AT=98
+
+BAT_ICON=""
+ICON=""
+
+get_battery()
+{
+ # The vast majority of people only use one battery.
+
+ if [ -d /sys/class/power_supply/BAT0 ]; then
+ capacity=$(cat /sys/class/power_supply/BAT0/capacity)
+ charging=$(cat /sys/class/power_supply/BAT0/status)
+ if [[ "$charging" == "Charging" ]]; then
+ ICON="$CHARGING_ICON"
+ elif [[ $capacity -le 25 ]]; then
+ ICON="$WARNING_ICON"
+ fi
+
+ if [[ $capacity -ge $FULL_AT ]]; then
+ BAT_ICON=$BATTERY_FULL_ICON
+ elif [[ $capacity -le 25 ]]; then
+ BAT_ICON=$BATTERY_4_ICON
+ elif [[ $capacity -le 60 ]]; then
+ BAT_ICON=$BATTERY_3_ICON
+ elif [[ $capacity -le $FULL_AT ]]; then
+ BAT_ICON=$BATTERY_2_ICON
+ fi
+ fi
+ echo "$ICON$BAT_ICON $capacity%"
+}
+
+get_battery
diff --git a/modules/bluetooth b/modules/bluetooth
new file mode 100755
index 0000000..5dea2b0
--- /dev/null
+++ b/modules/bluetooth
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Prints out the bluetooth status
+
+BLUETOOTH_ON_ICON=''
+BLUETOOTH_OFF_ICON=''
+
+get_bluetooth()
+{
+ status=$(systemctl is-active bluetooth.service)
+
+ if [ "$status" == "active" ]
+ then
+ echo "$BLUETOOTH_ON_ICON"
+ else
+ :
+ #echo "$BLUETOOTH_OFF_ICON"
+ fi
+}
+
+get_bluetooth
diff --git a/modules/cpuload b/modules/cpuload
new file mode 100755
index 0000000..db14d40
--- /dev/null
+++ b/modules/cpuload
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Prints out the CPU load percentage
+
+PREFIX='🧠 '
+
+get_load()
+{
+ # Get the first line with aggregate of all CPUs
+ cpu_last=($(head -n1 /proc/stat))
+ cpu_last_sum="${cpu_last[@]:1}"
+ cpu_last_sum=$((${cpu_last_sum// /+}))
+
+ sleep 0.05
+
+ cpu_now=($(head -n1 /proc/stat))
+ cpu_sum="${cpu_now[@]:1}"
+ cpu_sum=$((${cpu_sum// /+}))
+
+ cpu_delta=$((cpu_sum - cpu_last_sum))
+ cpu_idle=$((cpu_now[4]- cpu_last[4]))
+ cpu_used=$((cpu_delta - cpu_idle))
+ cpu_usage=$((100 * cpu_used / cpu_delta))
+
+ # Keep this as last for our next read
+ cpu_last=("${cpu_now[@]}")
+ cpu_last_sum=$cpu_sum
+
+ echo "$PREFIX $cpu_usage%"
+}
+
+get_load
diff --git a/modules/cputemp b/modules/cputemp
new file mode 100755
index 0000000..c7d4fc4
--- /dev/null
+++ b/modules/cputemp
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Gets temperature of the CPU
+# Dependencies: lm_sensors
+
+PREFIX='🌡️ '
+FIRE='🔥 '
+
+WARNING_LEVEL=80
+
+get_cputemp()
+{
+ # CPU_T=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon?/temp2_input)
+ # CPU_TEMP=$(expr $CPU_T / 1000)
+
+ CPU_TEMP="$(sensors | grep temp1 | awk 'NR==1{gsub("+", " "); gsub("\\..", " "); print $2}')"
+
+ if [ "$CPU_TEMP" -ge $WARNING_LEVEL ]; then
+ PREFIX="$FIRE$PREFIX"
+ fi
+
+ echo "$PREFIX$CPU_TEMP°C"
+}
+
+get_cputemp
diff --git a/modules/date b/modules/date
new file mode 100755
index 0000000..1ef3a99
--- /dev/null
+++ b/modules/date
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Prints out the date
+
+PREFIX='📆 '
+
+get_date()
+{
+ echo "$PREFIX $(date '+%d-%m-%y (%a)')"
+}
+
+get_date
diff --git a/modules/day_of_week b/modules/day_of_week
new file mode 100755
index 0000000..6465068
--- /dev/null
+++ b/modules/day_of_week
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Prints out the date
+
+PREFIX='🗓️'
+
+get_day()
+{
+ echo "$PREFIX $(date '+%a')"
+}
+
+get_day
diff --git a/modules/daypercentage b/modules/daypercentage
new file mode 100755
index 0000000..97e5eec
--- /dev/null
+++ b/modules/daypercentage
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+PREFIX = '🔮 '
+
+import datetime
+
+now = datetime.datetime.now()
+minutes = now.hour * 60 + now.minute
+percentage = round(minutes * 100 / 1440)
+
+print(PREFIX + str(percentage) + "%")
diff --git a/modules/default_shell b/modules/default_shell
new file mode 100755
index 0000000..3add959
--- /dev/null
+++ b/modules/default_shell
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Prints out the name of the default shell
+
+PREFIX='🐚 '
+
+get_default_shell()
+{
+ echo "$PREFIX$(echo $SHELL |sed 's/.*\///g')"
+}
+
+get_default_shell
diff --git a/modules/disksize b/modules/disksize
new file mode 100755
index 0000000..972c209
--- /dev/null
+++ b/modules/disksize
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Prints out the total disk memory and the availeable memory
+
+PREFIX='🗄️ '
+
+get_disk()
+{
+ TOTAL_SIZE=$( df -h --total | tail -1 | awk {'printf $2'})
+ USED_SIZE=$(df -h --total | tail -1 | awk {'printf $3'})
+ PERCENTAGE=$(df -h --total | tail -1 | awk {'printf $5'})
+
+ echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
+}
+
+get_disk
diff --git a/modules/ethernet b/modules/ethernet
new file mode 100755
index 0000000..ffd91a9
--- /dev/null
+++ b/modules/ethernet
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Prints out if there is an ethernet cable connected
+
+ETHERNET_ICON='🖥️'
+
+get_ethernet()
+{
+ if [ -d /sys/class/net/eth? ]; then
+ if [ "$(cat /sys/class/net/eth?/carrier)" == "1" ]; then
+ echo "$ETHERNET_ICON"
+ fi
+ fi
+}
+
+get_ethernet
diff --git a/modules/fanspeed b/modules/fanspeed
new file mode 100755
index 0000000..ea6063a
--- /dev/null
+++ b/modules/fanspeed
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Prints the fan RPM
+# Depends on lm_sensors
+
+PREFIX='🌬️ '
+
+get_fan_speed()
+{
+ echo "$PREFIX$(sensors | grep fan1 | awk 'NR==1{print $2}') RPM"
+}
+
+get_fan_speed
diff --git a/modules/hostname b/modules/hostname
new file mode 100755
index 0000000..258fbd8
--- /dev/null
+++ b/modules/hostname
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Prints USER@hostname
+
+PREFIX='💻 '
+
+get_hostname()
+{
+ echo "$PREFIX$USER@$(hostname)"
+}
+
+get_hostname
diff --git a/modules/internet b/modules/internet
new file mode 100755
index 0000000..22cbd6a
--- /dev/null
+++ b/modules/internet
Binary files differ
diff --git a/modules/kernel b/modules/kernel
new file mode 100755
index 0000000..1ee3939
--- /dev/null
+++ b/modules/kernel
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Prints out the kernel version
+
+PREFIX=' '
+
+get_kernel()
+{
+ echo "$PREFIX$(uname -r)"
+}
+
+get_kernel
diff --git a/modules/localip b/modules/localip
new file mode 100755
index 0000000..91a74c0
--- /dev/null
+++ b/modules/localip
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Prints out your local IP
+
+PREFIX='ﯱ '
+
+get_local_ip()
+{
+ IP=$(ip addr | grep -e "inet " | awk 'NR==2' | sed 's/^.*inet.//g; s/\/.*//g')
+
+ echo "$PREFIX$IP"
+}
+
+get_local_ip
diff --git a/modules/mail b/modules/mail
new file mode 100755
index 0000000..52660d5
--- /dev/null
+++ b/modules/mail
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Prints number of unread mail
+# Requires mutt/neomutt
+
+MAIL_DIR="/home/$USER/Mail/INBOX/new/*"
+PREFIX=' :'
+
+get_mail()
+{
+ echo "$PREFIX$(du -a $MAIL_DIR 2>/dev/null | wc -l)"
+}
+
+get_mail
diff --git a/modules/mpd b/modules/mpd
new file mode 100755
index 0000000..ecbdd4e
--- /dev/null
+++ b/modules/mpd
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PREFIX_PLAY=' '
+PREFIX_PAUSE=' '
+
+get_mpd()
+{
+ current_song="$(mpc current)"
+
+ if [[ "$current_song" = "" ]]; then
+ echo " "
+ exit 0
+ else
+ playpause=$(mpc | awk '/\[.*]/{split($0, a, " "); print a[1]}')
+ if [[ "$playpause" = "[playing]" ]]; then
+ current_song="$PREFIX_PLAY $current_song"
+ elif [[ "$playpause" = "[paused]" ]]; then
+ current_song="$PREFIX_PAUSE $current_song"
+ fi
+ fi
+
+ echo "$current_song"
+}
+
+get_mpd
diff --git a/modules/networkdowntraffic b/modules/networkdowntraffic
new file mode 100755
index 0000000..e8d3a74
--- /dev/null
+++ b/modules/networkdowntraffic
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# Prints out the current down network traffic in MB
+
+PREFIX=' '
+
+get_down_traffic()
+{
+ 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 $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE1))
+ fi
+ done
+
+ sleep 1
+
+ IFACES=$(ip -o link show | awk -F': ' '{print $2}')
+ for IFACE in $IFACES; do
+ if [ $IFACE != "lo" ]; then
+ RECIEVE2=$(($(ip -s -c link show $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE2))
+ fi
+ done
+
+ echo "$PREFIX$(expr $(expr $RECIEVE2 - $RECIEVE1 ) / 1000)KB/s"
+}
+
+get_down_traffic
diff --git a/modules/networkuptraffic b/modules/networkuptraffic
new file mode 100755
index 0000000..396e969
--- /dev/null
+++ b/modules/networkuptraffic
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Prints out the current up network traffic in MB
+
+PREFIX=' '
+
+get_up_traffic()
+{
+ 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 $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT1))
+ fi
+ done
+
+ sleep 1
+
+ IFACES=$(ip -o link show | awk -F': ' '{print $2}')
+ for IFACE in $IFACES; do
+ if [ $IFACE != "lo" ]; then
+ TRANSMIT2=$(($(ip -s -c link show $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT2))
+ fi
+ done
+
+ echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000)KB/s"
+}
+
+get_up_traffic
+
diff --git a/modules/nvidia_gpu_temp b/modules/nvidia_gpu_temp
new file mode 100755
index 0000000..5fc26e7
--- /dev/null
+++ b/modules/nvidia_gpu_temp
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Gets temperature of the GPU
+# Dependencies: nvidia drivers and nvidia-settings
+
+PREFIX=' '
+FIRE=' '
+
+WARNING_LEVEL=80
+
+get_gputemp()
+{
+ GPU_TEMP="$(nvidia-settings -q gpucoretemp -t | head -n 1)"
+
+ if [ "$GPU_TEMP" -ge $WARNING_LEVEL ]; then
+ PREFIX="$FIRE$PREFIX"
+ fi
+
+ echo "$PREFIX$GPU_TEMP°C"
+}
+
+get_gputemp
diff --git a/modules/os-release b/modules/os-release
new file mode 100755
index 0000000..165a7c3
--- /dev/null
+++ b/modules/os-release
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Prints out your OS name
+
+PREFIX=' '
+
+get_os_name()
+{
+ OS=$(cat /etc/os-release | head -n 1 | sed 's/NAME=//g')
+
+ echo "$PREFIX$OS"
+}
+
+get_os_name
diff --git a/modules/process_count b/modules/process_count
new file mode 100755
index 0000000..7d4d0ca
--- /dev/null
+++ b/modules/process_count
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Prints out your process count
+
+PREFIX=' '
+
+get_proc_count()
+{
+ PROC_COUNT=$(ps -Al | wc -l)
+
+ echo "$PREFIX$PROC_COUNT"
+}
+
+get_proc_count
diff --git a/modules/publicip b/modules/publicip
new file mode 100755
index 0000000..2e94e04
--- /dev/null
+++ b/modules/publicip
@@ -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
diff --git a/modules/ram b/modules/ram
new file mode 100755
index 0000000..f7b1c40
--- /dev/null
+++ b/modules/ram
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Prints the total ram and used ram in Mb
+
+PREFIX=' '
+
+get_ram()
+{
+ TOTAL_RAM=$(free -mh --si | awk {'print $2'} | head -n 2 | tail -1)
+ USED_RAM=$(free -mh --si | awk {'print $3'} | head -n 2 | tail -1)
+ MB="MB"
+
+ echo "$PREFIX$USED_RAM/$TOTAL_RAM"
+}
+
+get_ram
diff --git a/modules/ram_perc b/modules/ram_perc
new file mode 100755
index 0000000..40c2b2f
--- /dev/null
+++ b/modules/ram_perc
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Prints the total ram and used ram in Mb
+
+PREFIX=' '
+
+get_ram()
+{
+ USED_RAM=$(free | awk '/Mem/{printf("%d"), $3/$2*100}')
+ echo "$PREFIX$USED_RAM%"
+}
+
+get_ram
diff --git a/modules/redshift b/modules/redshift
new file mode 100755
index 0000000..69f3f9e
--- /dev/null
+++ b/modules/redshift
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Prints out the screen color temperature
+# Requires the redshift package
+
+PREFIX=''
+
+get_redshift()
+{
+ echo "$PREFIX$(redshift -p 2> /dev/null | grep "temp" | awk '{print $3}')"
+}
+
+get_redshift
diff --git a/modules/src/internet.c b/modules/src/internet.c
new file mode 100644
index 0000000..916445b
--- /dev/null
+++ b/modules/src/internet.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+int main()
+{
+ char *internet_icon = " ";
+
+ printf("%s\n", internet_icon);
+
+ return 0;
+}
diff --git a/modules/sunmoon b/modules/sunmoon
new file mode 100755
index 0000000..4bbc062
--- /dev/null
+++ b/modules/sunmoon
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Outputs sun if its daytime and moon if its nighttime
+# Requires the redshift package
+
+SUN_ICON='盛'
+MOON_ICON=''
+
+get_sunmoon()
+{
+ if [[ $(redshift -p | grep "Period" | awk '{print $2}') == "Night" ]]; then
+ echo "$MOON_ICON"
+ else
+ echo "$SUN_ICON"
+ fi
+}
+
+get_sunmoon
diff --git a/modules/time b/modules/time
new file mode 100755
index 0000000..dfd2400
--- /dev/null
+++ b/modules/time
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Prints out the time
+
+PREFIX=' '
+
+get_time()
+{
+ echo "$PREFIX$(date '+%H:%M')"
+}
+
+get_time
diff --git a/modules/todo b/modules/todo
new file mode 100755
index 0000000..09b00ca
--- /dev/null
+++ b/modules/todo
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Prints number of todos
+# Requires t todo manager (https://github.com/sjl/t)
+
+TASKS_DIR="/home/$USER/.todo"
+TASKS_NAME="tasks"
+PREFIX=': '
+
+get_todo()
+{
+echo "$PREFIX$(t --task-dir $TASKS_DIR --list $TASKS_NAME | wc -l)"
+}
+
+get_todo
diff --git a/modules/tor b/modules/tor
new file mode 100755
index 0000000..74ff5b1
--- /dev/null
+++ b/modules/tor
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Prints if the tor service is enabled or not
+# Requires tor
+
+TOR_ENABLED='ﴣ'
+TOR_DISABLED=''
+
+get_tor()
+{
+ status=$(systemctl is-active tor.service)
+
+ if [ "$status" == "active" ]
+ then
+ echo "$TOR_ENABLED"
+ else
+ :
+ #echo "$TOR_DISABLED"
+ fi
+
+}
+
+get_tor
diff --git a/modules/uptime b/modules/uptime
new file mode 100755
index 0000000..2c771d4
--- /dev/null
+++ b/modules/uptime
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Prints the total ram and used ram in Mb
+
+PREFIX=''
+
+get_uptime()
+{
+ UPTIME=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
+ echo "$PREFIX$UPTIME"
+}
+
+get_uptime
diff --git a/modules/username b/modules/username
new file mode 100755
index 0000000..2527b37
--- /dev/null
+++ b/modules/username
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Prints the effective username of the current user
+
+PREFIX=''
+
+get_username()
+{
+ USERNAME=$(whoami)
+
+ echo "$PREFIX $USERNAME"
+}
+
+get_username \ No newline at end of file
diff --git a/modules/voidupdates b/modules/voidupdates
new file mode 100755
index 0000000..9411637
--- /dev/null
+++ b/modules/voidupdates
@@ -0,0 +1,18 @@
+#!/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"
+}
+
+if [ $(( 10#$(date '+%M') % 3 )) -eq 0 ] && [ $(( 10#$(date '+%S') )) -eq 5 ]; then
+ get_updates
+fi
diff --git a/modules/volume b/modules/volume
new file mode 100755
index 0000000..6b5b96e
--- /dev/null
+++ b/modules/volume
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Prints out the volume percentage
+
+VOLUME_ON_ICON=''
+VOLUME_MUTED_ICON=''
+
+get_volume(){
+ curStatus=$(pactl get-sink-mute @DEFAULT_SINK@)
+ volume=$(pactl get-sink-volume @DEFAULT_SINK@ | tail -n 2 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' | head -n 1)
+
+ if [ "${curStatus}" = 'Mute: yes' ]
+ then
+ echo "$VOLUME_MUTED_ICON $volume%"
+ else
+ echo "$VOLUME_ON_ICON $volume%"
+ fi
+}
+
+get_volume
diff --git a/modules/volumebar b/modules/volumebar
new file mode 100755
index 0000000..219428d
--- /dev/null
+++ b/modules/volumebar
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Prints out the volume percentage
+
+# Dependencies: bc
+
+VOLUME_WIDTH=9
+VOLUME_SLIDER='⬤'
+VOLUME_RAIL='◯'
+VOLUME_MUTED='muted'
+
+PREFIX=''
+
+# If volume is >100
+ALERT='!!!'
+
+get_volume(){
+ active_sink=$(pacmd list-sinks | awk '/* index:/{print $3}')
+ curStatus=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | awk '/muted/{ print $2}')
+ volume=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | grep 'volume:' | grep -E -v 'base volume:' | awk -F : '{print $3}' | grep -o -P '.{0,3}%'| sed s/.$// | tr -d ' ')
+ slider_position=$(python -c "print(($volume / 100) * $VOLUME_WIDTH)")
+
+ if [ "${curStatus}" = 'yes' ]
+ then
+ echo "$VOLUME_MUTED"
+ exit 0
+ else
+ for i in $(seq 1 $VOLUME_WIDTH); do
+ [[ $i = $slider_position ]] && BAR=$BAR$VOLUME_SLIDER
+ [[ $i < $slider_position ]] && BAR=$BAR$VOLUME_SLIDER
+ [[ $i > $slider_position ]] && BAR=$BAR$VOLUME_RAIL
+ done
+ fi
+
+ [[ $volume -gt 100 ]] && PREFIX=$PREFIX$ALERT
+
+ echo "$PREFIX$BAR"
+}
+
+get_volume
diff --git a/modules/weather b/modules/weather
new file mode 100755
index 0000000..9bd9f52
--- /dev/null
+++ b/modules/weather
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Deps:
+# curl
+
+
+get_weather()
+{
+ curl -s v2.wttr.in | grep -e "Weather" | sed -n 2p | sed s/Weather://g | sed 's/,//g' | sed 's/+//g' | sed 's/°C.*/°C/' | sed 's/.*m//'
+}
+
+
+if [ $(( 10#$(date '+%S') % 30 )) -eq 0 ]; then
+ get_weather
+fi
diff --git a/modules/wifi b/modules/wifi
new file mode 100755
index 0000000..4f56b5a
--- /dev/null
+++ b/modules/wifi
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Gets the wifi status
+
+WIFI_FULL_ICON=''
+WIFI_MID_ICON=''
+WIFI_LOW_ICON=''
+NO_WIFI_ICON=''
+
+get_wifi()
+{
+ if grep -q wl* "/proc/net/wireless"; then
+ # Wifi quality percentage
+ percentage=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70)}'| xargs)
+ case $percentage in
+ 0) echo $NO_WIFI_ICON;;
+ 100|9[0-9]|8[0-9]|7[0-9]) echo "$WIFI_FULL_ICON" ;;
+ 6[0-9]|5[0-9]|4[0-9]|3[0-9]) echo "$WIFI_MID_ICON" ;;
+ 2[0-9]|1[0-9]|[0-9]) echo "$WIFI_LOW_ICON" ;;
+ esac
+ fi
+}
+
+get_wifi