Repository navigation
feat: add portrait mode, dynamic monitor positioning, and stream flow control - #1
Conversation
… control - Dynamic monitor positioning (--position auto|left|right) and rotation/transform support (--transform, --portrait) - Non-negative coordinate shifting when placing displays on the left, keeping layer-shell daemons (waybar, swww) fully intact - Multi-worker frame pacing and dynamic WebSocket transmission interval matching target FPS to eliminate TCP socket bufferbloat and lag - Made scripts fully portable and dynamic without hardcoded user paths or monitor coordinates - Added fullSensor orientation and FillBounds stretch toggle support to Android app and HTML5 web client - Asynchronous mDNS registration thread to prevent startup blocking
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1f4d6b15c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if command -v systemd-run >/dev/null 2>&1; then | ||
| systemd-run --user --unit=linuxextend-server --working-directory="$INSTALL_DIR/server" python3 -u -m linuxextend "$@" >/dev/null 2>&1 |
There was a problem hiding this comment.
Fall back to nohup when the user service manager is unavailable
When systemd-run is installed but no user service manager is reachable, start now exits without launching the server. The installed command's help describes --user as “Run as user unit”; executable availability alone does not establish that this works. In the inspected environment, systemd-run --user ... /bin/true fails with Failed to connect to bus: No medium found. Because this invocation runs under set -e and suppresses its diagnostics, the existing nohup branch is never reached. Test whether service creation succeeds and fall back on failure.
Useful? React with 👍 / 👎.
| self._run_hyprctl("keyword", "monitor", f"{p_name},{p_w}x{p_h}@{p_r},0x0,{p_scale}") | ||
| return f"{p_w}x0" |
There was a problem hiding this comment.
Calculate right-side placement using the preserved monitor scale
For a primary monitor with scale other than 1, preserving p_scale while still positioning the headless output at the physical pixel width creates a gap between the displays. For example, a 3840-wide primary at scale 2 occupies 1920 logical units, but this places the tablet at x=3840. The Hyprland monitor documentation explicitly states that “The position is calculated with the scaled (and transformed) resolution.” Previously this branch forced scale 1, so its width calculation was consistent. Calculate the primary's logical width before returning the tablet position.
Useful? React with 👍 / 👎.
| echo "$s_pid" > "$PID_FILE" | ||
| # Start server in background (using systemd-run if available, else nohup) | ||
| if command -v systemd-run >/dev/null 2>&1; then | ||
| systemd-run --user --unit=linuxextend-server --working-directory="$INSTALL_DIR/server" python3 -u -m linuxextend "$@" >/dev/null 2>&1 |
There was a problem hiding this comment.
Preserve log access for the new systemd launch path
When the systemd branch is used, the server no longer writes to $LOG_FILE, but both cmd_logs() and the startup-failure diagnostic still read only that file. Consequently, linuxextend logs reports no log file on a fresh installation or follows stale output from an earlier nohup launch, and startup errors lose their Python diagnostics. Route the service output to the existing log file or update both readers to retrieve the unit's journal.
Useful? React with 👍 / 👎.
Summary of Changes
This PR introduces portrait orientation support, dynamic monitor positioning, stream flow control to eliminate latency, and replaces hardcoded paths and coordinates with dynamic detection.
1. Dynamic Monitor Positioning & Portrait Support
--position [auto|left|right]and--transform [0|1|2|3]flags, plus a--portraitconvenience shortcut.--position left), the primary display is dynamically shifted to positive coordinates (e.g.1080x0). This preserves strictly non-negative coordinate space across all outputs, preventing Wayland layer-shell daemons (such asswwwfor wallpaper andwaybar) from clipping or failing to render.2. Stream Flow Control & Latency Elimination
frame_interval * num_workers) so workers evenly deliver the target FPS without overloadinggrimor Hyprland.3. Edge-to-Edge Fit & Orientation Controls
AndroidManifest.xmltoandroid:screenOrientation="fullSensor"and defaulted toFillBoundsscaling to support any physical orientation.100vw/100vhfullscreen positioning and added an interactive Stretch Fit / Contain Aspect toggle.4. Portability & Cleanup
scripts/linuxextend.shandscripts/install_apk.shwith portableBASH_SOURCEand standard environment variable fallbacks.scripts/switch_monitor.shto dynamically detect monitor geometry, orientation, and focus center viahyprctl.zeroconf) to prevent blocking server startup.5. Testing & Validation
pytest tests/).