Repository navigation
feat: add LXQt and MATE desktop environment support - #7
Conversation
Save detected GPU vendor to OHMYTERMUX_CONFIG_DIR/gpu_vendor (for zrun/zrunhud) and update the Adreno path to install mesa-vulkan-drivers via proot-distro/apt. Replaces the previous hardcoded .deb download and dpkg check for mesa-vulkan-kgsl with a simpler apt install, and updates the function header/comment to reflect GPU detection and saving.
Add i18n messages for desktop environment selection (XFCE/LXQt), LXQt installation flow, and LXQt script-specific messages in both English and French. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add --desktop/-de flag for desktop environment selection, keeping --xfce/-x for backwards compatibility. Update all references in CLI parsing, main execution, help, and cleanup. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…nd LXQt Add desktop environment selection UI (gum and text mode) that prompts for XFCE or LXQt. Saves choice to desktop.conf. Branches to _install_xfce() or _install_lxqt() accordingly. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace install_xfce_scripts() with install_desktop_scripts() that reads desktop.conf to launch the correct DE session (xfce4-session or startlxqt) and kill the right processes. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add complete LXQt installation script with bootstrap, argument parsing, package definitions (base + recommended), LXQt/Openbox/ Kvantum/qterminal configuration, browser and icon installation. Mirrors xfce.sh structure with minimal and recommended modes only. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Skip GTK-specific theme application when DESKTOP_ENV=lxqt in theme_config.tmp, since LXQt uses Qt/Kvantum themes instead. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace XFCE-specific references in start/stop/cp2menu messages with generic desktop session wording. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fix stop script config path to use $OHMYTERMUX_CONFIG_DIR (OhMyTermux with capitals) instead of hardcoded lowercase path. Fix tput cuu off-by-one in LXQt version selection menu. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Bump the BRANCH variable from 1.2.1 to 1.2.2 in lxqt.sh so downloads point to the 1.2.2 GitHub branch.
Fix download_and_execute() to prefer local script files over remote download, preventing 404 errors for scripts not yet pushed to GitHub. Add -f flag to curl to fail properly on HTTP errors. Fix lxqt.sh BRANCH from "1.2.2" to "1.2.1" to match install.sh and xfce.sh. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Save selected DE and generate robust start/stop scripts with LXQt detection and handling. Writes DESKTOP_SESSION=lxqt to ~/.config/OhMyTermux/desktop.conf and adds _update_start_script to lxqt.sh to deploy updated $PREFIX/bin/start and kill_termux_x11 (handles XFCE and LXQt). Updates src/start and the generated start script in utils.sh to: detect DE from desktop.conf or theme_config.tmp or binaries; start PulseAudio, Termux-X11 and virgl_test_server (with Adreno flag); launch either startlxqt or xfce4-session; and disable screensavers. Also improves kill script to stop virgl/openbox/lxqt processes, clean X11 locks, and small formatting fixes for desktop files.
Introduce full MATE desktop support and improve i18n handling. Adds a new mate.sh installer (packages, config, start/stop scripts, theme/icon handling) and integrates MATE selection into install.sh and desktop start logic (xfce/lxqt/mate). Add MSG_I18N_VERSION and many MATE-related messages to en.sh and fr.sh. Implement safer i18n_loader download/refresh across scripts (install.sh, lxqt.sh, proot.sh, utils.sh, xfce.sh) using a temp file and shebang validation, and add version-based message file refresh in lib/i18n_loader.sh. Also update App-Installer repository URL in utils.sh and minor start/stop adjustments to detect/handle mate-session and marco.
Review Summary by QodoAdd LXQt and MATE desktop environment support with multi-DE awareness
WalkthroughsDescription• Add LXQt and MATE desktop environment support alongside XFCE • Replace --xfce flag with --desktop <xfce|lxqt|mate> for flexible DE selection • Create standalone lxqt.sh and mate.sh installation scripts (654 and 551 lines) • Make start and kill_termux_x11 scripts DE-aware via desktop.conf detection • Add 110+ i18n message keys in English and French for new DEs • Improve i18n loader robustness with version checking and fallback caching • Skip GTK themes for LXQt (uses Qt/Kvantum instead) in PRoot integration • Save GPU vendor detection for zrun/zrunhud utilities Diagramflowchart LR
A["install.sh<br/>--desktop flag"] -->|xfce| B["_install_xfce"]
A -->|lxqt| C["_install_lxqt"]
A -->|mate| D["_install_mate"]
B --> E["xfce.sh"]
C --> F["lxqt.sh"]
D --> G["mate.sh"]
E --> H["desktop.conf<br/>saved"]
F --> H
G --> H
H -->|detected by| I["start script"]
H -->|detected by| J["kill_termux_x11 script"]
I --> K["Launch correct DE<br/>xfce4-session|startlxqt|mate-session"]
J --> L["Kill correct DE<br/>processes"]
File Changes1. install.sh
|
📝 WalkthroughWalkthroughMulti-desktop environment support (LXQt, MATE, XFCE) is introduced to the Termux-X11 installation framework. Changes include expanded i18n messages for desktop environments, centralized desktop selection and installation orchestration, new installer scripts for each environment, automated i18n message refresh logic, version bump to 1.2.2, and updated startup/stop scripts with desktop detection. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant InstallScript as install.sh
participant DesktopOrch as Desktop<br/>Orchestrator
participant Installer as Desktop<br/>Installer<br/>(XFCE/LXQt/MATE)
participant i18n as i18n Loader
participant System as System<br/>Packages
User->>InstallScript: Run installer with--desktop=lxqt
InstallScript->>i18n: Load messages (with refresh check)
i18n-->>InstallScript: Messages loaded
InstallScript->>DesktopOrch: install_desktop(lxqt)
DesktopOrch->>Installer: _install_lxqt()
Installer->>System: Update system packages
System-->>Installer: Success
Installer->>System: Install base LXQt packages
System-->>Installer: Success
Installer->>System: Install browser (Firefox/Chromium)
System-->>Installer: Success
Installer->>Installer: Generate config files<br/>(lxqt.conf, panel.conf,<br/>openbox config, themes)
Installer->>Installer: Create start/stop scripts<br/>(with environment detection)
Installer->>Installer: Persist DESKTOP_SESSION=lxqt
Installer-->>DesktopOrch: Installation complete
DesktopOrch-->>InstallScript: Success
InstallScript-->>User: Desktop environment ready
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review by Qodo
1. i18n_loader.sh sourced without guard
|
| # Always try to refresh i18n_loader.sh; fall back to cached version if download fails | ||
| _loader_tmp=$(mktemp 2>/dev/null || echo "$SCRIPT_DIR/lib/i18n_loader.sh.tmp") | ||
| if curl -fL -s -o "$_loader_tmp" "$_loader_url" 2>/dev/null && head -1 "$_loader_tmp" 2>/dev/null | grep -q "^#!/bin/bash"; then | ||
| mv "$_loader_tmp" "$SCRIPT_DIR/lib/i18n_loader.sh" | ||
| else | ||
| rm -f "$_loader_tmp" 2>/dev/null | ||
| if [ ! -f "$SCRIPT_DIR/lib/i18n_loader.sh" ]; then | ||
| echo "Warning: Could not download i18n_loader.sh and no cached version available" >&2 | ||
| fi | ||
| fi | ||
| I18N_DEFER_INIT=true | ||
| source "$SCRIPT_DIR/lib/i18n_loader.sh" |
There was a problem hiding this comment.
1. i18n_loader.sh sourced without guard 📘 Rule violation ⛯ Reliability
If the download fails and no cached i18n_loader.sh exists, the scripts still source it, causing hard-to-diagnose runtime failures. This is not graceful degradation and provides limited actionable recovery for users.
Agent Prompt
## Issue description
The scripts attempt to download `lib/i18n_loader.sh`, but if the download fails and there is no cached copy, they still run `source "$SCRIPT_DIR/lib/i18n_loader.sh"`. This can lead to immediate failures without a controlled fallback.
## Issue Context
This affects `install.sh`, `lxqt.sh`, and `mate.sh` and violates robust error-handling expectations.
## Fix Focus Areas
- install.sh[75-86]
- lxqt.sh[35-47]
- mate.sh[35-47]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| --desktop|-de) | ||
| DESKTOP_CHOICE=true | ||
| ONLY_GUM=false | ||
| shift | ||
| if [ -n "$1" ] && [[ "$1" =~ ^(xfce|lxqt|mate)$ ]]; then | ||
| DESKTOP_ENV="$1" | ||
| shift | ||
| fi | ||
| ;; |
There was a problem hiding this comment.
2. --desktop invalid value ignored 📘 Rule violation ✓ Correctness
When --desktop is provided with a missing/invalid value, the script silently continues instead of failing with a clear error. This can lead to unintended defaults or interactive prompts in non-interactive usage.
Agent Prompt
## Issue description
`install.sh --desktop` silently ignores invalid or missing values instead of rejecting them with an actionable error.
## Issue Context
This is a user-controlled external input and should be validated explicitly; silent fallback can break automation.
## Fix Focus Areas
- install.sh[225-233]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Read desktop configuration | ||
| CONFIG_FILE="$OHMYTERMUX_CONFIG_DIR/desktop.conf" | ||
| DESKTOP_SESSION="xfce" | ||
| [ -f "\$CONFIG_FILE" ] && source "\$CONFIG_FILE" |
There was a problem hiding this comment.
3. desktop.conf sourced unsafely 📘 Rule violation ⛨ Security
The generated scripts load desktop.conf using source, which executes its contents as shell code. Because this file is user-writable, it can be used for command injection when the start/stop scripts run.
Agent Prompt
## Issue description
`desktop.conf` is loaded with `source`, so its contents are executed as shell code, enabling command injection if the file is modified.
## Issue Context
`desktop.conf` is stored under the user's config directory and is user-writable; it should be treated as untrusted input.
## Fix Focus Areas
- install.sh[2119-2122]
- install.sh[2179-2182]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| install_desktop_scripts() { | ||
| local de_name="XFCE" | ||
| local msg_config_key="MSG_CONFIG_XFCE_SCRIPTS" | ||
|
|
||
| # Read desktop config | ||
| if [ -f "$OHMYTERMUX_CONFIG_DIR/desktop.conf" ]; then | ||
| source "$OHMYTERMUX_CONFIG_DIR/desktop.conf" | ||
| fi | ||
|
|
||
| case "${DESKTOP_SESSION:-xfce}" in | ||
| lxqt) | ||
| de_name="LXQt" | ||
| msg_config_key="MSG_CONFIG_LXQT_SCRIPTS" | ||
| ;; | ||
| esac | ||
|
|
||
| title_msg "$(t "$msg_config_key")" | ||
|
|
||
| # Installation of the start script | ||
| cat <<'EOF' > start | ||
| cat <<EOF > start | ||
| #!/bin/bash | ||
|
|
||
| # Read desktop configuration | ||
| DESKTOP_SESSION="${DESKTOP_SESSION:-xfce}" | ||
|
|
||
| # Activate PulseAudio on the network | ||
| pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 > /dev/null 2>&1 | ||
|
|
||
| XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | ||
| XDG_RUNTIME_DIR=\${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 virgl_test_server_android --angle-gl & > /dev/null 2>&1 | ||
|
|
||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | ||
| case "\$DESKTOP_SESSION" in | ||
| lxqt) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session startlxqt & > /dev/null 2>&1 | ||
| ;; | ||
| *) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | ||
| ;; | ||
| esac | ||
|
|
||
| # Set the audio server | ||
| export PULSE_SERVER=127.0.0.1 > /dev/null 2>&1 | ||
|
|
||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]fce4-screensaver' | awk '{print $2}') | ||
| kill "$process_id" > /dev/null 2>&1 | ||
|
|
||
| case "\$DESKTOP_SESSION" in | ||
| xfce|"") | ||
| process_id=\$(ps -aux | grep '[x]fce4-screensaver' | awk '{print \$2}') | ||
| [ -n "\$process_id" ] && kill "\$process_id" > /dev/null 2>&1 | ||
| ;; | ||
| esac |
There was a problem hiding this comment.
4. Mate start/stop broken 🐞 Bug ✓ Correctness
install.sh always installs its own start/kill scripts (when PROOT is false), but those scripts only support XFCE/LXQt; with DESKTOP_SESSION=mate they fall back to XFCE, so MATE installs won’t start/stop correctly.
Agent Prompt
### Issue description
`install.sh` generates and installs `start` and `kill_termux_x11` scripts that only handle XFCE/LXQt. When the user selects MATE, these scripts still get installed and will start/stop the wrong session.
### Issue Context
The PR goal is DE-aware start/stop based on `desktop.conf` (and fallbacks), but `install_desktop_scripts()` currently does not implement MATE.
### Fix Focus Areas
- install.sh[2115-2227]
- Extend the DE selection logic to include `mate`
- In the generated `start` script: add a `mate)` branch that launches `mate-session`
- In the generated `kill_termux_x11`: add a `mate)` branch that finds/kills `mate-session` (and likely `marco`) and uses `de_name="MATE"`
- Prefer runtime reading of `desktop.conf` instead of embedding a fixed DESKTOP_SESSION at generation-time (consider using a quoted heredoc and explicit `source "$HOME/.config/OhMyTermux/desktop.conf"` at runtime)
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Start Termux-X11 with XFCE or LXQt depending on the installed DE | ||
| #------------------------------------------------------------------------------ | ||
| cat <<'EOF' > start | ||
| #!/bin/bash | ||
|
|
||
| # Enable PulseAudio on the network | ||
| pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 > /dev/null 2>&1 | ||
|
|
||
| XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | ||
| # --------------------------------------------------------------------------- | ||
| # OhMyTermux - start | ||
| # Démarre Termux-X11 avec XFCE ou LXQt selon l'environnement installé | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # NETTOYAGE DU SERVEUR X EXISTANT | ||
| # --------------------------------------------------------------------------- | ||
| pkill -f "termux.x11" > /dev/null 2>&1 | ||
| pkill -f "Xwayland" > /dev/null 2>&1 | ||
| pkill -f "xfce4-session" > /dev/null 2>&1 | ||
| pkill -f "lxqt-session" > /dev/null 2>&1 | ||
| pkill -f "startlxqt" > /dev/null 2>&1 | ||
| pkill -f "openbox" > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | ||
| sleep 1 | ||
| # Supprimer les verrous X11 résiduels | ||
| rm -f /tmp/.X1-lock > /dev/null 2>&1 | ||
| rm -f /tmp/.X11-unix/X1 > /dev/null 2>&1 | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # DÉTECTER L'ENVIRONNEMENT DE BUREAU | ||
| # --------------------------------------------------------------------------- | ||
| DESKTOP_SESSION="unknown" | ||
| OHMYTERMUX_CONFIG="$HOME/.config/OhMyTermux" | ||
|
|
||
| # 1. Lire depuis desktop.conf (priorité haute - écrit par install.sh / lxqt.sh) | ||
| if [ -f "$OHMYTERMUX_CONFIG/desktop.conf" ]; then | ||
| source "$OHMYTERMUX_CONFIG/desktop.conf" | ||
| fi | ||
|
|
||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 virgl_test_server_android --angle-gl & > /dev/null 2>&1 | ||
| # 2. Fallback : lire depuis theme_config.tmp (écrit par lxqt.sh) | ||
| if [ "$DESKTOP_SESSION" = "unknown" ] || [ -z "$DESKTOP_SESSION" ]; then | ||
| if [ -f "$OHMYTERMUX_CONFIG/theme_config.tmp" ]; then | ||
| DETECTED=$(grep '^DESKTOP_ENV=' "$OHMYTERMUX_CONFIG/theme_config.tmp" | cut -d'=' -f2 | tr -d '"') | ||
| [ -n "$DETECTED" ] && DESKTOP_SESSION="$DETECTED" | ||
| fi | ||
| fi | ||
|
|
||
| #GALLIUM_DRIVER=virpipe MESA_GL_VERSION_OVERRIDE=4.0 program | ||
| # 3. Fallback final : détecter par la présence des binaires | ||
| if [ "$DESKTOP_SESSION" = "unknown" ] || [ -z "$DESKTOP_SESSION" ]; then | ||
| if command -v startlxqt > /dev/null 2>&1 || command -v lxqt-session > /dev/null 2>&1; then | ||
| DESKTOP_SESSION="lxqt" | ||
| elif command -v xfce4-session > /dev/null 2>&1; then | ||
| DESKTOP_SESSION="xfce" | ||
| else | ||
| echo "[start] Aucun environnement de bureau détecté (xfce4-session ou startlxqt)." | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| #MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform program | ||
| # --------------------------------------------------------------------------- | ||
| # PULSEAUDIO | ||
| # --------------------------------------------------------------------------- | ||
| pulseaudio --start \ | ||
| --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" \ | ||
| --exit-idle-time=-1 > /dev/null 2>&1 | ||
|
|
||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | ||
| export PULSE_SERVER=127.0.0.1 | ||
|
|
||
| # Set the audio server | ||
| export PULSE_SERVER=127.0.0.1 > /dev/null 2>&1 | ||
| # --------------------------------------------------------------------------- | ||
| # DÉMARRER TERMUX-X11 | ||
| # --------------------------------------------------------------------------- | ||
| XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :1.0 &> /dev/null & | ||
| sleep 1 | ||
|
|
||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]fce4-screensaver' | awk '{print $2}') | ||
| kill "$process_id" > /dev/null 2>&1 | ||
| # Ouvrir l'activité Termux-X11 | ||
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # VIRGL (rendu GPU) | ||
| # --------------------------------------------------------------------------- | ||
| GPU_VENDOR="unknown" | ||
| if [ -f "$OHMYTERMUX_CONFIG/gpu_vendor" ]; then | ||
| GPU_VENDOR=$(cat "$OHMYTERMUX_CONFIG/gpu_vendor") | ||
| fi | ||
|
|
||
| if [ "$GPU_VENDOR" = "adreno" ]; then | ||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 \ | ||
| virgl_test_server_android --angle-gl &> /dev/null & | ||
| else | ||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 \ | ||
| virgl_test_server_android &> /dev/null & | ||
| fi | ||
| sleep 1 | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # DÉMARRER LA SESSION DE BUREAU | ||
| # --------------------------------------------------------------------------- | ||
| export DISPLAY=:1.0 | ||
| export GALLIUM_DRIVER=virpipe | ||
|
|
||
| case "$DESKTOP_SESSION" in | ||
| lxqt) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe \ | ||
| dbus-launch --exit-with-session startlxqt &> /dev/null & | ||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]screensaver' | awk '{print $2}') | ||
| [ -n "$process_id" ] && kill "$process_id" > /dev/null 2>&1 | ||
| ;; | ||
| xfce) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe \ | ||
| dbus-launch --exit-with-session xfce4-session &> /dev/null & | ||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]fce4-screensaver' | awk '{print $2}') | ||
| [ -n "$process_id" ] && kill "$process_id" > /dev/null 2>&1 | ||
| ;; | ||
| *) | ||
| echo "[start] Environnement de bureau non reconnu : $DESKTOP_SESSION" | ||
| echo " Valeurs acceptées : xfce, lxqt" | ||
| exit 1 | ||
| ;; | ||
| esac |
There was a problem hiding this comment.
5. Proot path lacks mate 🐞 Bug ✓ Correctness
The start/stop scripts installed via utils.sh (used in PROOT flows) and the tracked src/start script only recognize xfce/lxqt. In MATE+PROOT installs, utils.sh can overwrite mate.sh’s more complete scripts, leaving no way to start/stop MATE properly.
Agent Prompt
### Issue description
In PROOT installs, the `start`/`kill_termux_x11` scripts produced by `utils.sh` don’t support MATE, so MATE+PROOT users can’t start/stop the correct desktop session.
### Issue Context
The PR adds MATE, but only some script installation paths were updated.
### Fix Focus Areas
- utils.sh[234-355]
- Add a `mate)` branch to launch `mate-session`
- Update accepted values text to include mate
- utils.sh[362-412]
- Add detection/kill of `mate-session` and window manager `marco` (similar to mate.sh)
- src/start[1-122]
- If this file is distributed/used as a template, add MATE support consistently
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Actionable comments posted: 13
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
utils.sh (1)
366-425:⚠️ Potential issue | 🟠 MajorStop script in utils.sh also missing MATE process handling.
The
kill_termux_x11script generated here killsxfce4-session,lxqt-session,openbox, andvirgl_test_server, but does not handlemate-sessionormarco. The dynamic message check on line 408 also only checks for$lxqt_pidbut not any MATE process ID.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@utils.sh` around lines 366 - 425, The kill_termux_x11 script is missing MATE session handling; add pgrep assignments for mate-session and marco (e.g., mate_pid and marco_pid) alongside the existing termux_x11_pid/xfce_pid/lxqt_pid/openbox_pid/virgl_pid, add conditional kill -9 blocks for $mate_pid and $marco_pid (silencing errors), and include those variables in the final dynamic-message test (the if that currently checks termux_x11_pid, xfce_pid, lxqt_pid) so the success/failure zenity message reflects MATE sessions as well.i18n/messages/en.sh (1)
249-249:⚠️ Potential issue | 🟡 MinorPre-existing: French text in the English message file.
MSG_INSTALL_POWERLEVEL10K_PROGRESScontains"Installation de PowerLevel10k"(French) instead of"Installation of PowerLevel10k". This is an existing defect in a file being actively modified — good moment to fix it.🐛 Proposed fix
-MSG_INSTALL_POWERLEVEL10K_PROGRESS="Installation de PowerLevel10k" +MSG_INSTALL_POWERLEVEL10K_PROGRESS="Installation of PowerLevel10k"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@i18n/messages/en.sh` at line 249, Replace the French text in the English messages constant MSG_INSTALL_POWERLEVEL10K_PROGRESS with the correct English phrase; locate the MSG_INSTALL_POWERLEVEL10K_PROGRESS definition and change its value from "Installation de PowerLevel10k" to "Installation of PowerLevel10k" so the English locale file contains the proper English message.
🧹 Nitpick comments (5)
src/start (1)
30-32: Sourcingdesktop.confexecutes arbitrary shell code.
source "$OHMYTERMUX_CONFIG/desktop.conf"will execute any code in that file, not just readDESKTOP_SESSION. Since it's in the user's home directory, risk is low, but a safer alternative would be togrepfor the specific variable as done withtheme_config.tmpin the next fallback block.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/start` around lines 30 - 32, The snippet sources the user file desktop.conf (source "$OHMYTERMUX_CONFIG/desktop.conf"), which can execute arbitrary code; instead, stop sourcing and extract only the DESKTOP_SESSION value like the theme_config.tmp fallback does: read or grep for the DESKTOP_SESSION key within "$OHMYTERMUX_CONFIG/desktop.conf" (and validate/trim quotes) and export or assign it to DESKTOP_SESSION if found, avoiding executing the file contents; reference OHMYTERMUX_CONFIG, desktop.conf, DESKTOP_SESSION and the existing theme_config.tmp extraction approach when implementing the change.install.sh (1)
225-233:--desktopwithout a valid argument silently leavesDESKTOP_ENVempty.If
--desktopis followed by an unrecognized value (e.g.,--desktop kde), the value is not consumed andDESKTOP_ENVstays empty, which later triggers the interactive selection. This is acceptable behavior but may confuse CLI users who expect an error. Consider adding an explicit warning for invalid desktop values.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@install.sh` around lines 225 - 233, The --desktop|-de case currently only sets DESKTOP_ENV when the next token matches ^(xfce|lxqt|mate)$ and otherwise leaves the unrecognized value unconsumed causing surprising interactive fallback; update the case block to detect when a next argument exists but does not match the allowed set, print a concise warning to stderr mentioning the invalid desktop value, and shift to consume that token (so it isn't treated as a separate flag), while keeping DESKTOP_CHOICE=true and ONLY_GUM=false; reference the --desktop|-de case and the DESKTOP_ENV variable when implementing this change.mate.sh (1)
342-343: Icons installed unconditionally, inconsistent with LXQt's gated approach.
install_icons()is called for all MATE versions (line 343), but inlxqt.sh(line 440-442) it's gated behindif [ "$LXQT_VERSION" = "recommended" ]. This means minimal MATE installs get Papirus icons while minimal LXQt installs don't. If this is intentional, consider adding a comment; otherwise, gate it similarly.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mate.sh` around lines 342 - 343, The install_icons() call is unconditional; mirror LXQt's gating by wrapping or guarding the install_icons invocation with the same version check used in lxqt.sh (e.g., check a MATE_VERSION variable like if [ "$MATE_VERSION" = "recommended" ] or reuse the existing LXQT-style conditional) so icons are only installed for the "recommended" MATE flavor (or add a clarifying comment if unconditional behavior is intentional); update the call to reference the install_icons() function and the version variable used elsewhere in the script.i18n/messages/fr.sh (1)
1-11: Suppress pervasive SC2034 false positives with a file-level directive.All variables in this definitions file are consumed externally via
source. ShellCheck flags every one of them (80+ warnings). A single disable directive at the top of the file is the idiomatic fix.♻️ Suggested directive placement
#!/bin/bash +# shellcheck disable=SC2034 # Variables are sourced/used externally # =============================================================================🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@i18n/messages/fr.sh` around lines 1 - 11, Add a file-level ShellCheck disable for SC2034 to suppress the false positives caused by variables (e.g., MSG_I18N_VERSION and the other exported message variables) that are only referenced when the file is sourced; place the directive immediately after the shebang so ShellCheck ignores unused-variable warnings for this whole file while keeping the rest of the file unchanged.i18n/messages/en.sh (1)
1-11: Same SC2034 noise — add a file-level# shellcheck disable=SC2034.Same as
fr.sh: all variables here are sourced externally; a single top-level directive eliminates ~80 false-positive warnings.♻️ Suggested directive placement
#!/bin/bash +# shellcheck disable=SC2034 # Variables are sourced/used externally # =============================================================================🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@i18n/messages/en.sh` around lines 1 - 11, The file emits ShellCheck SC2034 false positives because exported message variables like MSG_I18N_VERSION are only referenced when the file is sourced; add a top-level ShellCheck directive (e.g., a file-level "# shellcheck disable=SC2034" comment) near the top of i18n/messages/en.sh to suppress these warnings for the whole file so variables such as MSG_I18N_VERSION are not flagged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@i18n/messages/en.sh`:
- Line 31: Update the MSG_OPT_DESKTOP string so its help text lists MATE as a
valid option; locate the MSG_OPT_DESKTOP variable definition and change the
parenthetical from "(xfce or lxqt)" to something like "(xfce, lxqt or mate)" so
the message accurately reflects all supported desktop environment choices.
In `@i18n/messages/fr.sh`:
- Around line 394-397: Update the hard-coded "XFCE" strings for
MSG_KILL_X11_GET_PIDS, MSG_KILL_X11_SESSIONS_CLOSED, and MSG_KILL_X11_NOT_FOUND
to a DE-agnostic term (e.g., "DE" or "desktop") so messages are correct for
MATE/LXQt; locate these symbols in the file and replace the literal "XFCE" with
the chosen neutral word in their French translations, keeping surrounding
phrasing and punctuation intact and matching existing capitalization/grammar.
- Line 31: Update the French help string for MSG_OPT_DESKTOP to include the
newly supported "mate" desktop; locate the MSG_OPT_DESKTOP definition and change
its value so the parenthetical lists all three options (xfce, lxqt et mate) in
French, e.g. replacing "(xfce ou lxqt)" with a phrase that mentions mate as
well.
In `@install.sh`:
- Around line 2124-2130: The branch handling DESKTOP_SESSION == "lxqt" assigns
de_name="LXQt" but de_name is never used; remove the unused assignment or use it
consistently. Edit the case block that matches lxqt to either delete the
de_name="LXQt" line or replace references to msg_config_key elsewhere with
de_name where appropriate (or set msg_config_key from de_name), ensuring only
the necessary variable (msg_config_key or de_name) remains and no unused
variables are left.
- Around line 2482-2489: The desktop script generation is inconsistent:
install_desktop_scripts is skipped when PROOT_CHOICE=true causing install_proot
→ install_utils (utils.sh) to generate scripts that lack full MATE support and
may overwrite later; fix by centralizing script generation into a single helper
(e.g., generate_desktop_scripts) that implements full support for all three DEs
(including MATE) and invoke that helper from both the non-PROOT path (after
install_desktop) and the PROOT path (from install_proot/install_utils) — or
alternatively make install_utils call install_desktop_scripts (or source the
same logic) after install_proot to ensure the canonical, MATE-capable scripts
are produced and not overwritten.
- Around line 2112-2170: install_desktop_scripts currently only special-cases
lxqt and defaults everything else to XFCE, so DESKTOP_SESSION=mate will launch
xfce4-session and kill xfce-related processes; update install_desktop_scripts to
add a mate branch: set de_name and msg_config_key for "mate", and in the
generated start script's case on "$DESKTOP_SESSION" add a "mate)" branch that
starts mate-session (env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch
--exit-with-session mate-session & ...) instead of the default xfce4-session;
likewise update the stop/cleanup script case that currently looks for
xfce4-screensaver/xfce4-session to handle "mate" (use mate-session and the
proper mate process names to kill) so MATE users launch and stop mate sessions
correctly.
In `@lib/i18n_loader.sh`:
- Around line 83-91: The _check_and_refresh_messages function currently writes
downloads directly to "$SCRIPT_DIR/i18n/messages/${_lang}.sh" and silences
failures; change it to download each file to a secure temporary file (e.g.,
"${SCRIPT_DIR}/i18n/messages/${_lang}.sh.tmp" or mktemp), verify the curl exit
status and file integrity (non-empty or valid shell syntax), then atomically mv
the temp file to "${_lang}.sh"; remove the trailing "|| true" so failures are
detected and ensure mkdir -p still runs before using the temp path; keep
references to SCRIPT_DIR, _base_url, and the for _lang in en fr loop to locate
where to implement this.
In `@mate.sh`:
- Around line 495-545: The stop script generated for kill_termux_x11 lacks the
Termux app termination block; update the here-doc that creates
"$PREFIX/bin/kill_termux_x11" to append the same Termux termination logic used
in lxqt.sh/utils.sh/install_desktop_scripts(): after the zenity dialogs check
termux_info/termux_x11_pid (variable termux_x11_pid) and call termux-info/kill
on the Termux app PID (e.g., kill "$pid" or kill -9 "$termux_x11_pid") if
present, ensuring the Termux app process is terminated just like in the other
stop scripts.
- Around line 176-178: The local variable version in configure_mate() is unused;
either remove the version parameter from configure_mate and its local assignment
to stop the false positive, or use it like configure_lxqt to apply different
Mate configuration for "minimal" vs "recommended" (e.g., conditional
Kvantum/theme steps) so the parameter is meaningful; update the function
signature and all callers if you remove the parameter, or add a version-based
conditional inside configure_mate() referencing the existing local version="$1"
to drive differing configuration paths.
In `@src/start`:
- Line 51: Replace the hardcoded French echo messages with the project's i18n
system (or at minimum English strings) so user-facing text is consistent; locate
the echo statements that print "Aucun environnement de bureau détecté
(xfce4-session ou startlxqt).", "Lancement de LXQt...", "Environnement de bureau
non reconnu" in the start script and the embedded start scripts in utils.sh (the
block around the start logic), and change them to call the i18n helper (e.g.,
i18n.t("desktop.no_environment") or similar) or replace the literal French text
with equivalent English messages; ensure the same change is applied to the other
echoed lines referenced (around the other occurrences) and keep existing
logging/exit behavior intact.
- Around line 3-6: The start script lacks MATE support: add cleanup pkill
targets for "mate-session" and "marco" where other desktops are cleaned up,
extend the desktop-binary fallback detection to check for MATE binaries (e.g.,
"mate-session" and "marco") alongside xfce/lxqt, and add a MATE branch in the
session handler to launch mate-session (mirroring how XFCE and LXQt cases are
handled); ensure the same symbols referenced in the PR (_update_start_script(),
mate-session, marco) are used so the installed/inline start script behaves
identically whether overwritten or not.
In `@utils.sh`:
- Around line 236-354: The generated start/stop scripts in utils.sh and
install_desktop_scripts() lack MATE support and overwrite correct mate.sh
versions; update both places to add MATE handling by: (1) adding pkill entries
for "mate-session" and "marco" in the start script cleanup, (2) adding MATE
detection in the desktop detection fallback (check command -v mate-session/marco
and set DESKTOP_SESSION="mate"), (3) adding a mate case in the session launch
case block that launches mate-session (with same DISPLAY/GALLIUM env +
dbus-launch pattern) and kills any mate screensaver processes, and (4) in the
stop script add mate_pid and marco_pid variables and include them in the
kill/cleanup logic so stop properly terminates mate-session and marco; apply
these same edits inside install_desktop_scripts() so neither path overwrites a
complete MATE-capable start/stop script.
In `@xfce.sh`:
- Around line 37-47: The current block attempts to source
"$SCRIPT_DIR/lib/i18n_loader.sh" unconditionally (see the use of _loader_tmp,
_loader_url and the final source line), which will crash if the download failed
and no cached file exists; change the flow to only source the file when it
actually exists (e.g., test -f "$SCRIPT_DIR/lib/i18n_loader.sh") and otherwise
handle the error path by exiting non-zero or skipping functionality that depends
on the loader; apply the same guard/fix to the identical blocks in proot.sh,
utils.sh, lxqt.sh, mate.sh and install.sh so they do not attempt to source a
missing i18n_loader.sh.
---
Outside diff comments:
In `@i18n/messages/en.sh`:
- Line 249: Replace the French text in the English messages constant
MSG_INSTALL_POWERLEVEL10K_PROGRESS with the correct English phrase; locate the
MSG_INSTALL_POWERLEVEL10K_PROGRESS definition and change its value from
"Installation de PowerLevel10k" to "Installation of PowerLevel10k" so the
English locale file contains the proper English message.
In `@utils.sh`:
- Around line 366-425: The kill_termux_x11 script is missing MATE session
handling; add pgrep assignments for mate-session and marco (e.g., mate_pid and
marco_pid) alongside the existing
termux_x11_pid/xfce_pid/lxqt_pid/openbox_pid/virgl_pid, add conditional kill -9
blocks for $mate_pid and $marco_pid (silencing errors), and include those
variables in the final dynamic-message test (the if that currently checks
termux_x11_pid, xfce_pid, lxqt_pid) so the success/failure zenity message
reflects MATE sessions as well.
---
Nitpick comments:
In `@i18n/messages/en.sh`:
- Around line 1-11: The file emits ShellCheck SC2034 false positives because
exported message variables like MSG_I18N_VERSION are only referenced when the
file is sourced; add a top-level ShellCheck directive (e.g., a file-level "#
shellcheck disable=SC2034" comment) near the top of i18n/messages/en.sh to
suppress these warnings for the whole file so variables such as MSG_I18N_VERSION
are not flagged.
In `@i18n/messages/fr.sh`:
- Around line 1-11: Add a file-level ShellCheck disable for SC2034 to suppress
the false positives caused by variables (e.g., MSG_I18N_VERSION and the other
exported message variables) that are only referenced when the file is sourced;
place the directive immediately after the shebang so ShellCheck ignores
unused-variable warnings for this whole file while keeping the rest of the file
unchanged.
In `@install.sh`:
- Around line 225-233: The --desktop|-de case currently only sets DESKTOP_ENV
when the next token matches ^(xfce|lxqt|mate)$ and otherwise leaves the
unrecognized value unconsumed causing surprising interactive fallback; update
the case block to detect when a next argument exists but does not match the
allowed set, print a concise warning to stderr mentioning the invalid desktop
value, and shift to consume that token (so it isn't treated as a separate flag),
while keeping DESKTOP_CHOICE=true and ONLY_GUM=false; reference the
--desktop|-de case and the DESKTOP_ENV variable when implementing this change.
In `@mate.sh`:
- Around line 342-343: The install_icons() call is unconditional; mirror LXQt's
gating by wrapping or guarding the install_icons invocation with the same
version check used in lxqt.sh (e.g., check a MATE_VERSION variable like if [
"$MATE_VERSION" = "recommended" ] or reuse the existing LXQT-style conditional)
so icons are only installed for the "recommended" MATE flavor (or add a
clarifying comment if unconditional behavior is intentional); update the call to
reference the install_icons() function and the version variable used elsewhere
in the script.
In `@src/start`:
- Around line 30-32: The snippet sources the user file desktop.conf (source
"$OHMYTERMUX_CONFIG/desktop.conf"), which can execute arbitrary code; instead,
stop sourcing and extract only the DESKTOP_SESSION value like the
theme_config.tmp fallback does: read or grep for the DESKTOP_SESSION key within
"$OHMYTERMUX_CONFIG/desktop.conf" (and validate/trim quotes) and export or
assign it to DESKTOP_SESSION if found, avoiding executing the file contents;
reference OHMYTERMUX_CONFIG, desktop.conf, DESKTOP_SESSION and the existing
theme_config.tmp extraction approach when implementing the change.
| MSG_OPT_PACKAGE="Install packages module" | ||
| MSG_OPT_FONT="Install font module" | ||
| MSG_OPT_XFCE="Install XFCE module" | ||
| MSG_OPT_DESKTOP="Install desktop environment module (xfce or lxqt)" |
There was a problem hiding this comment.
MSG_OPT_DESKTOP description omits mate.
Same issue as fr.sh — the help text only mentions (xfce or lxqt) despite MATE being a valid third option.
🐛 Proposed fix
-MSG_OPT_DESKTOP="Install desktop environment module (xfce or lxqt)"
+MSG_OPT_DESKTOP="Install desktop environment module (xfce, lxqt, or mate)"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| MSG_OPT_DESKTOP="Install desktop environment module (xfce or lxqt)" | |
| MSG_OPT_DESKTOP="Install desktop environment module (xfce, lxqt, or mate)" |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 31-31: MSG_OPT_DESKTOP appears unused. Verify use (or export if used externally).
(SC2034)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@i18n/messages/en.sh` at line 31, Update the MSG_OPT_DESKTOP string so its
help text lists MATE as a valid option; locate the MSG_OPT_DESKTOP variable
definition and change the parenthetical from "(xfce or lxqt)" to something like
"(xfce, lxqt or mate)" so the message accurately reflects all supported desktop
environment choices.
| MSG_OPT_PACKAGE="Module d'installation des packages" | ||
| MSG_OPT_FONT="Module d'installation de la police" | ||
| MSG_OPT_XFCE="Module d'installation de XFCE" | ||
| MSG_OPT_DESKTOP="Module d'installation de l'environnement de bureau (xfce ou lxqt)" |
There was a problem hiding this comment.
MSG_OPT_DESKTOP description omits mate.
The PR adds MATE as a third supported desktop environment, but the help string only lists (xfce ou lxqt).
🐛 Proposed fix
-MSG_OPT_DESKTOP="Module d'installation de l'environnement de bureau (xfce ou lxqt)"
+MSG_OPT_DESKTOP="Module d'installation de l'environnement de bureau (xfce, lxqt ou mate)"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| MSG_OPT_DESKTOP="Module d'installation de l'environnement de bureau (xfce ou lxqt)" | |
| MSG_OPT_DESKTOP="Module d'installation de l'environnement de bureau (xfce, lxqt ou mate)" |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 31-31: MSG_OPT_DESKTOP appears unused. Verify use (or export if used externally).
(SC2034)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@i18n/messages/fr.sh` at line 31, Update the French help string for
MSG_OPT_DESKTOP to include the newly supported "mate" desktop; locate the
MSG_OPT_DESKTOP definition and change its value so the parenthetical lists all
three options (xfce, lxqt et mate) in French, e.g. replacing "(xfce ou lxqt)"
with a phrase that mentions mate as well.
| MSG_UTILS_COMMENT_CP2MENU="Lancer des programmes à partir du menu de bureau au lieu du terminal" | ||
| MSG_UTILS_COMMENT_APP_INSTALLER="Installer des apps indisponibles dans les dépôts Termux / Debian proot" | ||
| MSG_UTILS_COMMENT_START_SCRIPT="Démarrer Termux-X11 et XFCE" | ||
| MSG_UTILS_COMMENT_STOP_SCRIPT="Stopper Termux-X11 et XFCE" | ||
| MSG_UTILS_COMMENT_START_SCRIPT="Démarrer la session de bureau Termux-X11" | ||
| MSG_UTILS_COMMENT_STOP_SCRIPT="Arrêter la session de bureau Termux-X11" |
There was a problem hiding this comment.
Existing MSG_KILL_X11_* strings still hard-code "XFCE" — now user-visible for MATE/LXQt sessions.
Lines 425–429 (MSG_KILL_X11_GET_PIDS, MSG_KILL_X11_SESSIONS_CLOSED, MSG_KILL_X11_NOT_FOUND) still contain "XFCE" verbatim. The PR makes kill_termux_x11 DE-aware, so these messages will be shown to MATE and LXQt users with inaccurate text. Consider generalizing them (e.g., replace "XFCE" with "DE" or "desktop").
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 394-394: MSG_UTILS_COMMENT_CP2MENU appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 395-395: MSG_UTILS_COMMENT_APP_INSTALLER appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 396-396: MSG_UTILS_COMMENT_START_SCRIPT appears unused. Verify use (or export if used externally).
(SC2034)
[warning] 397-397: MSG_UTILS_COMMENT_STOP_SCRIPT appears unused. Verify use (or export if used externally).
(SC2034)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@i18n/messages/fr.sh` around lines 394 - 397, Update the hard-coded "XFCE"
strings for MSG_KILL_X11_GET_PIDS, MSG_KILL_X11_SESSIONS_CLOSED, and
MSG_KILL_X11_NOT_FOUND to a DE-agnostic term (e.g., "DE" or "desktop") so
messages are correct for MATE/LXQt; locate these symbols in the file and replace
the literal "XFCE" with the chosen neutral word in their French translations,
keeping surrounding phrasing and punctuation intact and matching existing
capitalization/grammar.
| #------------------------------------------------------------------------------ | ||
| # INSTALLATION OF THE XFCE SCRIPTS | ||
| # INSTALLATION OF THE DESKTOP SCRIPTS | ||
| #------------------------------------------------------------------------------ | ||
| install_xfce_scripts() { | ||
| title_msg "$(t MSG_CONFIG_XFCE_SCRIPTS)" | ||
| install_desktop_scripts() { | ||
| local de_name="XFCE" | ||
| local msg_config_key="MSG_CONFIG_XFCE_SCRIPTS" | ||
|
|
||
| # Read desktop config | ||
| if [ -f "$OHMYTERMUX_CONFIG_DIR/desktop.conf" ]; then | ||
| source "$OHMYTERMUX_CONFIG_DIR/desktop.conf" | ||
| fi | ||
|
|
||
| case "${DESKTOP_SESSION:-xfce}" in | ||
| lxqt) | ||
| de_name="LXQt" | ||
| msg_config_key="MSG_CONFIG_LXQT_SCRIPTS" | ||
| ;; | ||
| esac | ||
|
|
||
| title_msg "$(t "$msg_config_key")" | ||
|
|
||
| # Installation of the start script | ||
| cat <<'EOF' > start | ||
| cat <<EOF > start | ||
| #!/bin/bash | ||
|
|
||
| # Read desktop configuration | ||
| DESKTOP_SESSION="${DESKTOP_SESSION:-xfce}" | ||
|
|
||
| # Activate PulseAudio on the network | ||
| pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 > /dev/null 2>&1 | ||
|
|
||
| XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | ||
| XDG_RUNTIME_DIR=\${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 virgl_test_server_android --angle-gl & > /dev/null 2>&1 | ||
|
|
||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | ||
| case "\$DESKTOP_SESSION" in | ||
| lxqt) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session startlxqt & > /dev/null 2>&1 | ||
| ;; | ||
| *) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | ||
| ;; | ||
| esac | ||
|
|
||
| # Set the audio server | ||
| export PULSE_SERVER=127.0.0.1 > /dev/null 2>&1 | ||
|
|
||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]fce4-screensaver' | awk '{print $2}') | ||
| kill "$process_id" > /dev/null 2>&1 | ||
|
|
||
| case "\$DESKTOP_SESSION" in | ||
| xfce|"") | ||
| process_id=\$(ps -aux | grep '[x]fce4-screensaver' | awk '{print \$2}') | ||
| [ -n "\$process_id" ] && kill "\$process_id" > /dev/null 2>&1 | ||
| ;; | ||
| esac |
There was a problem hiding this comment.
install_desktop_scripts doesn't handle MATE — will launch XFCE instead.
The generated start script (lines 2134-2171) uses a case with only lxqt and * (default). If DESKTOP_SESSION=mate, the * wildcard matches and launches xfce4-session instead of mate-session. The stop script (lines 2176-2227) has the same issue — it would try to kill xfce4-session for MATE users.
Similarly, install_desktop_scripts only maps lxqt to the LXQt config key (line 2124-2129) with no mate case.
Proposed fix for the start script case block
case "\$DESKTOP_SESSION" in
lxqt)
env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session startlxqt & > /dev/null 2>&1
;;
+ mate)
+ env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session mate-session & > /dev/null 2>&1
+ ;;
*)
env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1
;;
esacAnd for the stop script:
case "\$DESKTOP_SESSION" in
lxqt)
de_pid=\$(pgrep -f "lxqt-session")
de_name="LXQt"
;;
+ mate)
+ de_pid=\$(pgrep -f "mate-session")
+ de_name="MATE"
+ ;;
*)
de_pid=\$(pgrep -f "xfce4-session")
de_name="XFCE"
;;
esac📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| #------------------------------------------------------------------------------ | |
| # INSTALLATION OF THE XFCE SCRIPTS | |
| # INSTALLATION OF THE DESKTOP SCRIPTS | |
| #------------------------------------------------------------------------------ | |
| install_xfce_scripts() { | |
| title_msg "$(t MSG_CONFIG_XFCE_SCRIPTS)" | |
| install_desktop_scripts() { | |
| local de_name="XFCE" | |
| local msg_config_key="MSG_CONFIG_XFCE_SCRIPTS" | |
| # Read desktop config | |
| if [ -f "$OHMYTERMUX_CONFIG_DIR/desktop.conf" ]; then | |
| source "$OHMYTERMUX_CONFIG_DIR/desktop.conf" | |
| fi | |
| case "${DESKTOP_SESSION:-xfce}" in | |
| lxqt) | |
| de_name="LXQt" | |
| msg_config_key="MSG_CONFIG_LXQT_SCRIPTS" | |
| ;; | |
| esac | |
| title_msg "$(t "$msg_config_key")" | |
| # Installation of the start script | |
| cat <<'EOF' > start | |
| cat <<EOF > start | |
| #!/bin/bash | |
| # Read desktop configuration | |
| DESKTOP_SESSION="${DESKTOP_SESSION:-xfce}" | |
| # Activate PulseAudio on the network | |
| pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 > /dev/null 2>&1 | |
| XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | |
| XDG_RUNTIME_DIR=\${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | |
| sleep 1 | |
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | |
| sleep 1 | |
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 virgl_test_server_android --angle-gl & > /dev/null 2>&1 | |
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | |
| case "\$DESKTOP_SESSION" in | |
| lxqt) | |
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session startlxqt & > /dev/null 2>&1 | |
| ;; | |
| *) | |
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | |
| ;; | |
| esac | |
| # Set the audio server | |
| export PULSE_SERVER=127.0.0.1 > /dev/null 2>&1 | |
| sleep 5 | |
| process_id=$(ps -aux | grep '[x]fce4-screensaver' | awk '{print $2}') | |
| kill "$process_id" > /dev/null 2>&1 | |
| case "\$DESKTOP_SESSION" in | |
| xfce|"") | |
| process_id=\$(ps -aux | grep '[x]fce4-screensaver' | awk '{print \$2}') | |
| [ -n "\$process_id" ] && kill "\$process_id" > /dev/null 2>&1 | |
| ;; | |
| esac | |
| `#------------------------------------------------------------------------------` | |
| # INSTALLATION OF THE DESKTOP SCRIPTS | |
| `#------------------------------------------------------------------------------` | |
| install_desktop_scripts() { | |
| local de_name="XFCE" | |
| local msg_config_key="MSG_CONFIG_XFCE_SCRIPTS" | |
| # Read desktop config | |
| if [ -f "$OHMYTERMUX_CONFIG_DIR/desktop.conf" ]; then | |
| source "$OHMYTERMUX_CONFIG_DIR/desktop.conf" | |
| fi | |
| case "${DESKTOP_SESSION:-xfce}" in | |
| lxqt) | |
| de_name="LXQt" | |
| msg_config_key="MSG_CONFIG_LXQT_SCRIPTS" | |
| ;; | |
| esac | |
| title_msg "$(t "$msg_config_key")" | |
| # Installation of the start script | |
| cat <<EOF > start | |
| #!/bin/bash | |
| # Read desktop configuration | |
| DESKTOP_SESSION="${DESKTOP_SESSION:-xfce}" | |
| # Activate PulseAudio on the network | |
| pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 > /dev/null 2>&1 | |
| XDG_RUNTIME_DIR=\${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | |
| sleep 1 | |
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | |
| sleep 1 | |
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 virgl_test_server_android --angle-gl & > /dev/null 2>&1 | |
| case "\$DESKTOP_SESSION" in | |
| lxqt) | |
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session startlxqt & > /dev/null 2>&1 | |
| ;; | |
| mate) | |
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session mate-session & > /dev/null 2>&1 | |
| ;; | |
| *) | |
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | |
| ;; | |
| esac | |
| # Set the audio server | |
| export PULSE_SERVER=127.0.0.1 > /dev/null 2>&1 | |
| sleep 5 | |
| case "\$DESKTOP_SESSION" in | |
| xfce|"") | |
| process_id=\$(ps -aux | grep '[x]fce4-screensaver' | awk '{print \$2}') | |
| [ -n "\$process_id" ] && kill "\$process_id" > /dev/null 2>&1 | |
| ;; | |
| esac |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 2126-2126: de_name appears unused. Verify use (or export if used externally).
(SC2034)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@install.sh` around lines 2112 - 2170, install_desktop_scripts currently only
special-cases lxqt and defaults everything else to XFCE, so DESKTOP_SESSION=mate
will launch xfce4-session and kill xfce-related processes; update
install_desktop_scripts to add a mate branch: set de_name and msg_config_key for
"mate", and in the generated start script's case on "$DESKTOP_SESSION" add a
"mate)" branch that starts mate-session (env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe
dbus-launch --exit-with-session mate-session & ...) instead of the default
xfce4-session; likewise update the stop/cleanup script case that currently looks
for xfce4-screensaver/xfce4-session to handle "mate" (use mate-session and the
proper mate process names to kill) so MATE users launch and stop mate sessions
correctly.
| case "${DESKTOP_SESSION:-xfce}" in | ||
| lxqt) | ||
| de_name="LXQt" | ||
| msg_config_key="MSG_CONFIG_LXQT_SCRIPTS" | ||
| ;; | ||
| esac | ||
|
|
There was a problem hiding this comment.
de_name variable is set but never used (valid static analysis finding).
Line 2126 sets de_name="LXQt" but it's never referenced. The msg_config_key variable is what's actually used on line 2131. Remove de_name or use it.
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 2126-2126: de_name appears unused. Verify use (or export if used externally).
(SC2034)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@install.sh` around lines 2124 - 2130, The branch handling DESKTOP_SESSION ==
"lxqt" assigns de_name="LXQt" but de_name is never used; remove the unused
assignment or use it consistently. Edit the case block that matches lxqt to
either delete the de_name="LXQt" line or replace references to msg_config_key
elsewhere with de_name where appropriate (or set msg_config_key from de_name),
ensuring only the necessary variable (msg_config_key or de_name) remains and no
unused variables are left.
| cat > "$PREFIX/bin/kill_termux_x11" << STOPEOF | ||
| #!/bin/bash | ||
|
|
||
| OHMYTERMUX_CONFIG="\$HOME/.config/OhMyTermux" | ||
| DESKTOP_SESSION="mate" | ||
| [ -f "\$OHMYTERMUX_CONFIG/desktop.conf" ] && source "\$OHMYTERMUX_CONFIG/desktop.conf" | ||
|
|
||
| if pgrep -f 'apt|apt-get|dpkg|nala' > /dev/null; then | ||
| zenity --info --text="A software is being installed. Please wait before stopping the session." | ||
| exit 1 | ||
| fi | ||
|
|
||
| termux_x11_pid=\$(pgrep -f /system/bin/app_process.*com.termux.x11.Loader) | ||
| virgl_pid=\$(pgrep -f "virgl_test_server") | ||
|
|
||
| case "\$DESKTOP_SESSION" in | ||
| mate) | ||
| de_pid=\$(pgrep -f "mate-session") | ||
| wm_pid=\$(pgrep -f "marco") | ||
| de_name="MATE" | ||
| ;; | ||
| lxqt) | ||
| de_pid=\$(pgrep -f "lxqt-session") | ||
| wm_pid=\$(pgrep -f "openbox") | ||
| de_name="LXQt" | ||
| ;; | ||
| *) | ||
| de_pid=\$(pgrep -f "xfce4-session") | ||
| wm_pid="" | ||
| de_name="XFCE" | ||
| ;; | ||
| esac | ||
|
|
||
| [ -n "\$termux_x11_pid" ] && kill -9 "\$termux_x11_pid" 2>/dev/null | ||
| [ -n "\$de_pid" ] && kill -9 "\$de_pid" 2>/dev/null | ||
| [ -n "\$wm_pid" ] && kill -9 "\$wm_pid" 2>/dev/null | ||
| [ -n "\$virgl_pid" ] && kill -9 "\$virgl_pid" 2>/dev/null | ||
|
|
||
| rm -f /tmp/.X1-lock 2>/dev/null | ||
| rm -f /tmp/.X11-unix/X1 2>/dev/null | ||
|
|
||
| if [ -n "\$termux_x11_pid" ] || [ -n "\$de_pid" ]; then | ||
| zenity --info --title="Session closed" \ | ||
| --text="Termux-X11 and \$de_name session closed." 2>/dev/null || true | ||
| else | ||
| zenity --info --title="Session not found" \ | ||
| --text="Termux-X11 or \$de_name session not found." 2>/dev/null || true | ||
| fi | ||
| STOPEOF | ||
|
|
||
| chmod +x "$PREFIX/bin/kill_termux_x11" |
There was a problem hiding this comment.
Stop script missing Termux app termination (same as lxqt.sh).
The generated kill_termux_x11 script ends after the zenity dialogs without the termux-info / kill "$pid" block that terminates the Termux app. This is inconsistent with the stop scripts in utils.sh and install.sh:install_desktop_scripts(). See the same issue flagged on lxqt.sh.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@mate.sh` around lines 495 - 545, The stop script generated for
kill_termux_x11 lacks the Termux app termination block; update the here-doc that
creates "$PREFIX/bin/kill_termux_x11" to append the same Termux termination
logic used in lxqt.sh/utils.sh/install_desktop_scripts(): after the zenity
dialogs check termux_info/termux_x11_pid (variable termux_x11_pid) and call
termux-info/kill on the Termux app PID (e.g., kill "$pid" or kill -9
"$termux_x11_pid") if present, ensuring the Termux app process is terminated
just like in the other stop scripts.
| # --------------------------------------------------------------------------- | ||
| # OhMyTermux - start | ||
| # Démarre Termux-X11 avec XFCE ou LXQt selon l'environnement installé | ||
| # --------------------------------------------------------------------------- |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check where src/start is referenced/deployed
rg -n 'src/start' --type sh -A 2 -B 2Repository: devohmycode/OhMyTermux
Length of output: 48
🏁 Script executed:
#!/bin/bash
# Search for references to the start script in install and utility scripts
rg -n '\bstart\b' install.sh utils.sh 2>/dev/null | grep -E '(cp|mv|cat|install|src)' | head -20Repository: devohmycode/OhMyTermux
Length of output: 660
🏁 Script executed:
#!/bin/bash
# List all files in src directory to understand structure
ls -la src/ 2>/dev/null || echo "src directory check failed"Repository: devohmycode/OhMyTermux
Length of output: 1197
🏁 Script executed:
#!/bin/bash
# Check lxqt.sh for _update_start_script function
rg -n '_update_start_script' --type sh -A 30Repository: devohmycode/OhMyTermux
Length of output: 3845
🏁 Script executed:
#!/bin/bash
# Check mate.sh for _update_start_script function
rg -n '_update_start_script' --type sh -A 30 | grep -A 30 'mate'Repository: devohmycode/OhMyTermux
Length of output: 3795
🏁 Script executed:
cat -n src/startRepository: devohmycode/OhMyTermux
Length of output: 5616
🏁 Script executed:
# Check what install.sh does with src/start - does it use it?
rg -n 'src/' install.sh | head -30Repository: devohmycode/OhMyTermux
Length of output: 1147
🏁 Script executed:
# Check when _update_start_script is called in lxqt.sh and mate.sh
rg -n 'call.*_update_start_script|_update_start_script' lxqt.sh mate.sh install.sh -B 5 -A 2Repository: devohmycode/OhMyTermux
Length of output: 1560
🏁 Script executed:
sed -n '2130,2180p' install.shRepository: devohmycode/OhMyTermux
Length of output: 1579
🏁 Script executed:
# Check utils.sh around line 238 for start script generation
sed -n '235,365p' utils.shRepository: devohmycode/OhMyTermux
Length of output: 5001
src/start is missing MATE desktop environment support.
This template script only handles xfce and lxqt, but the PR adds MATE as a third desktop option. The script lacks:
pkillcleanup formate-sessionandmarco(lines 11–16)- MATE binary detection in the fallback (lines 44–54)
- MATE launch case in the session handler (lines 98–122)
The issue is critical because src/start is deployed by utils.sh (line 238) and install.sh (line 2133) generates an inline version with the same gaps. Only lxqt.sh and mate.sh provide complete versions via _update_start_script(), which overwrites the script after installation. If that step is skipped or fails, users selecting MATE will have a non-functional start script.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/start` around lines 3 - 6, The start script lacks MATE support: add
cleanup pkill targets for "mate-session" and "marco" where other desktops are
cleaned up, extend the desktop-binary fallback detection to check for MATE
binaries (e.g., "mate-session" and "marco") alongside xfce/lxqt, and add a MATE
branch in the session handler to launch mate-session (mirroring how XFCE and
LXQt cases are handled); ensure the same symbols referenced in the PR
(_update_start_script(), mate-session, marco) are used so the installed/inline
start script behaves identically whether overwritten or not.
| elif command -v xfce4-session > /dev/null 2>&1; then | ||
| DESKTOP_SESSION="xfce" | ||
| else | ||
| echo "[start] Aucun environnement de bureau détecté (xfce4-session ou startlxqt)." |
There was a problem hiding this comment.
User-facing messages are hardcoded in French.
All echo messages in this script are in French (e.g., "Aucun environnement de bureau détecté", "Lancement de LXQt...", "Environnement de bureau non reconnu"). Since the rest of the project uses an i18n system, these should either use i18n keys or at minimum be in English for consistency with the project's primary language. The same issue appears in the embedded start scripts within utils.sh (lines 241-354).
Also applies to: 100-100, 109-109, 118-119
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/start` at line 51, Replace the hardcoded French echo messages with the
project's i18n system (or at minimum English strings) so user-facing text is
consistent; locate the echo statements that print "Aucun environnement de bureau
détecté (xfce4-session ou startlxqt).", "Lancement de LXQt...", "Environnement
de bureau non reconnu" in the start script and the embedded start scripts in
utils.sh (the block around the start logic), and change them to call the i18n
helper (e.g., i18n.t("desktop.no_environment") or similar) or replace the
literal French text with equivalent English messages; ensure the same change is
applied to the other echoed lines referenced (around the other occurrences) and
keep existing logging/exit behavior intact.
| # Start Termux-X11 with XFCE or LXQt depending on the installed DE | ||
| #------------------------------------------------------------------------------ | ||
| cat <<'EOF' > start | ||
| #!/bin/bash | ||
|
|
||
| # Enable PulseAudio on the network | ||
| pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 > /dev/null 2>&1 | ||
|
|
||
| XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :1.0 & > /dev/null 2>&1 | ||
| # --------------------------------------------------------------------------- | ||
| # OhMyTermux - start | ||
| # Démarre Termux-X11 avec XFCE ou LXQt selon l'environnement installé | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # NETTOYAGE DU SERVEUR X EXISTANT | ||
| # --------------------------------------------------------------------------- | ||
| pkill -f "termux.x11" > /dev/null 2>&1 | ||
| pkill -f "Xwayland" > /dev/null 2>&1 | ||
| pkill -f "xfce4-session" > /dev/null 2>&1 | ||
| pkill -f "lxqt-session" > /dev/null 2>&1 | ||
| pkill -f "startlxqt" > /dev/null 2>&1 | ||
| pkill -f "openbox" > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | ||
| sleep 1 | ||
| # Supprimer les verrous X11 résiduels | ||
| rm -f /tmp/.X1-lock > /dev/null 2>&1 | ||
| rm -f /tmp/.X11-unix/X1 > /dev/null 2>&1 | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # DÉTECTER L'ENVIRONNEMENT DE BUREAU | ||
| # --------------------------------------------------------------------------- | ||
| DESKTOP_SESSION="unknown" | ||
| OHMYTERMUX_CONFIG="$HOME/.config/OhMyTermux" | ||
|
|
||
| # 1. Lire depuis desktop.conf (priorité haute - écrit par install.sh / lxqt.sh) | ||
| if [ -f "$OHMYTERMUX_CONFIG/desktop.conf" ]; then | ||
| source "$OHMYTERMUX_CONFIG/desktop.conf" | ||
| fi | ||
|
|
||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 virgl_test_server_android --angle-gl & > /dev/null 2>&1 | ||
| # 2. Fallback : lire depuis theme_config.tmp (écrit par lxqt.sh) | ||
| if [ "$DESKTOP_SESSION" = "unknown" ] || [ -z "$DESKTOP_SESSION" ]; then | ||
| if [ -f "$OHMYTERMUX_CONFIG/theme_config.tmp" ]; then | ||
| DETECTED=$(grep '^DESKTOP_ENV=' "$OHMYTERMUX_CONFIG/theme_config.tmp" | cut -d'=' -f2 | tr -d '"') | ||
| [ -n "$DETECTED" ] && DESKTOP_SESSION="$DETECTED" | ||
| fi | ||
| fi | ||
|
|
||
| #GALLIUM_DRIVER=virpipe MESA_GL_VERSION_OVERRIDE=4.0 program | ||
| # 3. Fallback final : détecter par la présence des binaires | ||
| if [ "$DESKTOP_SESSION" = "unknown" ] || [ -z "$DESKTOP_SESSION" ]; then | ||
| if command -v startlxqt > /dev/null 2>&1 || command -v lxqt-session > /dev/null 2>&1; then | ||
| DESKTOP_SESSION="lxqt" | ||
| elif command -v xfce4-session > /dev/null 2>&1; then | ||
| DESKTOP_SESSION="xfce" | ||
| else | ||
| echo "[start] Aucun environnement de bureau détecté (xfce4-session ou startlxqt)." | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| #MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform program | ||
| # --------------------------------------------------------------------------- | ||
| # PULSEAUDIO | ||
| # --------------------------------------------------------------------------- | ||
| pulseaudio --start \ | ||
| --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" \ | ||
| --exit-idle-time=-1 > /dev/null 2>&1 | ||
|
|
||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1 | ||
| export PULSE_SERVER=127.0.0.1 | ||
|
|
||
| # Set the audio server | ||
| export PULSE_SERVER=127.0.0.1 > /dev/null 2>&1 | ||
| # --------------------------------------------------------------------------- | ||
| # DÉMARRER TERMUX-X11 | ||
| # --------------------------------------------------------------------------- | ||
| XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :1.0 &> /dev/null & | ||
| sleep 1 | ||
|
|
||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]fce4-screensaver' | awk '{print $2}') | ||
| kill "$process_id" > /dev/null 2>&1 | ||
| # Ouvrir l'activité Termux-X11 | ||
| am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 | ||
| sleep 1 | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # VIRGL (rendu GPU) | ||
| # --------------------------------------------------------------------------- | ||
| GPU_VENDOR="unknown" | ||
| if [ -f "$OHMYTERMUX_CONFIG/gpu_vendor" ]; then | ||
| GPU_VENDOR=$(cat "$OHMYTERMUX_CONFIG/gpu_vendor") | ||
| fi | ||
|
|
||
| if [ "$GPU_VENDOR" = "adreno" ]; then | ||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 \ | ||
| virgl_test_server_android --angle-gl &> /dev/null & | ||
| else | ||
| MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.3COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 \ | ||
| virgl_test_server_android &> /dev/null & | ||
| fi | ||
| sleep 1 | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # DÉMARRER LA SESSION DE BUREAU | ||
| # --------------------------------------------------------------------------- | ||
| export DISPLAY=:1.0 | ||
| export GALLIUM_DRIVER=virpipe | ||
|
|
||
| case "$DESKTOP_SESSION" in | ||
| lxqt) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe \ | ||
| dbus-launch --exit-with-session startlxqt &> /dev/null & | ||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]screensaver' | awk '{print $2}') | ||
| [ -n "$process_id" ] && kill "$process_id" > /dev/null 2>&1 | ||
| ;; | ||
| xfce) | ||
| env DISPLAY=:1.0 GALLIUM_DRIVER=virpipe \ | ||
| dbus-launch --exit-with-session xfce4-session &> /dev/null & | ||
| sleep 5 | ||
| process_id=$(ps -aux | grep '[x]fce4-screensaver' | awk '{print $2}') | ||
| [ -n "$process_id" ] && kill "$process_id" > /dev/null 2>&1 | ||
| ;; | ||
| *) | ||
| echo "[start] Environnement de bureau non reconnu : $DESKTOP_SESSION" | ||
| echo " Valeurs acceptées : xfce, lxqt" | ||
| exit 1 | ||
| ;; | ||
| esac |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
echo "=== Install.sh: install_desktop, install_proot, install_utils call locations ==="
rg -n 'install_desktop\(|install_proot\(|install_utils\(' install.sh | head -30
echo -e "\n=== Install.sh: install_desktop_scripts call location ==="
rg -n 'install_desktop_scripts' install.sh | head -10
echo -e "\n=== Utils.sh: where start/stop scripts are written ==="
rg -n 'cat.*> start|cat.*> stop|mv start|mv stop' utils.sh
echo -e "\n=== Mate.sh: where start/stop scripts are written ==="
rg -n 'cat.*> start|cat.*> stop|mv start|mv stop' mate.sh
echo -e "\n=== Lxqt.sh: where start/stop scripts are written ==="
rg -n 'cat.*> start|cat.*> stop|mv start|mv stop' lxqt.shRepository: devohmycode/OhMyTermux
Length of output: 585
🏁 Script executed:
#!/bin/bash
echo "=== Install.sh main function body - check execution order ==="
sed -n '/^main()/,/^}/p' install.sh | head -100Repository: devohmycode/OhMyTermux
Length of output: 127
🏁 Script executed:
#!/bin/bash
echo "=== Check if utils.sh is called from install_utils ==="
rg -A 20 'install_utils\(\)' install.sh | head -30
echo -e "\n=== Check if install_proot calls install_utils ==="
rg -A 30 'install_proot\(\)' install.sh | head -40Repository: devohmycode/OhMyTermux
Length of output: 2110
🏁 Script executed:
#!/bin/bash
echo "=== Check main() execution order ==="
sed -n '/^main() {/,/^}/p' install.sh | grep -E '^\s+(install_|_)' | head -30
echo -e "\n=== Verify mate.sh and lxqt.sh for script generation ==="
echo "--- mate.sh content (check for start/stop script writing) ---"
wc -l mate.sh
echo "--- First 50 lines of mate.sh ---"
head -50 mate.shRepository: devohmycode/OhMyTermux
Length of output: 2029
🏁 Script executed:
#!/bin/bash
echo "=== Check if mate.sh writes start/stop scripts (broader search) ==="
rg -i 'start|stop|script' mate.sh | grep -i 'cat\|write\|echo.*>' | head -20
echo -e "\n=== Check lxqt.sh for script writing ==="
rg -i 'start|stop|script' lxqt.sh | grep -i 'cat\|write\|echo.*>' | head -20
echo -e "\n=== Check xfce.sh for script writing ==="
rg -i 'start|stop|script' xfce.sh | grep -i 'cat\|write\|echo.*>' | head -20Repository: devohmycode/OhMyTermux
Length of output: 515
🏁 Script executed:
#!/bin/bash
echo "=== Where is main() and what's the execution order? ==="
grep -n '^main\|^install_desktop\|^install_utils\|^install_proot\|^install_desktop_scripts' install.sh | tail -20
echo -e "\n=== Check the actual main() calls ==="
sed -n '/^main() {/,/^}$/p' install.sh | grep -E 'install_desktop|install_utils|install_proot|install_desktop_scripts' | head -20Repository: devohmycode/OhMyTermux
Length of output: 264
🏁 Script executed:
#!/bin/bash
echo "=== Find where main() is invoked and the call order ==="
tail -100 install.sh | head -50
echo -e "\n=== Look for the actual main invocation ==="
rg -n 'main\b' install.sh | tail -5
echo -e "\n=== Get lines around the main call ==="
rg -B 5 -A 15 '^main$' install.sh | head -40Repository: devohmycode/OhMyTermux
Length of output: 2804
🏁 Script executed:
#!/bin/bash
echo "=== Full install_desktop flow in install.sh ==="
sed -n '1825,1900p' install.sh
echo -e "\n=== Full install_proot flow ==="
sed -n '2252,2310p' install.sh
echo -e "\n=== Full main() definition ==="
grep -n '^main' install.sh
rg -A 100 'if __name__|^main\s*\(' install.sh | head -120Repository: devohmycode/OhMyTermux
Length of output: 5645
🏁 Script executed:
#!/bin/bash
echo "=== Look at the very end of install.sh for main invocation ==="
tail -50 install.sh
echo -e "\n=== Search for where install_desktop, install_proot, etc are called ==="
rg 'install_desktop\(|install_proot\(|install_utils\(|install_desktop_scripts\(' install.shRepository: devohmycode/OhMyTermux
Length of output: 1865
🏁 Script executed:
#!/bin/bash
echo "=== Verify if install_desktop_scripts is actually called anywhere ==="
rg 'install_desktop_scripts' install.sh
echo -e "\n=== Check what install_desktop_scripts does ==="
sed -n '2115,2200p' install.sh
echo -e "\n=== Verify mate.sh actually writes start script (get full function) ==="
rg -A 30 'cat > "\$PREFIX/bin/start"' mate.shRepository: devohmycode/OhMyTermux
Length of output: 4118
🏁 Script executed:
#!/bin/bash
echo "=== Check lxqt.sh for start script details ==="
rg -B 5 -A 30 'cat > "\$PREFIX/bin/start"' lxqt.sh | head -50Repository: devohmycode/OhMyTermux
Length of output: 1535
🏁 Script executed:
#!/bin/bash
echo "=== Find the exact call to install_desktop_scripts ==="
rg -B 5 -A 5 '^\s+install_desktop_scripts' install.sh | head -40
echo -e "\n=== Check if it's called inside install_proot or elsewhere ==="
sed -n '2252,2310p' install.sh | grep -A 60 'install_proot'Repository: devohmycode/OhMyTermux
Length of output: 3205
🏁 Script executed:
#!/bin/bash
echo "=== Compare: does install_desktop_scripts actually get called in main flow? ==="
echo "Looking for the main function execution block..."
rg -A 80 'type run_hook.*post_packages' install.sh | grep -E 'install_|^--' | head -20Repository: devohmycode/OhMyTermux
Length of output: 483
🏁 Script executed:
#!/bin/bash
echo "=== Check utils.sh stop script for MATE support ==="
sed -n '358,430p' utils.sh
echo -e "\n=== Check if stop script has MATE case ==="
rg -A 40 'cat <<.*EOF.*> stop' utils.sh | grep -i 'mate\|marco'
echo -e "\n=== Compare install_desktop_scripts stop script ==="
sed -n '2160,2210p' install.sh | grep -A 30 'kill_termux_x11'Repository: devohmycode/OhMyTermux
Length of output: 2976
Both utils.sh and install_desktop_scripts() in install.sh write incomplete start/stop scripts that lack MATE support and can overwrite correct versions from mate.sh.
The start script (lines 238-354) and stop script (lines 358-430) in utils.sh are missing:
pkillformate-sessionandmarcoin start script- MATE binary detection (
mate-session/marco) - MATE case in session launch block
mate_pidandmarco_pidvariables in stop script- MATE handling in kill logic
This creates an overwrite problem: if a user installs MATE, the mate.sh script writes complete start/stop scripts handling all three DEs, but then:
- If PRoot is chosen:
install_proot()→install_utils()→utils.shoverwrites with these incomplete scripts - If PRoot is not chosen:
install_desktop_scripts()(also at line 2115 ininstall.sh) similarly overwrites with incomplete scripts (only handles XFCE and LXQt)
Both locations need MATE support added to their start/stop scripts.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@utils.sh` around lines 236 - 354, The generated start/stop scripts in
utils.sh and install_desktop_scripts() lack MATE support and overwrite correct
mate.sh versions; update both places to add MATE handling by: (1) adding pkill
entries for "mate-session" and "marco" in the start script cleanup, (2) adding
MATE detection in the desktop detection fallback (check command -v
mate-session/marco and set DESKTOP_SESSION="mate"), (3) adding a mate case in
the session launch case block that launches mate-session (with same
DISPLAY/GALLIUM env + dbus-launch pattern) and kills any mate screensaver
processes, and (4) in the stop script add mate_pid and marco_pid variables and
include them in the kill/cleanup logic so stop properly terminates mate-session
and marco; apply these same edits inside install_desktop_scripts() so neither
path overwrites a complete MATE-capable start/stop script.
| # Always try to refresh i18n_loader.sh; fall back to cached version if download fails | ||
| _loader_tmp=$(mktemp 2>/dev/null || echo "$SCRIPT_DIR/lib/i18n_loader.sh.tmp") | ||
| if curl -fL -s -o "$_loader_tmp" "$_loader_url" 2>/dev/null && head -1 "$_loader_tmp" 2>/dev/null | grep -q "^#!/bin/bash"; then | ||
| mv "$_loader_tmp" "$SCRIPT_DIR/lib/i18n_loader.sh" | ||
| else | ||
| rm -f "$_loader_tmp" 2>/dev/null | ||
| if [ ! -f "$SCRIPT_DIR/lib/i18n_loader.sh" ]; then | ||
| echo "Warning: Could not download i18n_loader.sh and no cached version available" >&2 | ||
| fi | ||
| fi | ||
| source "$SCRIPT_DIR/lib/i18n_loader.sh" |
There was a problem hiding this comment.
source on line 47 will crash if both download and cache are missing.
When the download fails and no cached i18n_loader.sh exists, the warning is printed (line 44) but execution continues to source a non-existent file, producing an unhandled error and likely aborting the script.
Proposed fix
if [ ! -f "$SCRIPT_DIR/lib/i18n_loader.sh" ]; then
echo "Warning: Could not download i18n_loader.sh and no cached version available" >&2
+ exit 1
fi
fi
source "$SCRIPT_DIR/lib/i18n_loader.sh"This same pattern is duplicated in proot.sh, utils.sh, lxqt.sh, mate.sh, and install.sh — all have the same defect.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Always try to refresh i18n_loader.sh; fall back to cached version if download fails | |
| _loader_tmp=$(mktemp 2>/dev/null || echo "$SCRIPT_DIR/lib/i18n_loader.sh.tmp") | |
| if curl -fL -s -o "$_loader_tmp" "$_loader_url" 2>/dev/null && head -1 "$_loader_tmp" 2>/dev/null | grep -q "^#!/bin/bash"; then | |
| mv "$_loader_tmp" "$SCRIPT_DIR/lib/i18n_loader.sh" | |
| else | |
| rm -f "$_loader_tmp" 2>/dev/null | |
| if [ ! -f "$SCRIPT_DIR/lib/i18n_loader.sh" ]; then | |
| echo "Warning: Could not download i18n_loader.sh and no cached version available" >&2 | |
| fi | |
| fi | |
| source "$SCRIPT_DIR/lib/i18n_loader.sh" | |
| # Always try to refresh i18n_loader.sh; fall back to cached version if download fails | |
| _loader_tmp=$(mktemp 2>/dev/null || echo "$SCRIPT_DIR/lib/i18n_loader.sh.tmp") | |
| if curl -fL -s -o "$_loader_tmp" "$_loader_url" 2>/dev/null && head -1 "$_loader_tmp" 2>/dev/null | grep -q "^#!/bin/bash"; then | |
| mv "$_loader_tmp" "$SCRIPT_DIR/lib/i18n_loader.sh" | |
| else | |
| rm -f "$_loader_tmp" 2>/dev/null | |
| if [ ! -f "$SCRIPT_DIR/lib/i18n_loader.sh" ]; then | |
| echo "Warning: Could not download i18n_loader.sh and no cached version available" >&2 | |
| exit 1 | |
| fi | |
| fi | |
| source "$SCRIPT_DIR/lib/i18n_loader.sh" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@xfce.sh` around lines 37 - 47, The current block attempts to source
"$SCRIPT_DIR/lib/i18n_loader.sh" unconditionally (see the use of _loader_tmp,
_loader_url and the final source line), which will crash if the download failed
and no cached file exists; change the flow to only source the file when it
actually exists (e.g., test -f "$SCRIPT_DIR/lib/i18n_loader.sh") and otherwise
handle the error path by exiting non-zero or skipping functionality that depends
on the loader; apply the same guard/fix to the identical blocks in proot.sh,
utils.sh, lxqt.sh, mate.sh and install.sh so they do not attempt to source a
missing i18n_loader.sh.
Summary
--xfceflag with--desktop <xfce|lxqt|mate>(--xfceretained for backward compatibility). Users can now choose their DE via gum UI or CLI flag.lxqt.sh(654 lines) andmate.sh(551 lines) as standalone installation scripts mirroringxfce.shstructure, with Kvantum/Openbox config for LXQt and Marco/GTK config for MATE.startandkill_termux_x11detect the installed DE viadesktop.conf, binary detection fallback, andtheme_config.tmpfallback.Test plan
./install.sh --gumand verify DE selection menu appears (XFCE / LXQt / MATE)./install.sh --desktop lxqt --gumand verify LXQt installation flow./install.sh --desktop mate --gumand verify MATE installation flow./install.sh --xfce --gumand verify backward compatibilitystartscript detects and launches the correct DEkill_termux_x11stops the correct DE processes--lang fr)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Chores