From d7411594c0ca071f08da108f544902f03e2e413d Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Fri, 9 Oct 2020 09:50:40 -0400 Subject: fixed uptime and network scripts, added transcode-screencast --- git-create | 2 ++ github-mirror.sh | 3 +++ i3blocks-net.sh | 6 +++--- i3blocks-uptime.sh | 2 +- imager.sh | 2 +- transcode-screencast.sh | 11 +++++++++++ yt.sh | 5 +++-- 7 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 github-mirror.sh create mode 100755 transcode-screencast.sh diff --git a/git-create b/git-create index af9bb86..642016f 100755 --- a/git-create +++ b/git-create @@ -1,5 +1,7 @@ #!/bin/sh +# TODO: update this for gitea, insta-creation of repo + # create a repo of provided name on macon and make it the upstream name=$1 [[ ! $(echo "$name" | grep ".git" -) ]] && name="$1.git" diff --git a/github-mirror.sh b/github-mirror.sh new file mode 100644 index 0000000..5d9cb00 --- /dev/null +++ b/github-mirror.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +# Should mirror a gitea repo into github using the public API diff --git a/i3blocks-net.sh b/i3blocks-net.sh index 396faa6..26aad7b 100755 --- a/i3blocks-net.sh +++ b/i3blocks-net.sh @@ -4,12 +4,12 @@ icon_down=󰈂 icon_wireless=󰖩 is_ethernet=$(ifconfig em0 | grep status | cut -d\: -f2) +inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3) if [ "$is_ethernet" = " active" ]; then - inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3) - printf "%s%s\n" $icon_ethernet $inet + printf "%s%s" $icon_ethernet $inet 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" $icon_wireless "$ssid" + [ -n "$ssid" ] && printf "%s%s %s" $icon_wireless "$ssid" $inet else printf "%sNo connection" $icon_down fi diff --git a/i3blocks-uptime.sh b/i3blocks-uptime.sh index 515f056..778b71f 100755 --- a/i3blocks-uptime.sh +++ b/i3blocks-uptime.sh @@ -1,4 +1,4 @@ #!/bin/sh icon=󰣠 -printf "$icon%s\n" "$(uptime -p | cut -d, -f1,2)" +printf "$icon%s\n" "$(uptime | grep -o 'up[^,]*' )" diff --git a/imager.sh b/imager.sh index ef36b1c..32d9f5f 100755 --- a/imager.sh +++ b/imager.sh @@ -1,2 +1,2 @@ #!/bin/sh -find . -type f -exec sxiv "$1" "{}" + +find . -type f -maxdepth 1 -exec sxiv "$1" "{}" + diff --git a/transcode-screencast.sh b/transcode-screencast.sh new file mode 100755 index 0000000..61a9306 --- /dev/null +++ b/transcode-screencast.sh @@ -0,0 +1,11 @@ +#!/bin/sh +INPUT_VIDEO=$1 +INPUT_AUDIO=$2 +OUTPUT=$3 +ffmpeg -i "$INPUT_VIDEO" \ + -i "$INPUT_AUDIO" \ + -vcodec libx264 \ + -pix_fmt yuv420p \ + -acodec aac \ + -b:a 320k \ + "$OUTPUT" diff --git a/yt.sh b/yt.sh index d422a66..2ec834e 100755 --- a/yt.sh +++ b/yt.sh @@ -47,7 +47,8 @@ prompt_url() { ## Grab url from clipboard/primary selection, else get via prompt grab_url() { - if url=$(xclip -o -selection clipboard 2>/dev/null || echo) && check_if_youtube $url; then + if url="$1" && check_if_youtube $url; then + elif 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 @@ -131,7 +132,7 @@ print_info() { ## Main mkdir -p "$DOWNLOAD_DIR" -url=$(grab_url) +url=$(grab_url "$1") case "$(get_action_single)" in 5) -- cgit v1.2.3