You are not logged in.
Hi.
I have just bought a Sony Vaio Pro 13. I would like to be able to use FN + F1 to toggle the touchpad on and off instead of having to write the 'synclient TouchpadOff=1' command everytime i want to turn it off.
I have used the following scripts:
/etc/acpi/events/toggle-touchpad
event=button.fnf1 FNF1
action=/etc/acpi/actions/toggle-touchpad.sh "%e"and
/etc/acpi/actions/toggle-touchpad.sh
#!/bin/bash
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
export DISPLAY=:0
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`
if [ "$(su "$USER" -c "synclient -l" | grep TouchpadOff | awk '{print $3}')" == "0" ]; then
su "$USER" -c "synclient TouchpadOff=1"
else
su "$USER" -c "synclient TouchpadOff=0"
fiThe code is from the arch wiki page for the given laptop that I am using [link]https://wiki.archlinux.org/index.php/So … ntallation[/link] and should work, but it does not work for me.
Is there an error in the code or is there just something that I haven't done to get this to work?
EDIT: And of course acpid is installed and added to systemd.
Last edited by czepluch (2013-10-20 02:11:54)
Offline
Does the script work if you execute it manually?
Also, check that the key is sending the code you expect.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
When I execute it manually it says: "su: user does not exist".
This does of course give me a clue of whats wrong, but I don't know how to fix it. How do I check if a key sendt the code I expect?
Offline
Use acpi_listen in terminal to see if the key combo executes the acpi command you are expecting (i.e. FNF1). acpi_listen works something like xev. Start acpi_listen, then press the key combo.
Regarding starting the script file, I never used %e in the actions line. Try running the script toggle-touchpad.sh as root from terminal to test it. Make sure it's set as 'executable'.
Offline
When I execute it manually it says: "su: user does not exist".
This does of course give me a clue of whats wrong, but I don't know how to fix it. How do I check if a key sendt the code I expect?
The who command used in your example doesn't work on my install either. I'm guessing due to systemd.
Try replacing it with
USER=`loginctl --no-pager | awk '{ print $3 }' | head -n1`I haven't tested it extensively, but give it a try.
Offline