Mới gặp một con ma!
Số là mình tính làm một file dạng sh để bỏ dòng "synclient TouchpadOff=0" vào
rồi chạy nó khi cần. Liền go4 đa5i là:
# nano 000.sh (zero zero zero dot sh)
Nhấn enter thì thấy nguyên cái file này:
/etc/acpi/events/toggle-touchpad
event=button.fnf1 FNF1
action=/etc/acpi/actions/toggle-touchpad.sh "%e"
Note: This file must be marked as executable.
/etc/acpi/actions/toggle-touchpad.sh
#! /bin/sh
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
# Modern method, for Linux 3.11 or later.
sys_enable_file=/sys/devices/platform/sony-laptop/touchpad
if [ -r "$sys_enable_file" ]; then
read -r is_currently_enabled < "$sys_enable_file"
echo > "$sys_enable_file" $((1 - $is_currently_enabled))
else
# Older method: have the X11 driver do it
export DISPLAY=:0
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`
if [ "$(su "$USER" -c "synclient -l" | grep TouchpadOff | awk '{print $3}')" $
su "$USER" -c "synclient TouchpadOff=1"
else
su "$USER" -c "synclient TouchpadOff=0"
fi
fi/etc/acpi/events/toggle-touchpad
event=button.fnf1 FNF1
action=/etc/acpi/actions/toggle-touchpad.sh "%e"
Note: This file must be marked as executable.
/etc/acpi/actions/toggle-touchpad.sh
#! /bin/sh
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
# Modern method, for Linux 3.11 or later.
sys_enable_file=/sys/devices/platform/sony-laptop/touchpad
if [ -r "$sys_enable_file" ]; then
read -r is_currently_enabled < "$sys_enable_file"
echo > "$sys_enable_file" $((1 - $is_currently_enabled))
else
# Older method: have the X11 driver do it
export DISPLAY=:0
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`
if [ "$(su "$USER" -c "synclient -l" | grep TouchpadOff | awk '{print $3}')" $
su "$USER" -c "synclient TouchpadOff=1"
else
su "$USER" -c "synclient TouchpadOff=0"
fi
fi
Kinh ngạc quá nên thoát ra và gõ:
[root@arch kent]# whereis 000.sh
000:[root@arch kent]#
có nghĩa là không tồn tại file này.
Thử gõ ở root "cat 000.sh" thì cũng thấy y như file đã post trên kia.
Nó là con ma chăng?