summaryrefslogtreecommitdiff
path: root/.config/i3blocks/config
diff options
context:
space:
mode:
Diffstat (limited to '.config/i3blocks/config')
-rw-r--r--.config/i3blocks/config11
1 files changed, 6 insertions, 5 deletions
diff --git a/.config/i3blocks/config b/.config/i3blocks/config
index 367681d..8791d17 100644
--- a/.config/i3blocks/config
+++ b/.config/i3blocks/config
@@ -13,17 +13,17 @@ 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
+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
[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
+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
signal=13
-command=unread=$(newsboat -x print-unread|cut -w -f1) ; [ "$unread" != 0 ] && [ "$unread" != Authentication ] && printf "󰎕A:%s\n" $unread
+command=unread=$(newsboat -x print-unread|cut -w -f1) && [ "$unread" != 0 ] && [ "$unread" != Authentication ] && printf "󰎕%s\n" $unread || return 0
#[uptime]
#interval=300
@@ -35,11 +35,12 @@ command=doas freebsd-update updatesready > /dev/null ; [ $? -ne 2 ] && printf "
[weather]
interval=3600
-command=fetch -qo - "https://wttr.in/23435?format=2"
+#command=[ "$BLOCK_BUTTON" = 3 ] && alacritty -e zsh -i -c "fetch --user-agent=curl -qo - https://wttr.in/23435 && read line" || fetch -qo - "https://wttr.in/23435?format=%c+%f+%h+%w"
+command=weather.sh
[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"
+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"
[screencast]
interval=once