1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

cli: fix greeter enable, and color sync

This commit is contained in:
bbedward
2025-11-13 13:21:18 -05:00
parent b62ba69060
commit 201bd8dc1f
4 changed files with 20 additions and 8 deletions

View File

@@ -277,9 +277,9 @@ func enableGreeter() error {
}
}
wrapperCmd := "dms-greeter"
if !commandExists("dms-greeter") {
wrapperCmd = "/usr/local/bin/dms-greeter"
wrapperCmd, err := findCommandPath("dms-greeter")
if err != nil {
return fmt.Errorf("dms-greeter not found in PATH. Please ensure it is installed and accessible")
}
compositorLower := strings.ToLower(selectedCompositor)
@@ -444,7 +444,7 @@ func checkGreeterStatus() error {
desc: "Session state",
},
{
source: filepath.Join(homeDir, ".cache", "quickshell", "dankshell", "dms-colors.json"),
source: filepath.Join(homeDir, ".cache", "DankMaterialShell", "dms-colors.json"),
target: filepath.Join(cacheDir, "colors.json"),
desc: "Color theme",
},

View File

@@ -1,12 +1,24 @@
package main
import "os/exec"
import (
"fmt"
"os/exec"
)
func commandExists(cmd string) bool {
_, err := exec.LookPath(cmd)
return err == nil
}
// findCommandPath returns the absolute path to a command in PATH
func findCommandPath(cmd string) (string, error) {
path, err := exec.LookPath(cmd)
if err != nil {
return "", fmt.Errorf("command '%s' not found in PATH", cmd)
}
return path, nil
}
func isArchPackageInstalled(packageName string) bool {
cmd := exec.Command("pacman", "-Q", packageName)
err := cmd.Run()