Skip to content

Releases: umeiko/KlipperPhonesLinux

KlipperOS For Xiaomi Mi 4

04 Jan 02:27
6532895

Choose a tag to compare

image
  • 修复了开机启动慢的问题
  • 修复了触屏驱动问题
  • 修复了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

25 Aug 03:28
28461cd

Choose a tag to compare

KlipperOS For Redmi 4a (Xiaomi Rolex)

09 Jun 17:20
edd7689

Choose a tag to compare

刷入linux之前系统必须是国际版的MIUI
image

KlipperOS For Xiaomi Davinci (Xiaomi Mi 9T / Redmi K20)

14 May 18:30
0de864e

Choose a tag to compare

As Titled

after unlock BL
and use flash script inside zip file to flash your device.
image

KlipperOS For Xiaomi msm8953 Phones

19 Jul 06:55
dc8e2c8

Choose a tag to compare

Flashing Guide

中文文档
教学视频

  • Install xiaomi Drivers by Xiaomi MiFlash

  • Unlock the bootloader using the unlocking tool provided here.

  • Reff: Xiaomi Official Unlock Tutorial

  • Extract ***.zip to 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.bat to 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

image

xiaomi-5sp-sharp-panel

21 Apr 09:35
2e2c16b

Choose a tag to compare

KlipperOS for xiaomi-5sp-sharp-panel.

Only works for sharp panel !
只适配夏普屏幕!

JDI panel:
JDI 屏幕的刷机包:
reff
~F_GK@37QTDB9VT1T@~U_K0

Xiaomi msm8953 KDE-Plasma

22 Mar 03:10
862aa9a

Choose a tag to compare

刷机指南

支持机型

  • 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使用指南
image

KlipperOS For xiaomi 5 (gemini) / 5s (capricorn) / 5sp (natrium)

07 Mar 09:39
1cad994

Choose a tag to compare

Flashing Guide

  • Install xiaomi Drivers by Xiaomi MiFlash

  • Unlock the bootloader using the unlocking tool provided here.

  • Reff: Xiaomi Official Unlock Tutorial

  • Extract xiaomi_5_klipperos.zip to 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.bat to 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-r63452 panel.
  • 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 td4722 panel, you can try this version.
    image
    image
    image

KlipperOS For xiaomi redmi4x (santoni)

03 Mar 14:54
9ac71d5

Choose a tag to compare

Pre-release

Flashing Guide

  • Install xiaomi Drivers by Xiaomi MiFlash

  • Unlock the bootloader using the unlocking tool provided here.

  • Reff: Xiaomi Official Unlock Tutorial

  • Extract xiaomi_redmi4x_klipperos.zip to 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.bat to 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

5eef5a80360cb533a28694d6327e65a

KlipperOS For Huawei Maimang 5 / G9 (Plus) / Nova (Plus) (milan)

02 Mar 09:18

Choose a tag to compare

Flashing Guide

  • Unlock the bootloader.

  • Extract huawei_milan_klipperos.zip to 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.bat to 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-i2c touch ic now not supported.
  • If you want hide the mouse cursor:

sudo nano /root/KlipperScreen.conf

EL1O {{7TF 4CN0P(404{9