DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

DankGreet not applying the same user theme

Open Lzycode-byte opened this issue 1 year ago • 2 comments

Compositor

  • niri

Distribution

Arch

dms version

██████╗ █████╗ ███╗ ██╗██╗ ██╗ ██╔══██╗██╔══██╗████╗ ██║██║ ██╔╝ ██║ ██║███████║██╔██╗ ██║█████╔╝ ██║ ██║██╔══██║██║╚██╗██║██╔═██╗ ██████╔╝██║ ██║██║ ╚████║██║ ██╗ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ v0.3.4

Description

Tried the sync guide in dms documentation but its not applying

Solutions Tried

Syncing with DMS

You can automatically sync the system greeter with the logged in user's wallpaper, themes, fonts, etc. by following these steps.

Add your user to the greeter group

sudo usermod -aG greeter

note

You will have to logout or reboot for group change to take effect

Create configuration symlinks:

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

Lzycode-byte avatar Nov 04 '25 04:11 Lzycode-byte

You can try this, another user reported it worked

#!/bin/bash
set -e

if [ "$EUID" -eq 0 ]; then
    echo "Error: Do not run this script as root. Run as your regular user:"
    echo "  dms-greeter-sync"
    exit 1
fi

CURRENT_USER=$(whoami)
CACHE_DIR="/var/cache/dms-greeter"

echo "=== DMS Greeter Theme Sync Setup ==="
echo
echo "This will sync your DMS theme with the greeter login screen."
echo "User: $CURRENT_USER"
echo

# Add user to greeter group
if ! groups "$CURRENT_USER" | grep -q greeter; then
    echo "Adding $CURRENT_USER to greeter group..."
    sudo usermod -aG greeter "$CURRENT_USER"
    echo "✓ Added to greeter group (logout/login required for group membership)"
else
    echo "✓ Already in greeter group"
fi

# Set group permissions on config directories
echo
echo "Setting group permissions on config directories..."

# First, ensure parent directories are traversable by greeter user (using ACLs)
echo "Making parent directories traversable by greeter..."
if command -v setfacl >/dev/null 2>&1; then
    # Set ACL on home directory
    setfacl -m u:greeter:x ~ 2>/dev/null && echo "✓ Home directory" || echo "⚠ Home directory (may need sudo)"
    
    # Set ACLs on parent config directories
    setfacl -m u:greeter:x ~/.config 2>/dev/null && echo "✓ .config directory" || true
    setfacl -m u:greeter:x ~/.local 2>/dev/null && echo "✓ .local directory" || true
    setfacl -m u:greeter:x ~/.cache 2>/dev/null && echo "✓ .cache directory" || true
    setfacl -m u:greeter:x ~/.local/state 2>/dev/null && echo "✓ .local/state directory" || true
else
    echo "⚠ setfacl not found, you need to run:"
    echo "    setfacl -m u:greeter:x ~ ~/.config ~/.local ~/.cache ~/.local/state"
fi

# Then set permissions on target directories
for dir in ~/.config/DankMaterialShell ~/.local/state/DankMaterialShell ~/.cache/quickshell; do
    if [ -d "$dir" ]; then
        sudo chgrp -R greeter "$dir"
        sudo chmod -R g+rX "$dir"
        echo "✓ $(basename $dir)"
    else
        echo "⚠ $dir not found (will be created when you run DMS)"
    fi
done

# Set group read on parent state directory
sudo chmod g+x ~/.local/state 2>/dev/null || true

# Create symlinks
echo
echo "Creating symlinks to sync theme..."

declare -A links=(
    ["$HOME/.config/DankMaterialShell/settings.json"]="$CACHE_DIR/settings.json"
    ["$HOME/.local/state/DankMaterialShell/session.json"]="$CACHE_DIR/session.json"
    ["$HOME/.cache/DankMaterialShell/dms-colors.json"]="$CACHE_DIR/colors.json"
)

for source in "${!links[@]}"; do
    target="${links[$source]}"
    target_name=$(basename "$source")
    
    if [ -f "$source" ]; then
        sudo ln -sf "$source" "$target"
        echo "✓ Synced $target_name"
    else
        echo "⚠ $target_name not found yet (run DMS to generate it)"
    fi
done

echo
echo "=== Setup Complete! ==="
echo
echo "IMPORTANT: You must LOGOUT and LOGIN for group membership to take effect."
echo "After logging back in, your theme will be synced with the greeter."

put it at sync.sh or something, chmod +x sync.sh && ./sync.sh

It is not part of the AUR package but will be, soon

bbedward avatar Nov 04 '25 04:11 bbedward

That did the thing! Thanks!

Lzycode-byte avatar Nov 04 '25 05:11 Lzycode-byte