Skip to content

Commit 8b9adf9

Browse files
committed
🔨 refactor: Added settings to default-biglinux-config for Cinnamon, XFCE, and Gnome.
1 parent b35f68c commit 8b9adf9

2 files changed

Lines changed: 133 additions & 19 deletions

File tree

‎biglinux-livecd/usr/bin/biglinux-install-setup.sh‎

Lines changed: 132 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
# Script Name: biglinux-install-setup.sh
44
# Description: BigLinux Post-Installation Configuration
55
# 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).
88
# Package: biglinux-livecd
99
#
10+
# Supported Desktop Environments:
11+
# - KDE Plasma (SDDM)
12+
# - GNOME (GDM)
13+
# - Cinnamon (LightDM)
14+
# - XFCE (LightDM)
15+
#
1016
# Usage: biglinux-install-setup.sh <root_mount_point>
1117
#===============================================================================
1218

@@ -21,9 +27,28 @@ fi
2127

2228
# Define paths relative to root mount point
2329
GRUB_FILE="$ROOT_MOUNT/etc/default/grub"
24-
SDDM_STATE="$ROOT_MOUNT/var/lib/sddm/state.conf"
2530
CONFIG_DIR="$ROOT_MOUNT/etc/big-default-config"
2631

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+
2752
#-------------------------------------------------------------------------------
2853
# Configure GRUB Bootloader
2954
#-------------------------------------------------------------------------------
@@ -54,32 +79,121 @@ if [[ -f "$GRUB_FILE" ]]; then
5479
fi
5580

5681
#-------------------------------------------------------------------------------
57-
# Configure SDDM Session (Wayland vs X11)
82+
# Configure Display Manager Session
83+
# Sets the default session based on desktop environment and session type
5884
#-------------------------------------------------------------------------------
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
67171

68172
#-------------------------------------------------------------------------------
69173
# Migrate Live Session Configuration to Installed System
70174
#-------------------------------------------------------------------------------
71175
mkdir -p "$CONFIG_DIR"
72176

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"
75181

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
78191

192+
# Common configs for all desktop environments
79193
# Copy JamesDSP flag if exists
80194
[[ -f "/tmp/big_enable_jamesdsp" ]] && cp -f "/tmp/big_enable_jamesdsp" "$CONFIG_DIR/jamesdsp"
81195

82-
# Copy display profile flag if exists
196+
# Copy display profile/ICC flag if exists
83197
[[ -f "/tmp/big_improve_display" ]] && cp -f "/tmp/big_improve_display" "$CONFIG_DIR/display-profile"
84198

85-
echo "BigLinux installation setup completed successfully"
199+
echo "BigLinux installation setup completed successfully for $DESKTOP_ENV"

‎biglinux-livecd/usr/share/biglinux/calamares/src/utils/constants.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Application Information
1010
APP_NAME = "BigLinux Calamares Config"
1111
APP_ID = "com.biglinux.calamares-config"
12-
APP_VERSION = "1.0.0"
12+
APP_VERSION = "1.0.1"
1313

1414
# Paths and Directories
1515
BASE_DIR = Path(__file__).parent.parent.parent

0 commit comments

Comments
 (0)