Skip to content
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
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ install-common:
install -d $(DESTDIR)/etc/qubes/post-install.d
install -m 0755 appvm-scripts/etc/qubes/post-install.d/20-qubes-guivm-gui-agent.sh \
$(DESTDIR)/etc/qubes/post-install.d/20-qubes-guivm-gui-agent.sh
install -m 0755 appvm-scripts/etc/qubes/post-install.d/20-qubes-gui-agent.sh \
$(DESTDIR)/etc/qubes/post-install.d/20-qubes-gui-agent.sh
install -D appvm-scripts/usrbin/qubes-session \
$(DESTDIR)/usr/bin/qubes-session
install -D appvm-scripts/usrbin/qubes-run-xorg \
Expand Down Expand Up @@ -213,8 +211,6 @@ endif
$(DESTDIR)/etc/qubes-rpc/qubes.SetMonitorLayout
ln -sf ../../usr/bin/qubes-start-xephyr \
$(DESTDIR)/etc/qubes-rpc/qubes.GuiVMSession
install -d $(DESTDIR)/etc/qubes/rpc-config
echo "force-user='root'" > $(DESTDIR)/etc/qubes/rpc-config/qubes.GuiVMSession
install -D window-icon-updater/icon-sender \
$(DESTDIR)/usr/lib/qubes/icon-sender
install -m 0644 -D window-icon-updater/qubes-icon-sender.desktop \
Expand All @@ -225,6 +221,8 @@ endif
$(DESTDIR)/etc/xdg/autostart/qubes-keymap.desktop
install -m 0644 -D appvm-scripts/etc/xdgautostart/qubes-gtk4-workarounds.desktop \
$(DESTDIR)/etc/xdg/autostart/qubes-gtk4-workarounds.desktop
install -m 0644 -D appvm-scripts/etc/xdgautostart/qubes-set-xsettings-xfconf-query.desktop \
$(DESTDIR)/etc/xdg/autostart/qubes-set-xsettings-xfconf-query.desktop
install -D -m 0644 appvm-scripts/usr/lib/sysctl.d/30-qubes-gui-agent.conf \
$(DESTDIR)/usr/lib/sysctl.d/30-qubes-gui-agent.conf
install -D -m 0644 appvm-scripts/lib/udev/rules.d/70-master-of-seat.rules \
Expand Down
4 changes: 0 additions & 4 deletions appvm-scripts/etc/qubes/post-install.d/20-qubes-gui-agent.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=xfconf-query for Xfce-based QubesVM
Exec=/usr/bin/xfconf-query --channel xsettings --property /Gtk/DecorationLayout --set ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is assuming that the qube:

  1. has xfconf-query
  2. is currently using Xfce

Both conditions need to be met for this script to be called.

First, can be done with TryExec=/usr/bin/xfconf-query. Also, I'd rather the path was not hardcoded.

Second, XDG_SESSION_DESKTOP=X-QUBES is present on fedora-43-minimal, which is not the Xfce flavor and doesn't have xfconf-query. So you will need to find another thing to query.

@noskb noskb Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your review.

Since this won't take effect unless the qubes-gui-agent-xfce is installed, I think it's reasonable to assume that xfconf-query exists. That’s why I didn’t use TryExec=, but I wonder if I’m missing something.

Also, I'd rather the path was not hardcoded.

agree.


Since minimal template is intended for advanced users, I hadn't considered it.

I expect the same thing is possible by adding xsettingsd to the qubes-gui-agent package dependencies and placing the configuration file in its proper location, but I’m hesitant to add anything by default to minimal template, which is for advanced users who prefer minimizing things…

@ben-grande ben-grande Mar 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since minimal template is intended for advanced users, I hadn't considered it.

For advanced users to configure, doesn't mean things should be broken. I don't know if this breaks systemd somehow if it is configured to handle xdg autostart. But I'd rather that it is not left in a failed state, but skipped.

I expect the same thing is possible by adding xsettingsd to the qubes-gui-agent package dependencies and placing the configuration file in its proper location, but I’m hesitant to add anything by default to minimal template, which is for advanced users who prefer minimizing things…

No need to add the package. It doesn't guarantee that xfce is currently running. Please find a way to know if Xfce is currently running and add that as a check to TryExec=.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since minimal template is intended for advanced users, I hadn't considered it.

For advanced users to configure, doesn't mean things should be broken.

To explain this better, minimal templates don't have everything working by default, I just don't want a failed state by default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No need to add the package. It doesn't guarantee that xfce is currently running. Please find a way to know if Xfce is currently running and add that as a check to TryExec=.

Is it really needed to check whether Xfce is currently running here?

All environment variables recommended for checking whether XFCE (DE) is currently running are override by 60xfce-desktop included in the qubes-gui-agent-xfce package, so as I see it, if the package is installed, Xfce is assumed to be running. Furthermore,xfconf-query does not fail even if Xfce is not running. But, --set alone will fail if the channel or property does not exist, so adding --create is planned.`)

TryExec=xfconf-query
Exec=xfconf-query --channel xsettings --property /Gtk/DecorationLayout --create --type string --set ""

With this change, it should no longer default to a failed state. (for example, even in a unique environment where only xfconf and qubes-gui-agent-xfce packages are installed on minimal template)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TryExec approach is IMO good enough

Terminal=false
Type=Application
OnlyShowIn=X-QUBES;
1 change: 0 additions & 1 deletion appvm-scripts/qubes-gui-agent.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ TTYPath=/dev/tty7
# custom PATH for X session can be set with ENV_PATH; otherwise service's PATH
# is inherited
#Environment=ENV_PATH=/usr/local/bin:/usr/bin:/bin
ExecCondition=/bin/sh -c 'test "$(qubesdb-read --default=True /qubes-gui-enabled)" = "True"'
ExecStartPre=/bin/sh -c /usr/lib/qubes/qubes-gui-agent-pre.sh
ExecStart=/usr/bin/qubes-gui $GUI_OPTS
# clean env
Expand Down
9 changes: 1 addition & 8 deletions appvm-scripts/usrbin/qubes-run-xorg
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@

## This script is triggered by qubes-gui-agent systemd service.

#expects W, H, MEM and DEPTH env vars to be set by invoker, but use default
# values if they aren't

[ -n "$W" ] || W=1920
[ -n "$H" ] || H=1080
[ -n "$MEM" ] || MEM=$(( W * H * 4 / 1024 ))
[ -n "$DEPTH" ] || DEPTH=24

#expects W, H, MEM and DEPTH env vars to be set by invoker
DUMMY_MAX_CLOCK=300 #hardcoded in dummy_drv
PREFERRED_HSYNC=50
RES="$W"x"$H"
Expand Down
4 changes: 0 additions & 4 deletions appvm-scripts/usrbin/qubes-session
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ VMTYPE=$(/usr/bin/qubesdb-read /qubes-vm-type)
UPDTYPE=$(/usr/bin/qubesdb-read /qubes-vm-updateable)
[[ $UPDTYPE == 'True' ]] && UPDTYPE="UpdateableVM" || UPDTYPE="NonUpdateableVM"

# Sync environment variables from the user session into the systemd user
# manager and dbus-daemon
dbus-update-activation-environment --systemd --all

# process /etc/xdg/autostart and friends (according to Desktop Application
# Autostart Specification)
/usr/bin/qubes-session-autostart QUBES X-QUBES "X-$VMTYPE" "X-$UPDTYPE"
Expand Down
22 changes: 5 additions & 17 deletions appvm-scripts/usrbin/qubes-start-xephyr
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#!/bin/sh

# Start under new service unit, to detach from the current non-gui logind
# session
if [ -z "$INVOCATION_ID" ]; then
exec systemd-run --system \
--unit=qubes-gui-agent-session.service \
--description="Start GUI session via Xephyr" \
--property=TTYPath=/dev/tty8 \
--property=StandardInput=tty \
--wait \
-- "$0" "$@"
if [ $(whoami) == "root" ]; then
echo "Should be run as normal user!"
exit 1
fi

# do not let child processes believe they are running as qrexec service
Expand All @@ -36,11 +29,6 @@ if ! timeout 30s sh -c "while ! xdpyinfo -display $DISPLAY_XORG > /dev/null 2>&1
exit 1
fi

# parameters for logind session
export DISPLAY=$DISPLAY_XEPHYR
export XDG_SEAT=seat0
export XDG_SESSION_CLASS=user

# Run xsession into Xephyr
user=$(qubesdb-read --default=user /default-user)
exec /usr/bin/qubes-gui-runuser $user /usr/bin/env env DISPLAY=$DISPLAY_XORG /usr/bin/xinit $XSESSION -- /usr/bin/qubes-run-xephyr $DISPLAY_XEPHYR > ~/.xsession-errors 2>&1
export DISPLAY=$DISPLAY_XORG
exec /usr/bin/xinit $XSESSION -- /usr/bin/qubes-run-xephyr $DISPLAY_XEPHYR > ~/.xsession-errors 2>&1
1 change: 0 additions & 1 deletion archlinux/PKGBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ makedepends=(
xorg-util-macros
libxcomposite
libxt
libxcursor
libxdamage
libunistring
pixman
Expand Down
20 changes: 0 additions & 20 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
qubes-gui-agent (4.4.1-1) unstable; urgency=medium

[ Aaron Rainbolt ]
* Sync environment variables from the user session into systemd and
dbus

-- Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Fri, 01 May 2026 14:55:53 +0200

qubes-gui-agent (4.4.0-1) unstable; urgency=medium

[ Marek Marczykowski-Górecki ]
* archlinux: relax runtime pulseaudio dependency too
* Delay connecting with gui-daemon until after starting Xorg
* Create status file with info about gui-daemon connection

[ Ben Grande ]
* Allow preloading without graphics

-- Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Mon, 16 Mar 2026 18:55:26 +0100

qubes-gui-agent (4.3.15-1) unstable; urgency=medium

* debian: install cvt tool
Expand Down
2 changes: 0 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Build-Depends:
libx11-dev,
libgbm-dev,
libxcomposite-dev,
libxcursor-dev,
libxdamage-dev,
libxfixes-dev,
x11proto-xf86dga-dev,
Expand Down Expand Up @@ -43,7 +42,6 @@ Depends:
qubesdb-vm (>= 4.1.4),
libxdamage1,
libxcomposite1,
libxcursor1,
libxfixes3,
libxt6,
libx11-6,
Expand Down
3 changes: 2 additions & 1 deletion debian/qubes-gui-agent-xfce.install
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
etc/X11/Xsession.d/60xfce-desktop
etc/X11/Xsession.d/60xfce-desktop
etc/xdg/autostart/qubes-set-xsettings-xfconf-query.desktop
2 changes: 0 additions & 2 deletions debian/qubes-gui-agent.install
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ etc/security/limits.d/90-qubes-gui.conf
etc/qubes-rpc/qubes.SetMonitorLayout
etc/qubes-rpc/qubes.GuiVMSession
etc/qubes/post-install.d/20-qubes-guivm-gui-agent.sh
etc/qubes/post-install.d/20-qubes-gui-agent.sh
etc/qubes/rpc-config/qubes.GuiVMSession
etc/xdg/autostart/qubes-gtk4-workarounds.desktop
etc/xdg/autostart/qubes-icon-sender.desktop
etc/xdg/autostart/qubes-qrexec-fork-server.desktop
Expand Down
2 changes: 1 addition & 1 deletion gui-agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CFLAGS += -I../include/ `pkg-config --cflags vchan` \
-Wmissing-prototypes -Wstrict-prototypes -Wold-style-declaration \
-Wold-style-definition
OBJS = vmside.o txrx-vchan.o error.o list.o encoding.o
LIBS = -lX11 -lXdamage -lXcomposite -lXcursor -lXfixes `pkg-config --libs vchan` -lqubesdb \
LIBS = -lX11 -lXdamage -lXcomposite -lXfixes `pkg-config --libs vchan` -lqubesdb \
-lunistring


Expand Down
Loading