I am trying to run a script after resuming from suspend. I need this script to disable the right click in the touchpad and to fix a problem of my wifi. Accordingly to How to run script after resume and after unlocking screen I placed a script called autorun.sh in /etc/pm/sleep.d:
#! /bin/bash
case "$1" in
hibernate|suspend)
sudo -u giorgio env DISPLAY=:0 zenity --info synclient TapButton2=0
sudo -u giorgio env DISPLAY=:0 zenity --info modprobe iwlagn 11n_disable=1
exit
;;
thaw|resume)
sudo -u giorgio env DISPLAY=:0 zenity --info synclient TapButton2=0
sudo -u giorgio env DISPLAY=:0 zenity --info modprobe iwlagn 11n_disable=1
exit
;;
esac
exit
The problem is that when I resume, I realize that the script didn't actually work (the right click is not disabled) and in the log file /var/log/pm-suspend.log I have this lines:
Running hook /etc/pm/sleep.d/autorun.sh resume suspend:
(process:15304): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
(process:15310): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
What I am missing? Thanks in advance.
touch /tmp/resumed_okay
or something similar? Also, presumably the commands run fine if you run them manually from the command line? (Also, you don't need theexit
s in the script.) – Sparhawk Jun 02 '13 at 09:45touch /tmp/resumed_okay
in your autorun script. Is the file created on resume? – Sparhawk Jun 02 '13 at 10:41sudo -u giorgio env DISPLAY=:0 zenity touch /tmp/resumed_okay
No file was created on resume – gg-79 Jun 03 '13 at 07:30touch /tmp/resumed_okay
without anything else. – Sparhawk Jun 03 '13 at 10:47zenity
is for creating dialogue boxes, right? So it seems like your commands are to create a dialogue box but not do anything else? – Sparhawk Jun 03 '13 at 11:46zenity
to display the dialogue box just as an example. – Sparhawk Jun 03 '13 at 16:26