Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/lib/systemd/system-sleep/resume-x1-fix.sh
#!/bin/bash
# Makes sure bluetooth service is not running while suspended.
if [ "${1}" == "pre" ]; then
service bluetooth stop
elif [ "${1}" == "post" ]; then
service bluetooth start
fi
#!/bin/sh
if [ "$2" = "suspend" ] || [ "$2" = "resume" ]; then
case "$1" in
post)
# Reset Bluetooth and network service
#sudo systemctl restart NetworkManager & \
#/etc/init.d/bluetooth restart
# Reconnecting dead trackpad
echo -n "none" | sudo tee /sys/bus/serio/devices/serio1/drvctl
echo -n "reconnect" | sudo tee /sys/bus/serio/devices/serio1/drvctl
#sleep 1
# Disable trackpad middle button
#xinput set-button-map 'Synaptics TM3288-011' 1 1 3 4 5 6 7 >/dev/null
#xinput set-button-map 'TPPS/2 Elan TrackPoint' 1 1 3 4 5 6 7 >/dev/null
# Disabling the memory card reader
echo "2-3" | sudo tee /sys/bus/usb/drivers/usb/unbind
# Reset Yukico
echo '1-2'|sudo tee /sys/bus/usb/drivers/usb/unbind
sleep 1
echo '1-2'|sudo tee /sys/bus/usb/drivers/usb/bind
;;
suspend|hibernate)
;;
esac
fi
@PombeirP

This comment has been minimized.

Copy link
Owner Author

commented Jul 2, 2018

[Desktop Entry]
Type=Application
Terminal=true
Name=Resume
Exec=sudo /lib/systemd/system-sleep/resume-x1-fix.sh post suspend
Icon=/lib/systemd/system-sleep/reset.png
@PombeirP

This comment has been minimized.

Copy link
Owner Author

commented Sep 9, 2018

This file is not needed anymore after BIOS update 1.30, and can be replaced with https://gist.github.com/PombeirP/672de499389d216312fc3d0d6cc2e932. Only trackpad still has issues sometimes and needs to be reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.