歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 完美解決Linux Deepin 12.06屏幕亮度不能保存的問題

完美解決Linux Deepin 12.06屏幕亮度不能保存的問題

日期:2017/2/28 15:45:06   编辑:Linux教程

每次進入Linux Deepin 12.06系統時屏幕亮度都為最高,網上能搜索到的幾種解決方法要麼太復雜要麼無效。其實解決這個問題只需要兩行代碼。

Linux Deepin 12.06的亮度設置保存在”/sys/class/backlight/acpi_video0/brightness”。每次進入系統時這個文件都會被重置為最大值7,所以直接更改這個文件的值是沒用的。我們可以用以下兩個步驟來讓系統啟動後自動設置屏幕的亮度值。

  1. 更改rc.local文件使系統在啟動時自動更改/sys/class/backlight/acpi_video0/brightness文件權限
  2. 更改.profile文件使系統在用戶登錄時自動更改birghtness的值

具體操作步驟:

第一步,更改rc.local文件使系統在啟動時自動更改/sys/class/backlight/acpi_video0/brightness文件權限

在終端輸入

sudo gedit /etc/rc.local

如果詢問密碼的話,輸入你安裝系統時設置的密碼

打開後你會看到如下內容:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0″ on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

#exit 0

插入這句話到代碼中:

chmod a+w /sys/class/backlight/acpi_video0/brightness

保證修改後代碼如下,注意刪除exit前的“#”

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0″ on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
chmod a+w /sys/class/backlight/acpi_video0/brightness
exit 0

保存退出。

第二步,更改.profile文件使系統在用戶登錄時自動更改birghtness的值

進入主文件夾,點擊“查看”,點擊“顯示隱藏文件”。找到.profile文件,雙擊打開。

在.profile最後一行添加

echo 2 > /sys/class/backlight/acpi_video0/brightness

其中數字2為你設定的屏幕亮度值,最大值為7。

保存退出。

這樣每次進入系統後屏幕的亮度都會自動設置為.profile文件中設定的值。

順便說以下,網上所說的直接在rc.local添加代碼更改brightness的值的方法在Linux Deepin 12.06不可行。

本文來自路志偉的投稿。

Copyright © Linux教程網 All Rights Reserved