1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

Refactor pre-commit hooks to use prek (#976)

* ci: change to prek for pre-commit

* refactor: fix shellcheck warnings for the scripts

* chore: unify whitespace formatting

* nix: add prek to dev shell
This commit is contained in:
Marcus Ramberg
2025-12-11 15:11:12 +01:00
committed by GitHub
parent c8cfe0cb5a
commit 7c88865d67
147 changed files with 805 additions and 860 deletions

8
.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
[*.sh]
# like -i=4
indent_style = space
indent_size = 4
[*.nix]
# like -i=4
indent_style = space
indent_size = 4

View File

@@ -1,69 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
cd "$REPO_ROOT"
# =============================================================================
# Go CI checks (when core/ files are staged)
# =============================================================================
STAGED_CORE_FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep '^core/' || true)
if [[ -n "$STAGED_CORE_FILES" ]]; then
echo "Go files staged in core/, running CI checks..."
cd "$REPO_ROOT/core"
# Format check
echo " Checking gofmt..."
UNFORMATTED=$(gofmt -s -l . 2>/dev/null || true)
if [[ -n "$UNFORMATTED" ]]; then
echo "The following files are not formatted:"
echo "$UNFORMATTED"
echo ""
echo "Run: cd core && gofmt -s -w ."
exit 1
fi
# golangci-lint
if command -v golangci-lint &>/dev/null; then
echo " Running golangci-lint..."
golangci-lint run ./...
else
echo " Warning: golangci-lint not installed, skipping lint"
echo " Install: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest"
fi
# Tests
echo " Running tests..."
if ! go test ./... >/dev/null 2>&1; then
echo "Tests failed! Run 'go test ./...' for details."
exit 1
fi
# Build checks
echo " Building..."
mkdir -p bin
go build -buildvcs=false -o bin/dms ./cmd/dms
go build -buildvcs=false -o bin/dms-distro -tags distro_binary ./cmd/dms
go build -buildvcs=false -o bin/dankinstall ./cmd/dankinstall
echo "All Go CI checks passed!"
cd "$REPO_ROOT"
fi
# =============================================================================
# i18n sync check (DISABLED for now)
# =============================================================================
# if [[ -n "${POEDITOR_API_TOKEN:-}" ]] && [[ -n "${POEDITOR_PROJECT_ID:-}" ]]; then
# if command -v python3 &>/dev/null; then
# if ! python3 scripts/i18nsync.py check &>/dev/null; then
# echo "Translations out of sync"
# echo "Run: python3 scripts/i18nsync.py sync"
# exit 1
# fi
# fi
# fi
exit 0

View File

@@ -33,20 +33,6 @@ jobs:
with: with:
go-version-file: ./core/go.mod go-version-file: ./core/go.mod
- name: Format check
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "The following files are not formatted:"
gofmt -s -l .
exit 1
fi
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.6
working-directory: core
- name: Test - name: Test
run: go test -v ./... run: go test -v ./...

15
.github/workflows/prek.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Pre-commit Checks
on:
push:
pull_request:
branches: [master, main]
jobs:
pre-commit-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: run pre-commit hooks
uses: j178/prek-action@v1

12
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: end-of-file-fixer
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [-e, SC2164, -e, SC2001, -e, SC2012, -e, SC2317]

View File

@@ -6,10 +6,10 @@ To contribute fork this repository, make your changes, and open a pull request.
## Setup ## Setup
Enable pre-commit hooks to catch CI failures before pushing: Install [prek](https://prek.j178.dev/) then activate pre-commit hooks:
```bash ```bash
git config core.hooksPath .githooks prek install
``` ```
### Nix Development Shell ### Nix Development Shell

View File

@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v2.6.2
hooks:
- id: golangci-lint-full
- id: golangci-lint-fmt
- id: golangci-lint-config-verify

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
set -e set -e
@@ -55,7 +55,7 @@ curl -L "https://github.com/AvengeMedia/DankMaterialShell/releases/download/$LAT
curl -L "https://github.com/AvengeMedia/DankMaterialShell/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.sha256" -o "expected.sha256"
# Get the expected checksum # Get the expected checksum
EXPECTED_CHECKSUM=$(cat expected.sha256 | awk '{print $1}') EXPECTED_CHECKSUM=$(awk '{print $1}' expected.sha256)
# Calculate actual checksum # Calculate actual checksum
printf "%bVerifying checksum...%b\n" "$GREEN" "$NC" printf "%bVerifying checksum...%b\n" "$GREEN" "$NC"

View File

@@ -1,9 +1,9 @@
#!/bin/sh #!/usr/bin/env sh
# Runs go generate for each directory, but in parallel. Any arguments are appended to the # Runs go generate for each directory, but in parallel. Any arguments are appended to the
# go generate command. # go generate command.
# Usage: $ ./generatep [go generate arguments] # Usage: $ ./generatep [go generate arguments]
# Print all generate commands: $ ./generatep -x # Print all generate commands: $ ./generatep -x
cd ./wayland cd ./wayland || exit 1
find . -type f -name '*.go' -exec dirname {} \; | sort -u | parallel -j 0 go generate $1 {}/. find . -type f -name '*.go' -exec dirname {} \; | sort -u | parallel -j 0 go generate "$1" {}/.

View File

@@ -187,7 +187,7 @@ echo "Building SRPM..."
cd ~/rpmbuild/SPECS cd ~/rpmbuild/SPECS
rpmbuild -bs dms.spec rpmbuild -bs dms.spec
SRPM=$(ls ~/rpmbuild/SRPMS/dms-${VERSION}-*.src.rpm | tail -n 1) SRPM=$(ls ~/rpmbuild/SRPMS/dms-"${VERSION}"-*.src.rpm | tail -n 1)
if [ ! -f "$SRPM" ]; then if [ ! -f "$SRPM" ]; then
echo "Error: SRPM not found!" echo "Error: SRPM not found!"
exit 1 exit 1

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Unified OBS status checker for dms packages # Unified OBS status checker for dms packages
# Checks all platforms (Debian, OpenSUSE) and architectures (x86_64, aarch64) # Checks all platforms (Debian, OpenSUSE) and architectures (x86_64, aarch64)
# Only pulls logs if build failed # Only pulls logs if build failed
@@ -46,6 +46,7 @@ for pkg in "${PACKAGES[@]}"; do
continue continue
;; ;;
esac esac
(
echo "==========================================" echo "=========================================="
echo "=== $pkg ===" echo "=== $pkg ==="
@@ -107,9 +108,8 @@ for pkg in "${PACKAGES[@]}"; do
fi fi
echo "" echo ""
cd - > /dev/null )
done done
echo "==========================================" echo "=========================================="
echo "Status check complete!" echo "Status check complete!"

View File

@@ -46,7 +46,7 @@ if [[ -z "$PACKAGE" ]]; then
echo " 2. dms-git - Nightly DMS" echo " 2. dms-git - Nightly DMS"
echo " a. all" echo " a. all"
echo "" echo ""
read -p "Select package (1-${#AVAILABLE_PACKAGES[@]}, a): " selection read -r -p "Select package (1-${#AVAILABLE_PACKAGES[@]}, a): " selection
if [[ "$selection" == "a" ]] || [[ "$selection" == "all" ]]; then if [[ "$selection" == "a" ]] || [[ "$selection" == "all" ]]; then
PACKAGE="all" PACKAGE="all"
@@ -235,7 +235,7 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ "$UPLOAD_DEBIAN" == false ]] && [[ -f
echo " - OpenSUSE-only upload: creating source tarball" echo " - OpenSUSE-only upload: creating source tarball"
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
trap "rm -rf $TEMP_DIR" EXIT trap 'rm -rf $TEMP_DIR' EXIT
if [[ -f "distro/debian/$PACKAGE/_service" ]] && grep -q "tar_scm" "distro/debian/$PACKAGE/_service"; then if [[ -f "distro/debian/$PACKAGE/_service" ]] && grep -q "tar_scm" "distro/debian/$PACKAGE/_service"; then
GIT_URL=$(grep -A 5 'name="tar_scm"' "distro/debian/$PACKAGE/_service" | grep "url" | sed 's/.*<param name="url">\(.*\)<\/param>.*/\1/') GIT_URL=$(grep -A 5 'name="tar_scm"' "distro/debian/$PACKAGE/_service" | grep "url" | sed 's/.*<param name="url">\(.*\)<\/param>.*/\1/')
@@ -244,7 +244,7 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ "$UPLOAD_DEBIAN" == false ]] && [[ -f
if [[ -n "$GIT_URL" ]]; then if [[ -n "$GIT_URL" ]]; then
echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})" echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})"
SOURCE_DIR="$TEMP_DIR/dms-git-source" SOURCE_DIR="$TEMP_DIR/dms-git-source"
if git clone --depth 1 --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null || \ if git clone --depth 1 --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null ||
git clone --depth 1 "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then git clone --depth 1 "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then
cd "$SOURCE_DIR" cd "$SOURCE_DIR"
if [[ -n "$GIT_REVISION" ]]; then if [[ -n "$GIT_REVISION" ]]; then
@@ -295,7 +295,7 @@ fi
if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; then if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; then
# Use CHANGELOG_VERSION already set above, or get it if not set # Use CHANGELOG_VERSION already set above, or get it if not set
if [[ -z "$CHANGELOG_VERSION" ]]; then if [[ -z "$CHANGELOG_VERSION" ]]; then
CHANGELOG_VERSION=$(grep -m1 "^$PACKAGE" distro/debian/$PACKAGE/debian/changelog 2>/dev/null | sed 's/.*(\([^)]*\)).*/\1/' || echo "0.1.11") CHANGELOG_VERSION=$(grep -m1 "^$PACKAGE" distro/debian/"$PACKAGE"/debian/changelog 2>/dev/null | sed 's/.*(\([^)]*\)).*/\1/' || echo "0.1.11")
fi fi
# Determine source format # Determine source format
@@ -314,7 +314,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
VERSION="$CHANGELOG_VERSION" VERSION="$CHANGELOG_VERSION"
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
trap "rm -rf $TEMP_DIR" EXIT trap 'rm -rf $TEMP_DIR' EXIT
COMBINED_TARBALL="${PACKAGE}_${VERSION}.tar.gz" COMBINED_TARBALL="${PACKAGE}_${VERSION}.tar.gz"
SOURCE_DIR="" SOURCE_DIR=""
@@ -326,7 +326,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
if [[ -n "$GIT_URL" ]]; then if [[ -n "$GIT_URL" ]]; then
echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})" echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})"
SOURCE_DIR="$TEMP_DIR/dms-git-source" SOURCE_DIR="$TEMP_DIR/dms-git-source"
if git clone --depth 1 --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null || \ if git clone --depth 1 --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null ||
git clone --depth 1 "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then git clone --depth 1 "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then
cd "$SOURCE_DIR" cd "$SOURCE_DIR"
if [[ -n "$GIT_REVISION" ]]; then if [[ -n "$GIT_REVISION" ]]; then
@@ -341,13 +341,13 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
fi fi
fi fi
elif grep -q "download_url" "distro/debian/$PACKAGE/_service" && [[ "$PACKAGE" != "dms-git" ]]; then elif grep -q "download_url" "distro/debian/$PACKAGE/_service" && [[ "$PACKAGE" != "dms-git" ]]; then
ALL_PATHS=$(grep -A 5 '<service name="download_url">' "distro/debian/$PACKAGE/_service" | \ ALL_PATHS=$(grep -A 5 '<service name="download_url">' "distro/debian/$PACKAGE/_service" |
grep '<param name="path">' | \ grep '<param name="path">' |
sed 's/.*<param name="path">\(.*\)<\/param>.*/\1/') sed 's/.*<param name="path">\(.*\)<\/param>.*/\1/')
SOURCE_PATH="" SOURCE_PATH=""
for path in $ALL_PATHS; do for path in $ALL_PATHS; do
if echo "$path" | grep -qE "(source|archive|\.tar\.(gz|xz|bz2))" && \ if echo "$path" | grep -qE "(source|archive|\.tar\.(gz|xz|bz2))" &&
! echo "$path" | grep -qE "(distropkg|binary)"; then ! echo "$path" | grep -qE "(distropkg|binary)"; then
SOURCE_PATH="$path" SOURCE_PATH="$path"
break break
@@ -385,7 +385,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
SOURCE_URL="${URL_PROTOCOL}://${URL_HOST}${URL_PATH}" SOURCE_URL="${URL_PROTOCOL}://${URL_HOST}${URL_PATH}"
echo " Downloading source from: $SOURCE_URL" echo " Downloading source from: $SOURCE_URL"
if wget -q -O "$TEMP_DIR/source-archive" "$SOURCE_URL" 2>/dev/null || \ if wget -q -O "$TEMP_DIR/source-archive" "$SOURCE_URL" 2>/dev/null ||
curl -L -f -s -o "$TEMP_DIR/source-archive" "$SOURCE_URL" 2>/dev/null; then curl -L -f -s -o "$TEMP_DIR/source-archive" "$SOURCE_URL" 2>/dev/null; then
cd "$TEMP_DIR" cd "$TEMP_DIR"
if [[ "$SOURCE_URL" == *.tar.xz ]]; then if [[ "$SOURCE_URL" == *.tar.xz ]]; then
@@ -763,7 +763,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ "$SOURCE_FORMAT" == *"native"* ]] && [[
if [[ -f "$REPO_CHANGELOG" ]]; then if [[ -f "$REPO_CHANGELOG" ]]; then
OLD_ENTRY_START=$(grep -n "^$PACKAGE (" "$REPO_CHANGELOG" | sed -n '2p' | cut -d: -f1) OLD_ENTRY_START=$(grep -n "^$PACKAGE (" "$REPO_CHANGELOG" | sed -n '2p' | cut -d: -f1)
if [[ -n "$OLD_ENTRY_START" ]]; then if [[ -n "$OLD_ENTRY_START" ]]; then
tail -n +$OLD_ENTRY_START "$REPO_CHANGELOG" tail -n +"$OLD_ENTRY_START" "$REPO_CHANGELOG"
fi fi
fi fi
} >"$TEMP_CHANGELOG" } >"$TEMP_CHANGELOG"
@@ -848,7 +848,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ "$SOURCE_FORMAT" == *"native"* ]] && [[
if [[ -f "$REPO_CHANGELOG" ]]; then if [[ -f "$REPO_CHANGELOG" ]]; then
OLD_ENTRY_START=$(grep -n "^$PACKAGE (" "$REPO_CHANGELOG" | sed -n '2p' | cut -d: -f1) OLD_ENTRY_START=$(grep -n "^$PACKAGE (" "$REPO_CHANGELOG" | sed -n '2p' | cut -d: -f1)
if [[ -n "$OLD_ENTRY_START" ]]; then if [[ -n "$OLD_ENTRY_START" ]]; then
tail -n +$OLD_ENTRY_START "$REPO_CHANGELOG" tail -n +"$OLD_ENTRY_START" "$REPO_CHANGELOG"
fi fi
fi fi
} >"$TEMP_CHANGELOG" } >"$TEMP_CHANGELOG"
@@ -954,11 +954,11 @@ ls -la 2>&1 | head -20
echo "==> Staging changes" echo "==> Staging changes"
echo "Files to upload:" echo "Files to upload:"
if [[ "$UPLOAD_DEBIAN" == true ]] && [[ "$UPLOAD_OPENSUSE" == true ]]; then if [[ "$UPLOAD_DEBIAN" == true ]] && [[ "$UPLOAD_OPENSUSE" == true ]]; then
ls -lh *.tar.gz *.tar.xz *.tar *.spec *.dsc _service 2>/dev/null | awk '{print " " $9 " (" $5 ")"}' ls -lh ./*.tar.gz ./*.tar.xz ./*.tar ./*.spec ./*.dsc _service 2>/dev/null | awk '{print " " $9 " (" $5 ")"}'
elif [[ "$UPLOAD_DEBIAN" == true ]]; then elif [[ "$UPLOAD_DEBIAN" == true ]]; then
ls -lh *.tar.gz *.dsc _service 2>/dev/null | awk '{print " " $9 " (" $5 ")"}' ls -lh ./*.tar.gz ./*.dsc _service 2>/dev/null | awk '{print " " $9 " (" $5 ")"}'
elif [[ "$UPLOAD_OPENSUSE" == true ]]; then elif [[ "$UPLOAD_OPENSUSE" == true ]]; then
ls -lh *.tar.gz *.tar.xz *.tar *.spec _service 2>/dev/null | awk '{print " " $9 " (" $5 ")"}' ls -lh ./*.tar.gz ./*.tar.xz ./*.tar ./*.spec _service 2>/dev/null | awk '{print " " $9 " (" $5 ")"}'
fi fi
echo "" echo ""

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Generic source package builder for DMS PPA packages # Generic source package builder for DMS PPA packages
# Usage: ./create-source.sh <package-dir> [ubuntu-series] # Usage: ./create-source.sh <package-dir> [ubuntu-series]
# #
@@ -54,7 +54,7 @@ PACKAGE_PARENT=$(dirname "$PACKAGE_DIR")
# Create temporary working directory (like OBS) # Create temporary working directory (like OBS)
TEMP_WORK_DIR=$(mktemp -d -t ppa_build_work_XXXXXX) TEMP_WORK_DIR=$(mktemp -d -t ppa_build_work_XXXXXX)
trap "rm -rf '$TEMP_WORK_DIR'" EXIT trap 'rm -rf "$TEMP_WORK_DIR"' EXIT
info "Building source package for: $PACKAGE_NAME" info "Building source package for: $PACKAGE_NAME"
info "Package directory: $PACKAGE_DIR" info "Package directory: $PACKAGE_DIR"
@@ -327,7 +327,7 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then
OLD_ENTRY_START=$(grep -n "^${SOURCE_NAME} (" debian/changelog | sed -n '2p' | cut -d: -f1) OLD_ENTRY_START=$(grep -n "^${SOURCE_NAME} (" debian/changelog | sed -n '2p' | cut -d: -f1)
if [ -n "$OLD_ENTRY_START" ]; then if [ -n "$OLD_ENTRY_START" ]; then
# Found second entry, use everything from there # Found second entry, use everything from there
CHANGELOG_CONTENT=$(tail -n +$OLD_ENTRY_START debian/changelog) CHANGELOG_CONTENT=$(tail -n +"$OLD_ENTRY_START" debian/changelog)
else else
# No second entry found, changelog will only have new entry # No second entry found, changelog will only have new entry
CHANGELOG_CONTENT="" CHANGELOG_CONTENT=""
@@ -428,7 +428,6 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then
fi fi
fi fi
success "Source prepared for packaging" success "Source prepared for packaging"
else else
error "Failed to clone $GIT_REPO" error "Failed to clone $GIT_REPO"
@@ -443,7 +442,7 @@ elif [ -n "$GIT_REPO" ]; then
LATEST_TAG=$(get_latest_tag "$GIT_REPO") LATEST_TAG=$(get_latest_tag "$GIT_REPO")
if [ -n "$LATEST_TAG" ]; then if [ -n "$LATEST_TAG" ]; then
# Check source format - native packages can't use dashes # Check source format - native packages can't use dashes
SOURCE_FORMAT=$(cat debian/source/format 2>/dev/null | head -1 || echo "3.0 (quilt)") SOURCE_FORMAT=$(head -1 debian/source/format 2>/dev/null || echo "3.0 (quilt)")
# Get current version to check if we need to increment PPA number # Get current version to check if we need to increment PPA number
CURRENT_VERSION=$(dpkg-parsechangelog -S Version 2>/dev/null || echo "") CURRENT_VERSION=$(dpkg-parsechangelog -S Version 2>/dev/null || echo "")
@@ -498,7 +497,7 @@ elif [ -n "$GIT_REPO" ]; then
# Get current changelog content - find the next package header line # Get current changelog content - find the next package header line
OLD_ENTRY_START=$(grep -n "^${SOURCE_NAME} (" debian/changelog | sed -n '2p' | cut -d: -f1) OLD_ENTRY_START=$(grep -n "^${SOURCE_NAME} (" debian/changelog | sed -n '2p' | cut -d: -f1)
if [ -n "$OLD_ENTRY_START" ]; then if [ -n "$OLD_ENTRY_START" ]; then
CHANGELOG_CONTENT=$(tail -n +$OLD_ENTRY_START debian/changelog) CHANGELOG_CONTENT=$(tail -n +"$OLD_ENTRY_START" debian/changelog)
else else
CHANGELOG_CONTENT="" CHANGELOG_CONTENT=""
fi fi
@@ -621,11 +620,11 @@ if yes | DEBIAN_FRONTEND=noninteractive debuild -S $DEBUILD_SOURCE_FLAG -d; then
# Copy build artifacts back to parent directory # Copy build artifacts back to parent directory
info "Copying build artifacts to $PACKAGE_PARENT..." info "Copying build artifacts to $PACKAGE_PARENT..."
cp -v "$TEMP_WORK_DIR"/${SOURCE_NAME}_${CHANGELOG_VERSION}* "$PACKAGE_PARENT/" 2>/dev/null || true cp -v "$TEMP_WORK_DIR"/"${SOURCE_NAME}"_"${CHANGELOG_VERSION}"* "$PACKAGE_PARENT/" 2>/dev/null || true
# List generated files # List generated files
info "Generated files in $PACKAGE_PARENT:" info "Generated files in $PACKAGE_PARENT:"
ls -lh "$PACKAGE_PARENT"/${SOURCE_NAME}_${CHANGELOG_VERSION}* 2>/dev/null || true ls -lh "$PACKAGE_PARENT"/"${SOURCE_NAME}"_"${CHANGELOG_VERSION}"* 2>/dev/null || true
# Show what to do next # Show what to do next
echo echo

View File

@@ -58,23 +58,18 @@ CHANGES_FILE=$(realpath "$CHANGES_FILE")
info "Uploading to PPA: ppa:avengemedia/$PPA_NAME" info "Uploading to PPA: ppa:avengemedia/$PPA_NAME"
info "Changes file: $CHANGES_FILE" info "Changes file: $CHANGES_FILE"
# Check if dput or lftp is installed # Check if dput is installed
UPLOAD_METHOD=""
if command -v dput &>/dev/null; then if command -v dput &>/dev/null; then
UPLOAD_METHOD="dput" info "dput found"
elif command -v lftp &> /dev/null; then
UPLOAD_METHOD="lftp"
warn "dput not found, using lftp as fallback"
else else
error "Neither dput nor lftp found. Install one with:" error "dput not found. Install with:"
error " sudo dnf install dput-ng # Preferred but broken on Fedora" error " sudo dnf install dput-ng"
error " sudo dnf install lftp # Alternative upload method"
exit 1 exit 1
fi fi
# Check if ~/.dput.cf exists # Check if ~/.dput.cf exists
if [ ! -f "$HOME/.dput.cf" ]; then if [ ! -f "$HOME/.dput.cf" ]; then
error "~/.dput.cf not found!" error "$HOME/.dput.cf not found!"
echo echo
info "Create it from template:" info "Create it from template:"
echo " cp $(dirname "$0")/../dput.cf.template ~/.dput.cf" echo " cp $(dirname "$0")/../dput.cf.template ~/.dput.cf"

View File

@@ -99,10 +99,6 @@ info "Step 2: Uploading to PPA..."
if [ "$PPA_NAME" = "danklinux" ] || [ "$PPA_NAME" = "dms" ] || [ "$PPA_NAME" = "dms-git" ]; then if [ "$PPA_NAME" = "danklinux" ] || [ "$PPA_NAME" = "dms" ] || [ "$PPA_NAME" = "dms-git" ]; then
warn "Using lftp for upload" warn "Using lftp for upload"
# Extract version from changes file
VERSION=$(grep "^Version:" "$CHANGES_FILE" | awk '{print $2}')
SOURCE_NAME=$(grep "^Source:" "$CHANGES_FILE" | awk '{print $2}')
# Find all files to upload # Find all files to upload
BUILD_DIR=$(dirname "$CHANGES_FILE") BUILD_DIR=$(dirname "$CHANGES_FILE")
CHANGES_BASENAME=$(basename "$CHANGES_FILE") CHANGES_BASENAME=$(basename "$CHANGES_FILE")
@@ -246,4 +242,3 @@ fi
echo echo
success "Done!" success "Done!"

View File

@@ -171,11 +171,13 @@
delve delve
go-tools go-tools
gnumake gnumake
prek
] ]
++ devQmlPkgs; ++ devQmlPkgs;
shellHook = '' shellHook = ''
touch quickshell/.qmlls.ini 2>/dev/null touch quickshell/.qmlls.ini 2>/dev/null
if [ ! -f .git/hooks/pre-commit ]; then prek install; fi
''; '';
QML2_IMPORT_PATH = mkQmlImportPath pkgs devQmlPkgs; QML2_IMPORT_PATH = mkQmlImportPath pkgs devQmlPkgs;

View File

@@ -161,4 +161,3 @@ Inter is a [variable font](https://rsms.me/inter/#variable) and is in addition a
| Bold | Bold Italic | 700 | Bold | Bold Italic | 700
| Extra Bold | Extra Bold Italic | 800 | Extra Bold | Extra Bold Italic | 800
| Black | Black Italic | 900 | Black | Black Italic | 900

View File

@@ -45,4 +45,3 @@ Once you narrow down your font choice of family (`Droid Sans`, `Inconsolata`, et
For more information see: [The FAQ](https://github.com/ryanoasis/nerd-fonts/wiki/FAQ-and-Troubleshooting#which-font) For more information see: [The FAQ](https://github.com/ryanoasis/nerd-fonts/wiki/FAQ-and-Troubleshooting#which-font)
[SIL-RFN]:http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web_fonts_and_RFNs#14cbfd4a [SIL-RFN]:http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web_fonts_and_RFNs#14cbfd4a

View File

@@ -1,18 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
CONFIG_DIR="$1" CONFIG_DIR="$1"
IS_LIGHT="$2"
SHELL_DIR="$3"
if [ -z "$CONFIG_DIR" ] || [ -z "$IS_LIGHT" ] || [ -z "$SHELL_DIR" ]; then if [ -z "$CONFIG_DIR" ]; then
echo "Usage: $0 <config_dir> <is_light> <shell_dir>" >&2 echo "Usage: $0 <config_dir>" >&2
exit 1 exit 1
fi fi
apply_gtk3_colors() { apply_gtk3_colors() {
local config_dir="$1" local config_dir="$1"
local is_light="$2"
local shell_dir="$3"
local gtk3_dir="$config_dir/gtk-3.0" local gtk3_dir="$config_dir/gtk-3.0"
local dank_colors="$gtk3_dir/dank-colors.css" local dank_colors="$gtk3_dir/dank-colors.css"
@@ -60,7 +56,7 @@ apply_gtk4_colors() {
mkdir -p "$CONFIG_DIR/gtk-3.0" "$CONFIG_DIR/gtk-4.0" mkdir -p "$CONFIG_DIR/gtk-3.0" "$CONFIG_DIR/gtk-4.0"
apply_gtk3_colors "$CONFIG_DIR" "$IS_LIGHT" "$SHELL_DIR" apply_gtk3_colors "$CONFIG_DIR"
apply_gtk4_colors "$CONFIG_DIR" apply_gtk4_colors "$CONFIG_DIR"
echo "GTK colors applied successfully" echo "GTK colors applied successfully"

View File

@@ -9,7 +9,8 @@ fi
apply_qt_colors() { apply_qt_colors() {
local config_dir="$1" local config_dir="$1"
local color_scheme_path="$(dirname "$config_dir")/.local/share/color-schemes/DankMatugen.colors" local color_scheme_path
color_scheme_path="$(dirname "$config_dir")/.local/share/color-schemes/DankMatugen.colors"
if [ ! -f "$color_scheme_path" ]; then if [ ! -f "$color_scheme_path" ]; then
echo "Error: Qt color scheme not found at $color_scheme_path" >&2 echo "Error: Qt color scheme not found at $color_scheme_path" >&2
@@ -34,10 +35,12 @@ apply_qt_colors() {
sed -i "/^\\[Appearance\\]/a color_scheme_path=$color_scheme_path" "$config_file" sed -i "/^\\[Appearance\\]/a color_scheme_path=$color_scheme_path" "$config_file"
fi fi
else else
echo "" >> "$config_file" {
echo "[Appearance]" >> "$config_file" echo ""
echo "custom_palette=true" >> "$config_file" echo "[Appearance]"
echo "color_scheme_path=$color_scheme_path" >> "$config_file" echo "custom_palette=true"
echo "color_scheme_path=$color_scheme_path"
} >>"$config_file"
fi fi
else else
printf '[Appearance]\\ncustom_palette=true\\ncolor_scheme_path=%s\\n' "$color_scheme_path" >"$config_file" printf '[Appearance]\\ncustom_palette=true\\ncolor_scheme_path=%s\\n' "$color_scheme_path" >"$config_file"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Notification Spam Test Script - Sends 100 rapid notifications from fake apps # Notification Spam Test Script - Sends 100 rapid notifications from fake apps
@@ -151,7 +151,7 @@ echo "Starting notification spam..."
echo "------------------------------" echo "------------------------------"
# Send notifications rapidly # Send notifications rapidly
for i in $(seq 1 $TOTAL); do for _ in $(seq 1 $TOTAL); do
# Pick random app, title, message, and urgency # Pick random app, title, message, and urgency
APP=${APPS[$RANDOM % ${#APPS[@]}]} APP=${APPS[$RANDOM % ${#APPS[@]}]}
APP_NAME=${APP%%:*} APP_NAME=${APP%%:*}
@@ -171,9 +171,9 @@ for i in $(seq 1 $TOTAL); do
# Send notification with very short delay # Send notification with very short delay
notify-send \ notify-send \
-h string:desktop-entry:$APP_NAME \ -h "string:desktop-entry:$APP_NAME" \
-i $APP_ICON \ -i "$APP_ICON" \
-u $URG \ -u "$URG" \
"$APP_NAME: $TITLE" \ "$APP_NAME: $TITLE" \
"$MESSAGE" & "$MESSAGE" &
@@ -200,7 +200,7 @@ echo "Statistics:"
echo " Total notifications sent: $TOTAL" echo " Total notifications sent: $TOTAL"
echo " Apps simulated: ${#APPS[@]}" echo " Apps simulated: ${#APPS[@]}"
echo " Message variations: ${#MESSAGES[@]}" echo " Message variations: ${#MESSAGES[@]}"
echo " Time taken: ~$(($TOTAL / 100)) seconds" echo " Time taken: ~$((TOTAL / 100)) seconds"
echo "" echo ""
echo "Check your notification center - it should be FULL!" echo "Check your notification center - it should be FULL!"
echo "Tip: You may want to clear all notifications after this test" echo "Tip: You may want to clear all notifications after this test"

View File

@@ -8,12 +8,10 @@ echo "============================================================="
# Check what icons are available # Check what icons are available
echo "Checking available icons..." echo "Checking available icons..."
if [ -d "~/.local/share/icons/Papirus" ]; then if [ -d "$HOME/.local/share/icons/Papirus" ]; then
echo "✓ Icon theme found" echo "✓ Icon theme found"
ICON_BASE="~/.local/share/icons/Papirus"
else else
echo "! Using fallback icons" echo "! Using fallback icons"
ICON_BASE=""
fi fi
# Test 1: Basic notifications with markdown # Test 1: Basic notifications with markdown