diff options
author | Adam T. Carpenter <atc@53hor.net> | 2020-06-10 17:08:37 -0400 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2020-06-10 17:08:37 -0400 |
commit | 1a26090ba7df4b076f011b8f9ac5d4d81dc14a02 (patch) | |
tree | 7b54ccaa0813ba6ac3f9cfa1f99a313c386265f0 | |
parent | ade76bb57b81f879e4a2d59709db84f874524bcd (diff) | |
download | scripts-1a26090ba7df4b076f011b8f9ac5d4d81dc14a02.tar.xz scripts-1a26090ba7df4b076f011b8f9ac5d4d81dc14a02.zip |
updated porter, blocks, findport
-rwxr-xr-x | abraham-porter.sh | 4 | ||||
-rwxr-xr-x | findport.sh | 5 | ||||
-rwxr-xr-x | i3blocks-net.sh | 4 | ||||
-rwxr-xr-x | i3blocks-packages.sh | 4 | ||||
-rwxr-xr-x | 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" @@ -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 & } |