From 6b8c35c27beeb7e9a642e533796f4604386fd90c Mon Sep 17 00:00:00 2001 From: purian23 Date: Fri, 28 Nov 2025 16:32:48 -0500 Subject: [PATCH] feat: DMS Greeter for Ubuntu --- .github/workflows/run-ppa.yml | 11 +- distro/scripts/ppa-build.sh | 17 ++- distro/scripts/ppa-upload.sh | 7 ++ distro/ubuntu/dms-greeter/debian/changelog | 5 + distro/ubuntu/dms-greeter/debian/control | 23 ++++ distro/ubuntu/dms-greeter/debian/copyright | 27 +++++ distro/ubuntu/dms-greeter/debian/files | 1 + distro/ubuntu/dms-greeter/debian/postinst | 108 ++++++++++++++++++ distro/ubuntu/dms-greeter/debian/postrm | 14 +++ distro/ubuntu/dms-greeter/debian/rules | 55 +++++++++ .../ubuntu/dms-greeter/debian/source/format | 1 + .../debian/source/include-binaries | 1 + .../ubuntu/dms-greeter/debian/source/options | 3 + 13 files changed, 271 insertions(+), 2 deletions(-) create mode 100644 distro/ubuntu/dms-greeter/debian/changelog create mode 100644 distro/ubuntu/dms-greeter/debian/control create mode 100644 distro/ubuntu/dms-greeter/debian/copyright create mode 100644 distro/ubuntu/dms-greeter/debian/files create mode 100755 distro/ubuntu/dms-greeter/debian/postinst create mode 100755 distro/ubuntu/dms-greeter/debian/postrm create mode 100755 distro/ubuntu/dms-greeter/debian/rules create mode 100644 distro/ubuntu/dms-greeter/debian/source/format create mode 100644 distro/ubuntu/dms-greeter/debian/source/include-binaries create mode 100644 distro/ubuntu/dms-greeter/debian/source/options diff --git a/.github/workflows/run-ppa.yml b/.github/workflows/run-ppa.yml index d799087f..cc395466 100644 --- a/.github/workflows/run-ppa.yml +++ b/.github/workflows/run-ppa.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: package: - description: 'Package to upload (dms, dms-git, or all)' + description: 'Package to upload (dms, dms-git, dms-greeter, or all)' required: false default: 'dms-git' rebuild_release: @@ -83,6 +83,12 @@ jobs: echo "Uploading dms-git to PPA..." echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" bash distro/scripts/ppa-upload.sh "distro/ubuntu/dms-git" dms-git questing + + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "Uploading dms-greeter to PPA..." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + bash distro/scripts/ppa-upload.sh "distro/ubuntu/dms-greeter" danklinux questing else PPA_NAME="$PACKAGES" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" @@ -101,10 +107,13 @@ jobs: if [[ "$PACKAGES" == "all" ]]; then echo "- **PPA dms**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms/+packages" >> $GITHUB_STEP_SUMMARY echo "- **PPA dms-git**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms-git/+packages" >> $GITHUB_STEP_SUMMARY + echo "- **PPA danklinux**: https://launchpad.net/~avengemedia/+archive/ubuntu/danklinux/+packages" >> $GITHUB_STEP_SUMMARY elif [[ "$PACKAGES" == "dms" ]]; then echo "- **PPA**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms/+packages" >> $GITHUB_STEP_SUMMARY elif [[ "$PACKAGES" == "dms-git" ]]; then echo "- **PPA**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms-git/+packages" >> $GITHUB_STEP_SUMMARY + elif [[ "$PACKAGES" == "dms-greeter" ]]; then + echo "- **PPA**: https://launchpad.net/~avengemedia/+archive/ubuntu/danklinux/+packages" >> $GITHUB_STEP_SUMMARY fi if [[ -n "${{ steps.packages.outputs.version }}" ]]; then diff --git a/distro/scripts/ppa-build.sh b/distro/scripts/ppa-build.sh index 55947d7c..2e9b1b3f 100755 --- a/distro/scripts/ppa-build.sh +++ b/distro/scripts/ppa-build.sh @@ -182,8 +182,23 @@ case "$PACKAGE_NAME" in fi fi ;; + dms-greeter) + GIT_REPO="AvengeMedia/DankMaterialShell" + info "Downloading source for dms-greeter..." + VERSION=$(dpkg-parsechangelog -S Version | sed 's/-[^-]*$//' | sed 's/ppa[0-9]*$//') + + if [ ! -f "dms-greeter-source.tar.gz" ]; then + info "Downloading dms-greeter source..." + if wget -O dms-greeter-source.tar.gz "https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${VERSION}.tar.gz"; then + success "source tarball downloaded" + else + error "Failed to download dms-greeter-source.tar.gz" + exit 1 + fi + fi + ;; danksearch) - # danksearch uses pre-built binary from releases, like dgop + # danksearch uses pre-built binary from releases GIT_REPO="AvengeMedia/danksearch" ;; dgop) diff --git a/distro/scripts/ppa-upload.sh b/distro/scripts/ppa-upload.sh index bf17f4a4..8ef18fb1 100755 --- a/distro/scripts/ppa-upload.sh +++ b/distro/scripts/ppa-upload.sh @@ -224,6 +224,13 @@ if [ "$KEEP_BUILDS" = "false" ]; then REMOVED=$((REMOVED + 1)) fi ;; + dms-greeter) + # Remove downloaded source + if [ -f "$PACKAGE_DIR/dms-greeter-source.tar.gz" ]; then + rm -f "$PACKAGE_DIR/dms-greeter-source.tar.gz" + REMOVED=$((REMOVED + 1)) + fi + ;; esac if [ $REMOVED -gt 0 ]; then diff --git a/distro/ubuntu/dms-greeter/debian/changelog b/distro/ubuntu/dms-greeter/debian/changelog new file mode 100644 index 00000000..eb0d0613 --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/changelog @@ -0,0 +1,5 @@ +dms-greeter (0.6.2ppa3) questing; urgency=medium + + * Rebuild for packaging fixes (ppa3) + + -- Avenge Media Thu, 27 Nov 2025 23:38:37 -0500 diff --git a/distro/ubuntu/dms-greeter/debian/control b/distro/ubuntu/dms-greeter/debian/control new file mode 100644 index 00000000..81f05bcd --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/control @@ -0,0 +1,23 @@ +Source: dms-greeter +Section: x11 +Priority: optional +Maintainer: Avenge Media +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.2 +Homepage: https://github.com/AvengeMedia/DankMaterialShell +Vcs-Browser: https://github.com/AvengeMedia/DankMaterialShell +Vcs-Git: https://github.com/AvengeMedia/DankMaterialShell.git + +Package: dms-greeter +Architecture: all +Depends: ${misc:Depends}, + greetd, + quickshell-git | quickshell +Recommends: niri | hyprland | sway +Description: DankMaterialShell greeter for greetd + DankMaterialShell greeter for greetd login manager. A modern, Material Design 3 + inspired greeter interface built with Quickshell for Wayland compositors. + . + Supports multiple compositors including Niri, Hyprland, and Sway with automatic + compositor detection and configuration. Features session selection, user + authentication, and dynamic theming. diff --git a/distro/ubuntu/dms-greeter/debian/copyright b/distro/ubuntu/dms-greeter/debian/copyright new file mode 100644 index 00000000..cf9ece53 --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/copyright @@ -0,0 +1,27 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: dms-greeter +Upstream-Contact: Avenge Media LLC +Source: https://github.com/AvengeMedia/DankMaterialShell + +Files: * +Copyright: 2025 Avenge Media LLC +License: MIT + +License: MIT + 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. diff --git a/distro/ubuntu/dms-greeter/debian/files b/distro/ubuntu/dms-greeter/debian/files new file mode 100644 index 00000000..bb7d1471 --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/files @@ -0,0 +1 @@ +dms-greeter_0.6.2ppa3_source.buildinfo x11 optional diff --git a/distro/ubuntu/dms-greeter/debian/postinst b/distro/ubuntu/dms-greeter/debian/postinst new file mode 100755 index 00000000..10a5553d --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/postinst @@ -0,0 +1,108 @@ +#!/bin/sh +set -e + +case "$1" in + configure) + # Create greeter user/group if they don't exist + if ! getent group greeter >/dev/null; then + addgroup --system greeter + fi + + if ! getent passwd greeter >/dev/null; then + adduser --system --ingroup greeter --home /var/lib/greeter \ + --shell /bin/bash --gecos "System Greeter" greeter + fi + + if [ -d /var/cache/dms-greeter ]; then + chown -R greeter:greeter /var/cache/dms-greeter 2>/dev/null || true + fi + + if [ -d /var/lib/greeter ]; then + chown -R greeter:greeter /var/lib/greeter 2>/dev/null || true + fi + + # Check and 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 + + GREETD_CONFIG="/etc/greetd/config.toml" + CONFIG_STATUS="Not modified (already configured)" + + # Check if niri or hyprland exists + COMPOSITOR="niri" + if ! command -v niri >/dev/null 2>&1; then + if command -v Hyprland >/dev/null 2>&1; then + COMPOSITOR="hyprland" + fi + fi + + # If config doesn't exist, create a default one + if [ ! -f "$GREETD_CONFIG" ]; then + mkdir -p /etc/greetd + cat > "$GREETD_CONFIG" << 'GREETD_EOF' +[terminal] +vt = 1 + +[default_session] +user = "greeter" +command = "/usr/bin/dms-greeter --command COMPOSITOR_PLACEHOLDER" +GREETD_EOF + sed -i "s|COMPOSITOR_PLACEHOLDER|$COMPOSITOR|" "$GREETD_CONFIG" + CONFIG_STATUS="Created new config with $COMPOSITOR ✓" + elif ! grep -q "dms-greeter" "$GREETD_CONFIG"; then + # Backup existing config + BACKUP_FILE="${GREETD_CONFIG}.backup-$(date +%Y%m%d-%H%M%S)" + cp "$GREETD_CONFIG" "$BACKUP_FILE" 2>/dev/null || true + + # Update command in default_session section + sed -i "/^\[default_session\]/,/^\[/ s|^command =.*|command = \"/usr/bin/dms-greeter --command $COMPOSITOR\"|" "$GREETD_CONFIG" + sed -i '/^\[default_session\]/,/^\[/ s|^user =.*|user = "greeter"|' "$GREETD_CONFIG" + CONFIG_STATUS="Updated existing config (backed up) with $COMPOSITOR ✓" + fi + + # Only show banner on initial install + if [ -z "$2" ]; then + cat << 'EOF' + +========================================================================= + DMS Greeter Installation Complete! +========================================================================= + +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 + +Next steps: + +1. Enable the greeter: + dms greeter enable + (This will automatically disable conflicting display managers, + set graphical.target, and enable greetd) + +2. Sync your theme with the greeter (optional): + dms greeter sync + +3. Check your setup: + dms greeter status + +Ready to test? Run: sudo systemctl start greetd +Documentation: https://danklinux.com/docs/dankgreeter/ +========================================================================= + +EOF + fi + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/distro/ubuntu/dms-greeter/debian/postrm b/distro/ubuntu/dms-greeter/debian/postrm new file mode 100755 index 00000000..88addad3 --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/postrm @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +case "$1" in + purge) + # Remove greeter cache directory on purge + rm -rf /var/cache/dms-greeter 2>/dev/null || true + + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/distro/ubuntu/dms-greeter/debian/rules b/distro/ubuntu/dms-greeter/debian/rules new file mode 100755 index 00000000..d64343b7 --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/rules @@ -0,0 +1,55 @@ +#!/usr/bin/make -f + +export DH_VERBOSE = 1 + +# Extract version from debian/changelog +DEB_VERSION := $(shell dpkg-parsechangelog -S Version) +# Get upstream version (strip -1ppa1 suffix) +UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed 's/-[^-]*$$//') +BASE_VERSION := $(shell echo $(UPSTREAM_VERSION) | sed 's/ppa[0-9]*$$//' | sed 's/+git.*//') + +%: + dh $@ + +override_dh_auto_build: + # All files are included in source package + test -f dms-greeter-source.tar.gz || (echo "ERROR: dms-greeter-source.tar.gz not found!" && exit 1) + + # Extract source tarball + tar -xzf dms-greeter-source.tar.gz + # Find the extracted directory + SOURCE_DIR=$$(find . -maxdepth 1 -type d -name "DankMaterialShell*" | head -n1); \ + if [ -n "$$SOURCE_DIR" ]; then \ + ln -sf $$SOURCE_DIR DankMaterialShell-$(BASE_VERSION); \ + fi + +override_dh_auto_install: + # Install greeter files to shared data location + mkdir -p debian/dms-greeter/usr/share/quickshell/dms-greeter + cp -r DankMaterialShell-$(BASE_VERSION)/quickshell/* debian/dms-greeter/usr/share/quickshell/dms-greeter/ + + # Install launcher script + install -Dm755 DankMaterialShell-$(BASE_VERSION)/quickshell/Modules/Greetd/assets/dms-greeter \ + debian/dms-greeter/usr/bin/dms-greeter + + # Install documentation + install -Dm644 DankMaterialShell-$(BASE_VERSION)/quickshell/Modules/Greetd/README.md \ + debian/dms-greeter/usr/share/doc/dms-greeter/README.md + + # Install LICENSE file + install -Dm644 DankMaterialShell-$(BASE_VERSION)/LICENSE \ + debian/dms-greeter/usr/share/doc/dms-greeter/LICENSE + + # Create cache directory structure (will be created by postinst) + mkdir -p debian/dms-greeter/var/cache/dms-greeter + + # Remove build and development files + rm -rf debian/dms-greeter/usr/share/quickshell/dms-greeter/core + rm -rf debian/dms-greeter/usr/share/quickshell/dms-greeter/distro + rm -rf debian/dms-greeter/usr/share/quickshell/dms-greeter/.git* + rm -f debian/dms-greeter/usr/share/quickshell/dms-greeter/.gitignore + rm -rf debian/dms-greeter/usr/share/quickshell/dms-greeter/.github + +override_dh_auto_clean: + rm -rf DankMaterialShell-* + dh_auto_clean diff --git a/distro/ubuntu/dms-greeter/debian/source/format b/distro/ubuntu/dms-greeter/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/distro/ubuntu/dms-greeter/debian/source/include-binaries b/distro/ubuntu/dms-greeter/debian/source/include-binaries new file mode 100644 index 00000000..e95c5c0f --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/source/include-binaries @@ -0,0 +1 @@ +dms-greeter-source.tar.gz diff --git a/distro/ubuntu/dms-greeter/debian/source/options b/distro/ubuntu/dms-greeter/debian/source/options new file mode 100644 index 00000000..d46bb4a3 --- /dev/null +++ b/distro/ubuntu/dms-greeter/debian/source/options @@ -0,0 +1,3 @@ +# Include files that are normally excluded by .gitignore +# These are needed for the build process on Launchpad (which has no internet access) +tar-ignore = !dms-greeter-source.tar.gz