1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 23:12:49 -05:00

meta: monorepo updates

This commit is contained in:
bbedward
2025-11-12 20:34:58 -05:00
parent 24e800501a
commit e8510b925e
29 changed files with 1340 additions and 677 deletions

View File

@@ -9,7 +9,7 @@ import (
// LocateDMSConfig searches for DMS installation following XDG Base Directory specification
func LocateDMSConfig() (string, error) {
var searchPaths []string
var primaryPaths []string
configHome := os.Getenv("XDG_CONFIG_HOME")
if configHome == "" {
@@ -19,10 +19,10 @@ func LocateDMSConfig() (string, error) {
}
if configHome != "" {
searchPaths = append(searchPaths, filepath.Join(configHome, "quickshell", "dms"))
primaryPaths = append(primaryPaths, filepath.Join(configHome, "quickshell", "dms"))
}
searchPaths = append(searchPaths, "/usr/share/quickshell/dms")
primaryPaths = append(primaryPaths, "/usr/share/quickshell/dms")
configDirs := os.Getenv("XDG_CONFIG_DIRS")
if configDirs == "" {
@@ -31,10 +31,17 @@ func LocateDMSConfig() (string, error) {
for _, dir := range strings.Split(configDirs, ":") {
if dir != "" {
searchPaths = append(searchPaths, filepath.Join(dir, "quickshell", "dms"))
primaryPaths = append(primaryPaths, filepath.Join(dir, "quickshell", "dms"))
}
}
// Build search paths with secondary (monorepo) paths interleaved
var searchPaths []string
for _, path := range primaryPaths {
searchPaths = append(searchPaths, path)
searchPaths = append(searchPaths, filepath.Join(path, "quickshell"))
}
for _, path := range searchPaths {
shellPath := filepath.Join(path, "shell.qml")
if info, err := os.Stat(shellPath); err == nil && !info.IsDir() {

View File

@@ -587,7 +587,7 @@ func (b *BaseDistribution) installDMSBinary(ctx context.Context, sudoPassword st
// Get latest release version
latestVersionCmd := exec.CommandContext(ctx, "bash", "-c",
`curl -s https://api.github.com/repos/AvengeMedia/danklinux/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`)
`curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`)
versionOutput, err := latestVersionCmd.Output()
if err != nil {
return fmt.Errorf("failed to get latest DMS version: %w", err)
@@ -608,7 +608,7 @@ func (b *BaseDistribution) installDMSBinary(ctx context.Context, sudoPassword st
defer os.RemoveAll(tmpDir)
// Download the gzipped binary
downloadURL := fmt.Sprintf("https://github.com/AvengeMedia/DankMaterialShell/backend/releases/download/%s/dms-%s.gz", version, arch)
downloadURL := fmt.Sprintf("https://github.com/AvengeMedia/DankMaterialShell/releases/download/%s/dms-cli-%s.gz", version, arch)
gzPath := filepath.Join(tmpDir, "dms.gz")
downloadCmd := exec.CommandContext(ctx, "curl", "-L", downloadURL, "-o", gzPath)

View File

@@ -659,7 +659,7 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, s
Progress: 0.90,
Step: "Cloning DankMaterialShell config...",
IsComplete: false,
CommandInfo: "git clone https://github.com/AvengeMedia/DankMaterialShell.git ~/.config/quickshell/dms",
CommandInfo: "git clone https://github.com/AvengeMedia/DankMaterialShell.git",
}
configDir := filepath.Dir(dmsPath)
@@ -667,19 +667,22 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, s
return fmt.Errorf("failed to create quickshell config directory: %w", err)
}
tmpRepoPath := filepath.Join(os.TempDir(), "dms-clone-tmp")
defer os.RemoveAll(tmpRepoPath)
cloneCmd := exec.CommandContext(ctx, "git", "clone",
"https://github.com/AvengeMedia/DankMaterialShell.git", dmsPath)
"https://github.com/AvengeMedia/DankMaterialShell.git", tmpRepoPath)
if err := cloneCmd.Run(); err != nil {
return fmt.Errorf("failed to clone DankMaterialShell: %w", err)
}
if !forceDMSGit {
fetchCmd := exec.CommandContext(ctx, "git", "-C", dmsPath, "fetch", "--tags")
fetchCmd := exec.CommandContext(ctx, "git", "-C", tmpRepoPath, "fetch", "--tags")
if err := fetchCmd.Run(); err == nil {
tagCmd := exec.CommandContext(ctx, "git", "-C", dmsPath, "describe", "--tags", "--abbrev=0", "origin/master")
tagCmd := exec.CommandContext(ctx, "git", "-C", tmpRepoPath, "describe", "--tags", "--abbrev=0", "origin/master")
if tagOutput, err := tagCmd.Output(); err == nil {
latestTag := strings.TrimSpace(string(tagOutput))
checkoutCmd := exec.CommandContext(ctx, "git", "-C", dmsPath, "checkout", latestTag)
checkoutCmd := exec.CommandContext(ctx, "git", "-C", tmpRepoPath, "checkout", latestTag)
if err := checkoutCmd.Run(); err == nil {
m.log(fmt.Sprintf("Checked out latest tag: %s", latestTag))
}
@@ -687,6 +690,12 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, s
}
}
srcPath := filepath.Join(tmpRepoPath, "quickshell")
cpCmd := exec.CommandContext(ctx, "cp", "-r", srcPath, dmsPath)
if err := cpCmd.Run(); err != nil {
return fmt.Errorf("failed to copy quickshell directory: %w", err)
}
m.log("DankMaterialShell config cloned successfully")
} else {
// Config exists, update it
@@ -695,15 +704,41 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, s
Progress: 0.90,
Step: "Updating DankMaterialShell config...",
IsComplete: false,
CommandInfo: "git pull in ~/.config/quickshell/dms",
CommandInfo: "Updating ~/.config/quickshell/dms",
}
pullCmd := exec.CommandContext(ctx, "git", "pull")
pullCmd.Dir = dmsPath
if err := pullCmd.Run(); err != nil {
m.logError("Failed to update DankMaterialShell config", err)
tmpRepoPath := filepath.Join(os.TempDir(), "dms-update-tmp")
defer os.RemoveAll(tmpRepoPath)
cloneCmd := exec.CommandContext(ctx, "git", "clone",
"https://github.com/AvengeMedia/DankMaterialShell.git", tmpRepoPath)
if err := cloneCmd.Run(); err != nil {
m.logError("Failed to clone DankMaterialShell for update", err)
} else {
m.log("DankMaterialShell config updated successfully")
if !forceDMSGit {
fetchCmd := exec.CommandContext(ctx, "git", "-C", tmpRepoPath, "fetch", "--tags")
if err := fetchCmd.Run(); err == nil {
tagCmd := exec.CommandContext(ctx, "git", "-C", tmpRepoPath, "describe", "--tags", "--abbrev=0", "origin/master")
if tagOutput, err := tagCmd.Output(); err == nil {
latestTag := strings.TrimSpace(string(tagOutput))
checkoutCmd := exec.CommandContext(ctx, "git", "-C", tmpRepoPath, "checkout", latestTag)
_ = checkoutCmd.Run()
}
}
}
srcPath := filepath.Join(tmpRepoPath, "quickshell")
rsyncCmd := exec.CommandContext(ctx, "rsync", "-a", "--delete", srcPath+"/", dmsPath+"/")
if err := rsyncCmd.Run(); err != nil {
cpCmd := exec.CommandContext(ctx, "cp", "-rf", srcPath+"/.", dmsPath+"/")
if err := cpCmd.Run(); err != nil {
m.logError("Failed to update DankMaterialShell config", err)
} else {
m.log("DankMaterialShell config updated successfully")
}
} else {
m.log("DankMaterialShell config updated successfully")
}
}
}

View File

@@ -71,7 +71,7 @@ func (m Model) viewWelcome() string {
case "nixos":
errorMsg = "NixOS is currently not supported, but there is a DankMaterialShell flake available."
default:
errorMsg = fmt.Sprintf("%s is not supported.\nFeel free to request on https://github.com/AvengeMedia/DankMaterialShell/backend", m.osInfo.PrettyName)
errorMsg = fmt.Sprintf("%s is not supported.\nFeel free to request on https://github.com/AvengeMedia/DankMaterialShell", m.osInfo.PrettyName)
}
errorMsgStyled := lipgloss.NewStyle().

View File

@@ -130,7 +130,7 @@ func GetLatestDMSVersion() (string, error) {
}
// Add timeout to prevent hanging when GitHub is down
cmd := exec.Command("curl", "-s", "--max-time", "5", "https://api.github.com/repos/AvengeMedia/danklinux/releases/latest")
cmd := exec.Command("curl", "-s", "--max-time", "5", "https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest")
output, err := cmd.Output()
if err != nil {
return "", fmt.Errorf("failed to fetch latest release: %w", err)