summaryrefslogtreecommitdiff
path: root/.config/i3blocks
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-08-06 22:46:40 -0400
committer53hornet <atc@53hor.net>2021-08-06 22:46:40 -0400
commitdc1fbe8f36b71d3742ec18fcd6aa7adb969bf499 (patch)
treec7504e91c32d8619ab1dfa6415b51b563ffbad28 /.config/i3blocks
parent717d31ad4e8631c43110d9d202941cd91b19e239 (diff)
downloaddotfiles-dc1fbe8f36b71d3742ec18fcd6aa7adb969bf499.tar.xz
dotfiles-dc1fbe8f36b71d3742ec18fcd6aa7adb969bf499.zip
aliases, functions, mutt config, i3 template
Diffstat (limited to '.config/i3blocks')
-rw-r--r--.config/i3blocks/config25
1 files changed, 13 insertions, 12 deletions
diff --git a/.config/i3blocks/config b/.config/i3blocks/config
index e094451..968a4b4 100644
--- a/.config/i3blocks/config
+++ b/.config/i3blocks/config
@@ -4,6 +4,9 @@
# 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
@@ -12,25 +15,23 @@ separator=true
separator_block_width=15
[packages]
-interval=3600
-command=[ "$BLOCK_BUTTON" == 3 ] && alacritty -e zsh -i -c "doas pkg upgrade" || 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
+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=1800
+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
[news]
-interval=1800
+interval=once
signal=13
command=unread=$(newsboat -x print-unread|cut -w -f1) && [ "$unread" != 0 ] && [ "$unread" != Authentication ] && printf "󰎕%s\n" $unread || return 0
-#[uptime]
-#interval=300
-#command=printf "󰣠%s\n" "$(uptime | grep -o 'up[^,]*' )"
-
[updates]
-interval=86399
+interval=once
+signal=15
command=doas freebsd-update updatesready > /dev/null ; [ $? -ne 2 ] && printf "󰣠Updates ready" || return 0
[weather]
@@ -39,7 +40,7 @@ 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" || printf "󰈂Offline\n"
+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
@@ -52,7 +53,7 @@ signal=10
command=vol=$(mixer vol|cut -d':' -f2) ; printf "󰕾%.2d\n" $vol ; [ $vol -eq 0 ] && return 33 || return 0
[disk]
-interval=10
+interval=60
command=printf "󰋊%s\n" $(df -hk /usr/home | cut -w -f5 | sed 1d)
[memory]
@@ -68,7 +69,7 @@ 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
+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]