moonphase now has no deps
statusbarinfo obsolete and deleted
This commit is contained in:
parent
33e329c8cb
commit
26c92f886b
2 changed files with 29 additions and 49 deletions
|
@ -1,25 +1,37 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Shows the current moon phase. Requires `pom-perl`.
|
# Shows the current moon phase.
|
||||||
|
|
||||||
mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') || exit 1
|
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
||||||
prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' )
|
|
||||||
case "$mnphs" in
|
[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||||
"New") icon="🌑" prcnt="0" ;;
|
{ curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
|
||||||
"Waxing Crescent") icon="🌒" ;;
|
|
||||||
"First Quarter") icon="🌓" prcnt="50" ;;
|
icon="$(cat "$moonfile")"
|
||||||
"Waxing Gibbous") icon="🌔" ;;
|
|
||||||
"Full") icon="🌕" prcnt="100" ;;
|
case "$icon" in
|
||||||
"Waning Gibbous") icon="🌖" ;;
|
🌑) name="New" ;;
|
||||||
"Last Quarter") icon="🌗" prcnt="50" ;;
|
🌒) name="Waxing Crescent" ;;
|
||||||
"Waning Crescent") icon="🌘" ;;
|
🌓) name="First Quarter" ;;
|
||||||
|
🌔) name="Waxing Gibbous" ;;
|
||||||
|
🌕) name="Full" ;;
|
||||||
|
🌖) name="Waning Gibbous" ;;
|
||||||
|
🌗) name="Last Quarter" ;;
|
||||||
|
🌘) name="Waning Crescent" ;;
|
||||||
|
*) exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo "${icon-?}"
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) $mnphs ;;
|
3) notify-send "🌜 Moon phase module" "Displays current moon phase.
|
||||||
2) $mnphs ;;
|
- 🌑: New
|
||||||
3) notify-send " 🌜$(pom)" ;;
|
- 🌒: Waxing Crescent
|
||||||
|
- 🌓: First Quarter
|
||||||
|
- 🌔: Waxing Gibbous
|
||||||
|
- 🌕: Full
|
||||||
|
- 🌖: Waning Gibbous
|
||||||
|
- 🌗: Last Quarter
|
||||||
|
- 🌘: Waning Crescent" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "${icon:?}" "$prcnt"%
|
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "
|
|
||||||
____ _ _ _
|
|
||||||
/ ___|| |_ __ _| |_ _ _ ___| |__ __ _ _ __
|
|
||||||
\___ \| __/ _\` | __| | | / __| '_ \ / _\` | '__|
|
|
||||||
___) | || (_| | |_| |_| \__ \ |_) | (_| | |
|
|
||||||
|____/ \__\__,_|\__|\__,_|___/_.__/ \__,_|_|
|
|
||||||
|
|
||||||
This is a list of the statusbar modules.
|
|
||||||
|
|
||||||
📦5 \033[31mpacpackages\033[0m: updatable packages (must have pacman -Sy run in root cronjob to check).
|
|
||||||
📰 41 \033[32mnews\033[0m: unread RSS entries in newsboat.
|
|
||||||
☔ 83% ❄️ 69° 🌞 80° \033[33mweather\033[0m: ☔ for precipitation, 🌞 and ❄ for daily high and low.
|
|
||||||
📬 20 \033[34mmailbox\033[0m: number of unread mail if mutt-wizard is active.
|
|
||||||
🔉 62% \033[35mvolume\033[0m: master sink volume.
|
|
||||||
🔌83% \033[36mbattery\033[0m: 🔌 for charging, 🔋 for discharging, ⚡ for full.
|
|
||||||
📶 80% ❎ \033[37minternet\033[0m: 📶 for wifi with % (📡 if none), 🌐 for ethernet. (❎ if none).
|
|
||||||
|
|
||||||
Obviously the time and date are displayed as well.
|
|
||||||
|
|
||||||
Optional script modules:
|
|
||||||
|
|
||||||
Edit \033[32m~/.local/src/dwmblocks/config.h\033[0m to add these or your own if you'd like (and recompile and restart dwmblocks).
|
|
||||||
|
|
||||||
'memory' 🧠 559Mi/3.7Gi Current used memory/total memory.
|
|
||||||
'cpu' 🌡 +46.0°C CPU temperature.
|
|
||||||
'disk' 🖥 : 28G/30G Remaining disk space...
|
|
||||||
'disk ~' 🏠: 641G/850G ...can be given directory argument.
|
|
||||||
'moonphase' 🌕 39% Phase of the moon (requires \033[32m\`pom-perl\`\033[0m).
|
|
||||||
'iplocate' 🇺🇸 United States Your own or VPN location (requires \033[32m\`geoiplookup\`\033[0m).
|
|
||||||
" | less
|
|
Loading…
Reference in a new issue