From 680a167d6f72853eeab01970426028fc474c6005 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Thu, 14 May 2020 17:35:21 -0400 Subject: added net, updated audio for FreeBSD, removed title blocks --- findport.sh | 2 +- i3blocks-audio.sh | 7 +++---- i3blocks-net.sh | 12 ++++++++++++ i3blocks-title.sh | 4 ---- 4 files changed, 16 insertions(+), 9 deletions(-) create mode 100755 i3blocks-net.sh delete mode 100755 i3blocks-title.sh diff --git a/findport.sh b/findport.sh index 9aa11d9..4d9cc60 100755 --- a/findport.sh +++ b/findport.sh @@ -1,4 +1,4 @@ #!/bin/sh -find /usr/local/poudriere/ports/default -type d -name "*$1*" +find /usr/local/poudriere/ports/default -type d -name "*$1*" | sort diff --git a/i3blocks-audio.sh b/i3blocks-audio.sh index 84f883d..53b00e3 100755 --- a/i3blocks-audio.sh +++ b/i3blocks-audio.sh @@ -7,11 +7,10 @@ icon_mid=󰖀 icon_high=󰕾 icon_mute=󰝟 -[ $(pulsemixer --get-mute) -eq 1 ] && printf "$icon_mute\n" && exit - -volume=$(pulsemixer --get-volume | cut -d' ' -f1) +volume=$(mixer vol | cut -d':' -f2) icon= -[ $volume -lt $low ] && icon=$icon_low +[ $volume -eq 0 ] && icon=$icon_mute +[ $volume -gt 0 ] && [ $volume -lt $low ] && icon=$icon_low [ $volume -ge $low ] && [ $volume -lt $high ] && icon=$icon_mid [ $volume -ge $high ] && icon=$icon_high printf "%s %s%%\n" $icon $volume diff --git a/i3blocks-net.sh b/i3blocks-net.sh new file mode 100755 index 0000000..8690cb9 --- /dev/null +++ b/i3blocks-net.sh @@ -0,0 +1,12 @@ +#!/bin/sh +icon_ethernet=󰈁 +icon_wireless=󰖩 + +is_ethernet=$(ifconfig em0 | grep status | cut -d':' -f2) +if [ "$is_ethernet" = " active" ]; then + inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3) + printf "$icon_ethernet %s\n" $inet +else + ssid=$(ifconfig wlan0 | grep ssid | cut -d'"' -f2) + printf "$icon_wireless %s\n" "$ssid" +fi diff --git a/i3blocks-title.sh b/i3blocks-title.sh deleted file mode 100755 index cce4fc4..0000000 --- a/i3blocks-title.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -name=$(xdotool getactivewindow getwindowname) -[ -n "$name" ] && printf "%s\n" "$(xdotool getactivewindow getwindowname)" -- cgit v1.2.3