mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
Compare commits
2 Commits
f06e6e85d5
...
0221021078
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0221021078 | ||
|
|
966021bfd4 |
@@ -322,11 +322,74 @@ func enableGreeter() error {
|
||||
}
|
||||
|
||||
fmt.Printf("✓ Updated greetd configuration to use %s\n", selectedCompositor)
|
||||
|
||||
// Check and set graphical.target as default
|
||||
getDefaultCmd := exec.Command("systemctl", "get-default")
|
||||
currentTarget, err := getDefaultCmd.Output()
|
||||
if err != nil {
|
||||
fmt.Println("⚠ Warning: Could not detect current default systemd target")
|
||||
} else {
|
||||
currentTargetStr := strings.TrimSpace(string(currentTarget))
|
||||
if currentTargetStr != "graphical.target" {
|
||||
fmt.Printf("\nSetting graphical.target as default (current: %s)...\n", currentTargetStr)
|
||||
setDefaultCmd := exec.Command("sudo", "systemctl", "set-default", "graphical.target")
|
||||
setDefaultCmd.Stdout = os.Stdout
|
||||
setDefaultCmd.Stderr = os.Stderr
|
||||
if err := setDefaultCmd.Run(); err != nil {
|
||||
fmt.Println("⚠ Warning: Failed to set graphical.target as default")
|
||||
fmt.Println(" Greeter may not start on boot. Run manually:")
|
||||
fmt.Println(" sudo systemctl set-default graphical.target")
|
||||
} else {
|
||||
fmt.Println("✓ Set graphical.target as default")
|
||||
}
|
||||
} else {
|
||||
fmt.Println("✓ Default target already set to graphical.target")
|
||||
}
|
||||
}
|
||||
|
||||
// Check for conflicting display managers and disable them
|
||||
fmt.Println("\nChecking for conflicting display managers...")
|
||||
conflictingDMs := []string{"gdm", "lightdm", "sddm"}
|
||||
disabledAny := false
|
||||
|
||||
for _, dm := range conflictingDMs {
|
||||
checkCmd := exec.Command("systemctl", "is-enabled", dm)
|
||||
output, err := checkCmd.Output()
|
||||
if err == nil && strings.TrimSpace(string(output)) == "enabled" {
|
||||
fmt.Printf("⚠ Found enabled display manager: %s\n", dm)
|
||||
fmt.Printf(" Disabling %s...\n", dm)
|
||||
disableCmd := exec.Command("sudo", "systemctl", "disable", dm)
|
||||
disableCmd.Stdout = os.Stdout
|
||||
disableCmd.Stderr = os.Stderr
|
||||
if err := disableCmd.Run(); err != nil {
|
||||
fmt.Printf(" ⚠ Warning: Failed to disable %s\n", dm)
|
||||
} else {
|
||||
fmt.Printf(" ✓ Disabled %s\n", dm)
|
||||
disabledAny = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !disabledAny {
|
||||
fmt.Println("✓ No conflicting display managers found")
|
||||
}
|
||||
|
||||
// Enable greetd service
|
||||
fmt.Println("\nEnabling greetd service...")
|
||||
enableCmd := exec.Command("sudo", "systemctl", "enable", "greetd")
|
||||
enableCmd.Stdout = os.Stdout
|
||||
enableCmd.Stderr = os.Stderr
|
||||
if err := enableCmd.Run(); err != nil {
|
||||
fmt.Println("⚠ Warning: Failed to enable greetd service")
|
||||
fmt.Println(" Run manually: sudo systemctl enable greetd")
|
||||
} else {
|
||||
fmt.Println("✓ Enabled greetd service")
|
||||
}
|
||||
|
||||
fmt.Println("\n=== Enable Complete ===")
|
||||
fmt.Println("\nTo start the greeter, run:")
|
||||
fmt.Println("\nTo start the greeter now, run:")
|
||||
fmt.Println(" sudo systemctl start greetd")
|
||||
fmt.Println("\nTo enable on boot, run:")
|
||||
fmt.Println(" sudo systemctl enable --now greetd")
|
||||
fmt.Println("\nOr reboot to see the greeter at boot time.")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -210,6 +210,15 @@ elif ! grep -q "dms-greeter" "$GREETD_CONFIG"; then
|
||||
CONFIG_STATUS="Updated existing config (backed up) with $COMPOSITOR ✓"
|
||||
fi
|
||||
|
||||
# Set graphical.target as default
|
||||
CURRENT_TARGET=$(systemctl get-default 2>/dev/null || echo "unknown")
|
||||
if [ "$CURRENT_TARGET" != "graphical.target" ]; then
|
||||
systemctl set-default graphical.target >/dev/null 2>&1 || true
|
||||
TARGET_STATUS="Set to graphical.target (was: $CURRENT_TARGET) ✓"
|
||||
else
|
||||
TARGET_STATUS="Already graphical.target ✓"
|
||||
fi
|
||||
|
||||
# Only show banner on initial install
|
||||
if [ "$1" -eq 1 ]; then
|
||||
cat << 'EOF'
|
||||
@@ -219,31 +228,30 @@ cat << 'EOF'
|
||||
=========================================================================
|
||||
|
||||
Status:
|
||||
EOF
|
||||
echo " ✓ Greetd config: $CONFIG_STATUS"
|
||||
echo " ✓ Default target: $TARGET_STATUS"
|
||||
cat << 'EOF'
|
||||
✓ Greeter user: Created
|
||||
✓ Greeter directories: /var/cache/dms-greeter, /var/lib/greeter
|
||||
✓ SELinux contexts: Applied
|
||||
EOF
|
||||
echo " ✓ Greetd config: $CONFIG_STATUS"
|
||||
cat << 'EOF'
|
||||
|
||||
Next steps:
|
||||
|
||||
1. Disable any existing display managers (IMPORTANT):
|
||||
sudo systemctl disable gdm sddm lightdm
|
||||
1. Enable the greeter:
|
||||
dms greeter enable
|
||||
(This will automatically disable gdm, sddm, or lightdm display managers,
|
||||
set graphical.target, and enable greetd)
|
||||
|
||||
2. Enable greetd service:
|
||||
sudo systemctl enable greetd
|
||||
|
||||
3. (Optional) Sync your theme with the greeter:
|
||||
If you have DankMaterialShell (DMS) installed, you can sync with:
|
||||
2. Sync your theme with the greeter (optional):
|
||||
If you have DankMaterialShell (DMS) installed, you can sync theming with:
|
||||
dms greeter sync
|
||||
|
||||
Check sync status: dms greeter status
|
||||
Then logout/login to see your wallpaper on the greeter!
|
||||
3. Check your setup:
|
||||
dms greeter status
|
||||
|
||||
Ready to test? Reboot or run: sudo systemctl start greetd
|
||||
Documentation: /usr/share/doc/dms-greeter/README.md
|
||||
Website: https://danklinux.com/docs/dankgreeter/
|
||||
Ready to test? Run: sudo systemctl start greetd or simply log out/reboot your system
|
||||
Documentation: https://danklinux.com/docs/dankgreeter/
|
||||
=========================================================================
|
||||
|
||||
EOF
|
||||
|
||||
@@ -621,7 +621,7 @@ PanelWindow {
|
||||
DankBarContent {
|
||||
id: topBarContent
|
||||
barWindow: barWindow
|
||||
rootWindow: rootWindow
|
||||
rootWindow: barWindow.rootWindow
|
||||
barConfig: barWindow.barConfig
|
||||
leftWidgetsModel: barWindow.leftWidgetsModel
|
||||
centerWidgetsModel: barWindow.centerWidgetsModel
|
||||
|
||||
@@ -200,10 +200,10 @@ Item {
|
||||
}
|
||||
|
||||
const baseColor = Theme.widgetBaseBackgroundColor;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return baseColor;
|
||||
}
|
||||
const transparency = (root.barConfig && root.barConfig.widgetTransparency !== undefined) ? root.barConfig.widgetTransparency : 1.0;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * transparency);
|
||||
}
|
||||
return Theme.withAlpha(baseColor, transparency);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ Item {
|
||||
}
|
||||
|
||||
const baseColor = Theme.widgetBaseBackgroundColor;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return baseColor;
|
||||
}
|
||||
const transparency = (root.barConfig && root.barConfig.widgetTransparency !== undefined) ? root.barConfig.widgetTransparency : 1.0;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * transparency);
|
||||
}
|
||||
return Theme.withAlpha(baseColor, transparency);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,10 +601,10 @@ Item {
|
||||
if ((barConfig?.noBackground ?? false))
|
||||
return "transparent";
|
||||
const baseColor = Theme.widgetBaseBackgroundColor;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return baseColor;
|
||||
}
|
||||
const transparency = (root.barConfig && root.barConfig.widgetTransparency !== undefined) ? root.barConfig.widgetTransparency : 1.0;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * transparency);
|
||||
}
|
||||
return Theme.withAlpha(baseColor, transparency);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,10 +94,10 @@ Item {
|
||||
|
||||
const isHovered = mouseArea.containsMouse || (root.isHovered || false);
|
||||
const baseColor = isHovered ? Theme.widgetBaseHoverColor : Theme.widgetBaseBackgroundColor;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return baseColor;
|
||||
}
|
||||
const transparency = (root.barConfig && root.barConfig.widgetTransparency !== undefined) ? root.barConfig.widgetTransparency : 1.0;
|
||||
if (Theme.widgetBackgroundHasAlpha) {
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * transparency);
|
||||
}
|
||||
return Theme.withAlpha(baseColor, transparency);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user