1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 22:42:50 -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

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2025 Avenge Media LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,54 +1,43 @@
<div align="center">
<a href="https://danklinux.com">
<img src="assets/danklogo.svg" alt="Dank Linux" width="200">
</a>
# DMS Backend & CLI
### dms CLI & Backend + dankinstall
Go-based backend for DankMaterialShell providing system integration, IPC, and installation tools.
[![Documentation](https://img.shields.io/badge/docs-danklinux.com-9ccbfb?style=for-the-badge&labelColor=101418)](https://danklinux.com/docs)
[![GitHub release](https://img.shields.io/github/v/release/AvengeMedia/danklinux?style=for-the-badge&labelColor=101418&color=9ccbfb)](https://github.com/AvengeMedia/DankMaterialShell/backend/releases)
[![GitHub License](https://img.shields.io/badge/license-MIT-b9c8da?style=for-the-badge&labelColor=101418)](https://github.com/AvengeMedia/DankMaterialShell/backend/blob/master/LICENSE)
**See [root README](../README.md) for project overview and installation.**
</div>
## Components
---
**dms CLI**
Command-line interface and daemon for shell management and system control.
A monorepo for dankinstall and dms (cli+go backend), a modern desktop suite for Wayland compositors.
**dankinstall**
Distribution-aware installer with TUI for deploying DMS and compositor configurations on Arch, Fedora, Debian, Ubuntu, openSUSE, and Gentoo.
**[Full documentation →](https://danklinux.com/docs)**
## System Integration
- **dms** DankMaterialShell (cli + go backend)
- The backend side of dms, provides APIs for the desktop and a management CLI.
- Shared dbus connection for networking (NetworkManager, iwd), loginctl, accountsservice, cups, and other interfaces.
- Implements wayland protocols
- wlr-gamma-control-unstable-v1 (for night mode/gamma control)
- dwl-ipc-unstable-v2 (for dwl/MangoWC integration)
- ext-workspace-v1 (for workspace integrations)
- wlr-output-management-unstable-v1
- Exposes a json API over unix socket for interaction with these interfaces
- Provides plugin management APIs for the shell
- CUPS integration for printer management
- ddc/ci protocol implementation
- Allows controlling brightness of external monitors, like `ddcutil`
- backlight + led control integration
- Allows controlling backlight of integrated displays, or LED devices
- Uses `login1` when available, else falls back to sysfs writes.
- Optionally provides `update` interface - depending on build inputs.
- This is intended to be disabled when packaged as part of distribution packages.
- **dankinstall** Installs the Dank Linux suite for [niri](https://github.com/YaLTeR/niri) and/or [Hyprland](https://hypr.land)
- Features the [DankMaterialShell](https://github.com/AvengeMedia/DankMaterialShell)
- Which features a complete desktop experience with wallpapers, auto theming, notifications, lock screen, etc.
- Offers up solid out of the box configurations as usable, featured starting points.
- Can be installed if you already have niri/Hyprland configured
- Will allow you to keep your existing config, or replace with Dank ones (existing configs always backed up though)
**Wayland Protocols**
- `wlr-gamma-control-unstable-v1` - Night mode and gamma control
- `dwl-ipc-unstable-v2` - dwl/MangoWC workspace integration
- `ext-workspace-v1` - Workspace protocol support
- `wlr-output-management-unstable-v1` - Display configuration
# dms cli & backend
**DBus Interfaces**
- NetworkManager/iwd - Network management
- logind - Session control and inhibit locks
- accountsservice - User account information
- CUPS - Printer management
- Custom IPC via unix socket (JSON API)
Written in Go, provides a suite of APIs over unix socket via [godbus](https://github.com/godbus/dbus) and Wayland protocols. All features listed above are exposed over the socket API.
**Hardware Control**
- DDC/CI protocol - External monitor brightness control (like `ddcutil`)
- Backlight control - Internal display brightness via `login1` or sysfs
- LED control - Keyboard/device LED management
*Run `dms debug-srv` to start the socket service in standalone mode and see available APIs*
**Plugin System**
- Plugin registry integration
- Plugin lifecycle management
- Settings persistence
**CLI Commands:**
## CLI Commands
- `dms run [-d]` - Start shell (optionally as daemon)
- `dms restart` / `dms kill` - Manage running processes
- `dms ipc <command>` - Send IPC commands (toggle launcher, notifications, etc.)
@@ -57,254 +46,71 @@ Written in Go, provides a suite of APIs over unix socket via [godbus](https://gi
- `dms update` - Update DMS and dependencies (disabled in distro packages)
- `dms greeter install` - Install greetd greeter (disabled in distro packages)
## Build & Install
## Building
To build the dms CLI (Requires Go 1.24+):
### For distribution package maintainers
This produces a build without the `update` or `greeter` functionality, which are intended for manual installation.
Requires Go 1.24+
**Development build:**
```bash
make dist
make # Build dms CLI
make dankinstall # Build installer
make test # Run tests
```
Produces `bin/dms-linux-amd64` and `bin/dms-linux-arm64`
### Manual Install
**Distribution build:**
```bash
# Installs to /usr/local/bin/dms
make && sudo make install
make dist # Build without update/greeter features
```
### Wayland Protocol Bindings
Produces `bin/dms-linux-amd64` and `bin/dms-linux-arm64`
The gamma control functionality uses Wayland protocol bindings generated from the protocol XML definition. To regenerate the Go bindings from `internal/proto/xml/wlr-gamma-control-unstable-v1.xml`:
**Installation:**
```bash
sudo make install # Install to /usr/local/bin/dms
```
## Development
**Regenerating Wayland Protocol Bindings:**
```bash
go install github.com/rajveermalviya/go-wayland/cmd/go-wayland-scanner@latest
go-wayland-scanner -i internal/proto/xml/wlr-gamma-control-unstable-v1.xml \
-pkg wlr_gamma_control -o internal/proto/wlr_gamma_control/gamma_control.go
```
This is only needed if modifying the protocol or updating to a newer version.
**Module Structure:**
- `cmd/` - Binary entrypoints (dms, dankinstall)
- `internal/distros/` - Distribution-specific installation logic
- `internal/proto/` - Wayland protocol bindings
- `pkg/` - Shared packages
# Dank Linux/dankinstall
Installs compositor, dms, terminal, and some optional dependencies - along with a default compositor & terminal configuration.
## Quickstart
## Installation via dankinstall
```bash
curl -fsSL https://install.danklinux.com | sh
```
*Alternatively, download the latest [release](https://github.com/AvengeMedia/DankMaterialShell/backend/releases)*
## Supported Distributions
**Note on Greeter**: dankinstall does not install a greeter automatically.
- To install the dms greeter, run `dms greeter install` after installation.
- Then you can disable any existing greeter, if present, and run `sudo systemctl enable --now greetd`
Arch, Fedora, Debian, Ubuntu, openSUSE, Gentoo (and derivatives)
### Arch Linux & Derivatives
**Arch Linux**
Uses `pacman` for system packages, builds AUR packages via `makepkg`, no AUR helper dependency.
**Supported:** Arch, ArchARM, Archcraft, CachyOS, EndeavourOS, Manjaro
**Fedora**
**Special Notes:**
- Uses native `pacman` for system packages
- AUR packages are built manually using `makepkg` (no AUR helper dependency)
- **Recommendations**
- Use NetworkManager to manage networking
- If using archinstall, you can choose `minimal` for profile, and `NetworkManager` under networking.
Uses COPR repositories (`avengemedia/danklinux`, `avengemedia/dms`).
**Package Sources:**
| Package | Source | Notes |
|---------|---------|-------|
| System packages (git, jq, etc.) | Official repos | Via `pacman` |
| quickshell | AUR | Built from source |
| matugen | AUR (`matugen-bin`) | Pre-compiled binary |
| dgop | Official repos | Available in Extra repository |
| niri | Official repos (`niri`) | Latest niri |
| hyprland | Official repos | Available in Extra repository |
| DankMaterialShell | Manual | Git clone to `~/.config/quickshell/dms` |
**Ubuntu**
Requires PPA support. Most packages built from source (slow first install).
### Fedora & Derivatives
**Debian**
Debian 13+ (Trixie). niri only, no Hyprland support. Builds from source.
**Supported:** Fedora, Nobara, Fedora Asahi Remix
**openSUSE**
Most packages available in standard repos. Minimal building required.
**Special Notes:**
- Requires `dnf-plugins-core` for COPR repository support
- Automatically enables required COPR repositories
- All COPR repos are enabled with automatic acceptance
- **Editions** dankinstall is tested on "Workstation Edition", but probably works fine on any fedora flavor. Report issues if anything doesn't work.
- [Fedora Asahi Remix](https://asahilinux.org/fedora/) hasn't been tested, but presumably it should work fine as all of the dependencies should provide arm64 variants.
**Gentoo**
Uses Portage with GURU overlay. Automatically configures USE flags. Variable success depending on system configuration.
**Package Sources:**
| Package | Source | Notes |
|---------|---------|-------|
| System packages | Official repos | Via `dnf` |
| quickshell | COPR | `avengemedia/danklinux` |
| matugen | COPR | `avengemedia/danklinux` |
| dgop | Manual | Built from source with Go |
| cliphist | COPR | `avengemedia/danklinux` |
| ghostty | COPR | `avengemedia/danklinux` |
| hyprland | COPR | `solopasha/hyprland` |
| niri | COPR | `yalter/niri` |
| DankMaterialShell | COPR | `avengemedia/dms` |
### Ubuntu
**Supported:** Ubuntu 25.04+
**Special Notes:**
- Requires PPA support via `software-properties-common`
- Go installed from PPA for building manual packages
- Most packages require manual building due to limited repository availability
- This means the install can be quite slow, as many need to be compiled from source.
- niri is packages as a `.deb` so it can be managed via `apt`
- Automatic PPA repository addition and package list updates
**Package Sources:**
| Package | Source | Notes |
|---------|---------|-------|
| System packages | Official repos | Via `apt` |
| quickshell | Manual | Built from source with cmake |
| matugen | Manual | Built from source with Go |
| dgop | Manual | Built from source with Go |
| hyprland | PPA | `ppa:cppiber/hyprland` |
| hyprpicker | PPA | `ppa:cppiber/hyprland` |
| niri | Manual | Built from source with Rust |
| Go compiler | PPA | `ppa:longsleep/golang-backports` |
| DankMaterialShell | Manual | Git clone to `~/.config/quickshell/dms` |
### Debian
**Supported:** Debian 13+ (Trixie)
**Special Notes:**
- **niri only** - Debian does not support Hyprland currently, only niri.
- Most packages require manual building due to limited repository availability
- This means the install can be quite slow, as many need to be compiled from source.
- niri is packages as a `.deb` so it can be managed via `apt`
**Package Sources:**
| Package | Source | Notes |
|---------|---------|-------|
| System packages | Official repos | Via `apt` |
| quickshell | Manual | Built from source with cmake |
| matugen | Manual | Built from source with Go |
| dgop | Manual | Built from source with Go |
| niri | Manual | Built from source with Rust |
| DankMaterialShell | Manual | Git clone to `~/.config/quickshell/dms` |
### openSUSE Tumbleweed
**Special Notes:**
- Most packages available in standard repos, minimal manual building required
- quickshell and matugen require building from source
**Package Sources:**
| Package | Source | Notes |
|---------|---------|-------|
| System packages (git, jq, etc.) | Official repos | Via `zypper` |
| hyprland | Official repos | Available in standard repos |
| niri | Official repos | Available in standard repos |
| xwayland-satellite | Official repos | For niri X11 app support |
| ghostty | Official repos | Latest terminal emulator |
| kitty, alacritty | Official repos | Alternative terminals |
| grim, slurp, hyprpicker | Official repos | Wayland screenshot utilities |
| wl-clipboard | Official repos | Via `wl-clipboard` package |
| cliphist | Official repos | Clipboard manager |
| quickshell | Manual | Built from source with cmake + openSUSE flags |
| matugen | Manual | Built from source with Rust |
| dgop | Manual | Built from source with Go |
| DankMaterialShell | Manual | Git clone to `~/.config/quickshell/dms` |
### Gentoo
**Special Notes:**
- Gentoo installs are **highly variable** and user-specific, success is not guaranteed.
- `dankinstall` is most likely to succeed on a fresh stage3/systemd system
- Uses Portage package manager with GURU overlay for additional packages
- Automatically configures global USE flags in `/etc/portage/make.conf`
- Will create or append to your existing USE flags.
- Automatically configures package-specific USE flags in `/etc/portage/package.use/danklinux`
- Unmasks packages as-needed with architecture keywords in `/etc/portage/package.accept_keywords/danklinux`
- Supports both `amd64` and `arm64` architectures dynamically
- If not using bin packages, prepare for long compilation times
- **Ghostty** is removed from the options, due to extremely long compilation time of its
**Package Sources:**
| Package | Source | Notes |
|---------|---------|-------|
| System packages (git, etc.) | Official repos | Via `emerge` |
| niri | GURU overlay | With dbus and screencast USE flags |
| hyprland | Official repos (GURU for -git) | Depends on variant selection, with X USE flag |
| quickshell | GURU overlay | Always uses live ebuild (`**` keywords), full feature set |
| matugen | GURU overlay | Color generation tool |
| cliphist | GURU overlay | Clipboard manager |
| hyprpicker | GURU overlay | Color picker for Hyprland |
| xdg-desktop-portal-gtk | Official repos | With wayland and X USE flags |
| mate-polkit | Official repos | PolicyKit authentication agent |
| accountsservice | Official repos | User account management |
| dgop | Manual | Built from source with Go |
| xwayland-satellite | Manual | For niri X11 app support |
| grimblast | Manual | For Hyprland screenshot utility |
| DankMaterialShell | Manual | Git clone to `~/.config/quickshell/dms` |
**Global USE Flags:**
`X dbus udev alsa policykit jpeg png webp gif tiff svg brotli gdbm accessibility gtk qt6 egl gbm`
**Package-Specific USE Flags:**
- `sys-apps/xdg-desktop-portal-gtk`: wayland X
- `gui-wm/niri`: dbus screencast
- `gui-wm/hyprland`: X
- `dev-qt/qtbase`: wayland opengl vulkan widgets
- `dev-qt/qtdeclarative`: opengl vulkan
- `media-libs/mesa`: opengl vulkan
- `gui-apps/quickshell`: breakpad jemalloc sockets wayland layer-shell session-lock toplevel-management screencopy X pipewire tray mpris pam hyprland hyprland-global-shortcuts hyprland-focus-grab i3 i3-ipc bluetooth
### NixOS (Not supported by Dank Linux, but with Flake)
NixOS users should use the [dms flake](https://github.com/AvengeMedia/DankMaterialShell/tree/master?tab=readme-ov-file#nixos---via-home-manager)
## Manual Package Building
The installer handles manual package building for packages not available in repositories:
### quickshell (Ubuntu, Debian, openSUSE)
- Built from source using cmake
- Requires Qt6 development libraries
- Automatically handles build dependencies
- **openSUSE:** Uses special CFLAGS with rpm optflags and wayland include path
### matugen (Ubuntu, Debian, Fedora, openSUSE)
- Built from Rust source
- Requires cargo and rust toolchain
- Installed to `/usr/local/bin`
### dgop (All distros)
- Built from Go source
- Simple dependency-free build
- Installed to `/usr/local/bin`
### niri (Ubuntu, Debian)
- Built from Rust source
- Requires cargo and rust toolchain
- Complex build with multiple dependencies
## Commands
### dankinstall
Main installer with interactive TUI for initial setup
### dms
Management interface for DankMaterialShell:
- `dms` - Interactive management TUI
- `dms run` - Start interactive shell
- `dms run -d` - Start shell as daemon
- `dms restart` - Restart running DMS shell
- `dms kill` - Kill running DMS shell processes
- `dms ipc <command>` - Send IPC commands to running shell
See installer output for distribution-specific details during installation.

View File

@@ -392,7 +392,7 @@ func updateDMSBinary() error {
}
fmt.Println("Fetching latest release version...")
cmd := exec.Command("curl", "-s", "https://api.github.com/repos/AvengeMedia/danklinux/releases/latest")
cmd := exec.Command("curl", "-s", "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)
@@ -421,8 +421,8 @@ func updateDMSBinary() error {
}
defer os.RemoveAll(tempDir)
binaryURL := fmt.Sprintf("https://github.com/AvengeMedia/DankMaterialShell/backend/releases/download/%s/dms-%s.gz", version, arch)
checksumURL := fmt.Sprintf("https://github.com/AvengeMedia/DankMaterialShell/backend/releases/download/%s/dms-%s.gz.sha256", version, arch)
binaryURL := fmt.Sprintf("https://github.com/AvengeMedia/DankMaterialShell/releases/download/%s/dms-cli-%s.gz", version, arch)
checksumURL := fmt.Sprintf("https://github.com/AvengeMedia/DankMaterialShell/releases/download/%s/dms-cli-%s.gz.sha256", version, arch)
binaryPath := filepath.Join(tempDir, "dms.gz")
checksumPath := filepath.Join(tempDir, "dms.gz.sha256")

27
backend/flake.lock generated
View File

@@ -1,27 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1760878510,
"narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -1,61 +0,0 @@
{
description = "DankMaterialShell Command Line Interface";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems =
f:
builtins.listToAttrs (
map (system: {
name = system;
value = f system;
}) supportedSystems
);
in
{
packages = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
in
{
dms-cli = pkgs.buildGoModule (finalAttrs: {
pname = "dms-cli";
version = "0.4.3";
src = ./.;
vendorHash = "sha256-XbCg6qQwD4g4R/hBReLGE4NOq9uv0LBqogmfpBs//Ic=";
subPackages = [ "cmd/dms" ];
ldflags = [
"-s"
"-w"
"-X main.Version=${finalAttrs.version}"
];
meta = {
description = "DankMaterialShell Command Line Interface";
homepage = "https://github.com/AvengeMedia/DankMaterialShell/backend";
mainProgram = "dms";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
});
default = self.packages.${system}.dms-cli;
}
);
};
}

View File

@@ -36,7 +36,7 @@ case "$ARCH" in
esac
# Get the latest release version
LATEST_VERSION=$(curl -s https://api.github.com/repos/AvengeMedia/danklinux/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
LATEST_VERSION=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [ -z "$LATEST_VERSION" ]; then
printf "%bError: Could not fetch latest version%b\n" "$RED" "$NC"
@@ -51,8 +51,8 @@ cd "$TEMP_DIR" || exit 1
# Download the gzipped binary and its checksum
printf "%bDownloading installer...%b\n" "$GREEN" "$NC"
curl -L "https://github.com/AvengeMedia/DankMaterialShell/backend/releases/download/$LATEST_VERSION/dankinstall-$ARCH.gz" -o "installer.gz"
curl -L "https://github.com/AvengeMedia/DankMaterialShell/backend/releases/download/$LATEST_VERSION/dankinstall-$ARCH.gz.sha256" -o "expected.sha256"
curl -L "https://github.com/AvengeMedia/DankMaterialShell/releases/download/$LATEST_VERSION/dankinstall-$ARCH.gz" -o "installer.gz"
curl -L "https://github.com/AvengeMedia/DankMaterialShell/releases/download/$LATEST_VERSION/dankinstall-$ARCH.gz.sha256" -o "expected.sha256"
# Get the expected checksum
EXPECTED_CHECKSUM=$(cat expected.sha256 | awk '{print $1}')

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)