Skip to content

Commit b95d852

Browse files
committed
GDM fixes and quickshell fixes
1 parent c289882 commit b95d852

File tree

6 files changed

+341
-420
lines changed

6 files changed

+341
-420
lines changed

build_files/build.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fi
112112

113113
### Install GDM branding (login screen customization)
114114
if [ -d /usr/share/hypercube/config/gdm/dconf ]; then
115-
echo "Installing GDM branding..."
115+
echo "Installing GDM dconf settings..."
116116

117117
# Install dconf profile for GDM
118118
mkdir -p /etc/dconf/profile
@@ -127,16 +127,18 @@ if [ -d /usr/share/hypercube/config/gdm/dconf ]; then
127127
# Compile the dconf database
128128
dconf update
129129

130-
echo "GDM branding installed successfully"
130+
echo "GDM dconf settings installed successfully"
131131
fi
132132

133-
### Install GDM Tokyo Night theme CSS
134-
if [ -f /usr/share/hypercube/config/gdm/gnome-shell/gnome-shell.css ]; then
135-
echo "Installing GDM Tokyo Night CSS theme..."
133+
### Install GDM theme (modifies gnome-shell-theme.gresource)
134+
# This patches the GDM background to show our logo centered on black
135+
if [ -f /ctx/gdm-theme.sh ] && [ -f /usr/share/pixmaps/hypercube-logo.png ]; then
136+
# Install tools needed to extract and recompile gresource
137+
dnf5 -y install glib2-devel
136138

137-
# Install custom CSS to GDM's gnome-shell theme directory
138-
mkdir -p /usr/share/gnome-shell/theme
139-
cp -f /usr/share/hypercube/config/gdm/gnome-shell/gnome-shell.css /usr/share/gnome-shell/theme/gdm.css
139+
/ctx/gdm-theme.sh
140140

141-
echo "GDM Tokyo Night CSS theme installed successfully"
141+
# Remove build tools to keep image clean
142+
dnf5 -y remove glib2-devel
143+
dnf5 -y autoremove
142144
fi

build_files/gdm-theme.sh

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#!/bin/bash
2+
# Hypercube GDM Theme Installation
3+
# Modifies gnome-shell-theme.gresource to customize GDM login screen
4+
#
5+
# This script extracts the GNOME Shell theme gresource, patches the CSS
6+
# to use our custom background, and recompiles it.
7+
8+
set -euo pipefail
9+
10+
GRESOURCE="/usr/share/gnome-shell/gnome-shell-theme.gresource"
11+
WORKDIR="/var/tmp/gdm-theme-workdir"
12+
LOGO_PATH="/usr/share/pixmaps/hypercube-logo.png"
13+
14+
echo "Installing Hypercube GDM theme..."
15+
16+
# Verify required files exist
17+
if [ ! -f "$GRESOURCE" ]; then
18+
echo "ERROR: $GRESOURCE not found"
19+
exit 1
20+
fi
21+
22+
if [ ! -f "$LOGO_PATH" ]; then
23+
echo "ERROR: $LOGO_PATH not found"
24+
exit 1
25+
fi
26+
27+
# Verify gresource tools are available
28+
if ! command -v gresource &> /dev/null; then
29+
echo "ERROR: gresource command not found. Install glib2-devel."
30+
exit 1
31+
fi
32+
33+
if ! command -v glib-compile-resources &> /dev/null; then
34+
echo "ERROR: glib-compile-resources command not found. Install glib2-devel."
35+
exit 1
36+
fi
37+
38+
# Create working directory
39+
rm -rf "$WORKDIR"
40+
mkdir -p "$WORKDIR/theme"
41+
42+
# Extract all resources from the gresource file
43+
echo "Extracting gnome-shell-theme.gresource..."
44+
for resource in $(gresource list "$GRESOURCE"); do
45+
# Remove /org/gnome/shell/ prefix for local path
46+
local_path="${resource#/org/gnome/shell/}"
47+
mkdir -p "$WORKDIR/$(dirname "$local_path")"
48+
gresource extract "$GRESOURCE" "$resource" > "$WORKDIR/$local_path"
49+
done
50+
51+
# Copy our logo to the theme directory so it can be embedded
52+
cp "$LOGO_PATH" "$WORKDIR/theme/hypercube-logo.png"
53+
54+
# Patch the CSS files to use our custom background
55+
# We need to modify both light and dark variants
56+
for css_file in "$WORKDIR/theme/gnome-shell.css" "$WORKDIR/theme/gnome-shell-light.css" "$WORKDIR/theme/gnome-shell-dark.css"; do
57+
if [ -f "$css_file" ]; then
58+
echo "Patching $(basename "$css_file")..."
59+
60+
# Replace the #lockDialogGroup background
61+
# The original typically has: background-color: $system_bg_color; or similar
62+
# We replace any existing #lockDialogGroup block with our custom one
63+
64+
if grep -q '#lockDialogGroup' "$css_file"; then
65+
# Use sed to replace the existing #lockDialogGroup block
66+
# This handles multi-line blocks by replacing just the background property
67+
sed -i 's|#lockDialogGroup {|#lockDialogGroup { background: #000000 url(resource:///org/gnome/shell/theme/hypercube-logo.png) no-repeat center center; background-size: auto;|' "$css_file"
68+
# Remove any duplicate/old background properties that might conflict
69+
sed -i '/#lockDialogGroup/,/}/ { /background-color:/d; }' "$css_file"
70+
else
71+
# If #lockDialogGroup doesn't exist, append it
72+
echo '
73+
#lockDialogGroup {
74+
background: #000000 url(resource:///org/gnome/shell/theme/hypercube-logo.png) no-repeat center center;
75+
background-size: auto;
76+
}' >> "$css_file"
77+
fi
78+
fi
79+
done
80+
81+
# Create the gresource XML manifest
82+
echo "Creating gresource manifest..."
83+
cat > "$WORKDIR/gnome-shell-theme.gresource.xml" << 'XMLEOF'
84+
<?xml version="1.0" encoding="UTF-8"?>
85+
<gresources>
86+
<gresource prefix="/org/gnome/shell/theme">
87+
XMLEOF
88+
89+
# Add all files in theme directory to the manifest
90+
find "$WORKDIR/theme" -type f | while read -r file; do
91+
relpath="${file#$WORKDIR/theme/}"
92+
echo " <file>theme/$relpath</file>" >> "$WORKDIR/gnome-shell-theme.gresource.xml"
93+
done
94+
95+
cat >> "$WORKDIR/gnome-shell-theme.gresource.xml" << 'XMLEOF'
96+
</gresource>
97+
</gresources>
98+
XMLEOF
99+
100+
# Compile the new gresource
101+
echo "Compiling new gresource..."
102+
cd "$WORKDIR"
103+
glib-compile-resources gnome-shell-theme.gresource.xml --target=gnome-shell-theme.gresource
104+
105+
# Backup original and install new gresource
106+
# Use cp instead of mv to avoid SELinux issues
107+
echo "Installing new gresource..."
108+
cp "$GRESOURCE" "${GRESOURCE}.backup"
109+
cp "$WORKDIR/gnome-shell-theme.gresource" "$GRESOURCE"
110+
111+
# Cleanup
112+
rm -rf "$WORKDIR"
113+
114+
echo "Hypercube GDM theme installed successfully"

dot_files/gdm/dconf/hypercube-gdm

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,18 @@
22
# Tokyo Night theme colors applied to GDM login screen
33

44
[org/gnome/login-screen]
5-
# Disable user list for cleaner look (optional - comment out to show user list)
5+
# Show user list
66
disable-user-list=false
77

8-
# Enable banner message with Hypercube branding
8+
# Disable banner message
99
banner-message-enable=false
10-
banner-message-text='Welcome to Hypercube'
1110

12-
# Logo for GDM (displayed above login)
13-
logo='/usr/share/pixmaps/hypercube-logo.png'
14-
15-
[org/gnome/desktop/background]
16-
# GDM background - cube logo centered on black
17-
picture-uri='file:///usr/share/pixmaps/hypercube-logo.png'
18-
picture-uri-dark='file:///usr/share/pixmaps/hypercube-logo.png'
19-
picture-options='centered'
20-
21-
# Black background behind the centered logo
22-
primary-color='#000000'
23-
secondary-color='#000000'
24-
color-shading-type='solid'
25-
26-
[org/gnome/desktop/screensaver]
27-
# Lock screen background - cube logo centered on black
28-
picture-uri='file:///usr/share/pixmaps/hypercube-logo.png'
29-
primary-color='#000000'
30-
secondary-color='#000000'
31-
color-shading-type='solid'
32-
picture-options='centered'
11+
# Hide the logo at bottom of screen (empty string removes it)
12+
logo=''
3313

3414
[org/gnome/desktop/interface]
3515
# Tokyo Night compatible GTK theme and icon settings
3616
color-scheme='prefer-dark'
3717
cursor-theme='Adwaita'
3818
icon-theme='Adwaita'
3919
gtk-theme='Adwaita-dark'
40-
font-name='JetBrainsMono Nerd Font 13'
41-
monospace-font-name='JetBrainsMono Nerd Font Mono 13'
42-
document-font-name='JetBrainsMono Nerd Font 13'

dot_files/gdm/gnome-shell/gnome-shell.css

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)