0

Well i was just thinking of having an app or a feature which enables you to play music even the laptop lid is shut close. what i want is that the screen should be locked ie no one should be able to do any other thing and at the same time my music should be contiued to play; virtually turning my lid-turned down laptop into a musical jukebox, ie a musical screen saver of sorts. Can anyone help me in achieving this? Any hints?

2
  • you when the laptop lid is closed you want: 1. all processes killed, 2. music player started. or do you want 1. xlock started 2. music player started, or do you want 1. all x applications killed 2. xlock started 3. music player started. you need to be more clear about what exactly you need! Jan 18, 2013 at 12:49
  • I want music player started and xlock started
    – MKJ
    Jan 18, 2013 at 19:01

1 Answer 1

0

You could try putting this in a file, marking it executable, and referencing it in your xinit or rc.local:

#!/bin/sh
while true
do grep -v open /proc/acpi/button/lid/LID0/state
  if [ $? ]; then
    killall mplayer
  else
    pidof mplayer; if [ $? ]; then screen -d -m "sh -c 'mplayer -loop 0 -novideo /usr/share/example-content/Ubuntu_Free_Culture_Showcase/*' "; xlock; fi
  fi
  sleep 1
done

It's pretty straightforward, ask me if you have questions. Obviously it will only work problem-free if you do not use mplayer while using it.

1
  • I opened a music file in vlc media player and then closed the lid of my laptop. But after sometime it stopped playing .
    – MKJ
    Jan 20, 2013 at 4:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .