1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 16:02:51 -05:00

Suppress instructions after init install

This commit is contained in:
purian23
2025-10-16 17:58:31 -04:00
parent 5758d7274e
commit d3017e98c5

View File

@@ -80,10 +80,39 @@ getent passwd greeter >/dev/null || \
exit 0 exit 0
%post %post
===============================================================================
DMS Greeter Installation Complete!
===============================================================================
Configuration status:
- Greeter cache directory: /var/cache/dms-greeter (created with proper permissions)
- SELinux contexts: Applied (if semanage available)
- Greetd config: $CONFIG_STATUS
Next steps to enable the greeter:
1. IMPORTANT: Disable any existing display managers:
sudo systemctl disable gdm sddm lightdm
(Only greetd should run as the display manager)
2. Verify greetd configuration:
Check /etc/greetd/config.toml contains:
[default_session]
user = "greeter"
command = "/usr/bin/dms-greeter --command niri"
(Also supported: hyprland, sway)
Note: Existing config backed up to config.toml.backup-* if modified
3. Enable greetd service:
sudo systemctl enable greetd
4. (Optional) Sync your user's theme with the greeter:
sudo usermod -aG greeter YOUR_USERNAME
# Then LOGOUT and LOGIN to apply group membership
ln -sf ~/.config/DankMaterialShell/settings.json /var/cache/dms-greeter/settings.json
ln -sf ~/.local/state/DankMaterialShell/session.json /var/cache/dms-greeter/session.json
ln -sf ~/.cache/quickshell/dankshell/dms-colors.json /var/cache/dms-greeter/colors.json
Documentation: /usr/share/doc/dms-greeter/README.md
===============================================================================
# Set SELinux context for the wrapper script on Fedora systems # Set SELinux context for the wrapper script on Fedora systems
if [ -x /usr/sbin/semanage ]; then if [ -x /usr/sbin/semanage ]; then
semanage fcontext -a -t bin_t %{_bindir}/dms-greeter 2>/dev/null || true semanage fcontext -a -t bin_t %{_bindir}/dms-greeter 2>/dev/null || true
restorecon -v %{_bindir}/dms-greeter 2>/dev/null || true restorecon -v %{_bindir}/dms-greeter 2>/dev/null || true
fi fi
# Auto-configure greetd config # Auto-configure greetd config
@@ -93,15 +122,15 @@ CONFIG_STATUS="Not modified (already configured)"
# Check if niri or hyprland exists # Check if niri or hyprland exists
COMPOSITOR="niri" COMPOSITOR="niri"
if ! command -v niri >/dev/null 2>&1; then if ! command -v niri >/dev/null 2>&1; then
if command -v Hyprland >/dev/null 2>&1; then if command -v Hyprland >/dev/null 2>&1; then
COMPOSITOR="hyprland" COMPOSITOR="hyprland"
fi fi
fi fi
# If config doesn't exist, create a default one # If config doesn't exist, create a default one
if [ ! -f "$GREETD_CONFIG" ]; then if [ ! -f "$GREETD_CONFIG" ]; then
mkdir -p /etc/greetd mkdir -p /etc/greetd
cat > "$GREETD_CONFIG" << 'GREETD_EOF' cat > "$GREETD_CONFIG" << 'GREETD_EOF'
[terminal] [terminal]
vt = 1 vt = 1
@@ -109,61 +138,64 @@ vt = 1
user = "greeter" user = "greeter"
command = "/usr/bin/dms-greeter --command COMPOSITOR_PLACEHOLDER" command = "/usr/bin/dms-greeter --command COMPOSITOR_PLACEHOLDER"
GREETD_EOF GREETD_EOF
sed -i "s|COMPOSITOR_PLACEHOLDER|$COMPOSITOR|" "$GREETD_CONFIG" sed -i "s|COMPOSITOR_PLACEHOLDER|$COMPOSITOR|" "$GREETD_CONFIG"
CONFIG_STATUS="Created new config with $COMPOSITOR " CONFIG_STATUS="Created new config with $COMPOSITOR "
# If config exists and doesn't have dms-greeter, update it # If config exists and doesn't have dms-greeter, update it
elif ! grep -q "dms-greeter" "$GREETD_CONFIG"; then elif ! grep -q "dms-greeter" "$GREETD_CONFIG"; then
# Backup existing config # Backup existing config
BACKUP_FILE="${GREETD_CONFIG}.backup-$(date +%%Y%%m%%d-%%H%%M%%S)" BACKUP_FILE="${GREETD_CONFIG}.backup-$(date +%%Y%%m%%d-%%H%%M%%S)"
cp "$GREETD_CONFIG" "$BACKUP_FILE" 2>/dev/null || true cp "$GREETD_CONFIG" "$BACKUP_FILE" 2>/dev/null || true
# Update command in default_session section # Update command in default_session section
sed -i "/^\[default_session\]/,/^\[/ s|^command =.*|command = \"/usr/bin/dms-greeter --command $COMPOSITOR\"|" "$GREETD_CONFIG" sed -i "/^\[default_session\]/,/^\[/ s|^command =.*|command = \"/usr/bin/dms-greeter --command $COMPOSITOR\"|" "$GREETD_CONFIG"
sed -i '/^\[default_session\]/,/^\[/ s|^user =.*|user = "greeter"|' "$GREETD_CONFIG" sed -i '/^\[default_session\]/,/^\[/ s|^user =.*|user = "greeter"|' "$GREETD_CONFIG"
CONFIG_STATUS="Updated existing config (backed up) with $COMPOSITOR " CONFIG_STATUS="Updated existing config (backed up) with $COMPOSITOR "
fi fi
# Only show banner on initial install
if [ "$1" -eq 1 ]; then
cat << EOF cat << EOF
=============================================================================== ===============================================================================
DMS Greeter Installation Complete! DMS Greeter Installation Complete!
=============================================================================== ===============================================================================
Configuration status: Configuration status:
- Greeter cache directory: /var/cache/dms-greeter (created with proper permissions) - Greeter cache directory: /var/cache/dms-greeter (created with proper permissions)
- SELinux contexts: Applied (if semanage available) - SELinux contexts: Applied (if semanage available)
- Greetd config: $CONFIG_STATUS - Greetd config: $CONFIG_STATUS
Next steps to enable the greeter: Next steps to enable the greeter:
1. IMPORTANT: Disable any existing display managers: 1. IMPORTANT: Disable any existing display managers:
sudo systemctl disable gdm sddm lightdm sudo systemctl disable gdm sddm lightdm
(Only greetd should run as the display manager) (Only greetd should run as the display manager)
2. Verify greetd configuration: 2. Verify greetd configuration:
Check /etc/greetd/config.toml contains: Check /etc/greetd/config.toml contains:
[default_session] [default_session]
user = "greeter" user = "greeter"
command = "/usr/bin/dms-greeter --command niri" command = "/usr/bin/dms-greeter --command niri"
(Also supported: hyprland, sway) (Also supported: hyprland, sway)
Note: Existing config backed up to config.toml.backup-* if modified Note: Existing config backed up to config.toml.backup-* if modified
3. Enable greetd service: 3. Enable greetd service:
sudo systemctl enable greetd sudo systemctl enable greetd
4. (Optional) Sync your user's theme with the greeter: 4. (Optional) Sync your user's theme with the greeter:
sudo usermod -aG greeter YOUR_USERNAME sudo usermod -aG greeter YOUR_USERNAME
# Then LOGOUT and LOGIN to apply group membership # Then LOGOUT and LOGIN to apply group membership
ln -sf ~/.config/DankMaterialShell/settings.json /var/cache/dms-greeter/settings.json ln -sf ~/.config/DankMaterialShell/settings.json /var/cache/dms-greeter/settings.json
ln -sf ~/.local/state/DankMaterialShell/session.json /var/cache/dms-greeter/session.json ln -sf ~/.local/state/DankMaterialShell/session.json /var/cache/dms-greeter/session.json
ln -sf ~/.cache/quickshell/dankshell/dms-colors.json /var/cache/dms-greeter/colors.json ln -sf ~/.cache/quickshell/dankshell/dms-colors.json /var/cache/dms-greeter/colors.json
Documentation: /usr/share/doc/dms-greeter/README.md Documentation: /usr/share/doc/dms-greeter/README.md
=============================================================================== ===============================================================================
EOF EOF
fi
%changelog %changelog
{{{ git_dir_changelog }}} {{{ git_dir_changelog }}}