Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Xpra in desktop mode #328

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion capella/autostart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Load environment variables from /etc/environment
source /etc/environment

nitrogen --restore &
if command -v nitrogen > /dev/null; then
nitrogen --restore &
fi

if [ "$AUTOSTART_CAPELLA" = "1" ];
then
Expand Down
5 changes: 2 additions & 3 deletions capella/setup/provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@ def provide_project_dirs_to_capella_plugin(
projects: list[_ProjectDict],
) -> None:
locations = ":".join([str(project["location"]) for project in projects])
pathlib.Path("/etc/environment").write_text(
f"export MODEL_INBOX_DIRECTORIES={locations}\n", encoding="utf-8"
)
with open("/etc/environment", "a", encoding="utf-8") as f:
f.write(f"export MODEL_INBOX_DIRECTORIES={locations}\n")
log.info(
"Set environment variable MODEL_INBOX_DIRECTORIES to '%s'", locations
)
Expand Down
10 changes: 4 additions & 6 deletions remote/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco
obconf \
gettext-base \
xprintidle \
nitrogen && rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* && \
printf '%s\n' >> /usr/share/themes/Natura/openbox-3/themerc "border.width: 3" "window.handle.width: 0"

ARG XPRA_REGISTRY=https://xpra.org

Expand All @@ -45,13 +46,10 @@ RUN wget -qO /usr/share/keyrings/xpra.asc ${XPRA_REGISTRY}/xpra.asc && \
nginx && \
rm -rf /var/lib/apt/lists/*

COPY openbox-launcher.sh /usr/local/bin/openbox-launcher.sh
COPY rc.xml /etc/xdg/openbox/rc.xml
COPY menu.xml /etc/xdg/openbox/menu.xml

# Setup Nitrogen (Desktop background)
COPY wallpaper.png /tmp/wallpaper.png
COPY bg-saved.cfg /home/techuser/.config/nitrogen/bg-saved.cfg

# Copy Supervisor Configuration
RUN pip install --no-cache-dir supervisor==4.2.5
COPY supervisord.conf /etc/supervisord.conf
Expand All @@ -73,7 +71,7 @@ RUN mkdir -p /run/xrdp/sockdir && \
chown techuser /var/log && \
chown techuser /etc/supervisord.conf /var/log/nginx /var/log/nginx/* && \
chown techuser /etc/nginx && \
touch /etc/environment && chown techuser /etc/environment
chown techuser /etc/environment

WORKDIR /home/techuser

Expand Down
11 changes: 7 additions & 4 deletions remote/bg-saved.cfg → remote/openbox-launcher.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/sh

# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: Apache-2.0

[xin_-1]
file=/tmp/wallpaper.png
mode=4
bgcolor=#000000
xrdb -merge <<\EOF
Xft.dpi: 96
EOF

exec openbox-session
9 changes: 6 additions & 3 deletions remote/rc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
</placement>

<theme>
<name>Clearlooks</name>
<titleLayout>NLC</titleLayout>
<name>Natura</name>
<titleLayout>NLMC</titleLayout>
<!--
available characters are NDSLIMC, each can occur at most once.
N: window icon
Expand Down Expand Up @@ -750,7 +750,10 @@

# end of the example
-->
<application name="Capella">
<application type="splash">
<position force="yes"><x>50</x><y>50</y></position>
</application>
<application type="normal" title="workspace *- Capella*">
<fullscreen>yes</fullscreen>
</application>
</applications>
Expand Down
2 changes: 1 addition & 1 deletion remote/supervisord.xpra.conf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires testing: Does the session sharing in the Capella Collaboration Manager still work as expected? How does it behave with different screen sizes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires testing: Does the internal session viewer in the Capella Collaboration Manager still work as expected?

Copy link
Member

@MoritzWeber0 MoritzWeber0 Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires testing in the staging environment: How is the general connectivity? Reordering of a popup seems to cause more traffic since there is no window scoping anymore on the client side

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browser zoom in doesn't scale the window anymore. Needs more investigation, probably we can't do much about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zooming in and out does work for me, but only via the browser menu, as Ctrl+Scroll gets captured and sent to X. However it seems to suffer from the same issue as resizing quickly. Reloading fixes this as well, after which the Capella window is simply rendered larger (and blurry if zooming in, but that's expected on X).

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

[program:xpra]
command=xpra start :10 --start=/home/techuser/.config/openbox/autostart --start-env=GTK_IM_MODULE=ibus --attach=yes --daemon=no --bind-tcp=0.0.0.0:10001 --min-quality=70
command=xpra start-desktop :10 --start=/usr/local/bin/openbox-launcher.sh --attach=yes --daemon=no --bind-tcp=0.0.0.0:10001 --min-quality=70 --input-method=keep
user=techuser
autorestart=true
environment=DISPLAY=":10",XPRA_DEFAULT_CONTENT_TYPE="text",XPRA_DEFAULT_VFB_RESOLUTION="1920x1080"
Expand Down
Empty file removed remote/wallpaper.png
Empty file.