You are not logged in.

#1 2010-02-05 00:15:40

pw_f100_220
Member
From: about
Registered: 2009-12-03
Posts: 107

[SOLVED] Launch script to run after mplayer finishes?

I have a script to turn off my screen which I mapped to Fn F3.  I often like to go to sleep right after I watch a movie with mplayer.  Is there a way to make it so I can start the movie, then run the script which will wait until mplayer closes to actually execute?  (my computer is far from my bed smile

I used to just use "at" but my favorite part of linux is messing with something to make it as easy as possible later. 

Here is the original (my first script ever):

#!/bin/sh

sleep .25; xset dpms force off

Last edited by pw_f100_220 (2010-02-05 13:34:09)


Sometimes I just want people to expect me to do what I would do instead of what most people would do.

Offline

#2 2010-02-05 01:21:03

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Launch script to run after mplayer finishes?

mplayer files options etc;./shutdownscript

Will execute the script when mplayer finishes regardless of how it terminates.

Offline

#3 2010-02-05 01:36:42

pw_f100_220
Member
From: about
Registered: 2009-12-03
Posts: 107

Re: [SOLVED] Launch script to run after mplayer finishes?

I don't want it to happen every time.  That does sound like it would do the trick though.


Sometimes I just want people to expect me to do what I would do instead of what most people would do.

Offline

#4 2010-02-05 07:55:42

FarmerF
Member
From: Netherlands
Registered: 2009-06-08
Posts: 76

Re: [SOLVED] Launch script to run after mplayer finishes?

If you start mplayer from the command line then you could add your script so it executes once the mplayer command returns.

mplayer myfilm.avi && ./screenoff.sh

You should be able to add a similar line to a graphical launcher as well (perhaps a second button that starts it like that) but that depends on your DE/WM

Offline

#5 2010-02-05 13:33:38

pw_f100_220
Member
From: about
Registered: 2009-12-03
Posts: 107

Re: [SOLVED] Launch script to run after mplayer finishes?

awesome! works like a charm.  I only use mplayer from the command line so it's perfect.  Thanks man.  I looked around for something like that first but it's so hard knowing exactly what to search for sometimes.


Sometimes I just want people to expect me to do what I would do instead of what most people would do.

Offline

#6 2010-02-07 17:00:52

FarmerF
Member
From: Netherlands
Registered: 2009-06-08
Posts: 76

Re: [SOLVED] Launch script to run after mplayer finishes?

hehe glad to be of service.

Offline

#7 2010-02-07 17:17:34

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: [SOLVED] Launch script to run after mplayer finishes?

Or you can make a wrapper script for mplayer that first plays the movie of your selection and then executes the screen off script you wrote.  Either way works.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB