dotfiles/scripts/download-current-video.sh
inigoortega 753c07c665 All scripts are POSIXfied now (I think).
There might be bugs
2019-10-01 16:20:43 +02:00

12 lines
292 B
Bash

#!/usr/bin/env sh
xdotool key ctrl+l
xdotool key ctrl+c
# xdotool type yy
# link="$(xclip -o -selection clipboard | sed -E 's|([^&]*)(&)(.*)|\1|')"
link="$(xclip -o | sed -E 's|([^&]*)(&)(.*)|\1|')"
filename="$(dash $SCRIPTS/download-selected-video.sh "$link")"
printf "%b\n" "$filename"