Page 1 of 1

Shutdown after playback?

Posted: 22 Jun 2011 15:32
by Dreakon
I'm running Debian Testing and VLC 1.1.10. I'm a little new to the whole Linux scene, so you'll have to excuse me if I sound like an idiot at any point.

Is there any way to shut VLC down after playing back a video file?

According to this page:
http://wiki.videolan.org/How_to_shut_do ... uter#Linux
It should be as simple as making a .sh file. However, things got a little more complicated when it turned out the provided script wasn't working and required root.

I changed the script simply to:

Code: Select all

#! /bin/sh vlc && /sbin/shutdown -h now
... and changed some stuff elsewhere to get the script to work without prompting for a password (the laptop shuts down when I run the script on it's own)... but when I add the script to the VLC playlist and I play it, the laptop doesn't shut down.

Is that Wiki page outdated perhaps? Or am I doing something wrong? Thanks!

Re: Shutdown after playback?

Posted: 22 Jun 2011 16:32
by chad27295
Just create a simple text file (playlist) with the extension .m3u and enter your media files at the top and vlc://quit at the bottom. This will play your media and quit vlc once it finishes.

mymusic.mp3
vlc://quit



From the command line you will enter vlc playlist.m3u to start the playback!

Re: Shutdown after playback?

Posted: 22 Jun 2011 16:35
by Dreakon
Well, I'm actually looking to shut down my laptop after a file is done playing, not just close VLC. I often put on an episode or two of various shows as I fall asleep and it's nice when the laptop shuts down itself because I doze off from time to time. :)

Re: Shutdown after playback?

Posted: 22 Jun 2011 19:43
by chad27295
what about if you use vlc-wrapper in your script instead of vlc? That way you could use sudo on your script to run as root. ex:

#! /bin/sh

vlc-wrapper playlist.m3u
shutdown now



I didn't verify this so if it doesn't work I will try myself to see if I can get it to work.