View | Details | Raw Unified | Return to bug 113646
Collapse All | Expand All

(-)acpi_hotkeys_ASUS_M6842NW (-16 / +9 lines)
Lines 7-28 Link Here
7
PATH=/bin:/usr/bin # be paranoid, we're running as root.
7
PATH=/bin:/usr/bin # be paranoid, we're running as root.
8
# first get helper functions (e.g. DEBUG, load_scheme, ...), extend $PATH,
8
# first get helper functions (e.g. DEBUG, load_scheme, ...), extend $PATH,
9
# set variables etc. We get $SCRIPT_RETURN from here
9
# set variables etc. We get $SCRIPT_RETURN from here
10
. "/usr/lib/powersave/scripts/helper_functions"
10
. ${0%/*}/helper_functions # `dirname $0`/helper_functions
11
# get_x_user comes from here...
11
# get_x_user comes from here...
12
. "/usr/lib/powersave/scripts/x_helper_functions"
12
. ${SCRIPT_DIR}/x_helper_functions
13
export PATH
14
15
MYNAME=${0##*/} # basename $0
16
#
17
# look into the example_event_script for an explanation. We need this for
18
# $SCRIPT_RETURN
19
NUM=$4
20
13
21
# previously, we checked for $# <= 3. This is not very future-proof ;-)
14
# previously, we checked for $# <= 3. This is not very future-proof ;-)
22
if [ -z "$NUM" ]; then
15
if [ -z "$EV_ID" ]; then
23
    logger -t $MYNAME 'Sorry, not enough arguments: $4 is empty.'
16
    logger -t $MYNAME 'Sorry, not enough arguments: $4 is empty.'
24
    $SCRIPT_RETURN "$NUM|1|$MYNAME finished unsuccessful."
17
    $SCRIPT_RETURN $EV_ID 1 "$MYNAME finished unsuccessful."
25
    exit 1
18
    EXIT 1
26
fi
19
fi
27
20
28
run_on_xserver() {
21
run_on_xserver() {
Lines 31-37 Link Here
31
}
24
}
32
25
33
TYPE=$1
26
TYPE=$1
34
set $3 # powersaved gives us "other '<content of /proc/acpi/event>'" so we must split it.
27
set $3 # powersaved gives us "other 'schemename' '<content of /proc/acpi/event>'" so we must split it.
35
EVENT=$1   # "hotkey"
28
EVENT=$1   # "hotkey"
36
ACPI=$2    # "HOTK"
29
ACPI=$2    # "HOTK"
37
WHAT=$3    # "00000052"
30
WHAT=$3    # "00000052"
Lines 172-182 Link Here
172
  fi
165
  fi
173
  : # turn touchpad on or off
166
  : # turn touchpad on or off
174
else
167
else
175
  DEBUG "undefined hotkey: $VAL $TYPE $EVENT $ACPI $WHAT $SERIAL" DIAG
168
  DEBUG "undefined hotkey: keycode '$VAL'. $TYPE $EVENT $ACPI $WHAT $SERIAL" DIAG
176
  ret=1
169
  ret=1
177
fi
170
fi
178
#
171
#
179
# see example_event_script for an explanation.
172
# see example_event_script for an explanation.
180
$SCRIPT_RETURN "$NUM|0|$MYNAME finished"
173
$SCRIPT_RETURN $EV_ID 0 "$MYNAME finished"
181
#
174
#
182
exit $ret
175
EXIT $ret

Return to bug 113646