From 1a26090ba7df4b076f011b8f9ac5d4d81dc14a02 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Wed, 10 Jun 2020 17:08:37 -0400 Subject: updated porter, blocks, findport --- abraham-porter.sh | 4 ++-- findport.sh | 5 +++-- i3blocks-net.sh | 4 ++-- i3blocks-packages.sh | 4 ++-- yt.sh | 8 ++++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/abraham-porter.sh b/abraham-porter.sh index 23be09a..7aef841 100755 --- a/abraham-porter.sh +++ b/abraham-porter.sh @@ -111,7 +111,7 @@ EOF ## Main -while true; do +while true ; do action=$(get_action) case $action in 1) @@ -150,5 +150,5 @@ while true; do exit $NO_ACTION_PROVIDED ;; esac - get_another || exit OK + get_another || exit $OK done diff --git a/findport.sh b/findport.sh index 4d9cc60..9aaf349 100755 --- a/findport.sh +++ b/findport.sh @@ -1,4 +1,5 @@ #!/bin/sh -find /usr/local/poudriere/ports/default -type d -name "*$1*" | sort - +cwd="$(pwd)" +cd /usr/local/poudriere/ports/default +printf "%s\n" */* | grep "$1" | sort diff --git a/i3blocks-net.sh b/i3blocks-net.sh index b3d7239..abb241f 100755 --- a/i3blocks-net.sh +++ b/i3blocks-net.sh @@ -8,8 +8,8 @@ if [ "$is_ethernet" = " active" ]; then inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3) printf "%s%s\n" $icon_ethernet $inet elif [ "$(ifconfig wlan0 | grep status | cut -d\: -f2)" = " associated" ]; then - ssid=$(ifconfig wlan0 | grep ssid\ | cut -w -f3) - [ -n "$ssid" ] && printf "%s%s" $icon_wireless "$ssid" + ssid=$(ifconfig wlan0 | grep ssid\ | cut -d'"' -f2) + [ -n "$ssid" ] && printf "%s\"%s\"" $icon_wireless "$ssid" else printf "%sNo connection" $icon_down fi diff --git a/i3blocks-packages.sh b/i3blocks-packages.sh index 6e5d0e9..4fd211f 100755 --- a/i3blocks-packages.sh +++ b/i3blocks-packages.sh @@ -1,6 +1,6 @@ #!/bin/sh icon=󰏖 -package_count=$(pkg upgrade -n | tail -1 | cut -s -d':' -f2 | cut -w -f2) -[ -n "$package_count" ] && [ "$package_count" -gt 0 ] && printf "%s%s" $icon $package_count && notify-send "$package_count package upgrade(s) available" +count=$(pkg upgrade -n | sed -n 's/^Number of packages to be installed:\(.*\)/\1/p') +[ -n "$count" ] && [ "$count" -gt 0 ] && printf "%s%s" $icon $count && notify-send "$count package upgrade(s) available" printf "\n" diff --git a/yt.sh b/yt.sh index 823bb7c..a1c8261 100755 --- a/yt.sh +++ b/yt.sh @@ -47,9 +47,9 @@ prompt_url() { ## Grab url from clipboard/primary selection, else get via prompt grab_url() { - if url=$(grab_url_stdin) && check_if_youtube $url; then - elif url=$(xclip -o -selection clipboard 2>/dev/null || echo) && check_if_youtube $url; then + if url=$(xclip -o -selection clipboard 2>/dev/null || echo) && check_if_youtube $url; then elif url=$(xclip -o 2>/dev/null || echo) && check_if_youtube $url; then + elif url=$(grab_url_stdin) && check_if_youtube $url; then elif url=$(prompt_url) && check_if_youtube $url; then else exit $NO_YOUTUBE_URL @@ -109,7 +109,7 @@ download_audio() { play_video() { url="$1" notify-send "Playing video..." "$(get_info $url)" & - mpv --no-terminal $url & + mpv --no-terminal --geometry=25%-10-40 --title=yt.sh $url & } @@ -117,7 +117,7 @@ play_video() { play_audio() { url="$1" notify-send "Playing audio..." "$(get_info $url)" & - $TERMINAL -e mpv --no-video $url & + $TERMINAL -t yt.sh -e mpv --no-video $url & } -- cgit v1.2.3