You are not logged in.

#1 2009-05-13 19:06:12

dalingrin
Member
Registered: 2009-03-18
Posts: 128

[Solved] Need to be able to run a script upon resume from sleep

With my current macbook sleep and resume work perfectly out of the box with Arch. However there are somethings that get reset upon resume, such as CPU fan speed minimum. I would like to able to run a script to raise the fan speed upon resume. I have no idea how the hooks for resume work, especially since I didn't install or modify anything to get sleep to work in the first place.


Thanks for the help!

Last edited by dalingrin (2009-05-13 23:00:17)

Offline

#2 2009-05-13 20:04:00

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: [Solved] Need to be able to run a script upon resume from sleep

here you got a skeleton, place it in /etc/pm/sleep.d and give it +x

name it 01-something since its the last hook you wish to run.. modify the part that says thaw|resume)

#!/bin/bash

    case "$1" in
        hibernate|suspend)
            ;;
        thaw|resume)
            ;;
        *)
            ;;
    esac

EDIT: this is asuming you are using pm-suspend

EDIT2: some error fixed

Last edited by eldragon (2009-05-13 20:05:14)

Offline

#3 2009-05-13 22:59:35

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: [Solved] Need to be able to run a script upon resume from sleep

eldragon wrote:

here you got a skeleton, place it in /etc/pm/sleep.d and give it +x

name it 01-something since its the last hook you wish to run.. modify the part that says thaw|resume)

#!/bin/bash

    case "$1" in
        hibernate|suspend)
            ;;
        thaw|resume)
            ;;
        *)
            ;;
    esac

EDIT: this is asuming you are using pm-suspend

EDIT2: some error fixed

Perfection. Thanks so much.
I didn't realize I was using pm-suspend.

Offline

Board footer

Powered by FluxBB