7 Commits

Author SHA1 Message Date
Nick007
77edc4b33e fix: add curl retry for WeChat/QQ download to handle transient network failures 2026-03-23 21:06:24 +08:00
Nick007
680ee6dd4a feat: support minimal image variant with WeChat only (#92)
Add INSTALL_QQ and INSTALL_PCMANFM build args to conditionally skip QQ
and file manager installation. CI builds both :latest (full) and :minimal
(WeChat only) tags for each release.
2026-03-23 19:54:35 +08:00
Nick007
63b3f34527 feat: extract docker-compose config to .env and update commands to docker compose 2026-03-23 19:39:28 +08:00
Nick007
c2b6106fff docs: add WeChat/QQ version update guide and file manager feature docs (#100) 2026-03-23 18:56:51 +08:00
Nick007
e42a8e861d feat: add PCManFM file manager with right-click menu entry (#86) 2026-03-23 18:56:44 +08:00
Nick007
d87cb16fb9 feat: open WeChat/QQ as normal windows instead of maximized (#69) 2026-03-23 18:55:55 +08:00
Nick007
7c13e87a69 fix: clean up stale dbus pid file on startup (#81) 2026-03-23 18:55:36 +08:00
9 changed files with 246 additions and 75 deletions

14
.env.example Normal file
View File

@@ -0,0 +1,14 @@
# Ports
HTTP_PORT=3000
HTTPS_PORT=3001
# User/Group
PUID=1000
PGID=100
# Selkies Web UI
# CUSTOM_USER=
# PASSWORD=
# Shared Memory
SHM_SIZE=1gb

View File

@@ -70,6 +70,37 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Extract metadata for minimal image
id: meta-minimal
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }},enable=${{ vars.ENABLE_DOCKERHUB == 'true' }}
flavor: |
latest=false
suffix=-minimal
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=minimal,enable=${{ github.ref == format('refs/heads/{0}', 'master') || startsWith(github.ref, 'refs/tags/') }}
- name: Build and push minimal Docker image
id: build-minimal
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-minimal.outputs.tags }}
labels: ${{ steps.meta-minimal.outputs.labels }}
build-args: |
INSTALL_QQ=false
INSTALL_PCMANFM=false
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Generate artifact attestation
if: github.event_name != 'workflow_dispatch'
uses: actions/attest-build-provenance@v1
@@ -84,11 +115,16 @@ jobs:
echo "### GitHub Container Registry" >> $GITHUB_STEP_SUMMARY
echo "**Registry:** ${{ env.REGISTRY }}" >> $GITHUB_STEP_SUMMARY
echo "**Repository:** ${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY
echo "**Digest:** \`${{ steps.build-image.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
echo "**Full image digest:** \`${{ steps.build-image.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Minimal image digest:** \`${{ steps.build-minimal.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Tags (full):**" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "**Tags (minimal):**" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta-minimal.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
if [ "${{ vars.ENABLE_DOCKERHUB }}" == "true" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
@@ -115,6 +151,7 @@ jobs:
body: |
## 🐳 Docker Images
### Full (WeChat + QQ + File Manager)
**GitHub Container Registry:**
```bash
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
@@ -127,17 +164,20 @@ jobs:
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest
```
## 🚀 Quick Start
**GitHub Container Registry:**
### Minimal (WeChat only)
```bash
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:minimal
```
## 🚀 Quick Start
**Full:**
```bash
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
```
**Docker Hub** (if enabled):
**Minimal:**
```bash
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ steps.meta.outputs.version }}
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:minimal
```
Then visit: https://localhost:3001

3
.gitignore vendored
View File

@@ -1 +1,2 @@
/config/
/config/
.env

View File

@@ -13,9 +13,10 @@ LABEL org.opencontainers.image.licenses="GPL-3.0-only"
# Build arguments for multi-arch support
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG INSTALL_QQ=true
ARG INSTALL_PCMANFM=true
RUN echo "🏗️ Building WeChat-Selkies on $BUILDPLATFORM, targeting $TARGETPLATFORM"
# set environment variables
RUN apt-get update && \
apt-get install -y fonts-noto-cjk libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 \
@@ -27,7 +28,12 @@ RUN apt-get update && \
libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \
libxcomposite1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
libxss1 libxtst6 libatomic1 libxcomposite1 libxrender1 libxrandr2 libxkbcommon-x11-0 \
libfontconfig1 libdbus-1-3 libnss3 libx11-xcb1 python3-tk stalonetray inotify-tools
libfontconfig1 libdbus-1-3 libnss3 libx11-xcb1 stalonetray inotify-tools
ARG INSTALL_PCMANFM
RUN if [ "$INSTALL_PCMANFM" = "true" ]; then \
apt-get install -y --no-install-recommends pcmanfm; \
fi
RUN pip install --no-cache-dir python-xlib
@@ -45,31 +51,35 @@ RUN case "$TARGETPLATFORM" in \
exit 1 ;; \
esac && \
echo "📦 Downloading WeChat for $WECHAT_ARCH architecture..." && \
curl -fsSL -o wechat.deb "$WECHAT_URL" && \
curl -fsSL --retry 3 --retry-delay 10 --retry-all-errors -o wechat.deb "$WECHAT_URL" && \
echo "🔧 Installing WeChat..." && \
(dpkg -i wechat.deb || (apt-get update && apt-get install -f -y && dpkg -i wechat.deb)) && \
rm -f wechat.deb && \
echo "✅ WeChat installation completed for $WECHAT_ARCH"
# Install QQ based on target architecture
RUN case "$TARGETPLATFORM" in \
"linux/amd64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.22_251203_amd64_01.deb"; \
QQ_ARCH="x86_64" ;; \
"linux/arm64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.22_251203_arm64_01.deb"; \
QQ_ARCH="arm64" ;; \
*) \
echo "❌ Unsupported platform: $TARGETPLATFORM" >&2; \
echo "Supported platforms: linux/amd64, linux/arm64" >&2; \
exit 1 ;; \
esac && \
echo "📦 Downloading QQ for $QQ_ARCH architecture..." && \
curl -fsSL -o qq.deb "$QQ_URL" && \
echo "🔧 Installing QQ..." && \
(dpkg -i qq.deb || (apt-get update && apt-get install -f -y && dpkg -i qq.deb)) && \
rm -f qq.deb && \
echo "✅ QQ installation completed for $QQ_ARCH"
# Install QQ based on target architecture (optional)
ARG INSTALL_QQ
RUN if [ "$INSTALL_QQ" = "true" ]; then \
case "$TARGETPLATFORM" in \
"linux/amd64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.22_251203_amd64_01.deb"; \
QQ_ARCH="x86_64" ;; \
"linux/arm64") \
QQ_URL="https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.22_251203_arm64_01.deb"; \
QQ_ARCH="arm64" ;; \
*) \
echo "❌ Unsupported platform: $TARGETPLATFORM" >&2; \
exit 1 ;; \
esac && \
echo "📦 Downloading QQ for $QQ_ARCH architecture..." && \
curl -fsSL --retry 3 --retry-delay 10 --retry-all-errors -o qq.deb "$QQ_URL" && \
echo "🔧 Installing QQ..." && \
(dpkg -i qq.deb || (apt-get update && apt-get install -f -y && dpkg -i qq.deb)) && \
rm -f qq.deb && \
echo "✅ QQ installation completed for $QQ_ARCH"; \
else \
echo "⏭️ Skipping QQ installation (INSTALL_QQ=$INSTALL_QQ)"; \
fi
# Clean up
RUN apt-get purge -y --autoremove

View File

@@ -35,6 +35,7 @@
- 🪟 **窗口切换器**:左上角增加切换悬浮窗,方便切换到后台窗口,为后续添加其它功能做基础
- 🤖 **自动启动**可配置自动启动微信和QQ客户端可选
- 📋 **桌面快捷方式集成**:自动扫描 `~/Desktop/` 下的 `.desktop` 文件并添加到右键菜单,方便启动第三方应用(如通过 proot-apps 安装的应用)
- 📂 **文件管理器**:内置 PCManFM 轻量文件管理器,右键菜单即可启动,方便管理容器内文件
## 截图展示
![微信截图](./docs/images/wechat-selkies-1.jpg)
@@ -62,12 +63,18 @@ Docker Hub镜像
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickrunning/wechat-selkies:latest
```
> **精简版镜像**:如果只需要微信(不含 QQ 和文件管理器),可使用 `minimal` 标签,镜像体积更小:
> ```bash
> docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ghcr.io/nickrunning/wechat-selkies:minimal
> ```
> 精简版也支持版本号标签,如 `:1.2.3-minimal`、`:1.2-minimal`,方便锁定特定版本。
2. **访问微信**
在浏览器中访问:`https://localhost:3001``https://<服务器IP>:3001`
> **注意:** 映射3000端口用于HTTP访问3001端口用于HTTPS访问建议使用HTTPS。
### docker-compose 部署
### Docker Compose 部署
1. **创建项目目录并进入**
```bash
mkdir wechat-selkies
@@ -80,27 +87,43 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
container_name: wechat-selkies
ports:
- "3000:3000" # http port
- "3001:3001" # https port
- "${HTTP_PORT:-3000}:3000"
- "${HTTPS_PORT:-3001}:3001"
restart: unless-stopped
volumes:
- ./config:/config
devices:
- /dev/dri:/dev/dri # optional, for hardware acceleration
- /dev/dri:/dev/dri
environment:
- PUID=1000 # user ID, set according to your system
- PGID=100 # group ID, set according to your system
- TZ=Asia/Shanghai # timezone, set according to your timezone
- LC_ALL=zh_CN.UTF-8 # locale, set according to your needs
- AUTO_START_WECHAT=true # default is true
- AUTO_START_QQ=false # default is false
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
shm_size: "1gb" # recommended, will improve performance
- PUID=${PUID:-1000}
- PGID=${PGID:-100}
- TZ=Asia/Shanghai
- LC_ALL=zh_CN.UTF-8
- AUTO_START_WECHAT=true
- AUTO_START_QQ=false
- CUSTOM_USER=${CUSTOM_USER:-}
- PASSWORD=${PASSWORD:-}
shm_size: "${SHM_SIZE:-1gb}"
```
3. **启动服务**
3. **创建 `.env` 文件(可选)**
复制 `.env.example` 并按需修改,未设置的变量将使用默认值:
```bash
docker-compose up -d
cp .env.example .env
```
`.env` 文件示例:
```env
HTTP_PORT=3000
HTTPS_PORT=3001
PUID=1000
PGID=100
# CUSTOM_USER=
# PASSWORD=
SHM_SIZE=1gb
```
4. **启动服务**
```bash
docker compose up -d
```
### 源码部署
@@ -113,13 +136,18 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
2. **启动服务**
```bash
docker-compose up -d
docker compose up -d
```
3. **访问微信**
在浏览器中访问:`https://localhost:3001` 或 `https://<服务器IP>:3001`
> **构建精简版**:源码部署时可通过 build-arg 构建仅含微信的精简镜像:
> ```bash
> docker build --build-arg INSTALL_QQ=false --build-arg INSTALL_PCMANFM=false -t wechat-selkies:minimal .
> ```
### 配置说明
更多自定义配置请参考 [Selkies Base Images from LinuxServer](https://github.com/linuxserver/docker-baseimage-selkies)。
@@ -136,7 +164,7 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
#### 环境变量配置
在 `docker-compose.yml` 中可以配置以下环境变量:
在 `docker-compose.yml` 中可以配置以下环境变量,支持通过 `.env` 文件覆盖带有 `${VAR:-default}` 的配置项
| 变量名 | 默认值 | 说明 |
|--------|--------|------|
@@ -189,6 +217,7 @@ devices:
```
wechat-selkies/
├── docker-compose.yml # Docker Compose 配置文件
├── .env.example # 环境变量示例文件
├── Dockerfile # Docker 镜像构建文件
├── LICENSE # License
├── README.md # 项目说明文档
@@ -201,6 +230,20 @@ wechat-selkies/
## 故障排除
### 更新微信/QQ版本
当微信或QQ提示"版本过期"时,只需重新拉取最新镜像并重建容器即可,聊天记录和配置不受影响:
```bash
# 使用预构建镜像
docker compose pull && docker compose up -d
# 使用源码构建
git pull && docker compose up -d --build
```
> **注意:** 微信和QQ的安装包 URL 指向官方最新版本,重新构建镜像时会自动下载最新版。
### 常见问题
1. **无法访问 Web UI**
@@ -211,7 +254,7 @@ wechat-selkies/
查看容器运行日志:
```bash
docker-compose logs -f wechat-selkies
docker compose logs -f wechat-selkies
```
## 技术架构

View File

@@ -35,6 +35,7 @@ This project packages the official WeChat/QQ Linux client in a Docker container,
- 🪟 **Window Switcher**: Added a floating window switcher in the top left corner for easy switching to background windows, laying the foundation for adding other features in the future
- 🤖 **Auto Start**: Configurable auto-start for WeChat and QQ clients (optional)
- 📋 **Desktop Shortcut Integration**: Automatically scans `.desktop` files in `~/Desktop/` and adds them to the right-click menu, making it easy to launch third-party applications (e.g., apps installed via proot-apps)
- 📂 **File Manager**: Built-in PCManFM lightweight file manager, accessible from the right-click menu for easy file management inside the container
## Screenshots
![WeChat Screenshot](./docs/images/wechat-selkies-1.jpg)
@@ -60,12 +61,18 @@ Docker Hub image:
docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickrunning/wechat-selkies:latest
```
> **Minimal image**: If you only need WeChat (without QQ and file manager), use the `minimal` tag for a smaller image:
> ```bash
> docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri ghcr.io/nickrunning/wechat-selkies:minimal
> ```
> Versioned minimal tags are also available, e.g. `:1.2.3-minimal`, `:1.2-minimal`, for pinning to a specific release.
2. **Access WeChat**
Open in browser: `https://localhost:3001` or `https://<server-ip>:3001`
> **Note**: 3001 port is for HTTPS access. If you need HTTP access, please map port 3000 as well.
### docker-compose Deployment
### Docker Compose Deployment
1. **Create project directory and navigate into it**
```bash
mkdir wechat-selkies
@@ -78,27 +85,43 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
container_name: wechat-selkies
ports:
- "3000:3000" # http port
- "3001:3001" # https port
- "${HTTP_PORT:-3000}:3000"
- "${HTTPS_PORT:-3001}:3001"
restart: unless-stopped
volumes:
- ./config:/config
devices:
- /dev/dri:/dev/dri # optional, for hardware acceleration
- /dev/dri:/dev/dri
environment:
- PUID=1000 # user ID, set according to your system
- PGID=100 # group ID, set according to your system
- TZ=Asia/Shanghai # timezone, set according to your timezone
- LC_ALL=zh_CN.UTF-8 # locale, set according to your needs
- AUTO_START_WECHAT=true # default is true
- AUTO_START_QQ=false # default is false
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
shm_size: "1gb" # recommended, will improve performance
- PUID=${PUID:-1000}
- PGID=${PGID:-100}
- TZ=Asia/Shanghai
- LC_ALL=zh_CN.UTF-8
- AUTO_START_WECHAT=true
- AUTO_START_QQ=false
- CUSTOM_USER=${CUSTOM_USER:-}
- PASSWORD=${PASSWORD:-}
shm_size: "${SHM_SIZE:-1gb}"
```
3. **Start the service**
3. **Create `.env` file (optional)**
Copy `.env.example` and modify as needed. Variables not set will use default values:
```bash
docker-compose up -d
cp .env.example .env
```
`.env` file example:
```env
HTTP_PORT=3000
HTTPS_PORT=3001
PUID=1000
PGID=100
# CUSTOM_USER=
# PASSWORD=
SHM_SIZE=1gb
```
4. **Start the service**
```bash
docker compose up -d
```
### Source Code Deployment
@@ -111,13 +134,18 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
2. **Start the service**
```bash
docker-compose up -d
docker compose up -d
```
3. **Access WeChat**
Open in browser: `https://localhost:3001` or `https://<server-ip>:3001`
> **Build minimal version**: When building from source, use build-arg to create a WeChat-only image:
> ```bash
> docker build --build-arg INSTALL_QQ=false --build-arg INSTALL_PCMANFM=false -t wechat-selkies:minimal .
> ```
### Configuration
For more custom configurations, please refer to [Selkies Base Images from LinuxServer](https://github.com/linuxserver/docker-baseimage-selkies).
@@ -134,7 +162,7 @@ This project supports pushing to both GitHub Container Registry and Docker Hub.
#### Environment Variables
Configure the following environment variables in `docker-compose.yml`:
Configure the following environment variables in `docker-compose.yml`. Variables with `${VAR:-default}` syntax can be overridden via a `.env` file:
| Variable | Default | Description |
|----------|---------|-------------|
@@ -187,6 +215,7 @@ devices:
```
wechat-selkies/
├── docker-compose.yml # Docker Compose configuration file
├── .env.example # Environment variables example file
├── Dockerfile # Docker image build file
├── LICENSE # License
├── README.md # Project documentation (Chinese)
@@ -200,6 +229,20 @@ wechat-selkies/
## Troubleshooting
### Updating WeChat/QQ Version
When WeChat or QQ displays a "version outdated" message, simply pull the latest image and recreate the container. Your chat history and configurations will be preserved:
```bash
# Using pre-built images
docker compose pull && docker compose up -d
# Using source code build
git pull && docker compose up -d --build
```
> **Note:** The WeChat and QQ download URLs point to the latest official versions. Rebuilding the image will automatically download the newest version.
### Common Issues
1. **Unable to access Web UI**
@@ -210,7 +253,7 @@ wechat-selkies/
View container runtime logs:
```bash
docker-compose logs -f wechat-selkies
docker compose logs -f wechat-selkies
```
## Technical Architecture

View File

@@ -10,12 +10,12 @@ services:
devices:
- /dev/dri:/dev/dri # optional, for hardware acceleration
ports:
- "3000:3000" # http port
- "3001:3001" # https port
- "${HTTP_PORT:-3000}:3000" # http port
- "${HTTPS_PORT:-3001}:3001" # https port
restart: unless-stopped
environment:
- PUID=1000 # set user id according to your system
- PGID=100 # set group id according to your system
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
shm_size: "1gb" # recommended, will improve performance
- PUID=${PUID:-1000} # set user id according to your system
- PGID=${PGID:-100} # set group id according to your system
- CUSTOM_USER=${CUSTOM_USER:-} # recommended to set a custom user name
- PASSWORD=${PASSWORD:-} # recommended to set a password for selkies web ui
shm_size: "${SHM_SIZE:-1gb}" # recommended, will improve performance

View File

@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="root-menu" label="MENU">
<item label="xterm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm"><action name="Execute"><command>/usr/bin/xterm</command></action></item>
<item label="WeChat" icon="/usr/share/icons/hicolor/128x128/apps/wechat.png"><action name="Execute"><command>/scripts/wechat/wechat-start.sh</command></action></item>
<item label="QQ" icon="/usr/share/icons/hicolor/512x512/apps/qq.png"><action name="Execute"><command>/scripts/qq/qq-start.sh</command></action></item>
<separator />
<item label="File Manager" icon="/usr/share/pixmaps/xterm-color_48x48.xpm"><action name="Execute"><command>pcmanfm</command></action></item>
<item label="xterm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm"><action name="Execute"><command>/usr/bin/xterm</command></action></item>
</menu>
</openbox_menu>

View File

@@ -1,5 +1,8 @@
#!/bin/bash
# clean up stale dbus pid file to prevent startup failures after container restart
rm -f /run/dbus/pid
# configure openbox dock mode for stalonetray
if [ ! -f /config/.config/openbox/rc.xml ] || grep -A20 "<dock>" /config/.config/openbox/rc.xml | grep -q "<noStrut>no</noStrut>"; then
mkdir -p /config/.config/openbox
@@ -8,6 +11,21 @@ if [ ! -f /config/.config/openbox/rc.xml ] || grep -A20 "<dock>" /config/.config
openbox --reconfigure
fi
# configure default window behavior: open WeChat/QQ as normal windows instead of maximized
OB_RC="/config/.config/openbox/rc.xml"
if [ -f "$OB_RC" ] && ! grep -q '<application class="wechat"' "$OB_RC"; then
sed -i '/<\/openbox_config>/i \
<applications>\
<application class="wechat">\
<maximized>no</maximized>\
</application>\
<application class="QQ">\
<maximized>no</maximized>\
</application>\
</applications>' "$OB_RC"
openbox --reconfigure 2>/dev/null || true
fi
# generate openbox menu from defaults + ~/Desktop/*.desktop files
/scripts/refresh-menu.sh