summaryrefslogtreecommitdiff
path: root/scripts/.local/bin/statusbar
diff options
context:
space:
mode:
authorivan-boikov <ik.boikov.public@protonmail.com>2022-07-14 23:51:06 +0200
committerivan-boikov <ik.boikov.public@protonmail.com>2022-07-14 23:51:06 +0200
commit47eb75b4250badd24b3137f77bf237e6f0570b15 (patch)
tree3ea591e70b3e5f6e9a4dd7005904d9226f1b6891 /scripts/.local/bin/statusbar
parent919fe5982b47278ef34a30d3b08af41e1ddd1b11 (diff)
1
Diffstat (limited to 'scripts/.local/bin/statusbar')
-rwxr-xr-xscripts/.local/bin/statusbar/sb-battery23
-rwxr-xr-xscripts/.local/bin/statusbar/sb-clock3
-rwxr-xr-xscripts/.local/bin/statusbar/sb-cpu3
-rwxr-xr-xscripts/.local/bin/statusbar/sb-cpubars44
-rwxr-xr-xscripts/.local/bin/statusbar/sb-disk23
-rwxr-xr-xscripts/.local/bin/statusbar/sb-doppler206
-rwxr-xr-xscripts/.local/bin/statusbar/sb-forecast35
-rwxr-xr-xscripts/.local/bin/statusbar/sb-help-icon17
-rwxr-xr-xscripts/.local/bin/statusbar/sb-internet13
-rwxr-xr-xscripts/.local/bin/statusbar/sb-iplocate17
-rwxr-xr-xscripts/.local/bin/statusbar/sb-kbselect16
-rwxr-xr-xscripts/.local/bin/statusbar/sb-mailbox22
-rwxr-xr-xscripts/.local/bin/statusbar/sb-memory16
-rwxr-xr-xscripts/.local/bin/statusbar/sb-moonphase37
-rwxr-xr-xscripts/.local/bin/statusbar/sb-mpdup8
-rwxr-xr-xscripts/.local/bin/statusbar/sb-music5
-rwxr-xr-xscripts/.local/bin/statusbar/sb-nettraf29
-rwxr-xr-xscripts/.local/bin/statusbar/sb-news17
-rwxr-xr-xscripts/.local/bin/statusbar/sb-pacpackages29
-rwxr-xr-xscripts/.local/bin/statusbar/sb-popupgrade9
-rwxr-xr-xscripts/.local/bin/statusbar/sb-price50
-rwxr-xr-xscripts/.local/bin/statusbar/sb-tasks12
-rwxr-xr-xscripts/.local/bin/statusbar/sb-torrent27
-rwxr-xr-xscripts/.local/bin/statusbar/sb-volume26
24 files changed, 0 insertions, 687 deletions
diff --git a/scripts/.local/bin/statusbar/sb-battery b/scripts/.local/bin/statusbar/sb-battery
deleted file mode 100755
index 04a3cf7..0000000
--- a/scripts/.local/bin/statusbar/sb-battery
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Prints all batteries, their percentage remaining
-
-# Loop through all attached batteries and format the info
-for battery in /sys/class/power_supply/BAT?*; do
- # If non-first battery, print a space separator.
- [ -n "${capacity+x}" ] && printf " "
- # Sets up the status and capacity
- case "$(cat "$battery/status" 2>&1)" in
- "Full") status="F" ;;
- "Discharging") status="-" ;;
- "Charging") status="+" ;;
- "Not charging") status="" ;;
- "Unknown") status="?" ;;
- *) exit 1 ;;
- esac
- capacity="$(cat "$battery/capacity" 2>&1)"
- # Will make a warn variable if discharging and low
- [ "$status" = "D" ] && [ "$capacity" -le 25 ] && warn="!!!"
- # Prints the info
- printf "%d%%%s%s" "$capacity" "$status" "$warn" ; unset warn
-done && printf "\\n"
diff --git a/scripts/.local/bin/statusbar/sb-clock b/scripts/.local/bin/statusbar/sb-clock
deleted file mode 100755
index e6fbb6b..0000000
--- a/scripts/.local/bin/statusbar/sb-clock
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-date "+%d/%m/%y %a %H:%M:%S"
diff --git a/scripts/.local/bin/statusbar/sb-cpu b/scripts/.local/bin/statusbar/sb-cpu
deleted file mode 100755
index 4594826..0000000
--- a/scripts/.local/bin/statusbar/sb-cpu
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sensors | awk '/CPU:/ {print $2}' | sed 's/....$//'
diff --git a/scripts/.local/bin/statusbar/sb-cpubars b/scripts/.local/bin/statusbar/sb-cpubars
deleted file mode 100755
index cfa54e4..0000000
--- a/scripts/.local/bin/statusbar/sb-cpubars
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-# Module showing CPU load as a changing bars.
-# Just like in polybar.
-# Each bar represents amount of load on one core since
-# last run.
-
-# Cache in tmpfs to improve speed and reduce SSD load
-cache=/tmp/cpubarscache
-
-case $BLOCK_BUTTON in
- 2) setsid -f "$TERMINAL" -e htop ;;
- 3) notify-send "CPU load module" "Each bar represents
-one CPU core";;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-# id total idle
-stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat)
-[ ! -f $cache ] && echo "$stats" > "$cache"
-old=$(cat "$cache")
-printf ""
-echo "$stats" | while read -r row; do
- id=${row%% *}
- rest=${row#* }
- total=${rest%% *}
- idle=${rest##* }
-
- case "$(echo "$old" | awk '{if ($1 == id)
- printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \
- id="$id" total="$total" idle="$idle")" in
-
- "0") printf "▁";;
- "1") printf "▂";;
- "2") printf "▃";;
- "3") printf "▄";;
- "4") printf "▅";;
- "5") printf "▆";;
- "6") printf "▇";;
- "7") printf "█";;
- "8") printf "█";;
- esac
-done; printf "\\n"
-echo "$stats" > "$cache"
diff --git a/scripts/.local/bin/statusbar/sb-disk b/scripts/.local/bin/statusbar/sb-disk
deleted file mode 100755
index e947509..0000000
--- a/scripts/.local/bin/statusbar/sb-disk
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Status bar module for disk space
-# $1 should be drive mountpoint, otherwise assumed /.
-
-location=${1:-/}
-
-[ -d "$location" ] || exit
-
-case $BLOCK_BUTTON in
- 1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;;
- 3) notify-send "💽 Disk module" "\- Shows used hard drive space.
-- Click to show all disk info." ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-case "$location" in
- "/home"* ) icon="🏠" ;;
- "/mnt"* ) icon="💾" ;;
- *) icon="🖥";;
-esac
-
-printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')"
diff --git a/scripts/.local/bin/statusbar/sb-doppler b/scripts/.local/bin/statusbar/sb-doppler
deleted file mode 100755
index dc93db0..0000000
--- a/scripts/.local/bin/statusbar/sb-doppler
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/bin/sh
-
-# Show a Doppler RADAR of an American user's preferred location.
-
-secs=600 # Download a new doppler radar if one hasn't been downloaded in $secs seconds.
-radarloc="${XDG_CACHE_HOME:-$HOME/.cache}/radar"
-doppler="${XDG_CACHE_HOME:-$HOME/.cache}/doppler.gif"
-
-pickloc() { chosen="$(echo "Northeast
-Southeast
-PacNorthWest
-PacSouthWest
-UpperMissVly
-SouthMissVly
-SouthPlains
-NorthRockies
-SouthRockies
-Alaska
-Carib
-Hawaii
-CentGrLakes
-Conus-Large
-KABR: Aberdeen, SD
-KBIS: Bismarck, ND
-KFTG: Denver/Boulder, CO
-KDMX: Des Moines, IA
-KDTX: Detroit, MI
-KDDC: Dodge City, KS
-KDLH: Duluth, MN
-KCYS: Cheyenne, WY
-KLOT: Chicago, IL
-KGLD: Goodland, KS
-KUEX: Hastings, NE
-KGJX: Grand Junction, CO
-KGRR: Grand Rapids, MI
-KMVX: Fargo/Grand Forks, ND
-KGRB: Green Bay, WI
-KIND: Indianapolis, IN
-KJKL: Jackson, KY
-KARX: La Crosse, WI
-KILX: Lincoln/Central Illinois, IL
-KLVX: Louisville, KY
-KMQT: Marquette
-KMKX: Milwaukee, WI
-KMPX: Minneapolis, MN
-KAPX: Gaylord/Alpena, MI
-KLNX: North Platte, NE
-KIWX: N. Webster/Northern, IN
-KOAX: Omaha, NE
-KPAH: Paducah, KY
-KEAX: Pleasant Hill, MO
-KPUX: Pueblo, CO
-KDVN: Quad Cities, IA
-KUDX: Rapid City, SD
-KRIW: Riverton, WY
-KSGF: Springfield, MO
-KLSX: St. LOUIS, MO
-KFSD: Sioux Falls, IA
-KTWX: Topeka, KS
-KICT: Wichita, KS
-KVWX: Paducah, KY
-ICAO: Responsible Wfo
-KLTX: WILMINGTON, NC
-KCCX: State College/Central, PA
-KLWX: Sterling, VA
-KFCX: Blacksburg/Roanoke, VA
-KRAX: Raleigh/Durham, NC
-KGYX: Portland, ME
-KDIX: Mt Holly/Philadelphia, PA
-KPBZ: Pittsburgh, PA
-KAKQ: Wakefield, VA
-KMHX: Morehead City, NC
-KGSP: Greer/Greenville/Sprtbg, SC
-KILN: Wilmington/Cincinnati, OH
-KCLE: Cleveland, OH
-KCAE: Columbia, SC
-KBGM: Binghamton, NY
-KENX: Albany, NY
-KBUF: Buffalo, NY
-KCXX: Burlington, VT
-KCBW: Caribou, ME
-KBOX: Boston /Taunton, MA
-KOKX: New York City, NY
-KCLX: Charleston, SC
-KRLX: Charleston, WV
-ICAO: Responsible WFO
-KBRO: Brownsville, TX
-KABX: Albuquerque, NM
-KAMA: Amarillo, TX
-KFFC: Peachtree City/Atlanta, GA
-KEWX: Austin/Sanantonio, TX
-KBMX: Birmingham, AL
-KCRP: Corpus Christi, TX
-KFWS: Dallas / Ft. Worth, TX
-KEPZ: El Paso, TX
-KHGX: Houston/ Galveston, TX
-KJAX: Jacksonville, FL
-KBYX: Key West, FL
-KMRX: Morristown/knoxville, TN
-KLBB: Lubbock, TX
-KLZK: Little Rock, AR
-KLCH: Lake Charles, LA
-KOHX: Nashville, TN
-KMLB: Melbourne, FL
-KNQA: Memphis, TN
-KAMX: Miami, FL
-KMAF: Midland/odessa, TX
-KTLX: Norman, OK
-KHTX: Huntsville, AL
-KMOB: Mobile, AL
-KTLH: Tallahassee, FL
-KTBW: Tampa Bay Area, FL
-KSJT: San Angelo, TX
-KINX: Tulsa, OK
-KSRX: Tulsa, OK
-KLIX: New Orleans/slidell, LA
-KDGX: Jackson, MS
-KSHV: Shreveport, LA
-ICAO: Responsible WFO
-KLGX: Seattle / Tacoma, WA
-KOTX: Spokane, WA
-KEMX: Tucson, AZ
-KYUX: Phoenix, AZ
-KNKX: San Diego, CA
-KMUX: Monterey/san Francisco, CA
-KHNX: San Joaquin/hanford, CA
-KSOX: San Diego, CA
-KATX: Seattle / Tacoma, WA
-KIWA: Phoenix, AZ
-KRTX: Portland, OR
-KSFX: Pocatello, ID
-KRGX: Reno, NV
-KDAX: Sacramento, CA
-KMTX: Salt Lake City, UT
-KPDT: Pendleton, OR
-KMSX: Missoula, MT
-KESX: Las Vegas, NV
-KVTX: Los Angeles, CA
-KMAX: Medford, OR
-KFSX: Flagstaff, AZ
-KGGW: Glasgow, MT
-KLRX: Elko, NV
-KBHX: Eureka, CA
-KTFX: Great Falls, MT
-KCBX: Boise, ID
-KBLX: Billings, MT
-KICX: Salt Lake City, UT
-ICAO: Responsible Wfo W/ MSCF
-PABC: Anchorage, AK
-PAPD: Fairbanks, AK
-PHKM: Honolulu, HI
-PAHG: Anchorage, AK
-PAKC: Anchorage, AK
-PAIH: Anchorage, AK
-PHMO: Honolulu, HI
-PAEC: Fairbanks, AK
-TJUA: San Juan, PR
-PACG: Juneau, AK
-PHKI: Honolulu, HI
-PHWA: Honolulu, HI
-ICAO: Responsible Wfo W/ MSCF
-KFDR: Norman, OK
-PGUA: Guam
-KBBX: Sacramento, CA
-KFDX: Albuquerque, NM
-KGWX: Jackson, MS
-KDOX: Wakefield, VA
-KDYX: San Angelo, TX
-KEYX: Las Vegas, NV
-KEVX: Mobile, AL
-KHPX: Paducah, KY
-KTYX: Burlington, VT
-KGRK: Dallas / Ft. Worth, TX
-KPOE: Lake Charles, LA
-KEOX: Tallahassee, FL
-KHDX: El Paso, TX
-KDFX: San Antonio, TX
-KMXX: Birmingham, AL
-KMBX: Bismarck, ND
-KVAX: Jacksonville, FL
-KJGX: Peachtree City/atlanta, GA
-KVNX: Norman, OK
-KVBX: Vandenberg Afb: Orcutt, CA" | dmenu -r -i -l 50 -p "Select a National Weather Service radar to use as default:" | sed "s/:.*//" | tr "[:lower:]" "[:upper:]")"
-
-# Sanity check of selection and ensure user did not escape.
-echo "$chosen" | grep -q "^[A-Z]\+$" && echo "$chosen" > "$radarloc" ;}
-
-getdoppler() {
- loc="$(cat "$radarloc")"
- notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc."
- curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;}
-
-showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}
-
-case $BLOCK_BUTTON in
- 1) [ ! -f "$radarloc" ] && pickloc && getdoppler
- [ $(($(date '+%s') - $(stat -c %Y "$doppler"))) -gt "$secs" ] && getdoppler
- showdoppler ;;
- 2) pickloc && getdoppler && showdoppler ;;
- 3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR.
-- Middle click to update change RADAR location.
-After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-echo 🗺️
diff --git a/scripts/.local/bin/statusbar/sb-forecast b/scripts/.local/bin/statusbar/sb-forecast
deleted file mode 100755
index 1a625bd..0000000
--- a/scripts/.local/bin/statusbar/sb-forecast
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-# Displays todays precipication chance (☔) and daily low (🥶) and high (🌞).
-# Usually intended for the statusbar.
-
-# If we have internet, get a weather report from wttr.in and store it locally.
-# You could set up a shell alias to view the full file in a pager in the
-# terminal if desired. This function will only be run once a day when needed.
-weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport"
-getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
-
-# Some very particular and terse stream manipulation. We get the maximum
-# precipitation chance and the daily high and low from the downloaded file and
-# display them with coresponding emojis.
-showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" |
- grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')"
-sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " " $1 ".." $2 "°"}' ;}
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;
- 2) getforecast && showweather ;;
- 3) notify-send "🌈 Weather module" "\- Left click for full forecast.
-- Middle click to update forecast.
-☔: Chance of rain/snow
-🥶: Daily low
-🌞: Daily high" ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-# The test if our forcecast is updated to the day. If it isn't download a new
-# weather report from wttr.in with the above function.
-[ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
- getforecast
-
-showweather
diff --git a/scripts/.local/bin/statusbar/sb-help-icon b/scripts/.local/bin/statusbar/sb-help-icon
deleted file mode 100755
index 8fa4a52..0000000
--- a/scripts/.local/bin/statusbar/sb-help-icon
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-# The clickable help menu. Middle click to restart wm.
-
-# If dwm is running, use dwm's readme and restart.
-pidof dwm >/dev/null &&
- READMEFILE=/usr/local/share/dwm/larbs.mom
- restartwm() { pkill -HUP dwm ;} ||
- restartwm() { i3 restart ;}
-
-case $BLOCK_BUTTON in
- 1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;;
- 2) restartwm ;;
- 3) notify-send "❓ Help module" "\- Left click to open LARBS guide.
-- Middle click to refresh window manager." ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac; echo "❓"
diff --git a/scripts/.local/bin/statusbar/sb-internet b/scripts/.local/bin/statusbar/sb-internet
deleted file mode 100755
index 6d80852..0000000
--- a/scripts/.local/bin/statusbar/sb-internet
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-# Show wifi W and percent strength or w if none.
-# Show E if connected to ethernet or e if none.
-# Show V if a vpn connection is active
-
-if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
- wifiicon="$(awk '/^\s*w/ { print "W" int($3 * 100 / 70) }' /proc/net/wireless)"
-elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
- grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="w" || wifiicon="w"
-fi
-
-printf "%s%s%s\n" "$(sed "s/.*/V/" /sys/class/net/tun*/operstate 2>/dev/null)" "$(sed "s/down/e/;s/up/E/" /sys/class/net/e*/operstate 2>/dev/null)" "$wifiicon"
diff --git a/scripts/.local/bin/statusbar/sb-iplocate b/scripts/.local/bin/statusbar/sb-iplocate
deleted file mode 100755
index ab89ffd..0000000
--- a/scripts/.local/bin/statusbar/sb-iplocate
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-# Gets your public ip address checks which country you are in and
-# displays that information in the statusbar
-#
-# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
-
-#ifinstalled "geoip" || exit
-#addr="$(curl ifconfig.me 2>/dev/null)" || exit
-#grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"
-
-locaddr=$(hostname -i | awk '{print $1}')
-echo $locaddr
-
-case $BLOCK_BUTTON in
- 1) notify-send "$(curl ifconfig.me 2>/dev/null)"
-esac
diff --git a/scripts/.local/bin/statusbar/sb-kbselect b/scripts/.local/bin/statusbar/sb-kbselect
deleted file mode 100755
index f0c923f..0000000
--- a/scripts/.local/bin/statusbar/sb-kbselect
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-# works on any init system
-# requirements: dmenu, xorg-setxkbmap
-kb="$(setxkbmap -query | grep -oP 'layout:\s*\K\w+')" || exit 1
-
-case $BLOCK_BUTTON in
- 1) kb_choice="$(awk '/! layout/{flag=1; next} /! variant/{flag=0} flag {print $2, "- " $1}' /usr/share/X11/xkb/rules/base.lst | dmenu -l 15)"
- kb="$(echo "$kb_choice" | awk '{print $3}')"
- setxkbmap "$kb"
- pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";;
- 3) notify-send "⌨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')")
-- Left click to change keyboard.";;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-echo "$kb"
diff --git a/scripts/.local/bin/statusbar/sb-mailbox b/scripts/.local/bin/statusbar/sb-mailbox
deleted file mode 100755
index 13e152f..0000000
--- a/scripts/.local/bin/statusbar/sb-mailbox
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# Displays number of unread mail and an loading icon if updating.
-# When clicked, brings up `neomutt`.
-
-# ivan: removed gay emoji
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e neomutt ;;
- 2) setsid -f mw -Y >/dev/null ;;
- 3) notify-send "📬 Mail module" "\- Shows unread mail
-- Shows 🔃 if syncing mail
-- Left click opens neomutt
-- Middle click syncs mail" ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
-
-pidof mbsync >/dev/null 2>&1 && icon="U"
-
-[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "$unread$icon"
diff --git a/scripts/.local/bin/statusbar/sb-memory b/scripts/.local/bin/statusbar/sb-memory
deleted file mode 100755
index bfb31c3..0000000
--- a/scripts/.local/bin/statusbar/sb-memory
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-case $BLOCK_BUTTON in
- 1) notify-send "Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
- 2) setsid -f "$TERMINAL" -e htop ;;
- 3) notify-send "Memory module" "\- Shows Memory Used/Total.
-- Click to show memory hogs.
-- Middle click to open htop." ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-RAM=$(free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.1f/%2.1f\n", ( $3 / 1024), ($2 / 1024))}')
-
-swap=$(free --mebi | sed -n '3{p;q}' | awk '{printf ("%2.1f/%2.1f\n", ( $3 / 1024), ($2 / 1024))}')
-
-echo "$RAM $swap"
diff --git a/scripts/.local/bin/statusbar/sb-moonphase b/scripts/.local/bin/statusbar/sb-moonphase
deleted file mode 100755
index fab8b4d..0000000
--- a/scripts/.local/bin/statusbar/sb-moonphase
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-# Shows the current moon phase.
-
-moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
-
-[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
- { curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
-
-icon="$(cat "$moonfile")"
-
-case "$icon" in
- 🌑) name="New" ;;
- 🌒) name="Waxing Crescent" ;;
- 🌓) name="First Quarter" ;;
- 🌔) name="Waxing Gibbous" ;;
- 🌕) name="Full" ;;
- 🌖) name="Waning Gibbous" ;;
- 🌗) name="Last Quarter" ;;
- 🌘) name="Waning Crescent" ;;
- *) exit 1 ;;
-esac
-
-echo "${icon-?}"
-
-case $BLOCK_BUTTON in
- 3) notify-send "🌜 Moon phase module" "Displays current moon phase.
-- 🌑: New
-- 🌒: Waxing Crescent
-- 🌓: First Quarter
-- 🌔: Waxing Gibbous
-- 🌕: Full
-- 🌖: Waning Gibbous
-- 🌗: Last Quarter
-- 🌘: Waning Crescent" ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
diff --git a/scripts/.local/bin/statusbar/sb-mpdup b/scripts/.local/bin/statusbar/sb-mpdup
deleted file mode 100755
index af81a7d..0000000
--- a/scripts/.local/bin/statusbar/sb-mpdup
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-# This loop will update the mpd statusbar module whenever a command changes the
-# music player's status. mpd must be running on X's start for this to work.
-
-while : ; do
- mpc idle >/dev/null && kill -45 "$(pidof "${STATUSBAR:-dwmblocks}")" || break
-done
diff --git a/scripts/.local/bin/statusbar/sb-music b/scripts/.local/bin/statusbar/sb-music
deleted file mode 100755
index 06e7e4d..0000000
--- a/scripts/.local/bin/statusbar/sb-music
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
-
-mpc | sed "/^volume:/d;s/\\&/&amp;/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;
diff --git a/scripts/.local/bin/statusbar/sb-nettraf b/scripts/.local/bin/statusbar/sb-nettraf
deleted file mode 100755
index 824e156..0000000
--- a/scripts/.local/bin/statusbar/sb-nettraf
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-# Module showing network traffic. Shows how much data has been received (RX) or
-# transmitted (TX) since the previous time this script ran. So if run every
-# second, gives network traffic per second.
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e bmon ;;
- 3) notify-send "🌐 Network traffic module" "🔻: Traffic received
-🔺: Traffic transmitted" ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-update() {
- sum=0
- for arg; do
- read -r i < "$arg"
- sum=$(( sum + i ))
- done
- cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/}
- [ -f "$cache" ] && read -r old < "$cache" || old=0
- printf %d\\n "$sum" > "$cache"
- printf %d\\n $(( sum - old ))
-}
-
-rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
-tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
-
-printf "%4sB/%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx)
diff --git a/scripts/.local/bin/statusbar/sb-news b/scripts/.local/bin/statusbar/sb-news
deleted file mode 100755
index fe701db..0000000
--- a/scripts/.local/bin/statusbar/sb-news
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-# Displays number of unread news items and an loading icon if updating.
-# When clicked, brings up `newsboat`.
-
-case $BLOCK_BUTTON in
- 1) setsid "$TERMINAL" -e newsboat ;;
- 2) setsid -f newsup >/dev/null exit ;;
- 3) notify-send "📰 News module" "\- Shows unread news items
-- Shows 🔃 if updating with \`newsup\`
-- Left click opens newsboat
-- Middle click syncs RSS feeds
-<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
- cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "📰" $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"
diff --git a/scripts/.local/bin/statusbar/sb-pacpackages b/scripts/.local/bin/statusbar/sb-pacpackages
deleted file mode 100755
index 37ebed3..0000000
--- a/scripts/.local/bin/statusbar/sb-pacpackages
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-# Displays number of upgradeable packages.
-# For this to work, have a `pacman -Sy` command run in the background as a
-# cronjob every so often as root. This script will then read those packages.
-# When clicked, it will run an upgrade via pacman.
-#
-# Add the following text as a file in /usr/share/libalpm/hooks/statusbar.hook:
-#
-# [Trigger]
-# Operation = Upgrade
-# Type = Package
-# Target = *
-#
-# [Action]
-# Description = Updating statusbar...
-# When = PostTransaction
-# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3.
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e sb-popupgrade ;;
- 2) notify-send "$(/usr/bin/pacman -Qu)" ;;
- 3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
-- Left click to upgrade packages
-- Middle click to show upgradable packages" ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g"
diff --git a/scripts/.local/bin/statusbar/sb-popupgrade b/scripts/.local/bin/statusbar/sb-popupgrade
deleted file mode 100755
index 29d6230..0000000
--- a/scripts/.local/bin/statusbar/sb-popupgrade
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-printf "Beginning upgrade.\\n"
-
-yay -Syu
-pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
-
-printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
-read -r _
diff --git a/scripts/.local/bin/statusbar/sb-price b/scripts/.local/bin/statusbar/sb-price
deleted file mode 100755
index 42c84c1..0000000
--- a/scripts/.local/bin/statusbar/sb-price
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-# Usage:
-# price <url> <Name of currency> <icon> <Price to show in>
-# price bat "Basic Attention Token" 🦁
-# When the name of the currency is multi-word, put it in quotes.
-
-[ -z "$3" ] && exit 1
-
-# use $4 as currency, if not passed in use "usd" as default
-currency="${4:-usd}"
-interval="@14d" # History contained in chart preceded by '@' (7d = 7 days)
-dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
-pricefile="$dir/$1-$currency"
-chartfile="$dir/$1-$currency-chart"
-
-updateprice() { temp="$(mktemp)"
- curl -s "$currency.rate.sx/1$1" > "$temp" &&
- mv -f "$temp" "$pricefile" &&
- curl -s "$currency.rate.sx/$1$interval" > "$temp" &&
- mv -f "$temp" "$chartfile" ;}
-
-[ -d "$dir" ] || mkdir -p "$dir"
-
-[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
- updateprice "$1"
-
-case $BLOCK_BUTTON in
- 1) setsid "$TERMINAL" -e less -Srf "$chartfile" ;;
- 2) notify-send -u low "$3 Updating..." "Updating $2 price..."
- updateprice "$1" && notify-send "$3 Update complete." "$2 price is now
-\$$(cat "$pricefile")" ;;
- 3) uptime="$(date -d "$(stat -c %x "$pricefile")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
- notify-send "$3 $2 module" "\- <b>Exact price: \$$(cat "$pricefile")</b>
-- Left click for chart of changes.
-- Middle click to update.
-- Shows 🔃 if updating prices.
-- <b>Last updated:
- $uptime</b>" ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-case "$currency" in
- usd) symb="$" ;;
- gbp) symb="£" ;;
- eur) symb="€" ;;
- btc) symb="₿" ;;
-esac
-
-printf "$3$symb%0.2f$after" "$(cat "$pricefile")"
diff --git a/scripts/.local/bin/statusbar/sb-tasks b/scripts/.local/bin/statusbar/sb-tasks
deleted file mode 100755
index 349e8cb..0000000
--- a/scripts/.local/bin/statusbar/sb-tasks
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# Originally by Andr3as07 <https://github.com/Andr3as07>
-# Some changes by Luke
-# Rebuild by Tenyun
-
-# This block displays the number running background tasks. Requires tsp.
-
-num=$(tsp -l | awk -v numr=0 -v numq=0 '{if (/running/)numr++; if (/queued/)numq++} END{print numr+numq"("numq")"}')
-
-[ "$num" != "0(0)" ] &&
- echo "$num"
diff --git a/scripts/.local/bin/statusbar/sb-torrent b/scripts/.local/bin/statusbar/sb-torrent
deleted file mode 100755
index 6527005..0000000
--- a/scripts/.local/bin/statusbar/sb-torrent
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-transmission-remote -l | grep % |
- sed " # The letters are for sorting and will not appear.
- s/.*Stopped.*/A 🛑/;
- s/.*Seeding.*/Z 🌱/;
- s/.*100%.*/N ✅/;
- s/.*Idle.*/B 🕰️/;
- s/.*Uploading.*/L ⬆️/;
- s/.*%.*/M ⬇️/" |
- sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e tremc ;;
- 2) td-toggle ;;
- 3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
-- Middle click to toggle transmission.
-- Shift click to edit script.
-Module shows number of torrents:
-🛑: paused
-🕰: idle (seeds needed)
-🔼: uploading (unfinished)
-🔽: downloading
-✅: done
-🌱: done and seeding" ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
diff --git a/scripts/.local/bin/statusbar/sb-volume b/scripts/.local/bin/statusbar/sb-volume
deleted file mode 100755
index 2b7ce67..0000000
--- a/scripts/.local/bin/statusbar/sb-volume
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# Prints the current volume or 🔇 if muted.
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e pulsemixer ;;
- 2) pamixer -t ;;
- 4) pamixer --allow-boost -i 1 ;;
- 5) pamixer --allow-boost -d 1 ;;
- 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
-- Middle click to mute.
-- Scroll to change." ;;
- 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-[ $(pamixer --get-mute) = true ] && echo 🔇 && exit
-
-vol="$(pamixer --get-volume)"
-
-if [ "$vol" -gt "0" ]; then
- icon=""
-else
- echo  && exit
-fi
-
-echo "$icon$vol%"