Releases: umeiko/KlipperPhonesLinux
KlipperOS For Xiaomi Mi 4
- 修复了开机启动慢的问题
- 修复了触屏驱动问题
- 修复了ssh-server默认没有安装的问题
- 优化了系统性能
如果需要横屏显示的话,首先确保机器是能联网的状态:
执行
cd ~ && nano switch-ks-to-weston.sh
将以下内容粘贴进去后 ctrl+o 保存,ctrl+x 退出
#!/bin/bash
set -e
# ============================================================
# KlipperScreen Wayland compositor switcher: cage -> weston
# Run this script as root
# ============================================================
echo "========================================"
echo "KlipperScreen: Switching Cage -> Weston"
echo "========================================"
# ---------- 0. Check root ----------
if [ "$(id -u)" -ne 0 ]; then
echo "Error: Please run this script as root (e.g. sudo $0)"
exit 1
fi
# ---------- 1. Install required packages ----------
echo "[1/4] Installing packages: cage seatd xwayland weston ..."
if command -v apt-get &>/dev/null; then
apt-get update
apt-get install -y cage seatd xwayland weston
elif command -v pacman &>/dev/null; then
pacman -Sy --noconfirm cage seatd xwayland weston
elif command -v dnf &>/dev/null; then
dnf install -y cage seatd xwayland weston
else
echo "Warning: Could not detect package manager. Please install manually: cage seatd xwayland weston"
fi
# ---------- 2. Create /etc/xdg/weston/weston.ini ----------
echo "[2/4] Creating /etc/xdg/weston/weston.ini ..."
mkdir -p /etc/xdg/weston
cat > /etc/xdg/weston/weston.ini <<'EOF'
[core]
idle-time=0
use-pixman=false
[output]
name=DSI-1
transform=rotate-90
EOF
# ---------- 3. Modify KlipperScreen.service ----------
SERVICE_FILE="/etc/systemd/system/KlipperScreen.service"
echo "[3/4] Patching $SERVICE_FILE ..."
if [ -f "$SERVICE_FILE" ]; then
# Backup
cp -a "$SERVICE_FILE" "${SERVICE_FILE}.bak.$(date +%Y%m%d%H%M%S)"
# Change BACKEND=X (or whatever) to BACKEND=W
sed -i 's/BACKEND=[^"[:space:]]*/BACKEND=W/g' "$SERVICE_FILE"
# Change User=umeko to User=root
sed -i 's/^User=.*/User=root/' "$SERVICE_FILE"
echo " -> BACKEND set to W"
echo " -> User set to root"
else
echo "Warning: $SERVICE_FILE not found, skipping service patch."
fi
# ---------- 4. Modify KlipperScreen-start.sh ----------
START_SCRIPT="/home/umeko/KlipperScreen/scripts/KlipperScreen-start.sh"
echo "[4/4] Patching $START_SCRIPT ..."
if [ -f "$START_SCRIPT" ]; then
# Backup
cp -a "$START_SCRIPT" "${START_SCRIPT}.bak.$(date +%Y%m%d%H%M%S)"
# Replace the cage block with weston block
# We use a Python heredoc to safely handle the multiline replacement
python3 <<'PYEOF'
import re
path = "/home/umeko/KlipperScreen/scripts/KlipperScreen-start.sh"
with open(path, "r") as f:
content = f.read()
old_block = '''if [[ "$BACKEND" =~ ^[wW]$ ]]; then
echo "Running KlipperScreen on Cage"
exec /usr/bin/cage -ds $KS_XCLIENT'''
new_block = '''if [[ "$BACKEND" =~ ^[wW]$ ]]; then
echo "Running KlipperScreen on Weston"
# Wayland requires 0700 permissions on XDG_RUNTIME_DIR
export XDG_RUNTIME_DIR=/run/user/$(id -u)
mkdir -p "$XDG_RUNTIME_DIR"
chmod 700 "$XDG_RUNTIME_DIR"
# Clean up stale sockets to prevent Weston from creating wayland-1
rm -f "$XDG_RUNTIME_DIR/wayland-"*
# Start Weston kiosk-shell in background
/usr/bin/weston --socket=wayland-0 --shell=kiosk-shell.so \\
--config=/etc/xdg/weston/weston.ini &
# Wait for socket readiness
for i in {1..50}; do
if [ -S "$XDG_RUNTIME_DIR/wayland-0" ]; then
echo "Weston ready"
break
fi
sleep 0.1
done
exec $KS_XCLIENT'''
if old_block in content:
content = content.replace(old_block, new_block)
with open(path, "w") as f:
f.write(content)
print(" -> Replaced cage block with weston block")
else:
print(" -> WARNING: Could not find the expected cage block.")
print(" The file may have already been patched or uses a different format.")
PYEOF
else
echo "Warning: $START_SCRIPT not found, skipping start script patch."
fi
# ---------- 5. Reload systemd & finish ----------
echo ""
echo "Reloading systemd daemon ..."
systemctl daemon-reload
echo ""
echo "========================================"
echo "Done! Please review the changes above."
echo ""
echo "To apply the new configuration, run:"
echo " sudo systemctl restart KlipperScreen"
echo "========================================"
添加可执行权限
chmod +x switch-ks-to-weston.sh
以管理员身份执行后重启即可
sudo ./switch-ks-to-weston.sh
KlipperOS For Huawei Maimang 4
KlipperOS For Redmi 4a (Xiaomi Rolex)
KlipperOS For Xiaomi Davinci (Xiaomi Mi 9T / Redmi K20)
KlipperOS For Xiaomi msm8953 Phones
Flashing Guide
-
Install xiaomi Drivers by Xiaomi MiFlash
-
Unlock the bootloader using the unlocking tool provided here.
-
Extract
***.zipto your computer, ensuring that the directory name consists of English characters only. -
Put your phone into Fastboot mode:
- Power off the phone, then press and hold the Volume Down button.
- Connect the phone to your computer using a USB data cable until the Fastboot logo appears on the screen.
-
Use the provided
flash_klipper_os.batto flash the firmware onto the phone.- During the flashing process, the phone will restart and pause in lk2nd mode. Press Enter on your computer to continue the flashing process.
-
username:
umeko -
password:
1234
If your xiaomi redmi 5 plus (vince) has an unstable touchscreen
git clone https://gitee.com/meiziyang2023/hmrmi4-reload.git
cd hmrmi4-reload
sudo chmod +x ./install.sh
sudo ./install.sh
if you are xiaomi redmi 6 pro (daisy)
before running flash_klipper_os.bat , flash rbv.img to your phone under Fastboot mode.
fastboot flash antirbpass rbv.img
xiaomi-5sp-sharp-panel
KlipperOS for xiaomi-5sp-sharp-panel.
Only works for sharp panel !
只适配夏普屏幕!
JDI panel:
JDI 屏幕的刷机包:
reff

Xiaomi msm8953 KDE-Plasma
支持机型
- Xiaomi Redmi 5 Plus
- Xiaomi Mi 5X
- Xiaomi Mi A1
- Xiaomi Mi A2 Lite
- Xiaomi Redmi 6 Pro
- Xiaomi Redmi 4 Prime
- Xiaomi Redmi Note 4
- Xiaomi Redmi S2
- Xiaomi Redmi Y2
快速上手
系统使用 linux6.7.5 内核
根文件系统基于 Ubuntu20.04-arm64 制作
用户界面为 KDE-Plasma
用户名 umeko
密码 1234
USB连接进入Linux终端
KDE使用指南

KlipperOS For xiaomi 5 (gemini) / 5s (capricorn) / 5sp (natrium)
Flashing Guide
-
Install xiaomi Drivers by Xiaomi MiFlash
-
Unlock the bootloader using the unlocking tool provided here.
-
Extract
xiaomi_5_klipperos.zipto your computer, ensuring that the directory name consists of English characters only. -
Put your phone into Fastboot mode:
- Power off the phone, then press and hold the Volume Down button.
- Connect the phone to your computer using a USB data cable until the Fastboot logo appears on the screen.
-
Use the provided
flash_klipper_os.batto flash the firmware onto the phone. -
username:
umeko -
password:
1234
Note
- Works good
- WiFi, BT, Display, Touchscreen, USB-OTG.
- Panel only works for
jdi-fhd-r63452panel. - Overly aged battery may causes unable to boot the Wi-Fi module under the Linux system.
- If your phone is xiaomi 5s plus with
sharp td4722panel, you can try this version.



KlipperOS For xiaomi redmi4x (santoni)
Flashing Guide
-
Install xiaomi Drivers by Xiaomi MiFlash
-
Unlock the bootloader using the unlocking tool provided here.
-
Extract
xiaomi_redmi4x_klipperos.zipto your computer, ensuring that the directory name consists of English characters only. -
Put your phone into Fastboot mode:
- Power off the phone, then press and hold the Volume Down button.
- Connect the phone to your computer using a USB data cable until the Fastboot logo appears on the screen.
-
Use the provided
flash_klipper_os.batto flash the firmware onto the phone.- During the flashing process, the phone will restart and pause in lk2nd mode. Press Enter on your computer to continue the flashing process.
-
username:
umeko -
password:
1234
Note
- USB cable requires an input of 5V, otherwise it cannot provide power to the device and function properly.
- USB-Serial-console can't enable with USB-otg. you can flash different boot.img to choose what the function you need.
If you want rotate the screen:
sudo /home/umeko/launch-ks-by-wayland/install.sh
KlipperOS For Huawei Maimang 5 / G9 (Plus) / Nova (Plus) (milan)
Flashing Guide
-
Unlock the bootloader.
-
Extract
huawei_milan_klipperos.zipto your computer, ensuring that the directory name consists of English characters only. -
Put your phone into Fastboot mode:
- Power off the phone, then press and hold the Volume Down button.
- Connect the phone to your computer using a USB data cable until the Fastboot logo appears on the screen.
-
Use the provided
flash_klipper_os.batto flash the firmware onto the phone.- During the flashing process, the phone will restart and pause in lk2nd mode. Press Enter on your computer to continue the flashing process.
-
username:
umeko -
password:
1234
Note
- USB-Serial-console can't enable with USB-otg. you can flash different boot.img to choose what the function you need.
rmi4-i2ctouch ic now not supported.- If you want hide the mouse cursor:
sudo nano /root/KlipperScreen.conf





