Files
ThinkpadX1Yoga_files/etc/acpi/thinkpad-tabletmode.sh

25 lines
811 B
Bash
Executable File

#!/bin/bash
MODE=$4
USER=$(ps aux | grep startkde | grep -v sddm | grep -v ssh-agent |grep -v grep | awk '{print $1}')
export DISPLAY=:0
case $MODE in
00000001)
# Tabletmode ON
sudo -u $USER xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
sudo -u $USER xinput set-prop "TPPS/2 Elan TrackPoint" "Device Enabled" 0
sudo -u $USER /etc/acpi/thinkpad-autorotate.py &
sudo -u $USER /usr/bin/onboard &
;;
00000000)
# Tabletmode OFF
sudo -u $USER xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1
sudo -u $USER xinput set-prop "TPPS/2 Elan TrackPoint" "Device Enabled" 1
pkill -f thinkpad-autorotate.py
pkill -f /usr/bin/onboard
sudo -u $USER /usr/local/bin/thinkpad-rotate.rb normal
;;
esac