summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/common/ytclipo10
-rwxr-xr-xconfig/wayland/dwl/startup.sh3
2 files changed, 9 insertions, 4 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo
index 8997539..959ee21 100755
--- a/bin/common/ytclipo
+++ b/bin/common/ytclipo
@@ -11,9 +11,13 @@ fi
inp="$1"
[ "${inp:=$(paste)}" ] || inp="$(cat /dev/stdin)"
-# take last link from clipboard
-# works when link is from yt-local
-inp="https://youtu.be/$(echo "$inp" | sed 's/.*\(.\{11\}\)$/\1/')"
+# remove util scheme
+inp="${inp#*//}"
+# convert to youtube.com/path url
+# works for:
+# - 'youtu.be/watch?v=xxxxxx'
+# - 'https://piped.video/watch?v=xxxxx'
+inp="https://youtube.com/${inp#*/}"
>&2 printf "inp: %s\n" "$inp"
notify-send "ytclipo" "downloading <i>$inp</i>" || :
diff --git a/config/wayland/dwl/startup.sh b/config/wayland/dwl/startup.sh
index 8817ad2..0f482fa 100755
--- a/config/wayland/dwl/startup.sh
+++ b/config/wayland/dwl/startup.sh
@@ -21,4 +21,5 @@ then
fi
(tail -f "$WOBCONFIG"/pipe | wob) &
-$TERMINAL -e tmux a || $TERMINAL tmux &
+# $TERMINAL -e tmux a || $TERMINAL tmux &
+emacsclient -c -a 'emacs' &