Sunday, 2 June 2013

Problem running a script after resume

Problem running a script after resume

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.

No comments:

Post a Comment