I've been using this suspend hook with Ubuntu & Kubuntu since the days of 12.10, however when I did a clean install of Xubuntu 15.04 yesterday, I noticed it suddenly not working. I've created a file /usr/lib/pm-utils/sleep.d/45fixusbwakeup
copied the script into it, and made it executable with sudo chmod +x /usr/lib/pm-utils/sleep.d/45fixusbwakeup
as I always did before. I'm not an expert, and this hook has always been working from me, so I don't have a clue what could be wrong now.
What I basically need is that these 3 commands execute every time before computer is going to sleep, or at every startup:
sudo -s
echo USB0 > /proc/acpi/wakeup
echo USB2 > /proc/acpi/wakeup
I would also like to note that when I suspend via terminal command sudo pm-suspend
the script works flawlessly, it's only not working via traditional logout--->suspend button in Xubuntu, so I guess this is something Xubuntu-related. I guess it actually suspends via xfce4-session-logout --suspend
and that's creating the problem.
sudo -s
will ask for the password. – Reloader Jul 01 '15 at 14:31gksu -s root
- it'll prompt you for thesudo
password on startup. – TellMeWhy Jul 01 '15 at 14:33gksu -s root
obviously don't do as same assudo -s
. Aftergksu -s root
, and entering password, next command,echo USB0 > /proc/acpi/wakeup
results inbash: /proc/acpi/wakeup: Permission denied
. – Reloader Jul 01 '15 at 14:55gksudo
installed on your system. – TellMeWhy Jul 01 '15 at 15:49USB0 > /proc/acpi/wakeup; echo USB2 > /proc/acpi/wakeup
. – user23013 Jul 01 '15 at 15:58/proc/acpi/wakeup/
settings. Meanwhile, I edited the question, I need a way to change default Xubuntu suspend command topm-suspend
, because script works that way. – Reloader Jul 01 '15 at 17:20gksudo -s root <path_to_other_bash_script>
and make it executable." This isn't related to your last comment btw. – TellMeWhy Jul 01 '15 at 17:38