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
@@ -22,13 +22,13 @@ fi
# Detect architecture # Detect architecture
ARCH=$(uname -m) ARCH=$(uname -m)
case "$ARCH" in case "$ARCH" in
x86_64) x86_64)
ARCH="amd64" ARCH="amd64"
;; ;;
aarch64) aarch64)
ARCH="arm64" ARCH="arm64"
;; ;;
*) *)
printf "%bError: Unsupported architecture: %s%b\n" "$RED" "$ARCH" "$NC" printf "%bError: Unsupported architecture: %s%b\n" "$RED" "$ARCH" "$NC"
printf "This installer only supports x86_64 (amd64) and aarch64 (arm64) architectures\n" printf "This installer only supports x86_64 (amd64) and aarch64 (arm64) architectures\n"
exit 1 exit 1
@@ -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"
@@ -67,7 +67,7 @@ if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
printf "Expected: %s\n" "$EXPECTED_CHECKSUM" printf "Expected: %s\n" "$EXPECTED_CHECKSUM"
printf "Got: %s\n" "$ACTUAL_CHECKSUM" printf "Got: %s\n" "$ACTUAL_CHECKSUM"
printf "The downloaded file may be corrupted or tampered with\n" printf "The downloaded file may be corrupted or tampered with\n"
cd - > /dev/null cd - >/dev/null
rm -rf "$TEMP_DIR" rm -rf "$TEMP_DIR"
exit 1 exit 1
fi fi
@@ -82,5 +82,5 @@ printf "%bRunning installer...%b\n" "$GREEN" "$NC"
./installer ./installer
# Cleanup # Cleanup
cd - > /dev/null cd - >/dev/null
rm -rf "$TEMP_DIR" rm -rf "$TEMP_DIR"

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

@@ -45,7 +45,7 @@ rm -rf "$TEMP_DIR"
echo "Generating spec file..." echo "Generating spec file..."
CHANGELOG_DATE="$(date '+%a %b %d %Y')" CHANGELOG_DATE="$(date '+%a %b %d %Y')"
cat > ~/rpmbuild/SPECS/dms.spec <<'SPECEOF' cat >~/rpmbuild/SPECS/dms.spec <<'SPECEOF'
# Spec for DMS stable releases - Built locally # Spec for DMS stable releases - Built locally
%global debug_package %{nil} %global debug_package %{nil}
@@ -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
@@ -196,7 +196,7 @@ fi
echo "SRPM built successfully: $SRPM" echo "SRPM built successfully: $SRPM"
# Check if copr-cli is installed # Check if copr-cli is installed
if ! command -v copr-cli &> /dev/null; then if ! command -v copr-cli &>/dev/null; then
echo "" echo ""
echo "copr-cli is not installed. Install it with:" echo "copr-cli is not installed. Install it with:"
echo " pip install copr-cli" echo " pip install copr-cli"

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 ==="
@@ -97,7 +98,7 @@ for pkg in "${PACKAGES[@]}"; do
echo "" echo ""
echo " 📋 Fetching logs for failed builds..." echo " 📋 Fetching logs for failed builds..."
for build in "${FAILED_BUILDS[@]}"; do for build in "${FAILED_BUILDS[@]}"; do
read -r repo arch <<< "$build" read -r repo arch <<<"$build"
echo "" echo ""
echo " ────────────────────────────────────────────" echo " ────────────────────────────────────────────"
echo " Build log: $repo $arch" echo " Build log: $repo $arch"
@@ -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,12 +46,12 @@ 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"
elif [[ "$selection" =~ ^[0-9]+$ ]] && [[ "$selection" -ge 1 ]] && [[ "$selection" -le ${#AVAILABLE_PACKAGES[@]} ]]; then elif [[ "$selection" =~ ^[0-9]+$ ]] && [[ "$selection" -ge 1 ]] && [[ "$selection" -le ${#AVAILABLE_PACKAGES[@]} ]]; then
PACKAGE="${AVAILABLE_PACKAGES[$((selection-1))]}" PACKAGE="${AVAILABLE_PACKAGES[$((selection - 1))]}"
else else
echo "Error: Invalid selection" echo "Error: Invalid selection"
exit 1 exit 1
@@ -124,13 +124,13 @@ if [[ ! -d "distro/debian/$PACKAGE" ]]; then
fi fi
case "$PACKAGE" in case "$PACKAGE" in
dms) dms)
PROJECT="dms" PROJECT="dms"
;; ;;
dms-git) dms-git)
PROJECT="dms-git" PROJECT="dms-git"
;; ;;
*) *)
echo "Error: Unknown package '$PACKAGE'" echo "Error: Unknown package '$PACKAGE'"
exit 1 exit 1
;; ;;
@@ -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
@@ -432,7 +432,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
echo " - Vendoring Go dependencies for offline OBS build..." echo " - Vendoring Go dependencies for offline OBS build..."
cd "$SOURCE_DIR/core" cd "$SOURCE_DIR/core"
if ! command -v go &> /dev/null; then if ! command -v go &>/dev/null; then
echo "ERROR: Go not found. Install Go to vendor dependencies." echo "ERROR: Go not found. Install Go to vendor dependencies."
echo " Install: sudo apt-get install golang-go (Debian/Ubuntu)" echo " Install: sudo apt-get install golang-go (Debian/Ubuntu)"
echo " or: sudo dnf install golang (Fedora)" echo " or: sudo dnf install golang (Fedora)"
@@ -592,7 +592,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
BUILD_DEPS="debhelper-compat (= 13)" BUILD_DEPS="debhelper-compat (= 13)"
fi fi
cat > "$WORK_DIR/$PACKAGE.dsc" << EOF cat >"$WORK_DIR/$PACKAGE.dsc" <<EOF
Format: 3.0 (native) Format: 3.0 (native)
Source: $PACKAGE Source: $PACKAGE
Binary: $PACKAGE Binary: $PACKAGE
@@ -618,7 +618,7 @@ EOF
tar -czf "$WORK_DIR/debian.tar.gz" -C "distro/debian/$PACKAGE" debian/ tar -czf "$WORK_DIR/debian.tar.gz" -C "distro/debian/$PACKAGE" debian/
echo " - Generating $PACKAGE.dsc for quilt format" echo " - Generating $PACKAGE.dsc for quilt format"
cat > "$WORK_DIR/$PACKAGE.dsc" << EOF cat >"$WORK_DIR/$PACKAGE.dsc" <<EOF
Format: 3.0 (quilt) Format: 3.0 (quilt)
Source: $PACKAGE Source: $PACKAGE
Binary: $PACKAGE Binary: $PACKAGE
@@ -763,10 +763,10 @@ 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"
cp "$TEMP_CHANGELOG" "$SOURCE_CHANGELOG" cp "$TEMP_CHANGELOG" "$SOURCE_CHANGELOG"
rm -f "$TEMP_CHANGELOG" rm -f "$TEMP_CHANGELOG"
@@ -848,10 +848,10 @@ 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"
cp "$TEMP_CHANGELOG" "$EXPECTED_DIR/debian/changelog" cp "$TEMP_CHANGELOG" "$EXPECTED_DIR/debian/changelog"
rm -f "$TEMP_CHANGELOG" rm -f "$TEMP_CHANGELOG"
fi fi
@@ -905,7 +905,7 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ "$SOURCE_FORMAT" == *"native"* ]] && [[
BUILD_DEPS="debhelper-compat (= 13)" BUILD_DEPS="debhelper-compat (= 13)"
fi fi
cat > "$WORK_DIR/$PACKAGE.dsc" << EOF cat >"$WORK_DIR/$PACKAGE.dsc" <<EOF
Format: 3.0 (native) Format: 3.0 (native)
Source: $PACKAGE Source: $PACKAGE
Binary: $PACKAGE Binary: $PACKAGE
@@ -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"
@@ -79,7 +79,7 @@ done
# Verify GPG key is set up # Verify GPG key is set up
info "Checking GPG key setup..." info "Checking GPG key setup..."
if ! gpg --list-secret-keys &> /dev/null; then if ! gpg --list-secret-keys &>/dev/null; then
error "No GPG secret keys found. Please set up GPG first!" error "No GPG secret keys found. Please set up GPG first!"
error "See GPG_SETUP.md for instructions" error "See GPG_SETUP.md for instructions"
exit 1 exit 1
@@ -88,7 +88,7 @@ fi
success "GPG key found" success "GPG key found"
# Check if debuild is installed # Check if debuild is installed
if ! command -v debuild &> /dev/null; then if ! command -v debuild &>/dev/null; then
error "debuild not found. Install devscripts:" error "debuild not found. Install devscripts:"
error " sudo dnf install devscripts" error " sudo dnf install devscripts"
exit 1 exit 1
@@ -137,7 +137,7 @@ cd "$WORK_PACKAGE_DIR"
get_latest_tag() { get_latest_tag() {
local repo="$1" local repo="$1"
# Try GitHub API first (faster) # Try GitHub API first (faster)
if command -v curl &> /dev/null; then if command -v curl &>/dev/null; then
LATEST_TAG=$(curl -s "https://api.github.com/repos/$repo/releases/latest" 2>/dev/null | grep '"tag_name":' | sed 's/.*"tag_name": "\(.*\)".*/\1/' | head -1) LATEST_TAG=$(curl -s "https://api.github.com/repos/$repo/releases/latest" 2>/dev/null | grep '"tag_name":' | sed 's/.*"tag_name": "\(.*\)".*/\1/' | head -1)
if [ -n "$LATEST_TAG" ]; then if [ -n "$LATEST_TAG" ]; then
echo "$LATEST_TAG" | sed 's/^v//' echo "$LATEST_TAG" | sed 's/^v//'
@@ -175,12 +175,12 @@ fi
# Special handling for known packages # Special handling for known packages
case "$PACKAGE_NAME" in case "$PACKAGE_NAME" in
dms-git) dms-git)
IS_GIT_PACKAGE=true IS_GIT_PACKAGE=true
GIT_REPO="AvengeMedia/DankMaterialShell" GIT_REPO="AvengeMedia/DankMaterialShell"
SOURCE_DIR="dms-git-repo" SOURCE_DIR="dms-git-repo"
;; ;;
dms) dms)
GIT_REPO="AvengeMedia/DankMaterialShell" GIT_REPO="AvengeMedia/DankMaterialShell"
info "Downloading pre-built binaries and source for dms..." info "Downloading pre-built binaries and source for dms..."
# Get version from changelog (remove ppa suffix for both quilt and native formats) # Get version from changelog (remove ppa suffix for both quilt and native formats)
@@ -209,7 +209,7 @@ case "$PACKAGE_NAME" in
fi fi
fi fi
;; ;;
dms-greeter) dms-greeter)
GIT_REPO="AvengeMedia/DankMaterialShell" GIT_REPO="AvengeMedia/DankMaterialShell"
info "Downloading source for dms-greeter..." info "Downloading source for dms-greeter..."
VERSION=$(dpkg-parsechangelog -S Version | sed 's/-[^-]*$//' | sed 's/ppa[0-9]*$//') VERSION=$(dpkg-parsechangelog -S Version | sed 's/-[^-]*$//' | sed 's/ppa[0-9]*$//')
@@ -224,11 +224,11 @@ case "$PACKAGE_NAME" in
fi fi
fi fi
;; ;;
danksearch) danksearch)
# danksearch uses pre-built binary from releases # danksearch uses pre-built binary from releases
GIT_REPO="AvengeMedia/danksearch" GIT_REPO="AvengeMedia/danksearch"
;; ;;
dgop) dgop)
# dgop uses pre-built binary from releases # dgop uses pre-built binary from releases
GIT_REPO="AvengeMedia/dgop" GIT_REPO="AvengeMedia/dgop"
;; ;;
@@ -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=""
@@ -341,10 +341,10 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then
-- Avenge Media <AvengeMedia.US@gmail.com> $(date -R)" -- Avenge Media <AvengeMedia.US@gmail.com> $(date -R)"
# Write new changelog (new entry, blank line, then old entries) # Write new changelog (new entry, blank line, then old entries)
echo "$CHANGELOG_ENTRY" > debian/changelog echo "$CHANGELOG_ENTRY" >debian/changelog
if [ -n "$CHANGELOG_CONTENT" ]; then if [ -n "$CHANGELOG_CONTENT" ]; then
echo "" >> debian/changelog echo "" >>debian/changelog
echo "$CHANGELOG_CONTENT" >> debian/changelog echo "$CHANGELOG_CONTENT" >>debian/changelog
fi fi
success "Version updated to $NEW_VERSION" success "Version updated to $NEW_VERSION"
@@ -355,8 +355,8 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then
# Save version info for dms-git build process # Save version info for dms-git build process
if [ "$PACKAGE_NAME" = "dms-git" ]; then if [ "$PACKAGE_NAME" = "dms-git" ]; then
info "Saving version info to .dms-version for build process..." info "Saving version info to .dms-version for build process..."
echo "VERSION=${UPSTREAM_VERSION}+git${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}" > "$SOURCE_DIR/.dms-version" echo "VERSION=${UPSTREAM_VERSION}+git${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}" >"$SOURCE_DIR/.dms-version"
echo "COMMIT=${GIT_COMMIT_HASH}" >> "$SOURCE_DIR/.dms-version" echo "COMMIT=${GIT_COMMIT_HASH}" >>"$SOURCE_DIR/.dms-version"
success "Version info saved: ${UPSTREAM_VERSION}+git${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}" success "Version info saved: ${UPSTREAM_VERSION}+git${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}"
# Vendor Go dependencies (Launchpad has no internet access) # Vendor Go dependencies (Launchpad has no internet access)
@@ -397,7 +397,7 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then
/^\[source\.crates-io\]/ { printing=1 } /^\[source\.crates-io\]/ { printing=1 }
printing { print } printing { print }
/^directory = "vendor"$/ { exit } /^directory = "vendor"$/ { exit }
' > .cargo/config.toml ' >.cargo/config.toml
# Verify vendor directory was created # Verify vendor directory was created
if [ ! -d "vendor" ]; then if [ ! -d "vendor" ]; then
@@ -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
@@ -515,10 +514,10 @@ elif [ -n "$GIT_REPO" ]; then
* ${CHANGELOG_MSG} * ${CHANGELOG_MSG}
-- Avenge Media <AvengeMedia.US@gmail.com> $(date -R)" -- Avenge Media <AvengeMedia.US@gmail.com> $(date -R)"
echo "$CHANGELOG_ENTRY" > debian/changelog echo "$CHANGELOG_ENTRY" >debian/changelog
if [ -n "$CHANGELOG_CONTENT" ]; then if [ -n "$CHANGELOG_CONTENT" ]; then
echo "" >> debian/changelog echo "" >>debian/changelog
echo "$CHANGELOG_CONTENT" >> debian/changelog echo "$CHANGELOG_CONTENT" >>debian/changelog
fi fi
success "Version updated to $NEW_VERSION" success "Version updated to $NEW_VERSION"
else else
@@ -532,7 +531,7 @@ fi
# Handle packages that need pre-built binaries downloaded # Handle packages that need pre-built binaries downloaded
cd "$PACKAGE_DIR" cd "$PACKAGE_DIR"
case "$PACKAGE_NAME" in case "$PACKAGE_NAME" in
danksearch) danksearch)
info "Downloading pre-built binaries for danksearch..." info "Downloading pre-built binaries for danksearch..."
# Get version from changelog (remove ppa suffix for both quilt and native formats) # Get version from changelog (remove ppa suffix for both quilt and native formats)
# Native: 0.5.2ppa1 -> 0.5.2, Quilt: 0.5.2-1ppa1 -> 0.5.2 # Native: 0.5.2ppa1 -> 0.5.2, Quilt: 0.5.2-1ppa1 -> 0.5.2
@@ -564,7 +563,7 @@ case "$PACKAGE_NAME" in
fi fi
fi fi
;; ;;
dgop) dgop)
# dgop binary should already be committed in the repo # dgop binary should already be committed in the repo
if [ ! -f "dgop" ]; then if [ ! -f "dgop" ]; then
warn "dgop binary not found - should be committed to repo" warn "dgop binary not found - should be committed to repo"
@@ -572,7 +571,7 @@ case "$PACKAGE_NAME" in
;; ;;
esac esac
cd - > /dev/null cd - >/dev/null
# Check if this version already exists on PPA (only in CI environment) # Check if this version already exists on PPA (only in CI environment)
if command -v rmadison >/dev/null 2>&1; then if command -v rmadison >/dev/null 2>&1; then
@@ -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 info "dput found"
UPLOAD_METHOD="dput"
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")
@@ -133,7 +129,7 @@ if [ "$PPA_NAME" = "danklinux" ] || [ "$PPA_NAME" = "dms" ] || [ "$PPA_NAME" = "
# lftp build dir change # lftp build dir change
LFTP_SCRIPT=$(mktemp) LFTP_SCRIPT=$(mktemp)
cat > "$LFTP_SCRIPT" <<EOF cat >"$LFTP_SCRIPT" <<EOF
cd ~avengemedia/ubuntu/$PPA_NAME/ cd ~avengemedia/ubuntu/$PPA_NAME/
lcd $BUILD_DIR lcd $BUILD_DIR
mput $CHANGES_BASENAME mput $CHANGES_BASENAME
@@ -143,7 +139,7 @@ mput $BUILDINFO
bye bye
EOF EOF
if lftp -d ftp://anonymous:@ppa.launchpad.net < "$LFTP_SCRIPT"; then if lftp -d ftp://anonymous:@ppa.launchpad.net <"$LFTP_SCRIPT"; then
success "Upload successful!" success "Upload successful!"
rm -f "$LFTP_SCRIPT" rm -f "$LFTP_SCRIPT"
else else
@@ -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"
@@ -53,14 +49,14 @@ apply_gtk4_colors() {
sed -i '/^@import url.*dank-colors\.css.*);$/d' "$gtk_css" sed -i '/^@import url.*dank-colors\.css.*);$/d' "$gtk_css"
sed -i "1i\\$gtk4_import" "$gtk_css" sed -i "1i\\$gtk4_import" "$gtk_css"
else else
echo "$gtk4_import" > "$gtk_css" echo "$gtk4_import" >"$gtk_css"
fi fi
echo "Updated GTK4 CSS import" echo "Updated GTK4 CSS import"
} }
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,13 +35,15 @@ 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"
fi fi
} }

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