LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-19-2014, 11:45 AM   #1
guiphil
LQ Newbie
 
Registered: Nov 2014
Posts: 2

Rep: Reputation: Disabled
Problem running a wake up script.


Hi all.
I am new to Linux. I installed mint 17 with Cinnamon on a Toshiba laptob. I had no sound coming out of my audio port/ headphones. I found out how to run HDA Analyzer, check EAPD, create a script that I named audio.py and run it on reboot (hurray!). Now when I close my laptop, and re-open it, the headphones go off.
I saw I had to run that same script in /etc/pm/sleep.d/
I searched extensively for examples and tried:
cd /etc/pm/sleep.d
sudo touch audio.py
sudo chmod +x audio.py
sudo gedit audio.py

then

#!/bin/bash
case"$1" in
thaw/resume)
su -c - username /home/username/Documents/audio.py
;;
*)
;;
esac
exit$?

what am I doing wrong? I tried several different things, but don't seem to be able to run that script located in /home/username/Documents/audio.py created from the HDA analyzer on resume...
Please save my sanity. Thank you for your help.
 
Old 11-23-2014, 04:59 PM   #2
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,825

Rep: Reputation: 221Reputation: 221Reputation: 221
This is not a python script, it is a bash script.
Code:
#!/bin/bash
case"$1" in
thaw/resume)
su -c - username /home/username/Documents/audio.py
;;
*)
;;
esac
exit$?
Not sure what you are trying to do.
Quote:
cd /etc/pm/sleep.d
sudo touch audio.py
sudo chmod +x audio.py
sudo gedit audio.py
That will make an empty file at /etc/pm/sleep.d/audio.py
Did you move that file to ~/Documents/audio.py?
Is audio.py now a python script that you've made?
Don't do this:
Code:
su -c - username /home/username/Documents/audio.py
If you need root access then run the script as root.
Code:
#! /usr/bin/env bash

cd $HOME/Documents

case "$1" in 
	thaw/resume) audio.py ;;
			*) ;;
esac
exit
 
Old 11-23-2014, 10:45 PM   #3
guiphil
LQ Newbie
 
Registered: Nov 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for your reply teckk.
I generated a python script with HDA Analyzer (named audio.py) and saved it in Documents.
I managed to run it in r-local so that my headphone now works when I reboot my pc and I don't have to pull up the HDA Analyzer and check EAPD each time.
Now I was trying to create a file / script in sleep.d that would run that same script audio.py (saved in my documents) but on resume, just like I did in r-local to run it on reboot. Still can't figure it out.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running script after screen wake - Debian 7 Shruikan Debian 2 07-30-2014 06:12 PM
Problem running a program/script in the background from a script newbie01.linux Programming 5 03-28-2011 08:28 AM
Problem running an Expect script within a Bash script mbeipi Programming 8 03-15-2011 05:07 PM
running Linux breaks Wake-on-LAN HFat Linux - Networking 4 06-19-2005 07:49 AM
Run script on wake FC3 JelloPhreak Linux - Software 0 06-15-2005 06:12 PM


All times are GMT -5. The time now is 10:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration