0

I am new to ubuntu and I am trying to create a file to fix a suspend problem I have with my system. I have found the answer here as follows:

Put attached script into dir /etc/pm/sleep.d e.g. with name fglrx-fix and make it executable (chmod u+x /etc/pm/sleep.d/fglrx-fix)

#!/bin/bash
#Script kills autofs when going into standby to eliminate issues with it
case $1 in

suspend)
#suspending to RAM
    chvt 1
    echo "Going to sleep"
    sleep 1
;;
resume)
#resume from suspend 
    echo "try to resume"
    sleep 1
    chvt 7
;;       
esac

I just cannot work out how to create the file in terminal, if someone could give a me a step by step instruction that would be great!

albany
  • 73
  • 1
  • 1
  • 7

1 Answers1

2

You'd most commonly use a command line editor like nano. You need to run it as root because of where you're trying to write:

sudo nano /etc/pm/sleep.d/fglrx-fix

nano will open up allowing you to paste the code in. Control+X to exit (press Y to confirm that you want to save it and Return to confirm the filename).

Then (per the original instuctions) make it executable with:

sudo chmod +x /etc/pm/sleep.d/fglrx-fix
Oli
  • 293,335
  • You could also use Text Editor, which is a little bit more user-friendly. To do that you would use the following command:
    `sudo gedit /etc/pm/sleep.d/fglrx-fix`
    
    

    ...And after you save and close it (when you close it in Text Editor it will return to your curson in the terminal), you would follow @Oli's instruction to make it executable.

    – User 1058612 Apr 01 '14 at 13:20
  • 2
    I stayed away from graphical options because the problem at hand seems to be a graphical one. nano is universally available and isn't that hard to use :) – Oli Apr 01 '14 at 13:27
  • Yes, that makes sense - I missed the OP's flgrx, which should have indicated a graphics/display issue to me. :p vi or vim works, too - but you are right, nano will work in the terminal no matter what. – User 1058612 Apr 02 '14 at 14:55