V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
magicxqh
V2EX  ›  问与答

ubuntu下,如何让这条指令开机自动执行? sudo setpci -s 00:02.0 F4.B=66 //显示器亮度调节

  •  
  •   magicxqh · 2012-04-29 08:11:00 +08:00 · 4571 次点击
    这是一个创建于 4407 天前的主题,其中的信息可能已经有所发展或是发生改变。
    11 条回复    1970-01-01 08:00:00 +08:00
    magicxqh
        1
    magicxqh  
    OP
       2012-04-29 08:13:23 +08:00
    没有用linux的吗?v2exer们 -。-
    magicxqh
        2
    magicxqh  
    OP
       2012-04-29 08:16:27 +08:00
    sudo setpci -s 00:02.0 F4.B=66
    magicxqh
        3
    magicxqh  
    OP
       2012-04-29 08:16:40 +08:00
    自动执行
    magicxqh
        4
    magicxqh  
    OP
       2012-04-29 08:19:22 +08:00
    没人吗?
    sunus
        5
    sunus  
       2012-04-29 08:37:21 +08:00   ❤️ 1
    放在/etc/environment,或者/etc/profile

    应该不用加sudo
    yishanhe
        6
    yishanhe  
       2012-04-29 08:56:46 +08:00   ❤️ 1
    放到/etc/rc.local
    laiwei
        7
    laiwei  
       2012-04-29 08:56:51 +08:00   ❤️ 1
    不能放到profile
    这个适合放在 /etc/rc.local 这个文件的末尾,不加sudo
    libei
        8
    libei  
       2012-04-29 09:02:15 +08:00   ❤️ 1
    去掉sudo,用文本存放到任何地方,然后在/etc/rc2.d/下创建一个S99xxxxxxx的符号链接到那个文件就可以了。
    magicxqh
        9
    magicxqh  
    OP
       2012-04-29 09:39:46 +08:00
    @sunus @yishanhe @laiwei @libei感谢回答
    将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.

    setpci -s 00:02.0 F4.B=66
    exit 0
    即可。
    magicxqh
        10
    magicxqh  
    OP
       2012-04-29 09:41:23 +08:00
    另外想问问怎样开机禁用触摸板?
    yetone
        11
    yetone  
       2012-04-29 10:22:15 +08:00   ❤️ 1
    @magicxqh synclient touchpadoff=1放入/etc/rc.local
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2883 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:46 · PVG 19:46 · LAX 04:46 · JFK 07:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.