aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/statusbar
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-08-24 14:08:03 +0300
committerawy <awy@awy.one>2025-08-24 14:08:03 +0300
commit474006cd2c173d02e4511045f07c04e159010d4e (patch)
treec6d494b835f0a2914493b1511c3af70b7009cff7 /.local/bin/statusbar
parent632c51ed3ce26090e5ba67b27075bd1ac5848fca (diff)
downloadhyprdots-474006cd2c173d02e4511045f07c04e159010d4e.tar.gz
cleanup
Diffstat (limited to '.local/bin/statusbar')
-rwxr-xr-x.local/bin/statusbar/sb-battery37
-rwxr-xr-x.local/bin/statusbar/sb-brightness23
-rwxr-xr-x.local/bin/statusbar/sb-clock13
-rwxr-xr-x.local/bin/statusbar/sb-cpu12
-rwxr-xr-x.local/bin/statusbar/sb-cpubars44
-rwxr-xr-x.local/bin/statusbar/sb-disk23
-rwxr-xr-x.local/bin/statusbar/sb-doppler241
-rwxr-xr-x.local/bin/statusbar/sb-internet41
-rwxr-xr-x.local/bin/statusbar/sb-iplocate15
-rwxr-xr-x.local/bin/statusbar/sb-kbselect26
-rwxr-xr-x.local/bin/statusbar/sb-mailbox24
-rwxr-xr-x.local/bin/statusbar/sb-memory31
-rwxr-xr-x.local/bin/statusbar/sb-microphone39
-rwxr-xr-x.local/bin/statusbar/sb-moonphase37
-rwxr-xr-x.local/bin/statusbar/sb-mpdup8
-rwxr-xr-x.local/bin/statusbar/sb-music45
-rwxr-xr-x.local/bin/statusbar/sb-nettraf28
-rwxr-xr-x.local/bin/statusbar/sb-news17
-rwxr-xr-x.local/bin/statusbar/sb-pacpackages29
-rwxr-xr-x.local/bin/statusbar/sb-popupgrade9
-rwxr-xr-x.local/bin/statusbar/sb-price59
-rwxr-xr-x.local/bin/statusbar/sb-tasks20
-rwxr-xr-x.local/bin/statusbar/sb-ticker49
-rwxr-xr-x.local/bin/statusbar/sb-torrent27
-rwxr-xr-x.local/bin/statusbar/sb-volume39
-rwxr-xr-x.local/bin/statusbar/sb-weather82
26 files changed, 0 insertions, 1018 deletions
diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery
deleted file mode 100755
index 0e25e72..0000000
--- a/.local/bin/statusbar/sb-battery
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-# Prints all batteries, their percentage remaining and an emoji corresponding
-# to charge status (๐Ÿ”Œ for plugged up, ๐Ÿ”‹ for discharging on battery, etc.).
-
-case $BLOCK_BUTTON in
- 3) notify-send "๐Ÿ”‹ Battery module" "๐Ÿ”‹: discharging
- ๐Ÿ›‘: not charging
- โ™ป: stagnant charge
- ๐Ÿ”Œ: charging
- โšก: charged
- โ—: battery very low!
- - Scroll to change adjust xbacklight." ;;
- 4) xbacklight -inc 10 ;;
- 5) xbacklight -dec 10 ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-# 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 "$(bat "$battery/status" 2>&1)" in
- "Full") status="โšก" ;;
- "Discharging") status="๐Ÿ”‹" ;;
- "Charging") status="๐Ÿ”Œ" ;;
- "Not charging") status="๐Ÿ›‘" ;;
- "Unknown") status="โ™ป๏ธ" ;;
- *) exit 1 ;;
- esac
- capacity="$(bat "$battery/capacity" 2>&1)"
- # Will make a warn variable if discharging and low
- [ "$status" = "๐Ÿ”‹" ] && [ "$capacity" -le 25 ] && warn="โ—"
- # Prints the info
- printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
-done && printf "\\n"
diff --git a/.local/bin/statusbar/sb-brightness b/.local/bin/statusbar/sb-brightness
deleted file mode 100755
index 30fe76b..0000000
--- a/.local/bin/statusbar/sb-brightness
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# current brightness
-curr_brightness=$(bat /sys/class/backlight/*/brightness)
-
-# max_brightness
-max_brightness=$(bat /sys/class/backlight/*/max_brightness)
-
-# brightness percentage
-brightness_per=$((100 * curr_brightness / max_brightness))
-
-case $BLOCK_BUTTON in
- 1)
- ;;
- 3)
- notify-send "๐Ÿ’ก Brightness module" "\- Shows current brightness level โ˜€๏ธ."
- ;;
- 8)
- setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1
- ;;
-esac
-
-echo "๐Ÿ’ก ${brightness_per}%"
diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock
deleted file mode 100755
index 63e45d6..0000000
--- a/.local/bin/statusbar/sb-clock
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-clock=$(date '+%I')
-
-case $BLOCK_BUTTON in
- 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
- 2) setsid -f "$TERMINAL" -e calcurse >/dev/null 2>&1 ;;
- 3) notify-send "๏‘• Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
-- Middle click opens calcurse if installed" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-date "+%H:%M"
diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu
deleted file mode 100755
index e9c9cae..0000000
--- a/.local/bin/statusbar/sb-cpu
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-case $BLOCK_BUTTON in
- 1) notify-send "๐Ÿ–ฅ CPU hogs" "$(ps axch -o cmd,%cpu | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)\\n(100% per core)" ;;
- 2) setsid -f "$TERMINAL" -e btop >/dev/null 2>&1 ;;
- 3) notify-send "๐Ÿ–ฅ CPU module " "\- Shows CPU temperature.
-- Click to show intensive processes.
-- Middle click to open btop." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-sensors | awk '/Core 0/ {print "๐ŸŒก" $3}'
diff --git a/.local/bin/statusbar/sb-cpubars b/.local/bin/statusbar/sb-cpubars
deleted file mode 100755
index a0d5dce..0000000
--- a/.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 btop >/dev/null 2>&1 ;;
- 3) notify-send "๐Ÿชจ CPU load module" "Each bar represents
-one CPU core";;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-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=$(bat "$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/.local/bin/statusbar/sb-disk b/.local/bin/statusbar/sb-disk
deleted file mode 100755
index adfa0e3..0000000
--- a/.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." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-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/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler
deleted file mode 100755
index 1930752..0000000
--- a/.local/bin/statusbar/sb-doppler
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/bin/sh
-
-# Show a Doppler RADAR of a 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 "US: CONUS: Continental United States
-US: Northeast
-US: Southeast
-US: PacNorthWest
-US: PacSouthWest
-US: UpperMissVly
-US: SouthMissVly
-US: SouthPlains
-US: NorthRockies
-US: SouthRockies
-US: Alaska
-US: Carib
-US: Hawaii
-US: CentGrLakes
-US: Conus-Large
-US: KABR: Aberdeen, SD
-US: KBIS: Bismarck, ND
-US: KFTG: Denver/Boulder, CO
-US: KDMX: Des Moines, IA
-US: KDTX: Detroit, MI
-US: KDDC: Dodge City, KS
-US: KDLH: Duluth, MN
-US: KCYS: Cheyenne, WY
-US: KLOT: Chicago, IL
-US: KGLD: Goodland, KS
-US: KUEX: Hastings, NE
-US: KGJX: Grand Junction, CO
-US: KGRR: Grand Rapids, MI
-US: KMVX: Fargo/Grand Forks, ND
-US: KGRB: Green Bay, WI
-US: KIND: Indianapolis, IN
-US: KJKL: Jackson, KY
-US: KARX: La Crosse, WI
-US: KILX: Lincoln/Central Illinois, IL
-US: KLVX: Louisville, KY
-US: KMQT: Marquette
-US: KMKX: Milwaukee, WI
-US: KMPX: Minneapolis, MN
-US: KAPX: Gaylord/Alpena, MI
-US: KLNX: North Platte, NE
-US: KIWX: N. Webster/Northern, IN
-US: KOAX: Omaha, NE
-US: KPAH: Paducah, KY
-US: KEAX: Pleasant Hill, MO
-US: KPUX: Pueblo, CO
-US: KDVN: Quad Cities, IA
-US: KUDX: Rapid City, SD
-US: KRIW: Riverton, WY
-US: KSGF: Springfield, MO
-US: KLSX: St. LOUIS, MO
-US: KFSD: Sioux Falls, SD
-US: KTWX: Topeka, KS
-US: KICT: Wichita, KS
-US: KVWX: Paducah, KY
-US: ICAO: Responsible Wfo
-US: KLTX: WILMINGTON, NC
-US: KCCX: State College/Central, PA
-US: KLWX: Sterling, VA
-US: KFCX: Blacksburg/Roanoke, VA
-US: KRAX: Raleigh/Durham, NC
-US: KGYX: Portland, ME
-US: KDIX: Mt Holly/Philadelphia, PA
-US: KPBZ: Pittsburgh, PA
-US: KAKQ: Wakefield, VA
-US: KMHX: Morehead City, NC
-US: KGSP: Greer/Greenville/Sprtbg, SC
-US: KILN: Wilmington/Cincinnati, OH
-US: KCLE: Cleveland, OH
-US: KCAE: Columbia, SC
-US: KBGM: Binghamton, NY
-US: KENX: Albany, NY
-US: KBUF: Buffalo, NY
-US: KCXX: Burlington, VT
-US: KCBW: Caribou, ME
-US: KBOX: Boston /Taunton, MA
-US: KOKX: New York City, NY
-US: KCLX: Charleston, SC
-US: KRLX: Charleston, WV
-US: ICAO: Responsible WFO
-US: KBRO: Brownsville, TX
-US: KABX: Albuquerque, NM
-US: KAMA: Amarillo, TX
-US: KFFC: Peachtree City/Atlanta, GA
-US: KEWX: Austin/Sanantonio, TX
-US: KBMX: Birmingham, AL
-US: KCRP: Corpus Christi, TX
-US: KFWS: Dallas / Ft. Worth, TX
-US: KEPZ: El Paso, TX
-US: KHGX: Houston/ Galveston, TX
-US: KJAX: Jacksonville, FL
-US: KBYX: Key West, FL
-US: KMRX: Morristown/knoxville, TN
-US: KLBB: Lubbock, TX
-US: KLZK: Little Rock, AR
-US: KLCH: Lake Charles, LA
-US: KOHX: Nashville, TN
-US: KMLB: Melbourne, FL
-US: KNQA: Memphis, TN
-US: KAMX: Miami, FL
-US: KMAF: Midland/odessa, TX
-US: KTLX: Norman, OK
-US: KHTX: Huntsville, AL
-US: KMOB: Mobile, AL
-US: KTLH: Tallahassee, FL
-US: KTBW: Tampa Bay Area, FL
-US: KSJT: San Angelo, TX
-US: KINX: Tulsa, OK
-US: KSRX: Tulsa, OK
-US: KLIX: New Orleans/slidell, LA
-US: KDGX: Jackson, MS
-US: KSHV: Shreveport, LA
-US: ICAO: Responsible WFO
-US: KLGX: Seattle / Tacoma, WA
-US: KOTX: Spokane, WA
-US: KEMX: Tucson, AZ
-US: KYUX: Phoenix, AZ
-US: KNKX: San Diego, CA
-US: KMUX: Monterey/san Francisco, CA
-US: KHNX: San Joaquin/hanford, CA
-US: KSOX: San Diego, CA
-US: KATX: Seattle / Tacoma, WA
-US: KIWA: Phoenix, AZ
-US: KRTX: Portland, OR
-US: KSFX: Pocatello, ID
-US: KRGX: Reno, NV
-US: KDAX: Sacramento, CA
-US: KMTX: Salt Lake City, UT
-US: KPDT: Pendleton, OR
-US: KMSX: Missoula, MT
-US: KESX: Las Vegas, NV
-US: KVTX: Los Angeles, CA
-US: KMAX: Medford, OR
-US: KFSX: Flagstaff, AZ
-US: KGGW: Glasgow, MT
-US: KLRX: Elko, NV
-US: KBHX: Eureka, CA
-US: KTFX: Great Falls, MT
-US: KCBX: Boise, ID
-US: KBLX: Billings, MT
-US: KICX: Salt Lake City, UT
-US: ICAO: Responsible Wfo W/ MSCF
-US: PABC: Anchorage, AK
-US: PAPD: Fairbanks, AK
-US: PHKM: Honolulu, HI
-US: PAHG: Anchorage, AK
-US: PAKC: Anchorage, AK
-US: PAIH: Anchorage, AK
-US: PHMO: Honolulu, HI
-US: PAEC: Fairbanks, AK
-US: TJUA: San Juan, PR
-US: PACG: Juneau, AK
-US: PHKI: Honolulu, HI
-US: PHWA: Honolulu, HI
-US: ICAO: Responsible Wfo W/ MSCF
-US: KFDR: Norman, OK
-US: PGUA: Guam
-US: KBBX: Sacramento, CA
-US: KFDX: Albuquerque, NM
-US: KGWX: Jackson, MS
-US: KDOX: Wakefield, VA
-US: KDYX: San Angelo, TX
-US: KEYX: Las Vegas, NV
-US: KEVX: Mobile, AL
-US: KHPX: Paducah, KY
-US: KTYX: Burlington, VT
-US: KGRK: Dallas / Ft. Worth, TX
-US: KPOE: Lake Charles, LA
-US: KEOX: Tallahassee, FL
-US: KHDX: El Paso, TX
-US: KDFX: San Antonio, TX
-US: KMXX: Birmingham, AL
-US: KMBX: Bismarck, ND
-US: KVAX: Jacksonville, FL
-US: KJGX: Peachtree City/atlanta, GA
-US: KVNX: Norman, OK
-US: KVBX: Vandenberg Afb: Orcutt, CA
-DE: BAW: Baden-Wรผrttemberg
-DE: BAY: Bavaria
-DE: BBB: Berlin
-DE: BBB: Brandenburg
-DE: HES: Hesse
-DE: MVP: Mecklenburg-Western Pomerania
-DE: NIB: Lower Saxony
-DE: NIB: Bremen
-DE: NRW: North Rhine-Westphalia
-DE: RPS: Rhineland-Palatinate
-DE: RPS: Saarland
-DE: SAC: Saxony
-DE: SAA: Saxony-Anhalt
-DE: SHH: Schleswig-Holstein
-DE: SHH: Hamburg
-DE: THU: Thuringia
-NL: The Netherlands
-RU: Russian Federation" | mew -i -l 50 -p "Select a radar to use as default:")"
-
-# Ensure user did not escape.
-[ -z "$chosen" ] && exit 1
-
-# Set country code and radar code.
-countrycode=${chosen%%:*}
-radarcode=${chosen#* } radarcode=${radarcode%:*}
-
-# Print codes to $radarloc file.
- printf "%s,%s\\n" "$countrycode" "$radarcode" > "$radarloc" ;}
-
-getdoppler() {
- country=$(cut -c -2 "$radarloc")
- province=$(cut -c 4- "$radarloc")
- notify-send "๐ŸŒฆ๏ธ Doppler RADAR" "Pulling most recent Doppler RADAR for $province."
- case "$country" in
- "US") province="$(echo "$province" | tr "[:lower:]" "[:upper:]")"
- curl -sL "https://radar.weather.gov/ridge/standard/${province}_loop.gif" > "$doppler" ;;
- "DE") province="$(echo "$province" | tr "[:upper:]" "[:lower:]")"
- curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${province}_akt.gif" > "$doppler" ;;
- "NL") curl -sL "https://cdn.knmi.nl/knmi/map/general/weather-map.gif" > "$doppler" ;;
- "RU") curl -sL "https://meteoinfo.ru/hmc-output/rmap/phenomena.gif" > "$doppler" ;;
- esac
-}
-
-showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" >/dev/null 2>&1 ;}
-
-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 RADAR location.
-After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-echo ๐ŸŒ…
diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet
deleted file mode 100755
index 378cccb..0000000
--- a/.local/bin/statusbar/sb-internet
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e nmtui >/dev/null 2>&1 ; pkill -RTMIN+4 waybar ;;
- 3) notify-send "๏ƒ Internet module" "\- Click to connect
-๓ฐคฎ : wifi disabled
-๓ฐคฎ : no wifi connection
-๓ฐคจ : wifi connection with quality
-๏„ง : no ethernet
-๏ƒ : ethernet working
-๓ฐ‘ช : vpn is active (routing)
-๓ฐ–‚ : vpn is active
- " ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-# Wifi
-if [ "$(bat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
- quality=$(awk '/^\s*w/ { print int($3 * 100 / 70) }' /proc/net/wireless)
-
- case 1 in
- $((quality >= 76)) ) wifiicon="๓ฐคจ" ;;
- $((quality >= 51)) ) wifiicon="๓ฐคฅ" ;;
- $((quality >= 26)) ) wifiicon="๓ฐคข" ;;
- $((quality >= 1)) ) wifiicon="๓ฐคŸ" ;;
- * ) wifiicon="๓ฐคฎ" ;;
- esac
- wifiicon="$wifiicon$quality% "
-
-elif [ "$(bat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
- [ "$(bat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="๓ฐคฎ " || wifiicon="๓ฐคฎ "
-fi
-
-# Ethernet
-[ "$(bat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="๏ƒ" || ethericon="๏„ง"
-
-# TUN
-[ -n "$(bat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" ๓ฐ–‚"
-[ -n "$(bat /sys/class/net/route*/operstate 2>/dev/null)" ] && tunicon=" ๓ฐ‘ช"
-
-printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon"
diff --git a/.local/bin/statusbar/sb-iplocate b/.local/bin/statusbar/sb-iplocate
deleted file mode 100755
index a993207..0000000
--- a/.local/bin/statusbar/sb-iplocate
+++ /dev/null
@@ -1,15 +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/
-
-set -e
-
-ifinstalled "geoip"
-addr="$(geoiplookup "$(curl -sfm 1 ifconfig.me 2>/dev/null)")"
-name="${addr##*, }"
-flag="$(rg "flag: $name" "${XDG_DATA_HOME:-$HOME/.local/share}/extras/emoji")"
-flag="${flag%% *}"
-printf "%s %s\\n" "$flag" "$name"
diff --git a/.local/bin/statusbar/sb-kbselect b/.local/bin/statusbar/sb-kbselect
deleted file mode 100755
index f4d3e9e..0000000
--- a/.local/bin/statusbar/sb-kbselect
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# works on any init system
-# requirements: mew
-
-kbquery()
-{
- kblayout=$(swaymsg --raw -t get_inputs | jq -r '.[] | select(.type == "keyboard") | .xkb_active_layout_name' | sort -u) || exit 1
- kblayout=$(echo "$kblayout" | sed 's/(/\\(/g; s/)/\\)/g') || exit 1
- kblayout=$(rg -oP "^\s*\K\w+(?=\s+$kblayout)" /usr/share/X11/xkb/rules/base.lst) || exit 1
- echo $kblayout
-}
-
-kb=$(kbquery)
-
-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 | mew -l 15)"
- [ -z "$kb_choice" ] && exit 0
- kb="$(echo "$kb_choice" | awk '{print $3}')"
- swaymsg input "type:keyboard" xkb_layout "$kb" >/dev/null 2>&1
- pkill -RTMIN+30 "${STATUSBAR:-waybar}";;
- 3) notify-send "โŒจ Keyboard/language module" "$(printf "%s" "\- Current layout: $(kbquery)")
-- Left click to change keyboard.";;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-echo "$kb"
diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox
deleted file mode 100755
index 19478e8..0000000
--- a/.local/bin/statusbar/sb-mailbox
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# Displays number of unread mail and an loading icon if updating.
-# When clicked, brings up `neomutt`.
-
-case $BLOCK_BUTTON in
- 1) setsid -w -f "$TERMINAL" -e neomutt ; pkill -RTMIN+12 "${STATUSBAR:-waybar}" ;;
- 2) setsid -f mailup >/dev/null && exit ;;
- 3) notify-send "๏ฏ Mail module" "\- Shows unread mail
-- Shows ๏€ก if syncing mail
-- Left click opens neomutt
-- Middle click syncs mail" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-unread="$(fd . "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/ -t f | wc -l 2>/dev/null)"
-
-icon=$(bat /tmp/mailupdate 2>/dev/null)
-
-if [ "$unread" -eq 0 ]; then
- [ -n "$icon" ] && echo "๏ฏ$icon" || exit 0
-else
- echo "๏ฏ $unread$icon"
-fi
diff --git a/.local/bin/statusbar/sb-memory b/.local/bin/statusbar/sb-memory
deleted file mode 100755
index e031e3e..0000000
--- a/.local/bin/statusbar/sb-memory
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-case $BLOCK_BUTTON in
- 1) notify-send "๎ฟ… Memory hogs" "$(ps axch -o cmd,%mem | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)" ;;
- 2) setsid -f "$TERMINAL" -e btop >/dev/null 2>&1 ;;
- 3) notify-send "๎ฟ… Memory module" "\- Shows Memory Used/Total.
-- Click to show memory hogs.
-- Middle click to open btop." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-used=$(free --mebi | sed -n '2{p;q}' | awk '{print $3}')
-total=$(free --mebi | sed -n '2{p;q}' | awk '{print $2}')
-
-usage_percentage=$((100 * used / total))
-
-# case 1 in
-# $((usage_percentage >= 87)) ) icon="โ–ˆ "; class="high" ;;
-# $((usage_percentage >= 70)) ) icon="โ–‡ "; class="high" ;;
-# $((usage_percentage >= 62)) ) icon="โ–† "; class="mid" ;;
-# $((usage_percentage >= 50)) ) icon="โ–… "; class="mid" ;;
-# $((usage_percentage >= 37)) ) icon="โ–„ "; class="mid" ;;
-# $((usage_percentage >= 25)) ) icon="โ–ƒ "; class="low" ;;
-# $((usage_percentage >= 12)) ) icon="โ–‚ "; class="low" ;;
-# $((usage_percentage >= 0)) ) icon="โ– "; class="low" ;;
-# * ) echo unavailable && exit ;;
-# esac
-
-output="$icon${used}MB"
-
-printf '{"text": "%s", "class": "%s" }' "$output" "$class"
diff --git a/.local/bin/statusbar/sb-microphone b/.local/bin/statusbar/sb-microphone
deleted file mode 100755
index 370c223..0000000
--- a/.local/bin/statusbar/sb-microphone
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# Prints the current microphone volume or ๏„ฑ if muted.
-
-case $BLOCK_BUTTON in
- 1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+23 "${STATUSBAR:-waybar}" ;;
- 2) wpctl set-mute @DEFAULT_SOURCE@ toggle ;;
- 4) wpctl set-volume @DEFAULT_SOURCE@ 1%+ ;;
- 5) wpctl set-volume @DEFAULT_SOURCE@ 1%- ;;
- 3) notify-send "๓ฐฌ Microphone volume module" "\- Shows volume ๓ฐฌ, ๏„ฑ if muted.
-- Middle click to mute.
-- Scroll to change." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-vol="$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
-
-# If muted, print ๏„ฑ and exit.
-[ "$vol" != "${vol%\[MUTED\]}" ] && echo ๏„ฑ && exit
-
-vol="${vol#Volume: }"
-
-split() {
- # For ommiting the . without calling and external program.
- IFS=$2
- set -- $1
- printf '%s' "$@"
-}
-
-vol="$(printf "%.0f" "$(split "$vol" ".")")"
-
-case 1 in
- $((vol >= 70)) ) icon="๏„ฐ " ;;
- $((vol >= 30)) ) icon="๏„ฐ " ;;
- $((vol >= 1)) ) icon="๏„ฐ " ;;
- * ) echo ๏„ฑ && exit ;;
-esac
-
-echo "$icon$vol%"
diff --git a/.local/bin/statusbar/sb-moonphase b/.local/bin/statusbar/sb-moonphase
deleted file mode 100755
index f91a751..0000000
--- a/.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"
-
-[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
- { curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
-
-icon="$(bat "$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" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
diff --git a/.local/bin/statusbar/sb-mpdup b/.local/bin/statusbar/sb-mpdup
deleted file mode 100755
index 42bd737..0000000
--- a/.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 "waybar")" || break
-done
diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music
deleted file mode 100755
index f144762..0000000
--- a/.local/bin/statusbar/sb-music
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-AWK_FILTER='
-NR==1 {
- if ($0 ~ /volume:/) { print ""; exit }
- artist_track = $0
- next
-}
-NR>1 {
- if ($0 ~ /\[paused\]/) status_icon = "๏Œ "
- if ($0 ~ /\[playing\]/) status_icon = ""
- if ($0 ~ /consume: on/) modes = modes "๏ƒ„ "
- if ($0 ~ /random: on/) modes = modes "๏ด "
- if ($0 ~ /repeat: on/) modes = modes "๏€ž "
- if ($0 ~ /single: on/) modes = modes "๏€ž1 "
-}
-END {
- sub(/[[:space:]]+$/, "", modes)
- if (artist_track) {
- if (modes) print status_icon artist_track " | " modes
- else print status_icon artist_track
- } else print ""
-}
-'
-
-pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
-
-case $BLOCK_BUTTON in
- 1) mpc status | awk "$AWK_FILTER" ; setsid -f "$TERMINAL" -e rmpc >/dev/null 2>&1 < /dev/null;;
- 2) mpc toggle | awk "$AWK_FILTER" ;;
- 3) mpc status | awk "$AWK_FILTER" ; notify-send "๏€ Music module" "\
-- Shows mpd song playing.
-- ๏Œ paused.
-- ๏ƒ„ consume mode.
-- ๏ด shuffle mode.
-- ๏€ž repeat mode.
-- ๏€ž1 single mode.
-- Left click opens rmpc.
-- Middle click pauses.
-- Scroll changes track.";;
- 4) mpc prev | awk "$AWK_FILTER" ;;
- 5) mpc next | awk "$AWK_FILTER" ;;
- 8) mpc status | awk "$AWK_FILTER" ; setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 < /dev/null ;;
- *) mpc status | awk "$AWK_FILTER" ;;
-esac
diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf
deleted file mode 100755
index 8921123..0000000
--- a/.local/bin/statusbar/sb-nettraf
+++ /dev/null
@@ -1,28 +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
- 3) notify-send "๐ŸŒ Network traffic module" "๐Ÿ”ป: Traffic received
-๐Ÿ”บ: Traffic transmitted" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-update() {
- sum=0
- for arg; do
- read -r i < "$arg"
- sum=$(( sum + i ))
- done
- cache=/tmp/${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 $tx)
diff --git a/.local/bin/statusbar/sb-news b/.local/bin/statusbar/sb-news
deleted file mode 100755
index bb45885..0000000
--- a/.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" -T newsboat -e newsboat >/dev/null 2>&1 ;;
- 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." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-bat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "๓ฐŽ• " $1}')$(bat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"
diff --git a/.local/bin/statusbar/sb-pacpackages b/.local/bin/statusbar/sb-pacpackages
deleted file mode 100755
index 5ef09d3..0000000
--- a/.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 >/dev/null 2>&1 ;;
- 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" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-pacman -Qu | rg -Fcv "[ignored]" | sed "s/^/๏“น /;s/^๏“น 0$//g"
diff --git a/.local/bin/statusbar/sb-popupgrade b/.local/bin/statusbar/sb-popupgrade
deleted file mode 100755
index 94279c8..0000000
--- a/.local/bin/statusbar/sb-popupgrade
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-printf "Beginning upgrade.\\n"
-
-paru
-pkill -RTMIN+8 "${STATUSBAR:-waybar}"
-
-printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
-read -r _
diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price
deleted file mode 100755
index d320511..0000000
--- a/.local/bin/statusbar/sb-price
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-# Usage:
-# price <currency-base currency> <name of currency> <icon> <signal>
-# price bat-btc "Basic Attention Token" ๐Ÿฆ 24
-# This will give the price of BAT denominated in BTC and will update on
-# signal 24.
-# When the name of the currency is multi-word, put it in quotes.
-
-[ -z "$1" ] && exit 1
-
-url="${CRYPTOURL:-rate.sx}"
-target="${1%%-*}"
-denom="${1##*-}"
-name="${2:-$1}"
-icon="${3:-๐Ÿ’ฐ}"
-case "$denom" in
- "$target"|usd) denom="usd"; symb="$" ;;
- gbp) symb="ยฃ" ;;
- eur) symb="โ‚ฌ" ;;
- rub) symb="โ‚ฝ" ;;
- btc) symb="๏…š" ;;
-esac
-interval="@14d" # History contained in chart preceded by '@' (7d = 7 days)
-dir="${XDG_CACHE_HOME:-$HOME/.cache}/crypto-prices"
-pricefile="$dir/$target-$denom"
-chartfile="$dir/$target-$denom-chart"
-filestat="$(stat -c %y "$pricefile" 2>/dev/null)"
-
-[ -d "$dir" ] || mkdir -p "$dir"
-
-updateprice() { curl -sf \
- --fail-early "${denom}.${url}/1${target}" "${denom}.${url}/${target}${interval}" \
- --output "$pricefile" --output "$chartfile" ||
- rm -f "$pricefile" "$chartfile" ;}
-
-[ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] &&
- updateme="1"
-
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e less -Srf "$chartfile" >/dev/null ;;
- 2) notify-send -u low "$icon Updating..." "Updating $name price..." ; updateme="1" ; showupdate="1" ;;
- 3) uptime="$(date -d "$filestat" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
- notify-send "$icon $name module" "\- <b>Exact price: $symb$(bat "$pricefile")</b>
-- Left click for chart of changes.
-- Middle click to update.
-- Shows ๐Ÿ”ƒ if updating prices.
-- <b>Last updated:
-$uptime</b>" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null ;;
-esac
-
-[ -n "$updateme" ] &&
- updateprice "$target" &&
- [ -n "$showupdate" ] &&
- notify-send "$icon Update complete." "$name price is now
-$symb$(bat "$pricefile")"
-
-[ -f "$pricefile" ] && printf "%s%s%0.2f\n" "$icon" "$symb" "$(bat "$pricefile")"
diff --git a/.local/bin/statusbar/sb-tasks b/.local/bin/statusbar/sb-tasks
deleted file mode 100755
index 14778a2..0000000
--- a/.local/bin/statusbar/sb-tasks
+++ /dev/null
@@ -1,20 +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")"}')
-
-# Handle mouse clicks
-case $BLOCK_BUTTON in
- 1) setsid -f "$TERMINAL" -e tsp -l >/dev/null 2>&1 ;;
- 3) notify-send "Tasks module" "๐Ÿค–: number of running/queued background tasks
-- Left click opens tsp" ;; # Right click
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-[ "$num" != "0(0)" ] &&
- echo "๐Ÿค–$num"
diff --git a/.local/bin/statusbar/sb-ticker b/.local/bin/statusbar/sb-ticker
deleted file mode 100755
index 5b26160..0000000
--- a/.local/bin/statusbar/sb-ticker
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-# Usage
-# sb-ticker
-# Sample output
-# ^DJI: 0.09%
-# CL=F: -1.88%
-# Description
-# displays/retrieves the latest percent-change in stock market quotes listed in $XDG_CONFIG_HOME/tickers.
-# defaults to S&P 500, Dow Jones Industrial, and the Nasdaq
-#
-# intended to be used in the statusbar, which will display the first quote price in the output
-
-url="terminal-stocks.dev"
-pricefile="${XDG_CACHE_HOME:-$HOME/.cache}/stock-prices"
-tickerfile="${XDG_CONFIG_HOME:-$HOME/.config}/tickers"
-
-[ -f "$tickerfile" ] && tickers="$(bat "$tickerfile")" || tickers="^GSPC,^DJI,^IXIC";
-
-checkprice() {
- [ -s "$pricefile" ] && [ "$(stat -c %y "$pricefile" 2>/dev/null |
- cut -d':' -f1)" != "$(date '+%Y-%m-%d %H')" ]
-}
-
-getchange() {
- mapfile -t changes < <(sed -e 's/ / /g' "$pricefile" | rg -oe '[m-]\+[0-9]\+\.[0-9]\+' | sed 's/[m ]/;/g')
- IFS=',' read -ra TICKER <<< "$tickers"
- for idx in "${!TICKER[@]}"; do
- printf "%s: %s%%\n" "${TICKER[$idx]}" "${changes[$idx]//;/}"
- done
-}
-
-updateprice() { curl -sfm 10 "$url/$tickers" --output "$pricefile" || rm -f "$pricefile" ; }
-
-case $BLOCK_BUTTON in
- 1) setsid "$TERMINAL" -e less -Srf "$pricefile" >/dev/null 2>&1 ;;
- 2) notify-send -u low "Updating..." "Updating prices" ; updateme="1" ;;
- 3) notify-send "Current prices:" "Current stock prices:\n<b>$(getchange)</b>
-- Left click to show price file
-- Middle click to update stock prices
-- Right click to get stock overview" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-[ -n "$updateme" ] && updateprice
-
-[ -f "$pricefile" ] && getchange
-
-checkprice && updateprice
diff --git a/.local/bin/statusbar/sb-torrent b/.local/bin/statusbar/sb-torrent
deleted file mode 100755
index 8415b25..0000000
--- a/.local/bin/statusbar/sb-torrent
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-transmission-remote -l | rg % |
- 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 stig >/dev/null 2>&1 ;;
- 2) td-toggle ;;
- 3) notify-send "๎ถง Torrent module" "\- Left click to open stig.
-- 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" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume
deleted file mode 100755
index 7a5bc42..0000000
--- a/.local/bin/statusbar/sb-volume
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# Prints the current volume or ๎ปจ if muted.
-
-case $BLOCK_BUTTON in
- 1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-waybar}" ;;
- 2) wpctl set-mute @DEFAULT_SINK@ toggle ;;
- 4) wpctl set-volume @DEFAULT_SINK@ 1%+ ;;
- 5) wpctl set-volume @DEFAULT_SINK@ 1%- ;;
- 3) notify-send "๏€จ Volume module" "\- Shows volume ๏€จ, ๎ปจ if muted.
-- Middle click to mute.
-- Scroll to change." ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
-
-# If muted, print ๎ปจ and exit.
-[ "$vol" != "${vol%\[MUTED\]}" ] && echo ๎ปจ && exit
-
-vol="${vol#Volume: }"
-
-split() {
- # For ommiting the . without calling and external program.
- IFS=$2
- set -- $1
- printf '%s' "$@"
-}
-
-vol="$(printf "%.0f" "$(split "$vol" ".")")"
-
-case 1 in
- $((vol >= 70)) ) icon="๏€จ " ;;
- $((vol >= 30)) ) icon="๏€ง " ;;
- $((vol >= 1)) ) icon="๏€ฆ " ;;
- * ) echo ๎ปจ && exit ;;
-esac
-
-echo "$icon$vol%"
diff --git a/.local/bin/statusbar/sb-weather b/.local/bin/statusbar/sb-weather
deleted file mode 100755
index dfaad4b..0000000
--- a/.local/bin/statusbar/sb-weather
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-arg=$1
-report=~/.cache/weather_report.json
-
-ifinstalled jq
-
-# Get a weather report from 'wttr.in' and save it locally.
-getforecast() { { rg -q -m1 '^up$' /sys/class/net/w*/operstate || rg -q -m1 '^up$' /sys/class/net/e*/operstate; } &&
- curl -sf "wttr.in/?format=j1" --output "$report" && touch "$report"
-}
-
-# Forecast should be updated only once a day.
-checkforecast() {
- [ "$(stat -c %y "$report" 2>/dev/null |
- cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
-}
-
-# Function to get weather emoji from code
-get_weather_emoji() {
- local code="$1"
- grep "^$code " ~/.local/share/extras/weather_codes | awk '{print $2}'
-}
-
-showweather(){
- temp=$(jq -r '.current_condition[0].temp_C' $report)
- code=$(jq -r '.current_condition[0].weatherCode' $report)
- rainchance=$(jq '.weather[].hourly[].chanceofrain | tonumber' $report | sort -n | tail -n 1)
-
- emoji=$(get_weather_emoji "$code")
- case "$arg" in
- weather)
- case 1 in
- $((temp >= 30)) ) class="very_hot" ;;
- $((temp >= 26)) ) class="hot" ;;
- $((temp >= 21)) ) class="warm" ;;
- $((temp >= 16)) ) class="mild" ;;
- $((temp >= 11)) ) class="cool" ;;
- $((temp >= 6)) ) class="chilly" ;;
- $((temp >= 0)) ) class="cold" ;;
- $((temp < 0)) ) class="below_zero" ;;
- * ) echo unavailable && exit ;;
- esac
- output="$emoji$tempยฐC"
- ;;
- rain)
- case 1 in
- $((rainchance >= 70)) ) class="high" ;;
- $((rainchance >= 45)) ) class="mid" ;;
- $((rainchance > 0)) ) class="low" ;;
- $((rainchance <= 0)) ) printf '' && exit ;;
- * ) echo unavailable && exit ;;
- esac
- output="๏ƒฉ$rainchance%"
- ;;
- *)
- echo "Usage: $0 {weather|rain}"
- exit 1
- ;;
- esac
- printf '{"text": "%s", "class": "%s" }' "$output" "$class"
-}
-
-case $BLOCK_BUTTON in
- 2) getforecast && showweather ;;
- 3) notify-send "๎ˆฆ Weather module" "\- Middle click to update forecast.
-๏ƒฉ: Chance of rain/snow
-๏”ข: Current temperature" ;;
- 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;;
-esac
-
-# shellcheck disable=SC2015
-checkforecast && showweather ||
- ( flock -n 9 &&
- ( tries=0; while [ $tries -ne 100 ]; do
- getforecast && break ||
- { tries=$((tries+1)); sleep .1; }
- done
- ! checkforecast &&
- until getforecast; do sleep 60; done
- pkill -RTMIN+5 "${STATUSBAR:-waybar}"
- ) &
- echo ) 9>"${XDG_RUNTIME_DIR}/sb-forecast.lock"