Skip to content

Instantly share code, notes, and snippets.

@serverwentdown
Last active August 29, 2015 14:10
Show Gist options
  • Save serverwentdown/67486810a04dd7386877 to your computer and use it in GitHub Desktop.
Save serverwentdown/67486810a04dd7386877 to your computer and use it in GitHub Desktop.
ubuntu + youtube-dl scripts
#!/bin/sh
amixer -D pulse sset Master $1
#!/bin/zsh
NOW=$(amixer -D pulse get Master | grep -m 1 -Poh "[0-9]+(?=%)")
STEPS=${$(echo "$NOW-$1" | bc)#-}
if [[ -z $2 ]]; then
2=6
fi
SLEEPTIME=$(echo "$2/$STEPS" | bc -l)
echo $NOW
echo $1
echo $STEPS
echo $SLEEPTIME
for i in $(eval echo "{$NOW..$1}"); do
amixer -q -D pulse sset Master $i%
sleep $SLEEPTIME
done
#!/bin/sh
if [ $1 = "--url" ]; then
youtube-dl -f bestaudio "$2" -o - | cvlc - --play-and-exit
else
youtube-dl -f bestaudio "ytsearch:$*" -o - | cvlc - --play-and-exit
fi;
@serverwentdown
Copy link
Author

There's something wrong with volumefade. It tends to overshoot the specified volume due to offsets. Expected, but ok.

@serverwentdown
Copy link
Author

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment