From 941f906e29adb0a6fc40ac9280ff8802b7c5fd8f Mon Sep 17 00:00:00 2001 From: mozempk Date: Thu, 23 Apr 2026 08:10:10 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Nemo=20terminal/keymap/vscode=20?= =?UTF-8?q?=E2=80=94=20alacritty=20default,=20CH+FR=20lock,=20code=20actio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dconf 00-cinnamon: add org.cinnamon+gnome.desktop.default-applications.terminal exec='alacritty' exec-arg='-e' so Nemo right-click → Open in Terminal works - dconf locks/keyboard: lock input-sources/sources and terminal exec keys so csd-keyboard doesn't reset them to defaults on first session start - build-live-iso.sh: add code-open wrapper script (/usr/local/bin/code-open) that finds 'code' in the live user's nix profile; add open-in-vscode Nemo action to /usr/share/nemo/actions/ - config/install.conf: add nixpkgs#vscode to NIX_USER_PACKAGES - packages.live-desktop.list: add setxkbmap (needed by csd-keyboard to apply XKB keyboard layout) --- config/install.conf | 1 + .../packages.live-desktop.list | 1 + iso/build-live-iso.sh | 58 +++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/config/install.conf b/config/install.conf index 4edaf33..bff7936 100644 --- a/config/install.conf +++ b/config/install.conf @@ -77,6 +77,7 @@ NIX_USER_PACKAGES=( "nixpkgs#localsend" "nixpkgs#google-chrome" "nixpkgs#mission-center" + "nixpkgs#vscode" ) # ---------- Cinnamon customization ---------- diff --git a/config/profiles/stable-cinnamon/packages.live-desktop.list b/config/profiles/stable-cinnamon/packages.live-desktop.list index 6c033c4..bffc4da 100644 --- a/config/profiles/stable-cinnamon/packages.live-desktop.list +++ b/config/profiles/stable-cinnamon/packages.live-desktop.list @@ -105,6 +105,7 @@ font-awesome6 # --- terminal --- alacritty +setxkbmap # --- gtk theming deps --- sassc diff --git a/iso/build-live-iso.sh b/iso/build-live-iso.sh index 421c650..7f0ca8c 100755 --- a/iso/build-live-iso.sh +++ b/iso/build-live-iso.sh @@ -397,12 +397,31 @@ picture-options='zoom' [org/gnome/desktop/input-sources] sources=[('xkb', 'ch+fr')] +[org/cinnamon/desktop/default-applications/terminal] +exec='alacritty' +exec-arg='-e' + +[org/gnome/desktop/default-applications/terminal] +exec='alacritty' +exec-arg='-e' + [org/cinnamon/desktop/keybindings/custom-keybindings/custom0] name='Open Terminal' command='${DEFAULT_TERMINAL:-alacritty}' binding=['t'] EOF +# dconf lock file — prevents the live user's session from overriding the +# keyboard layout with an empty list on first start. +install -d -m 0755 "$INCLUDE_DIR/etc/dconf/db/local.d/locks" +cat > "$INCLUDE_DIR/etc/dconf/db/local.d/locks/keyboard" <<'EOF' +/org/gnome/desktop/input-sources/sources +/org/cinnamon/desktop/default-applications/terminal/exec +/org/cinnamon/desktop/default-applications/terminal/exec-arg +/org/gnome/desktop/default-applications/terminal/exec +/org/gnome/desktop/default-applications/terminal/exec-arg +EOF + # ── 3e) Copy themes/icons/wallpapers directly into usr/share ──────────── # (dconf compile happens inside the Docker container — see _inner-build-live.sh) install -d -m 0755 "$INCLUDE_DIR/usr/share/backgrounds/void-installer" @@ -414,6 +433,45 @@ install -d -m 0755 "$INCLUDE_DIR/usr/share/themes" install -d -m 0755 "$INCLUDE_DIR/usr/share/icons" [[ -d "$OVERLAY/icons" ]] && cp -a "$OVERLAY/icons"/. "$INCLUDE_DIR/usr/share/icons/" 2>/dev/null || true +# ── 3e-bis) Nemo actions ───────────────────────────────────────────────── +install -d -m 0755 "$INCLUDE_DIR/usr/share/nemo/actions" +install -d -m 0755 "$INCLUDE_DIR/usr/local/bin" + +# Wrapper script: finds 'code' in the live user's nix profile. +# Used by the Nemo action so it doesn't need to know the nix profile path. +cat > "$INCLUDE_DIR/usr/local/bin/code-open" <<'EOF' +#!/bin/sh +# Open VS Code for the given file/folder arguments. +# Looks in the live user's nix profile first, then falls back to PATH. +for d in "/home/live/.nix-profile/bin" /nix/var/nix/profiles/per-user/live/profile/bin \ + /usr/local/bin /usr/bin; do + if [ -x "$d/code" ]; then + exec "$d/code" "$@" + fi +done +exec code "$@" +EOF +chmod 0755 "$INCLUDE_DIR/usr/local/bin/code-open" + +# Nemo action: Open in VS Code +cat > "$INCLUDE_DIR/usr/share/nemo/actions/open-in-vscode.nemo_action" <<'EOF' +[Nemo Action] + +Name=Open in VS _Code + +Comment=Open in Visual Studio Code + +Exec=/usr/local/bin/code-open %F + +Icon-Name=code + +Selection=Any + +Extensions=any; + +Dependencies=/usr/local/bin/code-open; +EOF + # ── 3f) first-login autostart + profile.d for the live user ───────────── install -d -m 0755 "$INCLUDE_DIR/etc/xdg/autostart" if [[ -r "$OVERLAY/first-login.sh" ]]; then