# i3blocks configuration file # # The i3blocks man page describes the usage of the binary, # and its website describes the configuration: # # https://vivien.github.io/i3blocks #test=󰣠 markup=pango # Global properties separator=true separator_block_width=15 [packages] interval=3600 command=count=$(pkg upgrade -n | sed -n 's/^Number of packages to be upgraded:\(.*\)/\1/p') ; [ -n "$count" ] && [ "$count" -gt 0 ] && printf "󰏖%s" $count && return 33 || return 0 [mail] interval=1800 signal=12 command=unread=$(ls ~/.mail/gmail/Inbox/new/ | wc -l | cut -w -f2) ; [ $unread -gt 0 ] && printf "󰶋%s\n" $unread || echo [news] interval=1800 signal=13 command=unread=$(newsboat -x print-unread|cut -w -f1) ; [ "$unread" != 0 ] && [ "$unread" != Authentication ] && printf "󰎕A:%s\n" $unread #[uptime] #interval=300 #command=printf "󰣠%s\n" "$(uptime | grep -o 'up[^,]*' )" [updates] interval=86399 command=doas freebsd-update updatesready > /dev/null ; [ $? -ne 2 ] && printf "󰣠Updates ready" || return 0 [weather] interval=3600 command=fetch -qo - "https://wttr.in/23435?format=2" [net] interval=10 command=inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3 | tr '\n' ' ') ; [ "$(ifconfig em0|grep status|cut -d\: -f2)" = " active" ] && printf "󰈁%s\n" "$inet" || [ "$(ifconfig wlan0|grep status|cut -d\: -f2)" = " associated" ] && ssid=$(ifconfig wlan0|sed -n 's/^.*ssid \(.*\) channel.*$/\1/p') && [ -n "$ssid" ] && printf "󰖩%s %s\n" "$ssid" "$inet" || printf "󰈂Offline\n" [screencast] interval=once signal=11 command=[ -f /tmp/cast.mkv ] && printf "󰻂\n" || return 0 [audio] interval=once signal=10 command=vol=$(mixer vol|cut -d':' -f2) ; printf "󰕾%.3d\n" $vol ; [ $vol -eq 0 ] && return 33 || return 0 [disk] interval=10 command=printf "󰋊%s\n" $(df -hk /usr/home | cut -w -f5 | sed 1d) [memory] interval=10 command=printf "󰍛%s\n" $(top -n | grep Mem | cut -w -f2) [load] interval=10 command=cpu_count=$(sysctl -n hw.ncpu) ; avg_load=$(sysctl vm.loadavg|cut -w -f3) ; percent=$(echo "result = $avg_load / $cpu_count * 100; scale=0; result / 1"|bc -l) ; printf "󰻠%.3d%%\n" $percent ; [ $percent -ge 70 ] && return 33 || return 0 [temp] interval=10 command=celcius=$(sysctl -n dev.cpu.0.temperature|cut -d'.' -f1) ; printf "󰔏%.3d ℉\n" $(echo "$celcius * 9 / 5 + 32" | bc) ; [ $celcius -ge 80 ] && return 33 || return 0 [battery] interval=59 command=status=$(apm -b) ; level=$(apm -l) ; [ $status -eq 3 ] && printf "󰂄%.3d%%" $level || printf "󰂁%.3d%%" $level && [ $status -eq 2 ] && return 33 || return 0 [date] interval=59 command=printf "󰃰%s\n" "$(date '+%a %b %e %l:%M %p')"