1

I successfully managed to install 14.04.3 on my Sony Vaio S Series SVS1513C5E laptop and after few minor tweaks I adore the setup!

My concern here is:

The device has Optimus graphics that uses a hardware switch (Windows 7-8) to change between Intel and Nvidia card. On Ubuntu, I have Nvidia Prime with quick switch indicator all set up to change it via software, but I'm wondering if there is a slight possibility to add the commands:

sudo prime-select nvidia and sudo prime-select intel

as executable script when changing between SPEED and STAMINA mode via that hardware switch?

There is a file in sony-laptop folder named gfx_switch_status that reacts on the switch and changes the "one word" in the file from stamina to speed and that's it.

So the hardware switch is being recognized, the file content is edited accordingly, how can I control what happens when it changes?

Thanks for any help on that ;)

EDIT: acpi_listen shows following hardware changes when moving the switch: root@UbuntuOne:~$ acpi_listen

sony/hotkey SNY5001:00 00000003 00000000

sony/hotkey SNY5001:00 00000003 00000001

0

I have not tested this method but you can try it.

Open a terminal and type : sudo gedit /etc/acpi/events/sonyswitch

Make the contents :

event=sony/hotkey
action=zenity --info --text=%e

Save the file.

Open a terminal and type : sudo apt-get install zenity to install zenity

Restart ACPI with "kill -SIGHUP pidof acpid"

Move the switch to both SPEED and STAMINA and write down what the message box says for both

Open gedit and type :

#/bin/bash

if [ "$1" == "WHAT THE MESSAGE BOX SAID FOR SPEED" ]
   sudo prime-select nvidia


if [ "$1" == "WHAT THE MESSAGE BOX SAID FOR STAMINA" ]
   sudo prime-select Intel

Save the file in ~/vaioswitch and open a terminal and run chmod +x ~/vaioswitch

Open a terminal and type : sudo gedit /etc/acpi/events/sonyswitch

Edit the contents to

Change line 2 to action=/home/YOUUSERNAME/vaioswitch %e

Fix any syntax errors in the script and reboot you computer.It should work now

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.