How do I run a script on resume from suspend?

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
xircon

How do I run a script on resume from suspend?

Post by xircon »

Created a script called 100resume:

Code: Select all

#!/bin/bash
case "$1" in
    thaw|resume)
    sh -c "echo low > /sys/class/drm/card0/device/power_profile"
    cpufreq-set -g powersave
        ;;
    *)
        ;;
esac
exit $?
I have placed it in /etc/pm/sleep.d & /usr/lib/pm-utils/sleep.d/ made executable, but it is not working.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
xircon

Re: How do I run a script on resume from suspend?

Post by xircon »

Still struggling with this, anybody any ideas? If I forget to run the echo command, the temperatures push up to the high 70 deg C.
ej64
Level 4
Level 4
Posts: 323
Joined: Tue Nov 24, 2009 7:43 am
Location: somewhere in Germany

Re: How do I run a script on resume from suspend?

Post by ej64 »

As I already wrote elsewhere:
- use a 2.6.39 kernel with "pcie_aspm=force"
- install the latest Catalyst driver (11.11)

That's the way to get best performance and best power savings. (And stay with that kernel until you like to mess up your system ...)
Thinkpad X220 with Samsung SSD running Xubuntu 13.04
I'm getting old gladly -- I don't like to die young ...
Locked

Return to “Scripts & Bash”