Skip to content

Instantly share code, notes, and snippets.

@ghthor
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save ghthor/d622eac67df89ff0c4ba to your computer and use it in GitHub Desktop.

Select an option

Save ghthor/d622eac67df89ff0c4ba to your computer and use it in GitHub Desktop.
Pick 5 random videos from my collection and play them, then shutdown my computer. I use it to fall asleep.
#!/bin/bash
# find all videos in $PWD/*
# randomize them
# pick 5 of them
# add the vlc quit signal
# vlc
# shut her down
find -name "*.mkv" | \
perl -MList::Util -e 'print List::Util::shuffle <>' | \
head -n 5 | \
sed '$ a\vlc://quit' | \
xargs vlc && \
sudo shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment