mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
changed to awesomefont, looks more clean
This commit is contained in:
parent
df8f562c97
commit
2616ce8b77
@ -1,15 +1,15 @@
|
||||
#!/bin/sh
|
||||
2#!/bin/sh
|
||||
|
||||
# Prints all batteries, their percentage remaining and an emoji corresponding
|
||||
# to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.).
|
||||
# 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!
|
||||
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 ;;
|
||||
@ -22,16 +22,16 @@ for battery in /sys/class/power_supply/BAT?*; do
|
||||
[ -n "${capacity+x}" ] && printf " "
|
||||
# Sets up the status and capacity
|
||||
case "$(cat "$battery/status" 2>&1)" in
|
||||
"Full") status="⚡" ;;
|
||||
"Discharging") status="🔋" ;;
|
||||
"Charging") status="🔌" ;;
|
||||
"Not charging") status="🛑" ;;
|
||||
"Unknown") status="♻️" ;;
|
||||
"Full") status="" ;;
|
||||
"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" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
|
||||
[ "$status" = "" ] && [ "$capacity" -le 25 ] && warn=""
|
||||
# Prints the info
|
||||
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
|
||||
done && printf "\\n"
|
||||
|
||||
@ -3,25 +3,25 @@
|
||||
clock=$(date '+%I')
|
||||
|
||||
case "$clock" in
|
||||
"00") icon="🕛" ;;
|
||||
"01") icon="🕐" ;;
|
||||
"02") icon="🕑" ;;
|
||||
"03") icon="🕒" ;;
|
||||
"04") icon="🕓" ;;
|
||||
"05") icon="🕔" ;;
|
||||
"06") icon="🕕" ;;
|
||||
"07") icon="🕖" ;;
|
||||
"08") icon="🕗" ;;
|
||||
"09") icon="🕘" ;;
|
||||
"10") icon="🕙" ;;
|
||||
"11") icon="🕚" ;;
|
||||
"12") icon="🕛" ;;
|
||||
"00") icon="" ;;
|
||||
"01") icon="" ;;
|
||||
"02") icon="" ;;
|
||||
"03") icon="" ;;
|
||||
"04") icon="" ;;
|
||||
"05") icon="" ;;
|
||||
"06") icon="" ;;
|
||||
"07") icon="" ;;
|
||||
"08") icon="" ;;
|
||||
"09") icon="" ;;
|
||||
"10") icon="" ;;
|
||||
"11") icon="" ;;
|
||||
"12") icon="" ;;
|
||||
esac
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
||||
2) setsid -f "$TERMINAL" -e calcurse ;;
|
||||
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\`
|
||||
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" ;;
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
|
||||
1) notify-send " CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
|
||||
2) setsid -f "$TERMINAL" -e htop ;;
|
||||
3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
|
||||
3) notify-send " CPU module " "\- Shows CPU temperature.
|
||||
- Click to show intensive processes.
|
||||
- Middle click to open htop." ;;
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
sensors | awk '/Core 0/ {print "🌡" $3}'
|
||||
sensors | awk '/Core 0/ {print " " $3}'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Displays todays precipication chance (☔) and daily low (🥶) and high (🌞).
|
||||
# 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.
|
||||
@ -13,17 +13,17 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
|
||||
# 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 "°"}' ;}
|
||||
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.
|
||||
3) notify-send " Weather module" "\- Left click for full forecast.
|
||||
- Middle click to update forecast.
|
||||
☔: Chance of rain/snow
|
||||
🥶: Daily low
|
||||
🌞: Daily high" ;;
|
||||
: Chance of rain/snow
|
||||
: Daily low
|
||||
: Daily high" ;;
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
|
||||
@ -6,21 +6,21 @@
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
|
||||
3) notify-send "🌐 Internet module" "\- Click to connect
|
||||
❌: wifi disabled
|
||||
📡: no wifi connection
|
||||
📶: wifi connection with quality
|
||||
❎: no ethernet
|
||||
🌐: ethernet working
|
||||
🔒: vpn is active
|
||||
3) notify-send " Internet module" "\- Click to connect
|
||||
: wifi disabled
|
||||
: no wifi connection
|
||||
: wifi connection with quality
|
||||
: no ethernet
|
||||
: ethernet working
|
||||
: vpn is active
|
||||
" ;;
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
|
||||
wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
||||
wifiicon="$(awk '/^\s*w/ { print "", 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="📡 " || wifiicon="❌ "
|
||||
fi
|
||||
|
||||
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
|
||||
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down//;s/up//" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
|
||||
|
||||
@ -8,7 +8,7 @@ case $BLOCK_BUTTON in
|
||||
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+')")
|
||||
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
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
|
||||
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.
|
||||
3) notify-send " Memory module" "\- Shows Memory Used/Total.
|
||||
- Click to show memory hogs.
|
||||
- Middle click to open htop." ;;
|
||||
6) "$TERMINAL" "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
|
||||
free --mebi | sed -n '2{p;q}' | awk '{printf (" %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
|
||||
'
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) setsid -f "$TERMINAL" -e bmon ;;
|
||||
3) notify-send "🌐 Network traffic module" "🔻: Traffic received
|
||||
🔺: Traffic transmitted" ;;
|
||||
3) notify-send " Network traffic module" ": Traffic received
|
||||
: Traffic transmitted" ;;
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
@ -26,4 +26,4 @@ update() {
|
||||
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)
|
||||
printf "%4s %4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx)
|
||||
|
||||
@ -20,10 +20,10 @@
|
||||
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
|
||||
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"
|
||||
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^//;s/^0$//g"
|
||||
|
||||
@ -27,7 +27,7 @@ updateprice() { temp="$(mktemp)"
|
||||
updateprice "$1"
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) setsid "kitty" -e less -Srf "$chartfile" ;;
|
||||
1) setsid "st" -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")" ;;
|
||||
@ -35,7 +35,7 @@ case $BLOCK_BUTTON in
|
||||
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.
|
||||
- Shows if updating prices.
|
||||
- <b>Last updated:
|
||||
$uptime</b>" ;;
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
|
||||
@ -7,24 +7,24 @@ case $BLOCK_BUTTON in
|
||||
2) pamixer -t ;;
|
||||
4) pamixer --allow-boost -i 1 ;;
|
||||
5) pamixer --allow-boost -d 1 ;;
|
||||
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
||||
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
|
||||
[ $(pamixer --get-mute) = true ] && echo && exit
|
||||
|
||||
vol="$(pamixer --get-volume)"
|
||||
|
||||
if [ "$vol" -gt "70" ]; then
|
||||
icon="🔊"
|
||||
icon=""
|
||||
elif [ "$vol" -gt "30" ]; then
|
||||
icon="🔉"
|
||||
icon=""
|
||||
elif [ "$vol" -gt "0" ]; then
|
||||
icon="🔈"
|
||||
icon=""
|
||||
else
|
||||
echo 🔇 && exit
|
||||
echo && exit
|
||||
fi
|
||||
|
||||
echo "$icon$vol%"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user