Skip to content

Switch desktop environment from GNOME to xfce#17

Open
kimptoc wants to merge 48 commits intomainfrom
claude/fix-xfce-wallpaper-FK5rh
Open

Switch desktop environment from GNOME to xfce#17
kimptoc wants to merge 48 commits intomainfrom
claude/fix-xfce-wallpaper-FK5rh

Conversation

@kimptoc
Copy link
Copy Markdown
Owner

@kimptoc kimptoc commented Apr 15, 2026

KDE Plasma doesn't have the donation/welcome dialogs that GNOME shows,
making it a simpler base for the CodeClub live CD.

Changes:

  • Import installation-cd-graphical-plasma6 instead of the GNOME variant
  • Enable services.desktopManager.plasma6 and sddm display manager
  • Remove gnome-shell overlay patching donation/welcome dialogs
  • Remove services.desktopManager.gnome, gnome-remote-desktop, gdm config
  • Remove environment.gnome.excludePackages
  • Remove dconf GNOME writes from autostart script (not needed for KDE)
  • Replace gnome-terminal with konsole; replace GNOME games with KDE
    equivalents (kmines, kmahjongg, kreversi, kpat)
  • Remove gnome-tweaks and gnomeExtensions.no-overview (GNOME-specific)
  • Use X-KDE-autostart-phase=2 in autostart desktop entries
  • Rename FFX* variables to CHR* since they control Chrome, not Firefox

claude and others added 23 commits April 8, 2026 16:49
KDE Plasma doesn't have the donation/welcome dialogs that GNOME shows,
making it a simpler base for the CodeClub live CD.

Changes:
- Import installation-cd-graphical-plasma6 instead of the GNOME variant
- Enable services.desktopManager.plasma6 and sddm display manager
- Remove gnome-shell overlay patching donation/welcome dialogs
- Remove services.desktopManager.gnome, gnome-remote-desktop, gdm config
- Remove environment.gnome.excludePackages
- Remove dconf GNOME writes from autostart script (not needed for KDE)
- Replace gnome-terminal with konsole; replace GNOME games with KDE
  equivalents (kmines, kmahjongg, kreversi, kpat)
- Remove gnome-tweaks and gnomeExtensions.no-overview (GNOME-specific)
- Use X-KDE-autostart-phase=2 in autostart desktop entries
- Rename FFX* variables to CHR* since they control Chrome, not Firefox
The non-calamares plasma6 module isn't present in this channel;
installation-cd-graphical-calamares-plasma6.nix is the available one
and additionally ships the Calamares graphical installer, which is
useful for a live CD users may want to install from.
- Fix stale comment naming the non-calamares plasma6 module
- Remove wmctrl maximize script and wmctrl package: wmctrl is X11-only
  and the session now runs on Wayland, and Chrome's --start-maximized
  in the exec line already handles window state
- Remove GSK_RENDERER=ngl: GTK4 scene graph renderer hint that was a
  GNOME leftover and has no effect on KDE Plasma
- Switch xdg.mime default browser from Firefox to Chrome: Chrome is
  what autostarts at login so the XDG default should match
- Use installation-cd-minimal as base (no Calamares installer, no gparted)
- Enable XFCE + LightDM with auto-login, skip greeter
- Disable gnome-keyring to prevent wallet prompts for wifi passwords
- Disable screensaver/DPMS for the live CD
- Replace KDE packages with XFCE/GTK equivalents:
  konsole -> xfce4-terminal, KDE games -> GNOME/GTK games
- Remove X-KDE-autostart-phase from desktop entries
- Chrome autostarts maximized via --start-maximized in XDG autostart

https://claude.ai/code/session_01SbhGbt5M1p1qXaZmx1LJdd
Setting greeter.enable=false breaks LightDM — it needs a greeter
even when auto-login bypasses it. Also removed extraSeatDefaults
which may have conflicted. Auto-login handles skipping the greeter.
installation-cd-minimal doesn't include any X11/graphics infrastructure.
LightDM was failing immediately (3ms, status=1) because there were no
video drivers. Add modesetting+fbdev drivers and hardware.graphics.enable.
The minimal base has no graphics infrastructure. The graphical base
provides video drivers, Mesa, fonts, and X11 configuration out of the
box — without pulling in a specific desktop environment or installer.
- Re-add screen blanking/DPMS disable via xserver serverFlagsSection
  (was lost when removing broken LightDM extraSeatDefaults)
- Document that GNOME games share XFCE's GTK toolkit so no extra bloat
…eleton

- Set initialPassword = "nixos" so VM login screen works when auto-login
  is bypassed (live CD auto-login still takes precedence)
- Add xfce.xfce4-systemload-plugin package for CPU/memory monitoring
- Add xfce4-panel.xml skeleton (disabled pending XML format fix) to
  place Chrome launcher and systemload widget in the top bar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace XFCE + LightDM with the Cosmic desktop environment and its
own greeter. Remove XFCE-specific packages (xfce4-terminal,
xfce4-systemload-plugin) and X11 server-flags screen-blanking config
which only applies to X11. Cosmic is Wayland-native and includes
built-in system monitoring in its panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch back from Cosmic to XFCE + LightDM (Cosmic needs real GPU,
  doesn't work in QEMU build-vm)
- Set Chrome as the XFCE preferred browser at session start via
  xfconf-query on the exo channel, so the panel web browser launcher
  opens Chrome rather than Firefox
- Keep xfce4-systemload-plugin in packages (right-click panel to add)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yautostart

Panel setup (runs once on first login, flagged by ~/.panel-configured):
- Set Chrome as the XFCE preferred browser via helpers.rc so the panel
  web-browser launcher opens Chrome rather than Firefox
- Remove workspace pager from all panels via xfconf-query and set
  workspace count to 1 (single workspace)
- Add xfce4-systemload-plugin to panel 1 before the systray via
  xfconf-query, then restart the panel to load it

KiloCode:
- Write ~/.local/bin/kilocode-wrapper with correct npm PATH
- Create kilocode.desktop launcher (appears in apps menu, pinnable
  to panel) that opens kilocode in xfce4-terminal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add XFCE panel XML config and launcher desktop files as nix derivations
- Deploy panel config and launcher files via activation script (runs at boot)
- Configure panel-2 dock: show-desktop, terminal, files, Chrome, app finder, btop
- Use xfconf-query with --force-array in myautostart to ensure launcher items
  are proper arrays (fixes launcher falling back to exo-open defaults)
- Set Chrome as XFCE preferred browser via helpers.rc
- Set Chrome as XDG default browser via mime defaults
- Rename live CD user from nixos to codeclub
- Add set +e to myautostart to prevent exit-on-error from NixOS bash -e wrapper
- Pass XAUTHORITY and DBUS_SESSION_BUS_ADDRESS to myautostart service

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous config crashed Chrome on every launch with
"chrome_crashpad_handler: --database is required" because
~/.config was created by the xfcePanelConfig activation script as
root:root mode 700, blocking Chrome from creating its own
~/.config/google-chrome/ directory for the crashpad database.

Root cause was chown by name ("codeclub:codeclub") failing silently
during activation — user database isn't resolvable from chown even
with deps=["users"]. Switched all chown calls in the activation
script to numeric UID/GID (1000:100).

Also fixes several related launcher issues found during rebuild:

- Dock Chrome launcher opened system Chrome without the CodeClub URL
  because xfce4-panel resolved "google-chrome.desktop" via XDG lookup
  and found /nix/store first. Renamed our custom launcher to
  codeclub-chrome.desktop (unique filename, no XDG collision).

- Applications menu "Google Chrome" opened Chrome without the URL for
  the same reason. Added ~/.local/share/applications/google-chrome.desktop
  override written at activation time so XDG lookup finds ours first.

- Dock btop/terminal/thunar/appfinder launchers used bare binary names
  in Exec=. Panel launcher exec environment lacks /run/current-system/sw/bin
  in PATH, so they silently failed. Switched to absolute nix-store paths.

- Applications → Web Browser (the exo-open preferred-application
  launcher) opened Chrome with no URL because helpers.rc pointed at
  the stock "google-chrome" XFCE helper which has no URL in its
  X-XFCE-Commands. Added codeclub-webbrowser.desktop XFCE helper with
  the full flags + URL and pointed helpers.rc at it.

- Added --new-window to Chrome Exec lines so clicking a launcher while
  Chrome is already running still opens a fresh window on the homepage
  instead of having the URL swallowed by the existing instance.

Rebuilt incrementally from a minimal base to pinpoint the crashpad
root cause — each step (locale, firefox policies, zsh, chrome policy,
nix-ld, panel config, myautostart) was tested in a VM. The crash
reproduced only after the xfcePanelConfig activation script was
reintroduced, which is how the .config ownership issue was identified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Addresses kilo-code-bot review nitpick on #16: this option is a
nixos-rebuild build-vm setting and has no effect on the ISO output.
Leftover from incremental VM testing of the Chrome crashpad fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Disable XFCE screensaver so kids don't get locked out of the live CD
- Seed ~/.zsh_history with kilocode/btop/python3/node/nmap so they're
  reachable via up-arrow without having to type
- Hide all desktop icons (xfce4-desktop /desktop-icons/style=0)
- Bundle paullinuxthemer/PRO-Dark-XFCE-Edition@4b3f32f via
  fetchFromGitHub, install under share/themes, and point xsettings +
  xfwm4 at it on boot
- Fetch Bing's daily wallpaper on boot and write it as the
  xfce4-desktop backdrop on every monitor xrandr reports (with a
  fallback to common monitor names), so all club machines booted the
  same day share the same picture
- Re-add virtualisation.diskSize = 4096; the earlier removal was
  technically correct (the option is a no-op in the ISO build) but it
  kneecapped nixos-rebuild build-vm iteration with "no space left on
  device" errors in the 1 GiB default qcow2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xfce4-panel auto-inserts tasklist/pager/extra separators into panel-1
regardless of our static XML, reshuffling plugin IDs so the clock is
not at the position we declared. Discover the clock plugin at runtime
after the panel restart and set digital-layout=3 (time-only) plus
%H:%M:%S format on the actual plugin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wallpaper fetch and kilocode npm install now wait for network
connectivity (polling every 5s for up to 5 min) before attempting
downloads. On school networks DHCP+DNS can take several minutes
after graphical login, causing all retry attempts to be exhausted
before the network is ready.

Also add recursive chown of /home/codeclub at end of activation
script to fix EACCES when kilocode tries to mkdir ~/.config/kilo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…o claude/fix-xfce-wallpaper-FK5rh

# Conflicts:
#	README.md
The myautostart systemd service called xfdesktop, xfce4-panel, and pkill
by bare name, but these aren't on PATH inside systemd user services.
This caused "command not found" errors, preventing:
- xfdesktop --reload (wallpaper never applied after download)
- xfce4-panel restart (panel config changes not picked up)

Replace bare commands with full Nix store paths:
- xfdesktop -> ${pkgs.xfce.xfdesktop}/bin/xfdesktop
- xfce4-panel -> ${pkgs.xfce.xfce4-panel}/bin/xfce4-panel
- pkill -> ${pkgs.procps}/bin/pkill

https://claude.ai/code/session_0159tRM3pC4n1b16wpDZaPLZ
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Apr 15, 2026

Code Review Roast 🔥

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything.

📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are.

Files Reviewed (1 file)
  • iso.nix

Reviewed by gpt-5.4-20260305 · 430,338 tokens

claude and others added 6 commits April 18, 2026 01:20
The PRO-dark-XFCE-4.14 theme has tiny/missing xfwm4 border images,
making windows only resizable from the top (title bar). Patch the
theme derivation to generate 4px dark border XPMs for bottom, left,
right, and corner edges so resize handles work on all sides.

https://claude.ai/code/session_0159tRM3pC4n1b16wpDZaPLZ
Panel-1 was missing an actions/session-menu plugin (the username
dropdown with logout/shutdown) and had no tasklist. xfce4-panel
auto-inserted a tasklist which pushed the clock to the middle.

Fix by explicitly defining:
- plugin-4: tasklist (expand=true) — fills middle, prevents auto-insertion
- plugin-7: actions (appearance=1) — session menu with username dropdown
- Remove unused expanding separator (plugin-3)

Panel-1 layout is now:
  app-menu | chrome-launcher | tasklist(expand) | systray | clock | session-menu

https://claude.ai/code/session_0159tRM3pC4n1b16wpDZaPLZ
Resolves README conflict: keep HEAD's detailed DONE items, add litterbox
TODO from upstream, drop wallpaper/resize TODOs (both now fixed).

Fix session-menu (actions plugin) not appearing: the static XML plugin-7
definition is bypassed because xfce4-panel auto-inserts plugins into
panel-1 at startup, reshuffling IDs before the live xfconfd state
diverges from the XML. Apply the same runtime-scan pattern used for the
clock: after the panel restart, iterate plugin IDs looking for the
actions plugin and set appearance=1. If the plugin is absent entirely,
register it as plugin-30 and append its ID to panel-1/plugin-ids before
a final --restart. Full diagnostics logged to ~/myautostart.log.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root cause: panel-2 worked because it was fully configured via
xfconf-query at runtime. Panel-1 relied on the static XML, which
xfce4-panel overrides on first start by auto-inserting its own
tasklist/pager/separators — pushing clock and systray to the middle
and preventing the actions/session-menu plugin from appearing.

Fix: add an xfconf-query block for panel-1 (plugin-ids + all 6 plugins)
immediately before the panel restart, mirroring the panel-2 approach.
This makes the live xfconfd state authoritative, so after the restart
xfce4-panel sees the correct layout: app-menu | chrome | tasklist(expand)
| systray | clock | session-menu.

Also simplify the post-restart actions scan to a simple belt-and-braces
check (confirm plugin-7 = actions, re-apply appearance=1) now that we
guarantee its existence in the pre-restart block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The tasklist (plugin-4) caused the clock/systray to shift to the middle
after network connected — likely because xfce4-panel auto-inserts a
second tasklist when network-related windows appear, adding an extra
expand element. The pre-Wednesday separator (plugin-3, expand=true) was
stable and didn't have this problem.

Switch back to separator for the expand element while keeping the
session-menu (plugin-7/actions) and the xfconf-query panel-1 setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- iso.nix: drop the xfconf-query plugin-ids rewrite (caused "(null)"
  popups + plugin-type reverts under live xfconfd). Accept xfce4-panel
  first-start defaults and only tweak plugin-4 (pager→Chrome launcher),
  plugin-8 (clock HH:MM:SS), plugin-10 (actions appearance), and
  panel-2 autohide.
- iso.nix: gate xfce4-panel --restart on org.xfce.Panel D-Bus name
  ownership to stop the "name not provided by .service files" GTK
  dialog on slow boots.
- iso.nix: wrap Chrome launches in chromeFocusOrLaunch so re-clicking
  the icon focuses the existing window instead of opening duplicates.
- iso.nix: kill+respawn xfdesktop after wallpaper write (--reload
  didn't pick up new last-image values); dump xrandr + final
  /backdrop state for diagnostics on real hardware.
- README.md: replace stale "graphical gnome template" steps with the
  actual nix-build invocation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kimptoc and others added 8 commits May 1, 2026 08:26
…K5rh

XFCE panel: drive via xfconf-query, Chrome focus-or-launch
…K5rh

Merge upstream main into xfce branch
- Audio: services.pipewire (alsa + pulse compat) + rtkit. Removes the
  "works on some machines" lottery and gives wired headsets (3.5mm/USB
  headphone+mic) input-and-output support out of the box. Adds
  xfce4-pulseaudio-plugin (right-click → Add to put on the panel) and
  pavucontrol for per-app + per-device control.

- Window edge-tiling: xfwm4 /general/tile_on_move = true. Drag a window
  to the left/right edge to fill that half, top edge to maximise — the
  Windows-style snap behaviour kids already expect.

- Wallpaper fallback monitor list: include HDMI-2/HDMI2 (and HDMI-A-1,
  DP-2, DisplayPort-1/2). At least one CC PC has its only display on
  HDMI-2 and was being skipped when xrandr --listactivemonitors came
  up empty during the 30 s retry window. xfdesktop ignores last-image
  keys for outputs that don't exist, so over-listing is safe.
With wrap_windows=true (xfwm4 default), the cursor wraps to the opposite
screen edge before the edge-tile preview can trigger, so drag-to-edge
tiling silently does nothing. With a single workspace these wrap modes
have no useful purpose anyway.
`aplay -l`, `speaker-test`, `pactl list` etc. are useful in the field
and during VM testing — pavucontrol covers the GUI case but a terminal
on a kid's PC is faster for triage.
Chrome's modern Linux passkey flow uses BT-LE proximity to a phone
acting as the authenticator (the QR-scan-with-phone option). Without
hardware.bluetooth, Chrome can't initialise that transport and the
QR code option silently doesn't appear.

Doesn't enable gnome-keyring (intentionally still off, see
services.gnome.gnome-keyring.enable = false above) — that route is
about platform authenticators which Chrome on Linux barely supports
and which don't make sense on a live CD anyway.

blueman-applet adds a GUI tray for pairing.
…K5rh

Audio, edge-tiling, and HDMI-2 wallpaper fallback
@kimptoc
Copy link
Copy Markdown
Owner Author

kimptoc commented May 2, 2026

XFCE Edge Tiling Keyboard Shortcuts Fix

Issue

The Super+Arrow keyboard shortcuts for window edge tiling were not working on the XFCE desktop.

Root Cause

XFCE's default edge tiling shortcuts only bind to the numeric keypad (<Super>KP_Left, <Super>KP_Right, etc.), not the regular arrow keys (<Super>Left, <Super>Right).

This means users without a numeric keypad, or those expecting standard Super+Arrow behavior (similar to Windows), cannot use edge tiling.

Configuration Found

Existing Settings (all correct)

  • /general/tile_on_move = true - enables tiling on window move to screen edge
  • /general/snap_to_border = true - enables snapping to screen borders
  • /general/snap_width = 10 - defines snap distance in pixels
  • Compositor enabled
  • xfwm4 version 4.20.0 running correctly
  • No conflicting window managers

Default Shortcuts (KP only)

/xfwm4/default/<Super>KP_Left    -> tile_left_key
/xfwm4/default/<Super>KP_Right   -> tile_right_key
/xfwm4/default/<Super>KP_Up      -> tile_up_key
/xfwm4/default/<Super>KP_Down    -> tile_down_key

Fix Applied

Added missing Super+Arrow key shortcuts:

# Left/Right tiling
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super>Left' -s 'tile_left_key' --create -n -t string
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super>Right' -s 'tile_right_key' --create -n -t string

# Up/Down tiling (maximize vertical)
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super>Up' -s 'tile_up_key' --create -n -t string
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super>Down' -s 'tile_down_key' --create -n -t string

# Corner tiling with Alt modifier
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super><Alt>Left' -s 'tile_up_left_key' --create -n -t string
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super><Alt>Right' -s 'tile_up_right_key' --create -n -t string
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super><Ctrl>Left' -s 'tile_down_left_key' --create -n -t string
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super><Ctrl>Right' -s 'tile_down_right_key' --create -n -t string

Recommended NixOS Module Configuration

Add to NixOS configuration to apply these shortcuts at build time:

# In the XFCE configuration section
services.xserver.desktopManager.xfce.enable = true;
services.xserver.desktopManager.xfce.extraShortcuts = {
  "<Super>Left" = "tile_left_key";
  "<Super>Right" = "tile_right_key";
  "<Super>Up" = "tile_up_key";
  "<Super>Down" = "tile_down_key";
  "<Super><Alt>Left" = "tile_up_left_key";
  "<Super><Alt>Right" = "tile_up_right_key";
  "<Super><Ctrl>Left" = "tile_down_left_key";
  "<Super><Ctrl>Right" = "tile_down_right_key";
};

Or manually add to /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml in the xfwm4 custom section.

Verification

After applying changes, verify with:

xfconf-query -c xfce4-keyboard-shortcuts -l -v | grep -E '/xfwm4/custom/<Super>(Left|Right|Up|Down)'

Expected output should show the tile_key commands for each direction.

Current Status

  • Super+Left: Working
  • Super+Right: Working
  • Super+Down: Working
  • Super+Up: Not working (investigating - may conflict with default up_key binding)

xfwm4's defaults only bind tile_left_key/right/up/down to the numeric
keypad (<Super>KP_*). On laptops and CC PCs without a numpad, Super+
Arrow silently does nothing. Add the regular-arrow bindings (and the
corner tiles via Alt/Ctrl modifiers) so kids get the Windows-style
shortcuts they expect.

Per Chris's PR #17 comment.
…K5rh

Edge-tiling polish, Super+Arrow keys, Bluetooth, audio diag tools
@kimptoc kimptoc changed the title Switch desktop environment from GNOME to KDE Plasma 6 Switch desktop environment from GNOME to xfce May 2, 2026
cattyclaw-bot added 2 commits May 2, 2026 22:29
xfwm4 only fires keybindings under the active keytheme. A fresh user
session has keytheme="Default", so bindings written under
/xfwm4/custom/ were correctly stored but ignored. Move them to
/xfwm4/default/ where they sit alongside the existing KP_* defaults
and fire on first boot.
tile_up_key only fills the top half; Windows users expect Super+Up to
toggle maximize. Switch to maximize_window_key. The -r before -n drops
any pre-existing binding on <Super>Up so the action takes cleanly,
addressing Chris's "Super+Up not working / may conflict with up_key"
note from PR #17.
@kimptoc
Copy link
Copy Markdown
Owner Author

kimptoc commented May 3, 2026

XFCE Keyboard Shortcuts (Edge Tiling) - Analysis

Issue: Super+Arrow key shortcuts for window tiling do not work on the CodeClub NixOS Live CD, despite being configured in iso.nix.

Branch: claude/fix-xfce-wallpaper-FK5rh (the branch that adds XFCE + edge-tiling support)


Background

PR #20 and PR #21 added edge-tiling support to the Live CD:

  • Drag-to-edge tiling (tile_on_move=true, wrap_windows=false, wrap_workspaces=false)
  • Super+Arrow key shortcuts for window tiling (Windows-style)

These were intended to work via xfconf-query commands in the myautostart systemd service.


Investigation Findings

1. Configuration in Source

The iso.nix file (lines 578–586) uses:

$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super>Left' -n -t string -s 'tile_left_key'

All eight shortcuts use /xfwm4/custom/ paths.

2. Configuration on Running System

On a live system built from this branch, two discrepancies were found:

a) Built script uses /xfwm4/default/ not /xfwm4/custom/

The generated /nix/store/...-unit-script-myautostart-start/bin/myautostart-start contains:

$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super>Left' -n -t string -s 'tile_left_key'

The comments in the built script explain the reasoning:

"bindings under /xfwm4/default/ — that's the active keytheme on a fresh user (writing under /xfwm4/custom/ instead would only fire if the user had switched their xfwm4 keytheme to 'Custom')."

This indicates someone already realised custom was wrong and patched it during build.

b) Even with /xfwm4/default/, some shortcuts are missing

On the live system, only these Super+Arrow bindings were present:

  • Super+Righttile_right_key
  • Super+Upmaximize_window_key
  • Super+Downtile_down_key
  • Super+LeftMISSING

The Super+Left binding did not exist in the xfce4-keyboard-shortcuts channel, meaning the xfconf-query command failed silently or was not executed properly.

3. Channel Behaviour

The xfce4-keyboard-shortcuts channel has two name spaces:

  • /xfwm4/default/... — used when the window manager key theme is "Default"
  • /xfwm4/custom/... — used when the key theme is "Custom"

A fresh XFCE session uses the "Default" key theme unless the user explicitly changes it. Therefore:

  • Writing to /xfwm4/custom/ has no effect on a fresh/Live CD session
  • Writing to /xfwm4/default/ is required

Custom bindings do appear in the merged channel listing, but xfwm4 only reads from the channel matching the current key theme. The default key theme reads from default, not custom.


Root Cause

The iso.nix source writes keyboard shortcuts to /xfwm4/custom/, which is only read if the user changes the xfwm4 key theme to "Custom". A fresh XFCE session (including the Live CD) uses the "Default" key theme, which reads from /xfwm4/default/.

Additionally, the -n (create-only) flag without a preceding -r (reset) makes the command non-idempotent. If the property already exists (e.g. from a previous boot with persistent /home), the -n causes the command to fail silently, leaving the binding unset. This likely explains why Super+Left was missing on the test system.


Fix Required

Update the keyboard shortcut lines in iso.nix (around line 578–586) to:

  1. Use /xfwm4/default/ instead of /xfwm4/custom/
  2. Add -r before -n to reset any existing property first, ensuring idempotency
# Super+Arrow tile shortcuts: write to /xfwm4/default/ because a fresh
# XFCE session uses the "Default" keytheme. Reset first (-r) so the
# commands are safe to re-run (e.g. on a live CD that persists /home).
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super>Left'  -r -n -t string -s 'tile_left_key'   2>>$MYLOG
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super>Right' -r -n -t string -s 'tile_right_key'  2>>$MYLOG
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super>Up'    -r -n -t string -s 'maximize_window_key' 2>>$MYLOG
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super>Down'  -r -n -t string -s 'tile_down_key'   2>>$MYLOG
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super><Alt>Left'   -r -n -t string -s 'tile_up_left_key'    2>>$MYLOG
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super><Alt>Right'  -r -n -t string -s 'tile_up_right_key'   2>>$MYLOG
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super><Ctrl>Left'  -r -n -t string -s 'tile_down_left_key'  2>>$MYLOG
$XQ -c xfce4-keyboard-shortcuts -p '/xfwm4/default/<Super><Ctrl>Right' -r -n -t string -s 'tile_down_right_key' 2>>$MYLOG
echo "xfwm4 Super+Arrow tile keys bound" >> $MYLOG

Verification

After applying the fix and rebuilding the ISO:

  1. Boot the Live CD
  2. Check /home/codeclub/myautostart.log contains xfwm4 Super+Arrow tile keys bound
  3. Run xfconf-query -c xfce4-keyboard-shortcuts -l | grep "/xfwm4/default/<Super>" — should show all 8 bindings with their action values
  4. Test: focus a window and press Super+Left → should tile to left half
  5. Test: Super+Right, Super+Up (maximise), Super+Down (tile bottom)
  6. Test: Super+Alt+Arrow (corner tiles) and Super+Ctrl+Arrow (other corners)

Related Settings (already working)

  • tile_on_move = true — drag window to edge to tile
  • wrap_windows = false — prevents cursor wrapping at screen edge, enabling edge-tiling
  • wrap_workspaces = false — prevents workspace wrap

These are correctly set in the same myautostart script via the xfwm4 channel.


Note on Current Branch State

The branch claude/fix-xfce-wallpaper-FK5rh was supposed to have the Super+Arrow fixes, but the source file still contains /xfwm4/custom/. Either:

  • The fix was applied post-merge in a local build that produced the running system
  • Or the built script you're running came from a build that had an uncommitted patch

To ensure the fix is permanent and reproducible, the source iso.nix must be updated to use /xfwm4/default/ with -r -n.

Per kimptoc's review on PR #17: xfconf-query -n is create-only and
fails silently when the property already exists. <Super>Left has a
default workspace-switch binding on stock xfwm4, which is why on the
test box that one binding stayed unset while Super+Right/Up/Down took.

Switch all 8 Super+Arrow shortcuts (and the corner Alt/Ctrl variants)
to -r -n so each property is reset first and then re-created with the
intended action. Folds the previous Super+Up two-line reset/create
into the same single-call pattern.
kimptoc and others added 6 commits May 3, 2026 22:06
…K5rh

Super+Arrow tile shortcuts: move to /xfwm4/default/ and reset before create
…alls

xfconf-query 4.20 (the version in the closure) refuses -r and -n in the
same invocation: "--create and --reset options can not be used together".
The previous attempt to fold reset+create into one call produced 8 such
errors per boot in ~/myautostart.log (one per binding) and left every
binding unset — the trailing "Super+Arrow tile keys bound" line in the
log is just an unconditional echo, not a status check.

Issue each -r and -n as separate calls (the original Super+Up pattern),
extended to all 8 bindings.
…K5rh

Fix Super+Arrow bindings: split xfconf-query reset and create
The previous "move to /xfwm4/default/" theory (97c7365) was inverted.
On this NixOS xfwm4 image /xfwm4/custom/override is true at first
login, making "Custom" the live key theme — xfwm4 reads bindings only
from /xfwm4/custom/ and silently ignores anything under
/xfwm4/default/. xfconf accepted our default-tree writes, but xfwm4
never grabbed the keys: verified live with xev, which showed
Super+Left flowing through to applications with state=Mod4Mask
untouched (no XGrabKey installed for it).

The stock <Super>KP_* numpad tile bindings ship in /xfwm4/custom/
already, which is why those always worked while the regular-arrow
bindings we kept adding to default never did.

Drop the -r reset dance (these regular-arrow paths don't pre-exist
in /xfwm4/custom/ on a fresh boot, so plain -n create is sufficient
and idempotent).

Add per-binding readback echoed into the autostart log via a small
bind_xfwm4 helper. The old "xfwm4 Super+Arrow tile keys bound" line
was an unconditional echo, not a status check, which hid silent
xfconf no-ops through three iterations of this fix. Future logs
will show which bindings took and which didn't, in one place.

Verified live by writing the same bindings to /xfwm4/custom/ via
xfconf-query on a running ISO: Super+Left/Right tile, Super+Up
maximises, Super+Down tiles bottom-half.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previous attempt (3ebd971) wrote bindings to /xfwm4/custom/ correctly
but 4 of 8 still silently failed to grab on a fresh boot. Two extra
defenses make this reliable:

1. Delete the four /xfwm4/custom/<Super>KP_{Right,Down,End,Next}
   numpad siblings before writing our regular-arrow bindings. xfwm4
   4.20 stores ONE binding per action enum (one slot in
   screen_info->params->keys[KEY_*]) — when two custom-tree paths
   point at the same tile_*_key, its runtime cb_shortcut_added
   installs only one grab, and not necessarily ours. Verified live
   with xev: with both <Super>Right and <Super>KP_Right pointing at
   tile_right_key, Super+Right reached applications with state=
   Mod4Mask untouched (no XGrabKey for it). Removing the numpad
   siblings is a non-regression — Code Club kit has no numpads.

2. Reset (-r) each target path before -n create. -n is no-op when
   the property already exists with ANY type, and we hit a case
   where /xfwm4/custom/<Super>Down had been promoted to an array
   [tile_down_key,tile_down_left_key] (origin unclear, likely from
   xfwm4-settings GUI fiddling on a previous live-CD test). xfwm4
   silently can't parse arrays as bindings → no grab. -r before -n
   guarantees a clean string property.

Verified the runtime equivalent of these two changes on the live
ISO: deleting the four KP_* siblings, then -r/-n-rewriting the
Super+Down array, made all 8 keyboard tiling combos fire correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…K5rh

Fix Super+Arrow keyboard tiling: write to /xfwm4/custom/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants