Created
April 19, 2016 19:39
-
-
Save AbdallaZaki/29b31116d377726b96a188c49bd066a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
last_video=$(find ~/Downloads -type f -regex ".*\.\(mp4\|mkv\|rmvb\|vob\|flv\|mov\|avi\)$" -printf "%-.22T+ %M %n %-8u %-8g %8s %Tx %.8TX %p\n" | sort | tail -n1 | grep -o "/home.*$" ) | |
if [ -z "$( pgrep totem )" ]; then | |
echo "$last_video" | xargs -d "\n" totem & | |
else | |
echo "$last_video" | xargs -d "\n" totem | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment