Linux OSD notification for Fn+X hotkey | 基于 Huawei WMI (华为) 驱动 | ODM: Longcheer 龙旗科技
English | 中文
English
On-Screen Display (OSD) notification for Fn+X performance mode switching on Mechrevo Xingyao 14 (机械革命 星耀14) laptop running Linux. Based on Huawei WMI driver, manufactured by Longcheer (龙旗科技).
Features
- Shows OSD notification when switching between Balanced and Performance modes via Fn+X
- Automatic startup via systemd user service
- Lightweight bash script with no additional dependencies
Compatibility
| Item |
Details |
| Model |
Mechrevo Xingyao 14 (机械革命 星耀14) |
| Board |
P916F-STX (Strix Point) |
| CPU |
AMD Ryzen AI 9 H 365 / Ryzen 7 H 255 |
| Tested OS |
Fedora 43 (Kernel 6.18+) |
May also work on
Other Mechrevo/Tongfang laptops that use the huawei-wmi driver. Check with:
lsmod | grep huawei_wmi
Background & Technical Details
Hardware Origins
During reverse engineering, the following was discovered:
| Finding |
Details |
| ODM |
Shanghai Longcheer Technology Co., Ltd (上海龙旗科技) |
| WMI GUID |
ABBC0F5B-8EA1-11D1-A000-C90629100000 / ABBC0F5C-8EA1-11D1-A000-C90629100000 |
| Driver |
huawei-wmi (auto-loaded by kernel) |
The Xingyao 14 shares the same WMI interface as Huawei MateBook laptops, indicating a common ODM/EC firmware origin. The huawei-wmi driver is automatically loaded by the Linux kernel due to matching WMI GUIDs.
How Fn+X Works
- Fn+X is handled directly by the Embedded Controller (EC)
- EC switches performance mode independently (no OS involvement required)
- EC sends WMI event to notify OS of the mode change
- The
huawei-wmi driver receives the event but doesn’t recognize the scancode
- Kernel logs:
input inputXX: Unknown key pressed, code: 0x0041/0x0042
- This tool monitors those log messages and displays OSD notifications
Scancode Mapping
| Scancode |
Mode |
0x0041 |
Balanced |
0x0042 |
Performance |
Installation
Prerequisites
huawei-wmi kernel module (usually auto-loaded)
libnotify (provides notify-send)
# Fedora
sudo dnf install libnotify
# Ubuntu/Debian
sudo apt install libnotify-bin
# Arch
sudo pacman -S libnotify
Install (Script)
git clone https://github.com/Rannk2085/Mechrevo-Xingyao-14-Performance-Mode-OSD-14-.git
cd mechrevo-xingyao-osd
chmod +x install.sh
./install.sh
Install (Manual)
# 1. Create directories
mkdir -p ~/.local/bin ~/.config/systemd/user
# 2. Copy files
cp scripts/mechrevo-hotkey-monitor.sh ~/.local/bin/
cp systemd/mechrevo-hotkey-osd.service ~/.config/systemd/user/
# 3. Add execute permission
chmod +x ~/.local/bin/mechrevo-hotkey-monitor.sh
# 4. Enable and start service
systemctl --user daemon-reload
systemctl --user enable --now mechrevo-hotkey-osd.service
Uninstall
# Using script
./uninstall.sh
# Or manually
systemctl --user disable --now mechrevo-hotkey-osd.service
rm -f ~/.local/bin/mechrevo-hotkey-monitor.sh
rm -f ~/.config/systemd/user/mechrevo-hotkey-osd.service
systemctl --user daemon-reload
Usage
Simply press Fn+X to switch performance modes. An OSD notification will appear showing:
- Balanced - Balance between performance and power
- Performance - Maximum performance
Manual Commands
# Check service status
systemctl --user status mechrevo-hotkey-osd.service
# Restart service
systemctl --user restart mechrevo-hotkey-osd.service
# Stop service
systemctl --user stop mechrevo-hotkey-osd.service
# Disable autostart
systemctl --user disable mechrevo-hotkey-osd.service
File Locations
| File |
Path |
| Script |
~/.local/bin/mechrevo-hotkey-monitor.sh |
| Service |
~/.config/systemd/user/mechrevo-hotkey-osd.service |
| Runtime |
/tmp/mechrevo-osd-notify-id (auto-created) |
Troubleshooting
No OSD appears when pressing Fn+X
-
Check if huawei-wmi is loaded:
lsmod | grep huawei_wmi
-
Check if kernel receives the key events:
journalctl -f -k | grep "Unknown key"
Press Fn+X and see if code: 0x0041 or code: 0x0042 appears.
-
Check service status:
systemctl --user status mechrevo-hotkey-osd.service
Different scancodes on your device
If your device shows different scancodes, edit ~/.local/bin/mechrevo-hotkey-monitor.sh and modify the get_mode_info() function.
Contributing
Issues and pull requests are welcome. If you have a similar Mechrevo/Tongfang laptop and want to add support, please share:
- Output of
cat /sys/class/dmi/id/product_name
- Output of
cat /sys/class/dmi/id/board_name
- Scancodes shown when pressing Fn+X (from
journalctl -f -k | grep "Unknown key")
License
MIT License
中文
在 Linux 系统上为机械革命 星耀14 笔记本提供 Fn+X 性能模式切换的 OSD 通知显示。基于华为 (Huawei) WMI 驱动,由龙旗科技 (Longcheer) 代工。
功能特性
- 通过 Fn+X 切换 平衡模式 和 性能模式 时显示 OSD 通知
- 通过 systemd 用户服务实现开机自启
- 轻量级 bash 脚本,无额外依赖
兼容性
| 项目 |
详情 |
| 型号 |
机械革命 星耀14 (Mechrevo Xingyao 14) |
| 主板 |
P916F-STX (Strix Point 平台) |
| 处理器 |
AMD Ryzen AI 9 H 365 / Ryzen 7 H 255 |
| 测试系统 |
Fedora 43 (内核 6.18+) |
可能兼容的设备
其他使用 huawei-wmi 驱动的机械革命/同方笔记本。检查方法:
lsmod | grep huawei_wmi
背景与技术细节
硬件溯源
通过逆向分析发现以下信息:
| 发现 |
详情 |
| ODM 代工厂 |
上海龙旗科技有限公司 (Shanghai Longcheer Technology) |
| WMI GUID |
ABBC0F5B-8EA1-11D1-A000-C90629100000 / ABBC0F5C-8EA1-11D1-A000-C90629100000 |
| 驱动 |
huawei-wmi (内核自动加载) |
星耀14 与 华为 MateBook 系列笔记本使用相同的 WMI 接口,表明它们共享相同的 ODM 代工厂和 EC 固件架构。Linux 内核因检测到匹配的 WMI GUID 而自动加载 huawei-wmi 驱动。
Fn+X 工作原理
- Fn+X 按键由嵌入式控制器 (EC) 直接处理
- EC 独立完成性能模式切换(无需操作系统参与)
- EC 发送 WMI 事件通知操作系统模式已切换
huawei-wmi 驱动接收到事件但不识别该扫描码
- 内核日志显示:
input inputXX: Unknown key pressed, code: 0x0041/0x0042
- 本工具监控这些日志消息并显示 OSD 通知
扫描码映射
| 扫描码 |
模式 |
0x0041 |
平衡模式 (Balanced) |
0x0042 |
性能模式 (Performance) |
安装
前置条件
huawei-wmi 内核模块(通常自动加载)
libnotify(提供 notify-send 命令)
# Fedora
sudo dnf install libnotify
# Ubuntu/Debian
sudo apt install libnotify-bin
# Arch
sudo pacman -S libnotify
安装(脚本)
git clone https://github.com/Rannk2085/Mechrevo-Xingyao-14-Performance-Mode-OSD-14-.git
cd mechrevo-xingyao-osd
chmod +x install.sh
./install.sh
安装(手动)
# 1. 创建目录
mkdir -p ~/.local/bin ~/.config/systemd/user
# 2. 复制文件
cp scripts/mechrevo-hotkey-monitor.sh ~/.local/bin/
cp systemd/mechrevo-hotkey-osd.service ~/.config/systemd/user/
# 3. 添加执行权限
chmod +x ~/.local/bin/mechrevo-hotkey-monitor.sh
# 4. 启用并启动服务
systemctl --user daemon-reload
systemctl --user enable --now mechrevo-hotkey-osd.service
卸载
# 使用脚本
./uninstall.sh
# 或手动卸载
systemctl --user disable --now mechrevo-hotkey-osd.service
rm -f ~/.local/bin/mechrevo-hotkey-monitor.sh
rm -f ~/.config/systemd/user/mechrevo-hotkey-osd.service
systemctl --user daemon-reload
使用方法
按 Fn+X 切换性能模式,屏幕将显示 OSD 通知:
- Balanced - 性能与功耗平衡
- Performance - 最高性能
手动命令
# 查看服务状态
systemctl --user status mechrevo-hotkey-osd.service
# 重启服务
systemctl --user restart mechrevo-hotkey-osd.service
# 停止服务
systemctl --user stop mechrevo-hotkey-osd.service
# 禁用开机自启
systemctl --user disable mechrevo-hotkey-osd.service
文件位置
| 文件 |
路径 |
| 脚本 |
~/.local/bin/mechrevo-hotkey-monitor.sh |
| 服务 |
~/.config/systemd/user/mechrevo-hotkey-osd.service |
| 运行时文件 |
/tmp/mechrevo-osd-notify-id (自动创建) |
故障排除
按 Fn+X 没有 OSD 弹出
-
检查 huawei-wmi 是否已加载:
lsmod | grep huawei_wmi
-
检查内核是否收到按键事件:
journalctl -f -k | grep "Unknown key"
按 Fn+X 查看是否出现 code: 0x0041 或 code: 0x0042。
-
检查服务状态:
systemctl --user status mechrevo-hotkey-osd.service
设备扫描码不同
如果你的设备显示不同的扫描码,请编辑 ~/.local/bin/mechrevo-hotkey-monitor.sh 文件,修改 get_mode_info() 函数中的扫描码映射。
贡献
欢迎提交 Issue 和 Pull Request。如果你有类似的机械革命/同方笔记本并想添加支持,请分享以下信息:
cat /sys/class/dmi/id/product_name 的输出
cat /sys/class/dmi/id/board_name 的输出
- 按 Fn+X 时显示的扫描码(通过
journalctl -f -k | grep "Unknown key" 查看)
许可证
MIT License
致谢
- 基于机械革命 Windows OSD 驱动的逆向分析
huawei-wmi 内核驱动作者 Ayman Bagabas
评论