|
3 | 3 | # Script Name: biglinux-install-setup.sh |
4 | 4 | # Description: BigLinux Post-Installation Configuration |
5 | 5 | # Called by Calamares grubcfg-fix module after installation. |
6 | | -# Configures GRUB, SDDM session, and migrates live session |
7 | | -# settings (theme, desktop, JamesDSP, display profile). |
| 6 | +# Configures GRUB, display manager session, and migrates live |
| 7 | +# session settings (theme, desktop, JamesDSP, display profile). |
8 | 8 | # Package: biglinux-livecd |
9 | 9 | # |
| 10 | +# Supported Desktop Environments: |
| 11 | +# - KDE Plasma (SDDM) |
| 12 | +# - GNOME (GDM) |
| 13 | +# - Cinnamon (LightDM) |
| 14 | +# - XFCE (LightDM) |
| 15 | +# |
10 | 16 | # Usage: biglinux-install-setup.sh <root_mount_point> |
11 | 17 | #=============================================================================== |
12 | 18 |
|
|
21 | 27 |
|
22 | 28 | # Define paths relative to root mount point |
23 | 29 | GRUB_FILE="$ROOT_MOUNT/etc/default/grub" |
24 | | -SDDM_STATE="$ROOT_MOUNT/var/lib/sddm/state.conf" |
25 | 30 | CONFIG_DIR="$ROOT_MOUNT/etc/big-default-config" |
26 | 31 |
|
| 32 | +#------------------------------------------------------------------------------- |
| 33 | +# Detect Desktop Environment |
| 34 | +#------------------------------------------------------------------------------- |
| 35 | +detect_desktop_environment() { |
| 36 | + if [[ -e "$ROOT_MOUNT/usr/bin/startplasma-x11" ]] || [[ -e "$ROOT_MOUNT/usr/share/xsessions/plasma.desktop" ]]; then |
| 37 | + echo "plasma" |
| 38 | + elif [[ -e "$ROOT_MOUNT/usr/bin/gnome-session" ]] || [[ -e "$ROOT_MOUNT/usr/bin/startgnome-community" ]]; then |
| 39 | + echo "gnome" |
| 40 | + elif [[ -e "$ROOT_MOUNT/usr/bin/cinnamon-session" ]] || [[ -e "$ROOT_MOUNT/usr/bin/startcinnamon-community" ]]; then |
| 41 | + echo "cinnamon" |
| 42 | + elif [[ -e "$ROOT_MOUNT/usr/bin/startxfce4" ]] || [[ -e "$ROOT_MOUNT/usr/bin/startxfce-community" ]]; then |
| 43 | + echo "xfce" |
| 44 | + else |
| 45 | + echo "unknown" |
| 46 | + fi |
| 47 | +} |
| 48 | + |
| 49 | +DESKTOP_ENV=$(detect_desktop_environment) |
| 50 | +echo "Detected desktop environment: $DESKTOP_ENV" |
| 51 | + |
27 | 52 | #------------------------------------------------------------------------------- |
28 | 53 | # Configure GRUB Bootloader |
29 | 54 | #------------------------------------------------------------------------------- |
@@ -54,32 +79,121 @@ if [[ -f "$GRUB_FILE" ]]; then |
54 | 79 | fi |
55 | 80 |
|
56 | 81 | #------------------------------------------------------------------------------- |
57 | | -# Configure SDDM Session (Wayland vs X11) |
| 82 | +# Configure Display Manager Session |
| 83 | +# Sets the default session based on desktop environment and session type |
58 | 84 | #------------------------------------------------------------------------------- |
59 | | -mkdir -p "$(dirname "$SDDM_STATE")" |
60 | | -if grep -q wayland /proc/cmdline; then |
61 | | - echo "[Last] |
62 | | - Session=/usr/share/wayland-sessions/plasmawayland.desktop" > "$SDDM_STATE" |
63 | | -else |
64 | | - echo "[Last] |
65 | | - Session=/usr/share/xsessions/plasma.desktop" > "$SDDM_STATE" |
66 | | -fi |
| 85 | +configure_display_manager_session() { |
| 86 | + local is_wayland=false |
| 87 | + grep -q wayland /proc/cmdline && is_wayland=true |
| 88 | + |
| 89 | + case "$DESKTOP_ENV" in |
| 90 | + plasma) |
| 91 | + # KDE Plasma uses SDDM |
| 92 | + local sddm_state="$ROOT_MOUNT/var/lib/sddm/state.conf" |
| 93 | + mkdir -p "$(dirname "$sddm_state")" |
| 94 | + if $is_wayland; then |
| 95 | + echo "[Last] |
| 96 | +Session=/usr/share/wayland-sessions/plasmawayland.desktop" > "$sddm_state" |
| 97 | + else |
| 98 | + echo "[Last] |
| 99 | +Session=/usr/share/xsessions/plasma.desktop" > "$sddm_state" |
| 100 | + fi |
| 101 | + echo "Configured SDDM for Plasma ($($is_wayland && echo 'Wayland' || echo 'X11'))" |
| 102 | + ;; |
| 103 | + |
| 104 | + gnome) |
| 105 | + # GNOME uses GDM |
| 106 | + local gdm_custom="$ROOT_MOUNT/etc/gdm/custom.conf" |
| 107 | + mkdir -p "$(dirname "$gdm_custom")" |
| 108 | + if $is_wayland; then |
| 109 | + # Enable Wayland for GDM |
| 110 | + cat > "$gdm_custom" << 'EOF' |
| 111 | +[daemon] |
| 112 | +WaylandEnable=true |
| 113 | +DefaultSession=gnome.desktop |
| 114 | +
|
| 115 | +[security] |
| 116 | +
|
| 117 | +[xdmcp] |
| 118 | +
|
| 119 | +[chooser] |
| 120 | +
|
| 121 | +[debug] |
| 122 | +EOF |
| 123 | + else |
| 124 | + # Force X11 for GDM |
| 125 | + cat > "$gdm_custom" << 'EOF' |
| 126 | +[daemon] |
| 127 | +WaylandEnable=false |
| 128 | +DefaultSession=gnome-xorg.desktop |
| 129 | +
|
| 130 | +[security] |
| 131 | +
|
| 132 | +[xdmcp] |
| 133 | +
|
| 134 | +[chooser] |
| 135 | +
|
| 136 | +[debug] |
| 137 | +EOF |
| 138 | + fi |
| 139 | + echo "Configured GDM for GNOME ($($is_wayland && echo 'Wayland' || echo 'X11'))" |
| 140 | + ;; |
| 141 | + |
| 142 | + cinnamon) |
| 143 | + # Cinnamon uses LightDM (X11 only) |
| 144 | + local lightdm_conf="$ROOT_MOUNT/etc/lightdm/lightdm.conf.d/50-biglinux.conf" |
| 145 | + mkdir -p "$(dirname "$lightdm_conf")" |
| 146 | + cat > "$lightdm_conf" << 'EOF' |
| 147 | +[Seat:*] |
| 148 | +user-session=cinnamon |
| 149 | +EOF |
| 150 | + echo "Configured LightDM for Cinnamon" |
| 151 | + ;; |
| 152 | + |
| 153 | + xfce) |
| 154 | + # XFCE uses LightDM (X11 only) |
| 155 | + local lightdm_conf="$ROOT_MOUNT/etc/lightdm/lightdm.conf.d/50-biglinux.conf" |
| 156 | + mkdir -p "$(dirname "$lightdm_conf")" |
| 157 | + cat > "$lightdm_conf" << 'EOF' |
| 158 | +[Seat:*] |
| 159 | +user-session=xfce |
| 160 | +EOF |
| 161 | + echo "Configured LightDM for XFCE" |
| 162 | + ;; |
| 163 | + |
| 164 | + *) |
| 165 | + echo "Warning: Unknown desktop environment, skipping display manager configuration" |
| 166 | + ;; |
| 167 | + esac |
| 168 | +} |
| 169 | + |
| 170 | +configure_display_manager_session |
67 | 171 |
|
68 | 172 | #------------------------------------------------------------------------------- |
69 | 173 | # Migrate Live Session Configuration to Installed System |
70 | 174 | #------------------------------------------------------------------------------- |
71 | 175 | mkdir -p "$CONFIG_DIR" |
72 | 176 |
|
73 | | -# Copy theme config if exists |
74 | | -[[ -f "/tmp/big_desktop_theme" ]] && cp -f "/tmp/big_desktop_theme" "$CONFIG_DIR/theme" |
| 177 | +# KDE Plasma specific configs |
| 178 | +if [[ "$DESKTOP_ENV" == "plasma" ]]; then |
| 179 | + # Copy theme config if exists (KDE themes like Breeze, etc) |
| 180 | + [[ -f "/tmp/big_desktop_theme" ]] && cp -f "/tmp/big_desktop_theme" "$CONFIG_DIR/theme" |
75 | 181 |
|
76 | | -# Copy desktop config if exists |
77 | | -[[ -f "/tmp/big_desktop_changed" ]] && cp -f "/tmp/big_desktop_changed" "$CONFIG_DIR/desktop" |
| 182 | + # Copy desktop layout config if exists (KDE panel layouts) |
| 183 | + [[ -f "/tmp/big_desktop_changed" ]] && cp -f "/tmp/big_desktop_changed" "$CONFIG_DIR/desktop" |
| 184 | +fi |
| 185 | + |
| 186 | +# GNOME/Cinnamon/XFCE specific configs (simplified theme: light/dark) |
| 187 | +if [[ "$DESKTOP_ENV" == "gnome" ]] || [[ "$DESKTOP_ENV" == "cinnamon" ]] || [[ "$DESKTOP_ENV" == "xfce" ]]; then |
| 188 | + # Copy simple theme selection (light/dark) |
| 189 | + [[ -f "/tmp/big_simple_theme" ]] && cp -f "/tmp/big_simple_theme" "$CONFIG_DIR/simple-theme" |
| 190 | +fi |
78 | 191 |
|
| 192 | +# Common configs for all desktop environments |
79 | 193 | # Copy JamesDSP flag if exists |
80 | 194 | [[ -f "/tmp/big_enable_jamesdsp" ]] && cp -f "/tmp/big_enable_jamesdsp" "$CONFIG_DIR/jamesdsp" |
81 | 195 |
|
82 | | -# Copy display profile flag if exists |
| 196 | +# Copy display profile/ICC flag if exists |
83 | 197 | [[ -f "/tmp/big_improve_display" ]] && cp -f "/tmp/big_improve_display" "$CONFIG_DIR/display-profile" |
84 | 198 |
|
85 | | -echo "BigLinux installation setup completed successfully" |
| 199 | +echo "BigLinux installation setup completed successfully for $DESKTOP_ENV" |
0 commit comments