summaryrefslogtreecommitdiff
path: root/.config/i3blocks/config
blob: 178b82cf18603ba03c8938c4072075bbaef4ac0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# i3blocks configuration file
#
# The i3blocks man page describes the usage of the binary,
# and its website describes the configuration:
#
#     https://vivien.github.io/i3blocks
#
# Note: on FreeBSD, the signals listed here are used by running `pkill -[signal
# + 65]`. So for example, if a block signal is 10, you would use `pkill -75`
#test=󰣠
markup=pango

# Global properties
separator=true
separator_block_width=15

[packages]
interval=once
signal=14
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=once
#signal=12
#command=unread=$(ls ~/.mail/gmail/Inbox/new/ | wc -l | cut -w -f2) ; [ $unread -gt 0 ] && printf "󰶋 %s\n" $unread && return 33 || return 0

[weather]
interval=300
command=weather.sh

[net]
interval=10
command=[ "$BLOCK_BUTTON" = 3 ] && doas service netif restart || 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" && return 0 || printf "󰈂 Offline\n" && return 33

[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 "󰕾 %.2d\n" $vol ; [ $vol -eq 0 ] && return 33 || return 0

[disk]
interval=60
#command=printf "󰋊 %s\n" $(df -hk /usr/home | cut -w -f5 | sed 1d)
command=printf "󰋊 %s\n" $(zpool list -H | cut -w -f8)

[memory]
interval=10
command=printf "󰑮 %s 󱎔 %s\n" $(top -n|grep Mem:|cut -w -f2,8)

[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 "󰻠 %.2d%%\n" $percent ; [ $percent -ge 70 ] && return 33 || return 0
#command=printf "󰻠 %s\n" $(top -n|sed -n '3p'|cut -w -f2)

[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=60
command=status=$(apm -b) ; level=$(apm -l) ; [ $status -eq 3 ] && printf "󰂄 %.2d%%" $level || printf "󰂁 %.2d%%" $level && [ $status -eq 2 ] && return 33 || return 0

[date]
interval=59
command=[ "$BLOCK_BUTTON" = 3 ] && date '+%Y-%m-%d' | xclip -i -selection clipboard || printf "󰃰 %s\n" "$(date '+%a %b %e %l:%M %p')"