Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## http://doc.ubuntu-fr.org/lenovo_yoga_13
- ## https://github.com/snaiffer/tabletMode
- ## https://github.com/pfps/yoga-laptop
- // yoga-laptop install // https://github.com/pfps/yoga-laptop
- sudo apt-get install libxrandr-devel
- // dirvers
- git clone https://github.com/pfps/yoga-laptop.git
- cd yoga-laptop
- make ideapad-laptop
- sudo make ideapad-laptop-install
- make sensors-drivers
- sudo make sensors-drivers-install
- make programs
- sudo make programs-install
- sudo nano /etc/sudoers
- ALL ALL=NOPASSWD: /usr/bin/orientation
- // Wireless
- Download source (zip) from here......
- https://github.com/lwfinger/rtl8723au
- https://github.com/lwfinger/rtl8723au/archive/master.zip
- cd rtl8723au-master
- make
- sudo make install
- sudo modprobe 8723au
- // Brightness
- sudo gedit /etc/default/grub
- GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
- Change it to:
- GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
- sudo update-grub
- nano /etc/modprobe.d/blacklist.conf
- blacklist ideapad_laptop
- // SSD config
- sudo gedit /etc/fstab
- ## add "noatime" to the line for root partition
- UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d / ext4 noatime,errors=remount-ro 0 1
- sudo gedit /etc/rc.local
- #!/bin/sh -e
- # rc.local
- fstrim -v /
- fstrim -v /home
- exit 0
- sudo mv -v /etc/cron.weekly/fstrim /fstrim
- // Touchpad config
- $ xinput list
- $ xinput list-props "SynPS/2 Synaptics TouchPad"
- ## Sets the pressure [FingerLow FingerHigh FingerPress] -> default [25 30 256]
- Synaptics Finger (290): 25, 30, 0
- Synaptics Noise Cancellation (323): 8, 8
- $ xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Finger" 35 40 256 ## or, 55 60 255
- $ xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Noise Cancellation" 24 24 ## or, 20 20
- // Closing the lid doesn’t always send the laptop to suspend, this is how to fix
- /etc/rc.local
- # Disable wake up on anything for Yoga Pro 2, otherwise it sometimes wakes from suspend
- cat /proc/acpi/wakeup |
- grep '*enabled' |
- cut -f 1 -d ' ' |
- xargs -n 1 -I {} sh -c 'echo Disabling wake up on {}... && echo {} > /proc/acpi/wakeup'
- // Adjust the trackpad
- nano /usr/share/X11/xorg.conf.d/50-synaptics.conf
- Section "InputClass"
- Identifier "touchpad catchall"
- Driver "synaptics"
- MatchIsTouchpad "on"
- # This option is recommend on all Linux systems using evdev, but cannot be
- # enabled by default. See the following link for details:
- # http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
- MatchDevicePath "/dev/input/event*"
- Option "FingerLow" "46"
- Option "FingerHigh" "46"
- Option "ClickFinger1" "1"
- Option "ClickFinger2" "2"
- Option "ClickFinger3" "3"
- Option "TapButton1" "1"
- Option "TapButton2" "3"
- Option "TapButton3" "2"
- Option "AreaBottomEdge" "85%"
- Option "SoftButtonAreas" "60% 0 85% 0 40% 60% 85% 0" # Btn2 LRTB - Btn3 LRTB
- Option "EmulateMidButtonTime" "75"
- EndSection
- // Enable some extra power save settings
- nano /etc/rc.local
- # tune all power save settings to >good<
- powertop --auto-tune
- # all power save settings are fine but the one for the touchpad
- # disable powertop >good<-setting for touchpad
- echo 'on' > '/sys/bus/usb/devices/2-7/power/control'
- // Screen Rotation
- https://gist.github.com/rubo77/daa262e0229f6e398766/download#
- nano /usr/local/bin/rotate-screen.sh
- alt + f5 /usr/local/bin/rotate-screen.sh
- shift + alt + f5 /usr/local/bin/rotate-screen.sh -n
- #!/bin/bash
- # This script rotates the screen and touchscreen input 90 degrees each time it is called,
- # also disables the touchpad, and enables the virtual keyboard accordingly
- # by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
- #### configuration
- # find your Touchscreen and Touchpad device with `xinput`
- TouchscreenDevice='ELAN Touchscreen'
- TouchpadDevice='SynPS/2 Synaptics TouchPad'
- if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
- echo 'Usage: rotate-screen.sh [OPTION]'
- echo
- echo 'This script rotates the screen and touchscreen input 90 degrees each time it is called,'
- echo 'also disables the touchpad, and enables the virtual keyboard accordingly'
- echo
- echo Usage:
- echo ' -h --help display this help'
- echo ' -j (just horizontal) rotates the screen and touchscreen input only 180 degrees'
- echo ' -n always rotates the screen back to normal'
- exit 0
- fi
- touchpadEnabled=$(xinput --list-props "$TouchpadDevice" | awk '/Device Enabled/{print $NF}')
- screenMatrix=$(xinput --list-props "$TouchscreenDevice" | awk '/Coordinate Transformation Matrix/{print $5$6$7$8$9$10$11$12$NF}')
- # Matrix for rotation
- # ⎡ 1 0 0 ⎤
- # ⎜ 0 1 0 ⎥
- # ⎣ 0 0 1 ⎦
- normal='1 0 0 0 1 0 0 0 1'
- normal_float='1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000'
- #⎡ -1 0 1 ⎤
- #⎜ 0 -1 1 ⎥
- #⎣ 0 0 1 ⎦
- inverted='-1 0 1 0 -1 1 0 0 1'
- inverted_float='-1.000000,0.000000,1.000000,0.000000,-1.000000,1.000000,0.000000,0.000000,1.000000'
- # 90° to the left
- # ⎡ 0 -1 1 ⎤
- # ⎜ 1 0 0 ⎥
- # ⎣ 0 0 1 ⎦
- left='0 -1 1 1 0 0 0 0 1'
- left_float='0.000000,-1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000'
- # 90° to the right
- #⎡ 0 1 0 ⎤
- #⎜ -1 0 1 ⎥
- #⎣ 0 0 1 ⎦
- right='0 1 0 -1 0 1 0 0 1'
- if [ $screenMatrix == $normal_float ] && [ "$1" != "-n" ]
- then
- echo "Upside down"
- xrandr -o inverted
- xinput set-prop "$TouchscreenDevice" 'Coordinate Transformation Matrix' $inverted
- xinput disable "$TouchpadDevice"
- # Remove hashtag below if you want pop-up the virtual keyboard
- #onboard &
- elif [ $screenMatrix == $inverted_float ] && [ "$1" != "-j" ] && [ "$1" != "-n" ]
- then
- echo "90° to the left"
- xrandr -o left
- xinput set-prop "$TouchscreenDevice" 'Coordinate Transformation Matrix' $left
- xinput disable "$TouchpadDevice"
- #killall onboard
- elif [ $screenMatrix == $left_float ] && [ "$1" != "-j" ] && [ "$1" != "-n" ]
- then
- echo "90° to the right"
- xrandr -o right
- xinput set-prop "$TouchscreenDevice" 'Coordinate Transformation Matrix' $right
- xinput disable "$TouchpadDevice"
- #killall onboard
- else
- echo "Back to normal"
- xrandr -o normal
- xinput set-prop "$TouchscreenDevice" 'Coordinate Transformation Matrix' $normal
- xinput enable "$TouchpadDevice"
- #killall onboard
- fi
- // Auto rotation (1)
- nano /usr/local/bin/rotate-screen.sh
- #!/bin/bash
- # This script rotates the screen and touchscreen input 180 degrees, disables the touchpad, and enables the virtual keyboard
- # And rotates screen back if the touchpad was disabled
- isEnabled=$(xinput --list-props 'SynPS/2 Synaptics TouchPad' | awk '/Device Enabled/{print $NF}')
- if [ $isEnabled == 1 ]
- then
- echo "Screen is turned upside down"
- xrandr -o inverted
- xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
- xinput disable 'SynPS/2 Synaptics TouchPad'
- # Remove hashtag below if you want pop-up the virtual keyboard
- onboard &
- # Disable Keyboard
- # xinput list - AT Translated Set 2 keyboard
- # xinput float <id#>
- # xinput float 11
- xinput disable 'AT Translated Set 2 keyboard'
- else
- echo "Screen is turned back to normal"
- xrandr -o normal
- xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
- xinput enable 'SynPS/2 Synaptics TouchPad'
- killall onboard
- # re-enable keyboard
- # xinput reattach <id#> <master/slave#>
- # xinput reattach 11 3
- xinput enable 'AT Translated Set 2 keyboard'
- fi
- sudo chmod +x /usr/local/bin/rotate-screen.sh
- sudo nano /usr/share/applications/rotate-screen.desktop
- [Desktop Entry]
- Type=Application
- Terminal=false
- Icon=/usr/share/icons/Humanity/actions/24/window_fullscreen.svg
- Name=Rotate Screen
- Exec=/usr/local/bin/rotate-screen.sh
- Categories=Utility;
Advertisement
Add Comment
Please, Sign In to add comment