From b387934988d98ca7842bf44bd94d5067e3f9f843 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Tue, 24 Nov 2020 08:14:24 -0500 Subject: updated blocks and autolock --- autolocker.sh | 3 +-- i3blocks-net.sh | 2 +- i3blocks-up.sh | 5 +++++ i3blocks-updates.sh | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100755 i3blocks-up.sh diff --git a/autolocker.sh b/autolocker.sh index f7b0b2a..692fbfb 100755 --- a/autolocker.sh +++ b/autolocker.sh @@ -8,9 +8,8 @@ if [ "$1" = "-d" ]; then -notifier "notify-send -t=10000 '10 seconds to lock...'" else xautolock \ - -detectsleep \ -killtime 10 \ - -killer "doas acpiconf -s3" \ + -killer "sleep 0.5; doas acpiconf -s3" \ -notify 10 \ -time 10 \ -locker "i3lock -n -f -c 000000 -i ~/.local/share/wallpapers/lock.png; sleep 0.2" \ diff --git a/i3blocks-net.sh b/i3blocks-net.sh index 26aad7b..340a70a 100755 --- a/i3blocks-net.sh +++ b/i3blocks-net.sh @@ -11,7 +11,7 @@ elif [ "$(ifconfig wlan0 | grep status | cut -d\: -f2)" = " associated" ]; then ssid=$(ifconfig wlan0 | sed -n 's/^.*ssid \(.*\) channel.*$/\1/p') [ -n "$ssid" ] && printf "%s%s %s" $icon_wireless "$ssid" $inet else - printf "%sNo connection" $icon_down + printf "%sOffline" $icon_down fi printf "\n" diff --git a/i3blocks-up.sh b/i3blocks-up.sh new file mode 100755 index 0000000..52791a1 --- /dev/null +++ b/i3blocks-up.sh @@ -0,0 +1,5 @@ +#!/bin/sh +icon=󰣠 + +doas freebsd-update updatesready > /dev/null +[ $? -eq 2 ] && printf "$icon%s\n" "$(uptime | grep -o 'up[^,]*')" || printf "%sUpdates are available" $icon diff --git a/i3blocks-updates.sh b/i3blocks-updates.sh index 3b73f3c..02d3a60 100755 --- a/i3blocks-updates.sh +++ b/i3blocks-updates.sh @@ -1,4 +1,5 @@ #!/bin/sh icon=󰣠 -freebsd-update updatesready && printf "%s" $icon && notify-send "FreeBSD updates are ready to install" +freebsd-update updatesready > /dev/null +[ $? -eq 2 ] || printf "%sUpdates are available" $icon && notify-send "Updates are ready to install" -- cgit v1.2.3