chmod 755 $(DESTDIR)$(PREFIX)/bin/sb-memory
chmod 755 $(DESTDIR)$(PREFIX)/bin/sb-nettraf
chmod 755 $(DESTDIR)$(PREFIX)/bin/sb-volume
- chmod 755 $(DESTDIR)$(PREFIX)/bin/sb-weather
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks\
$(DESTDIR)$(PREFIX)/bin/sb-*
static const Block blocks[] = {
/*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
{"", "cat /tmp/recordingicon 2>/dev/null", 0, 9},
-/* {"", "sb-weather", 600, 19}, */
{"", "sb-memory", 10, 14},
/* {"", "sb-cpu", 10, 18}, */
{"", "sb-volume", 0, 10},
{"", "sb-nettraf", 1, 16},
- {"", "sb-internet", 5, 4},
+ {"", "sb-internet", 30, 4},
/*uncomment for laptops:*/
/* {"", "sb-battery", 5, 3}, */
{"", "sb-clock", 60, 1},
case $BLOCK_BUTTON in
3) notify-send " Battery" ": discharging
-: not charging
-: stagnant charge
-: charging
-: charged
-: battery very low!
+❗: not charging
+🔴: stagnant charge
+🔌: charging
+🔋: charged
+🪫: battery very low!
- Scroll to change adjust xbacklight." ;;
4) xbacklight -inc 10 ;;
5) xbacklight -dec 10 ;;
[ -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="" ;;
+ "Full") status="🔋" ;;
+ "Discharging") status="🪫" ;;
+ "Charging") status="🔌" ;;
+ "Not charging") status="❗" ;;
"Unknown") status="?" ;;
*) exit 1 ;;
esac
done <<< "$input"
notify-send "$summary" "$current_block"
;;
- 3) notify-send " time/date" "\- displays time and date
+ 3) notify-send "🕰️ time/date" "\- displays time and date
\- left click to show schedule for current day using remind and to-do list" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
#!/bin/sh
case $BLOCK_BUTTON in
- 3) notify-send " internet" ": wifi disabled
-: no wifi connection
-: wifi connection with quality
-: no ethernet
-: ethernet working
-: vpn is active
+ 3) notify-send " internet" ": wifi disabled
+: no wifi connection
+: wifi connection with quality
+: no ethernet
+: ethernet working
+: vpn is active
" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
-# Wifi
-if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
- wifiicon="$(awk '/^\s*w/ { print "", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
-elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
- [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="📶" || wifiicon=""
-fi
+# Wifi - iterate in case of multiple interfaces
+wifiicon=""
+for iface in /sys/class/net/w*/operstate; do
+ [ -f "$iface" ] || continue
+ state=$(cat "$iface")
+ name="${iface%/operstate}"
+ name="${name##*/}"
+ if [ "$state" = 'up' ]; then
+ wifiicon="$(awk "/^\s*${name}/ { print \"\", int(\$3 * 100 / 70) \"% \" }" /proc/net/wireless)"
+ break
+ elif [ "$state" = 'down' ]; then
+ [ "$(cat "/sys/class/net/${name}/flags" 2>/dev/null)" = '0x1003' ] && wifiicon="📶" || wifiicon=""
+ fi
+done
-# Ethernet
-[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon=""
+# Ethernet - iterate in case of multiple interfaces
+ethericon=""
+for iface in /sys/class/net/e*/operstate; do
+ [ -f "$iface" ] || continue
+ [ "$(cat "$iface")" = 'up' ] && ethericon="🌐" && break
+done
-# TUN
-[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=""
+# VPN - tun* or tailscale*
+tunicon=""
+for iface in /sys/class/net/tun*/operstate /sys/class/net/tailscale*/operstate; do
+ [ -f "$iface" ] || continue
+ [ "$(cat "$iface")" != 'down' ] && tunicon="🔒" && break
+done
printf "[%s%s%s]\n" "$wifiicon" "$ethericon" "$tunicon"
#!/bin/sh
case $BLOCK_BUTTON in
- 3) notify-send " network traffic" "\- shows download/upload Traffic" ;;
+ 3) notify-send "🌐 network traffic" "\- shows download/upload Traffic" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
+++ /dev/null
-#!/bin/sh
-
-case $BLOCK_BUTTON in
- 1) notify-send "🌦️ weather" "$(curl 'wttr.in/Brockport?format=%l:+\n%C+%c\nfeels-like:%f+actual:%t\nsunrise:%S+sunset:%s\n')" ;;
- 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-echo ["$(curl 'wttr.in/Brockport?format=%f+%C\n')"]