让openRGB从睡眠、休眠、开机时启动等

zsanjin 发布于 2024-09-10 110 次阅读


AI 摘要

「关于控制RGB灯光的神奇之物——OpenRGB,策略多端,却难纳入开机自启舆图,唯有巧用.bat脚本,可着眼事件启动。此物另能命令行操作,合理施色效,添光亮。多端主控,且不忘依偎于计划任务之怀。」

OpenRGB Windows 64-bit>OpenRGB 0.91, for controlling RGB lighting.
Version: 0.91
Build Date 2024/05/10 脰脺脦氓
Git Commit ID f0591fda8bb0d1e7a585a2b86a6c4bbc2fa2faf1
Git Commit Date 2024-05-10 08:15:43 +0000
Git Branch master

 

 

不知道为什么openrgb不能按预设的设置下的开机自启,使用了计划任务程序也不行,只有用了.bat脚本才能开机启动,但是我经常是直接让windows睡眠,这种情况下就需要以事件发生的方式启动openRGB,并配上命令。

 

 

 

openRGB支持以命令行使用

在openRGB工作目录下用cmd命令`OpenRGB.exe --help`,有以下几种方式:

OpenRGB 0.91, for controlling RGB lighting.
Usage: OpenRGB (--device [--mode] [--color])...

Options:
--gui Shows the GUI. GUI also appears when not passing any parameters
--startminimized Starts the GUI minimized to tray. Implies --gui, even if not specified
--client [IP]:[Port] Starts an SDK client on the given IP:Port (assumes port 6742 if not specified)
--server Starts the SDK's server
--server-host Sets the SDK's server host. Default: 0.0.0.0 (all network interfaces)
--server-port Sets the SDK's server port. Default: 6742 (1024-65535)
-l, --list-devices Lists every compatible device with their number
-d, --device [0-9 | "name"] Selects device to apply colors and/or effect to, or applies to all devices if omitted
Basic string search is implemented 3 characters or more
Can be specified multiple times with different modes and colors
-z, --zone [0-9] Selects zone to apply colors and/or sizes to, or applies to all zones in device if omitted
Must be specified after specifying a device
-c, --color [random | FFFFF,00AAFF ...] Sets colors on each device directly if no effect is specified, and sets the effect color if an effect is specified
If there are more LEDs than colors given, the last color will be applied to the remaining LEDs
-m, --mode [breathing | static | ...] Sets the mode to be applied, check --list-devices to see which modes are supported on your device
-b, --brightness [0-100] Sets the brightness as a percentage if the mode supports brightness
-s, --speed [0-100] Sets the speed as a percentage if the mode supports speed
-sz, --size [0-N] Sets the new size of the specified device zone.
Must be specified after specifying a zone.
If the specified size is out of range, or the zone does not offer resizing capability, the size will not be changed
-V, --version Display version and software build information
-p, --profile filename[.orp] Load the profile from filename/filename.orp
-sp, --save-profile filename.orp Save the given settings to profile filename.orp
--i2c-tools Shows the I2C/SMBus Tools page in the GUI. Implies --gui, even if not specified.
USE I2C TOOLS AT YOUR OWN RISK! Don't use this option if you don't know what you're doing!
There is a risk of bricking your motherboard, RGB controller, and RAM if you send invalid SMBus/I2C transactions.
--localconfig Use the current working directory instead of the global configuration directory.
--config path Use a custom path instead of the global configuration directory.
--nodetect Do not try to detect hardware at startup.
--noautoconnect Do not try to autoconnect to a local server at startup.
--loglevel [0-6 | error | warning ...] Set the log level (0: fatal to 6: trace).
--print-source Print the source code file and line number for each log entry.
-v, --verbose Print log messages to stdout.
-vv, --very-verbose Print debug messages and log messages to stdout.
--autostart-check Check if OpenRGB starting at login is enabled.
--autostart-disable Disable OpenRGB starting at login.
--autostart-enable arguments Enable OpenRGB to start at login. Requires arguments to give to OpenRGB at login.

主要命令行参数和用法:

常用参数
--gui
启动 GUI 界面。
--startminimized
启动时最小化到系统托盘。
--server
启动 OpenRGB 的服务器。
--client [IP]:[Port]
启动 SDK 客户端,连接到指定的 IP 和端口(默认端口为 6742)。
-l, --list-devices
列出所有兼容的设备及其编号。
-d, --device [0-9 | "name"]
选择要应用颜色或效果的设备,可以指定多个设备。
-z, --zone [0-9]
选择设备的特定区域(zone)以应用颜色或尺寸。
-c, --color [random | FFFFF,00AAFF ...]
设置设备的颜色,可以指定多个颜色。
-m, --mode [breathing | static | ...]
设置设备的模式,支持的模式可以通过 --list-devices 查询。
-b, --brightness [0-100]
设置亮度(0-100%)。
-s, --speed [0-100]
设置模式的速度(0-100%)。
-p, --profile filename[.orp]
从指定文件加载配置文件。
-sp, --save-profile filename.orp
将当前设置保存到指定的配置文件。
-V, --version
显示版本信息。
--localconfig
使用当前工作目录而不是全局配置目录。
--nodetect
启动时不检测硬件。
--noautoconnect
启动时不尝试自动连接到本地服务器。
--loglevel [0-6 | error | warning ...]
设置日志级别(0: fatal 到 6: trace)。
-v, --verbose
打印日志消息到标准输出。
-vv, --very-verbose
打印调试消息和日志消息到标准输出。

我的.bat内容如下:

@echo off
cd "C:\Users\aaa\Documents\OpenRGB Windows 64-bit"
start OpenRGB.exe --server
timeout /t 5
OpenRGB.exe --color 000000

bat内容大概就是进入工作目录,启动服务,等待5秒读取设备信息,颜色黑色,但是实际运行是偏暗的随机颜色,反正降低光污染了就行

查看系统事件 ,这步骤可略,只要知道事件属性和代码就行,睡眠中启动,事件源/代码:Power-Troubleshooter/1,使用 Windows + R 快捷键打开「运行」对话框,执行 eventvwr.msc 打开事件查看器。

 

设置计划任务程序

使用 Windows + R 快捷键打开「运行」对话框,执行 taskschd.msc 打开任务计划程序,设置好执行的条件,运行的程序脚本即可。

 

 

 

 

感谢请我吃辣条
感谢请我吃泡面
感谢请我喝奶茶