个人工具

“UbuntuHelp:SonyVaioBrightness”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/SonyVaioBrightness}} {{Languages|UbuntuHelp:SonyVaioBrightness}} === Introduction === This page is a quick and brief guide to adjusting the brig...)
 
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/SonyVaioBrightness}}
 
{{From|https://help.ubuntu.com/community/SonyVaioBrightness}}
 
{{Languages|UbuntuHelp:SonyVaioBrightness}}
 
{{Languages|UbuntuHelp:SonyVaioBrightness}}
 
+
<<Include(Tag/StyleCleanup)>>
 
+
 
=== Introduction ===
 
=== Introduction ===
 
This page is a quick and brief guide to adjusting the brightness on a Sony VAIO laptop using Ubuntu 6.06.
 
This page is a quick and brief guide to adjusting the brightness on a Sony VAIO laptop using Ubuntu 6.06.
 
 
=== SONYPI Module ===
 
=== SONYPI Module ===
 
In order to adjust the brightness of a Sony VAIO laptop, the <code><nowiki>sonypi</nowiki></code> module needs to be loaded into the kernel.
 
In order to adjust the brightness of a Sony VAIO laptop, the <code><nowiki>sonypi</nowiki></code> module needs to be loaded into the kernel.
 
 
==== Step 1: Checking for Module ====
 
==== Step 1: Checking for Module ====
 
At the command line issue the following command:
 
At the command line issue the following command:
第15行: 第12行:
 
</nowiki></pre>
 
</nowiki></pre>
 
If you receive a line of outpout, and it states that it is <code><nowiki>Live</nowiki></code>, then the module is loaded. If not, move on to step 2.
 
If you receive a line of outpout, and it states that it is <code><nowiki>Live</nowiki></code>, then the module is loaded. If not, move on to step 2.
 
 
==== Step 2: Load the Module ====
 
==== Step 2: Load the Module ====
 
At the command line issue the following commands:
 
At the command line issue the following commands:
第23行: 第19行:
 
</nowiki></pre>
 
</nowiki></pre>
 
The first command adds the module to the customizable list of modules to load at startup in addition to the ones normally loaded by the system. The second command loads the module. If the module is already loaded, using this command will harmlessly and pointlessly re-load it.
 
The first command adds the module to the customizable list of modules to load at startup in addition to the ones normally loaded by the system. The second command loads the module. If the module is already loaded, using this command will harmlessly and pointlessly re-load it.
 
 
Now test whether the module is loaded with the grep command used above. This time there should be a line of output.
 
Now test whether the module is loaded with the grep command used above. This time there should be a line of output.
 
 
=== Spicctrl Application ===
 
=== Spicctrl Application ===
 
Spicctrl is an app that can be used to measure the battery life, and adjust the brightness of a Sony laptop. Spicctrl is known to work on some Sony laptops, but not all. If this method does not work, read the '''If Spicctrl Doesn't Work''' following these initial steps.
 
Spicctrl is an app that can be used to measure the battery life, and adjust the brightness of a Sony laptop. Spicctrl is known to work on some Sony laptops, but not all. If this method does not work, read the '''If Spicctrl Doesn't Work''' following these initial steps.
 
 
==== Step 1: Install Spicctrl ====
 
==== Step 1: Install Spicctrl ====
 
Issue the following command:
 
Issue the following command:
第34行: 第27行:
 
# sudo apt-get install spicctrl
 
# sudo apt-get install spicctrl
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== Step 2: Run Spicctrl ====
 
==== Step 2: Run Spicctrl ====
 
Wait for the app to download and install. Once completed issue the following command:
 
Wait for the app to download and install. Once completed issue the following command:
第41行: 第33行:
 
</nowiki></pre>
 
</nowiki></pre>
 
This will output the options of the program.
 
This will output the options of the program.
 
 
Issue the following command and read the output:
 
Issue the following command and read the output:
 
<pre><nowiki>
 
<pre><nowiki>
第47行: 第38行:
 
</nowiki></pre>
 
</nowiki></pre>
 
This should return a number between 0 and 255. Choose a number between 0 and 255 '''THAT IS DIFFERENT''' from the number outputed by the command.
 
This should return a number between 0 and 255. Choose a number between 0 and 255 '''THAT IS DIFFERENT''' from the number outputed by the command.
 
 
Replace the # symbol in the following command with that number:
 
Replace the # symbol in the following command with that number:
 
<pre><nowiki>
 
<pre><nowiki>
 
# sudo spicctrl -b#
 
# sudo spicctrl -b#
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Once that command is completed, issue the following:
 
Once that command is completed, issue the following:
 
<pre><nowiki>
 
<pre><nowiki>
第58行: 第47行:
 
</nowiki></pre>
 
</nowiki></pre>
 
If the number has changed to the one you chose, then Spicctrl is working correctly. What you did, was manually change the number for the display's brightness control. You can change those brightness settings however you want to change the brightness. An added bonus is that Spicctrl can be sucessfully used by any user.
 
If the number has changed to the one you chose, then Spicctrl is working correctly. What you did, was manually change the number for the display's brightness control. You can change those brightness settings however you want to change the brightness. An added bonus is that Spicctrl can be sucessfully used by any user.
 
 
=== If Spicctrl Doesn't Work ===
 
=== If Spicctrl Doesn't Work ===
 
If the previous steps did not work for you or your Sony VAIO, continue reading.
 
If the previous steps did not work for you or your Sony VAIO, continue reading.
 
 
==== Manual Brightness Editing ====
 
==== Manual Brightness Editing ====
 
'''NOTE:''' Changing the <code><nowiki>brightness</nowiki></code> or <code><nowiki>brightness_default</nowiki></code> file's data to anything other than a number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>, could possibly prevent your linux system from succesfully interacting with the monitor, meaning no screen image at all.
 
'''NOTE:''' Changing the <code><nowiki>brightness</nowiki></code> or <code><nowiki>brightness_default</nowiki></code> file's data to anything other than a number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>, could possibly prevent your linux system from succesfully interacting with the monitor, meaning no screen image at all.
 
 
To change the brightness manually, issue the following command:
 
To change the brightness manually, issue the following command:
 
<pre><nowiki>
 
<pre><nowiki>
第70行: 第56行:
 
</nowiki></pre>
 
</nowiki></pre>
 
You can replace the number <code><nowiki>4</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>. The numbers <code><nowiki>1</nowiki></code> through <code><nowiki>8</nowiki></code> can be used to adjust the brightness. <code><nowiki>1</nowiki></code> == dim. <code><nowiki>8</nowiki></code> == bright. The 'brightness' file changes the current brightness to the level you want. The brightness will stay that way until you change it again or until you shut down the computer.
 
You can replace the number <code><nowiki>4</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>. The numbers <code><nowiki>1</nowiki></code> through <code><nowiki>8</nowiki></code> can be used to adjust the brightness. <code><nowiki>1</nowiki></code> == dim. <code><nowiki>8</nowiki></code> == bright. The 'brightness' file changes the current brightness to the level you want. The brightness will stay that way until you change it again or until you shut down the computer.
 
 
==== Retaining Manual Brightness Edits ====
 
==== Retaining Manual Brightness Edits ====
 
The default level of brightness that Ubuntu uses whenever it boots up is stored in <code><nowiki>brightness_default</nowiki></code>. No matter what you change the brightness file entry to, the next time you start your computer, it's going to use the default brightness again. To change this default brightness to the level you want, issue the following command, replacing the <code><nowiki>#</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>:
 
The default level of brightness that Ubuntu uses whenever it boots up is stored in <code><nowiki>brightness_default</nowiki></code>. No matter what you change the brightness file entry to, the next time you start your computer, it's going to use the default brightness again. To change this default brightness to the level you want, issue the following command, replacing the <code><nowiki>#</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>:
第76行: 第61行:
 
# sudo echo "#" > /proc/acpi/sony/brightness_default
 
# sudo echo "#" > /proc/acpi/sony/brightness_default
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== Shortcuts ===
 
=== Shortcuts ===
 
The following will aid you in creating shell scripts that will allow you to issue script command instead of typing out the entire command that would change the brightness.
 
The following will aid you in creating shell scripts that will allow you to issue script command instead of typing out the entire command that would change the brightness.
 
 
==== Bright Script ====
 
==== Bright Script ====
 
The following code snipplets are to be copied and pasted into a command line. You can paste into a terminal command line by holding <code><nowiki>SHIFT</nowiki></code> and pressing the <code><nowiki>INSERT</nowiki></code> key on your keyboard. The following command will create a file in the <code><nowiki>/usr/sbin/</nowiki></code> directory called <code><nowiki>bright</nowiki></code>. Copy and paste the following:
 
The following code snipplets are to be copied and pasted into a command line. You can paste into a terminal command line by holding <code><nowiki>SHIFT</nowiki></code> and pressing the <code><nowiki>INSERT</nowiki></code> key on your keyboard. The following command will create a file in the <code><nowiki>/usr/sbin/</nowiki></code> directory called <code><nowiki>bright</nowiki></code>. Copy and paste the following:
第85行: 第68行:
 
sudo echo -e '#!/bin/bash \n syntax="\\n \\t SYNTAX:  bright # \\n \\t Where # is any whole number from 1 to 8.\\n"; \n if [ 1$1 -gt 10 ]; \n then \n if [ 1$1 -lt 19 ]; \n then \n echo $1 > /proc/acpi/sony/brightness; \n else \n echo -e $syntax; \n fi; \n else \n echo -e $syntax; \n fi;' > /usr/sbin/bright; chmod a+x /usr/sbin/bright;
 
sudo echo -e '#!/bin/bash \n syntax="\\n \\t SYNTAX:  bright # \\n \\t Where # is any whole number from 1 to 8.\\n"; \n if [ 1$1 -gt 10 ]; \n then \n if [ 1$1 -lt 19 ]; \n then \n echo $1 > /proc/acpi/sony/brightness; \n else \n echo -e $syntax; \n fi; \n else \n echo -e $syntax; \n fi;' > /usr/sbin/bright; chmod a+x /usr/sbin/bright;
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== Brightdefault Script ====
 
==== Brightdefault Script ====
 
Do the same as the <code><nowiki>Bright Script</nowiki></code> above. The following command will create a file in the <code><nowiki>usr/sbin/</nowiki></code> directory called <code><nowiki>brightdefault</nowiki></code>. Copy and paste the following:
 
Do the same as the <code><nowiki>Bright Script</nowiki></code> above. The following command will create a file in the <code><nowiki>usr/sbin/</nowiki></code> directory called <code><nowiki>brightdefault</nowiki></code>. Copy and paste the following:
第91行: 第73行:
 
sudo echo -e '#!/bin/bash \n syntax="\\n \\t SYNTAX:  brightdefault # \\n \\t Where # is any whole number from 1 to 8.\\n"; \n if [ 1$1 -gt 10 ]; \n then \n if [ 1$1 -lt 19 ]; \n then \n echo $1 > /proc/acpi/sony/brightness_default; \n else \n echo -e $syntax; \n fi; \n else \n echo -e $syntax; \n fi;' > /usr/sbin/brightdefault; chmod a+x /usr/sbin/brightdefault;
 
sudo echo -e '#!/bin/bash \n syntax="\\n \\t SYNTAX:  brightdefault # \\n \\t Where # is any whole number from 1 to 8.\\n"; \n if [ 1$1 -gt 10 ]; \n then \n if [ 1$1 -lt 19 ]; \n then \n echo $1 > /proc/acpi/sony/brightness_default; \n else \n echo -e $syntax; \n fi; \n else \n echo -e $syntax; \n fi;' > /usr/sbin/brightdefault; chmod a+x /usr/sbin/brightdefault;
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== Running the Scripts ====
 
==== Running the Scripts ====
 
Now, to run the <code><nowiki>Bright Script</nowiki></code> you can issue the following command:
 
Now, to run the <code><nowiki>Bright Script</nowiki></code> you can issue the following command:
第98行: 第79行:
 
</nowiki></pre>
 
</nowiki></pre>
 
This will set the brightness ''temporarily'' to <code><nowiki>4</nowiki></code>. You can replace the <code><nowiki>4</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>.  
 
This will set the brightness ''temporarily'' to <code><nowiki>4</nowiki></code>. You can replace the <code><nowiki>4</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>.  
 
 
To run the <code><nowiki>Brightdefault Script</nowiki></code> to change the default brightness, issue the following command:
 
To run the <code><nowiki>Brightdefault Script</nowiki></code> to change the default brightness, issue the following command:
 
<pre><nowiki>
 
<pre><nowiki>
第104行: 第84行:
 
</nowiki></pre>
 
</nowiki></pre>
 
This will set the default brightness to <code><nowiki>3</nowiki></code>. You can replace the <code><nowiki>3</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>.
 
This will set the default brightness to <code><nowiki>3</nowiki></code>. You can replace the <code><nowiki>3</nowiki></code> with any number between <code><nowiki>1</nowiki></code> and <code><nowiki>8</nowiki></code>.
 
 
----
 
----
[[category:CategoryCleanup]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月20日 (四) 00:15的最新版本

<<Include(Tag/StyleCleanup)>>

Introduction

This page is a quick and brief guide to adjusting the brightness on a Sony VAIO laptop using Ubuntu 6.06.

SONYPI Module

In order to adjust the brightness of a Sony VAIO laptop, the sonypi module needs to be loaded into the kernel.

Step 1: Checking for Module

At the command line issue the following command:

# grep -E "^sonypi" /proc/modules

If you receive a line of outpout, and it states that it is Live, then the module is loaded. If not, move on to step 2.

Step 2: Load the Module

At the command line issue the following commands:

# sudo echo "sonypi" >> /etc/modules
# sudo modprobe sonypi

The first command adds the module to the customizable list of modules to load at startup in addition to the ones normally loaded by the system. The second command loads the module. If the module is already loaded, using this command will harmlessly and pointlessly re-load it. Now test whether the module is loaded with the grep command used above. This time there should be a line of output.

Spicctrl Application

Spicctrl is an app that can be used to measure the battery life, and adjust the brightness of a Sony laptop. Spicctrl is known to work on some Sony laptops, but not all. If this method does not work, read the If Spicctrl Doesn't Work following these initial steps.

Step 1: Install Spicctrl

Issue the following command:

# sudo apt-get install spicctrl

Step 2: Run Spicctrl

Wait for the app to download and install. Once completed issue the following command:

# sudo spicctrl

This will output the options of the program. Issue the following command and read the output:

# sudo spicctrl -B

This should return a number between 0 and 255. Choose a number between 0 and 255 THAT IS DIFFERENT from the number outputed by the command. Replace the # symbol in the following command with that number:

# sudo spicctrl -b#

Once that command is completed, issue the following:

# sudo spicctrl -B

If the number has changed to the one you chose, then Spicctrl is working correctly. What you did, was manually change the number for the display's brightness control. You can change those brightness settings however you want to change the brightness. An added bonus is that Spicctrl can be sucessfully used by any user.

If Spicctrl Doesn't Work

If the previous steps did not work for you or your Sony VAIO, continue reading.

Manual Brightness Editing

NOTE: Changing the brightness or brightness_default file's data to anything other than a number between 1 and 8, could possibly prevent your linux system from succesfully interacting with the monitor, meaning no screen image at all. To change the brightness manually, issue the following command:

# sudo echo 4 > /proc/acpi/sony/brightness

You can replace the number 4 with any number between 1 and 8. The numbers 1 through 8 can be used to adjust the brightness. 1 == dim. 8 == bright. The 'brightness' file changes the current brightness to the level you want. The brightness will stay that way until you change it again or until you shut down the computer.

Retaining Manual Brightness Edits

The default level of brightness that Ubuntu uses whenever it boots up is stored in brightness_default. No matter what you change the brightness file entry to, the next time you start your computer, it's going to use the default brightness again. To change this default brightness to the level you want, issue the following command, replacing the # with any number between 1 and 8:

# sudo echo "#" > /proc/acpi/sony/brightness_default

Shortcuts

The following will aid you in creating shell scripts that will allow you to issue script command instead of typing out the entire command that would change the brightness.

Bright Script

The following code snipplets are to be copied and pasted into a command line. You can paste into a terminal command line by holding SHIFT and pressing the INSERT key on your keyboard. The following command will create a file in the /usr/sbin/ directory called bright. Copy and paste the following:

sudo echo -e '#!/bin/bash \n syntax="\\n \\t SYNTAX:  bright # \\n \\t Where # is any whole number from 1 to 8.\\n"; \n if [ 1$1 -gt 10 ]; \n then \n if [ 1$1 -lt 19 ]; \n then \n echo $1 > /proc/acpi/sony/brightness; \n else \n echo -e $syntax; \n fi; \n else \n echo -e $syntax; \n fi;' > /usr/sbin/bright; chmod a+x /usr/sbin/bright;

Brightdefault Script

Do the same as the Bright Script above. The following command will create a file in the usr/sbin/ directory called brightdefault. Copy and paste the following:

sudo echo -e '#!/bin/bash \n syntax="\\n \\t SYNTAX:  brightdefault # \\n \\t Where # is any whole number from 1 to 8.\\n"; \n if [ 1$1 -gt 10 ]; \n then \n if [ 1$1 -lt 19 ]; \n then \n echo $1 > /proc/acpi/sony/brightness_default; \n else \n echo -e $syntax; \n fi; \n else \n echo -e $syntax; \n fi;' > /usr/sbin/brightdefault; chmod a+x /usr/sbin/brightdefault;

Running the Scripts

Now, to run the Bright Script you can issue the following command:

# sudo bright 4

This will set the brightness temporarily to 4. You can replace the 4 with any number between 1 and 8. To run the Brightdefault Script to change the default brightness, issue the following command:

#sudo brightdefault 3

This will set the default brightness to 3. You can replace the 3 with any number between 1 and 8.