mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 10:32:07 -04:00
Compare commits
62 Commits
hotfix-1.4
...
v1.4.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f24cf37ca | ||
|
|
01218f34cb | ||
|
|
9da58d8296 | ||
|
|
af0038e634 | ||
|
|
05c312b9eb | ||
|
|
89d5c958c4 | ||
|
|
e4d86ad595 | ||
|
|
532b54a028 | ||
|
|
504d027c3f | ||
|
|
e8f95f4533 | ||
|
|
b83256c83a | ||
|
|
8e2cd21be8 | ||
|
|
c5413608da | ||
|
|
586bcad442 | ||
|
|
3b3d10f730 | ||
|
|
4834891b36 | ||
|
|
f60e65aecb | ||
|
|
01387b0123 | ||
|
|
1476658c23 | ||
|
|
7861c6e316 | ||
|
|
d2247d7b24 | ||
|
|
2ff78d4a02 | ||
|
|
785243ce5f | ||
|
|
0e1b868384 | ||
|
|
2b08e800e8 | ||
|
|
74e4f8ea1e | ||
|
|
9c58569b4c | ||
|
|
29de677e00 | ||
|
|
fae4944845 | ||
|
|
07a0ac4b7d | ||
|
|
b2d8f4d73b | ||
|
|
fe58c45233 | ||
|
|
3ea4e389eb | ||
|
|
7276f295fc | ||
|
|
93ed96a789 | ||
|
|
bea325e94c | ||
|
|
2f8f1c30ad | ||
|
|
f859a14173 | ||
|
|
153f39da48 | ||
|
|
e4accdd1c7 | ||
|
|
a2c89e0a8c | ||
|
|
e282831c2e | ||
|
|
5c5ff6195a | ||
|
|
c4bbf54679 | ||
|
|
98acafb4b8 | ||
|
|
da20681fc0 | ||
|
|
b38cb961b2 | ||
|
|
7a0bb07518 | ||
|
|
403e3e90a2 | ||
|
|
50b91f14b6 | ||
|
|
b3df47fce0 | ||
|
|
09bd65d746 | ||
|
|
020d56ab7f | ||
|
|
f3bee65da9 | ||
|
|
b14b0946e2 | ||
|
|
ca44205f1c | ||
|
|
2d39e8fd2a | ||
|
|
6d4df6e927 | ||
|
|
b8ab86e6c0 | ||
|
|
837329a6d8 | ||
|
|
8c6c2ffd23 | ||
|
|
ad3c8b6755 |
8
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
8
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -7,7 +7,7 @@ body:
|
||||
attributes:
|
||||
value: |
|
||||
## DankMaterialShell Bug Report
|
||||
Limit your report to one issue per submission unless closely related
|
||||
Limit your report to one issue per submission unless similarly related
|
||||
- type: dropdown
|
||||
id: compositor
|
||||
attributes:
|
||||
@@ -53,9 +53,9 @@ body:
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: original_installation_method_different
|
||||
id: original_installation_method
|
||||
attributes:
|
||||
label: Was your original Installation method different?
|
||||
label: Was this your original Installation method?
|
||||
options:
|
||||
- "Yes"
|
||||
- No (specify below)
|
||||
@@ -73,7 +73,7 @@ body:
|
||||
id: dms_doctor
|
||||
attributes:
|
||||
label: dms doctor -vC
|
||||
description: Output of `dms doctor -vC` command — paste between the lines below to keep it collapsed in the issue
|
||||
description: Output of `dms doctor -vC` command — paste between the details tags below to keep it collapsed in the issue
|
||||
placeholder: Paste the output of `dms doctor -vC` here
|
||||
value: |
|
||||
<details>
|
||||
|
||||
245
.github/workflows/run-obs.yml
vendored
245
.github/workflows/run-obs.yml
vendored
@@ -10,6 +10,7 @@ on:
|
||||
options:
|
||||
- dms
|
||||
- dms-git
|
||||
- dms-greeter
|
||||
- all
|
||||
default: "dms"
|
||||
rebuild_release:
|
||||
@@ -72,12 +73,27 @@ jobs:
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to check dms-greeter stable tag
|
||||
check_dms_greeter_stable() {
|
||||
LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "\([^"]*\)".*/\1/' || echo "")
|
||||
local OBS_SPEC=$(curl -s -u "$OBS_USERNAME:$OBS_PASSWORD" "https://api.opensuse.org/source/home:AvengeMedia:danklinux/dms-greeter/dms-greeter.spec" 2>/dev/null || echo "")
|
||||
local OBS_VERSION=$(echo "$OBS_SPEC" | grep "^Version:" | awk '{print $2}' | xargs | sed 's/^v//')
|
||||
|
||||
if [[ -n "$LATEST_TAG" && "$LATEST_TAG" == "v$OBS_VERSION" ]]; then
|
||||
echo "📋 dms-greeter: Tag $LATEST_TAG already exists, skipping"
|
||||
return 1 # No update needed
|
||||
else
|
||||
echo "📋 dms-greeter: New tag ${LATEST_TAG:-unknown} (OBS has ${OBS_VERSION:-none})"
|
||||
return 0 # Update needed
|
||||
fi
|
||||
}
|
||||
|
||||
# Main logic
|
||||
REBUILD="${{ github.event.inputs.rebuild_release }}"
|
||||
|
||||
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||
# Tag selected or pushed - always update stable package
|
||||
echo "packages=dms" >> $GITHUB_OUTPUT
|
||||
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]] && [[ -z "${{ github.event.inputs.package }}" ]]; then
|
||||
# Run from tag with no package specified - update both stable packages
|
||||
echo "packages=dms dms-greeter" >> $GITHUB_OUTPUT
|
||||
VERSION="${GITHUB_REF#refs/tags/}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||
@@ -112,6 +128,10 @@ jobs:
|
||||
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
fi
|
||||
if check_dms_greeter_stable; then
|
||||
PACKAGES_TO_UPDATE+=("dms-greeter")
|
||||
[[ -n "$LATEST_TAG" ]] && echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
if [[ ${#PACKAGES_TO_UPDATE[@]} -gt 0 ]]; then
|
||||
echo "packages=${PACKAGES_TO_UPDATE[*]}" >> $GITHUB_OUTPUT
|
||||
@@ -144,6 +164,18 @@ jobs:
|
||||
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
elif [[ "$PKG" == "dms-greeter" ]]; then
|
||||
if check_dms_greeter_stable; then
|
||||
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||
if [[ -n "$LATEST_TAG" ]]; then
|
||||
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "packages=" >> $GITHUB_OUTPUT
|
||||
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
else
|
||||
# Unknown package - proceed anyway
|
||||
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||
@@ -171,15 +203,8 @@ jobs:
|
||||
- name: Determine packages to update
|
||||
id: packages
|
||||
run: |
|
||||
# Check if GITHUB_REF points to a tag (works for both push events and workflow_dispatch with tag selected)
|
||||
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||
# Tag selected or pushed - use the tag from GITHUB_REF
|
||||
echo "packages=dms" >> $GITHUB_OUTPUT
|
||||
VERSION="${GITHUB_REF#refs/tags/}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Using tag from GITHUB_REF: $VERSION"
|
||||
# Check if check-updates already determined a version (from auto-detection)
|
||||
elif [[ -n "${{ needs.check-updates.outputs.version }}" ]]; then
|
||||
# Use check-updates outputs when available
|
||||
if [[ -n "${{ needs.check-updates.outputs.version }}" ]]; then
|
||||
# Use version from check-updates job
|
||||
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||
echo "version=${{ needs.check-updates.outputs.version }}" >> $GITHUB_OUTPUT
|
||||
@@ -191,40 +216,16 @@ jobs:
|
||||
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||
# Manual workflow dispatch
|
||||
|
||||
# Determine version for dms stable
|
||||
if [[ "${{ github.event.inputs.package }}" == "dms" ]]; then
|
||||
# Use github.ref if tag selected, otherwise auto-detect latest
|
||||
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||
VERSION="${GITHUB_REF#refs/tags/}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Using tag from GITHUB_REF: $VERSION"
|
||||
# Determine version for dms stable and dms-greeter using the API
|
||||
# GITHUB_REF is unreliable when "Use workflow from" a tag; API works from any ref
|
||||
if [[ "${{ github.event.inputs.package }}" == "dms" ]] || [[ "${{ github.event.inputs.package }}" == "dms-greeter" ]] || [[ "${{ github.event.inputs.package }}" == "all" ]]; then
|
||||
LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "\([^"]*\)".*/\1/' || echo "")
|
||||
if [[ -n "$LATEST_TAG" ]]; then
|
||||
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
echo "Using latest release from API: $LATEST_TAG"
|
||||
else
|
||||
# Auto-detect latest release for dms
|
||||
LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "\([^"]*\)".*/\1/' || echo "")
|
||||
if [[ -n "$LATEST_TAG" ]]; then
|
||||
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
echo "Auto-detected latest release: $LATEST_TAG"
|
||||
else
|
||||
echo "ERROR: Could not auto-detect latest release"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
elif [[ "${{ github.event.inputs.package }}" == "all" ]]; then
|
||||
# Use github.ref if tag selected, otherwise auto-detect latest
|
||||
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||
VERSION="${GITHUB_REF#refs/tags/}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Using tag from GITHUB_REF: $VERSION"
|
||||
else
|
||||
# Auto-detect latest release for "all"
|
||||
LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "\([^"]*\)".*/\1/' || echo "")
|
||||
if [[ -n "$LATEST_TAG" ]]; then
|
||||
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||
echo "Auto-detected latest release: $LATEST_TAG"
|
||||
else
|
||||
echo "ERROR: Could not auto-detect latest release"
|
||||
exit 1
|
||||
fi
|
||||
echo "ERROR: Could not fetch latest release from API"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -283,55 +284,66 @@ jobs:
|
||||
echo " -- Avenge Media <AvengeMedia.US@gmail.com> $CHANGELOG_DATE"
|
||||
} > "distro/debian/dms-git/debian/changelog"
|
||||
|
||||
- name: Update dms stable version
|
||||
- name: Update stable version (dms + dms-greeter)
|
||||
if: steps.packages.outputs.version != ''
|
||||
run: |
|
||||
VERSION="${{ steps.packages.outputs.version }}"
|
||||
VERSION_NO_V="${VERSION#v}"
|
||||
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||
echo "==> Updating packaging files to version: $VERSION_NO_V"
|
||||
|
||||
# Update spec file
|
||||
sed -i "s/^Version:.*/Version: $VERSION_NO_V/" distro/opensuse/dms.spec
|
||||
# Update dms spec and changelog when dms is in the upload list
|
||||
if [[ "$PACKAGES" == *"dms"* ]]; then
|
||||
sed -i "s/^Version:.*/Version: $VERSION_NO_V/" distro/opensuse/dms.spec
|
||||
UPDATED_VERSION=$(grep -oP '^Version:\s+\K[0-9.]+' distro/opensuse/dms.spec | head -1)
|
||||
echo "✓ dms spec now shows Version: $UPDATED_VERSION"
|
||||
|
||||
# Verify the update
|
||||
UPDATED_VERSION=$(grep -oP '^Version:\s+\K[0-9.]+' distro/opensuse/dms.spec | head -1)
|
||||
echo "✓ Spec file now shows Version: $UPDATED_VERSION"
|
||||
DATE_STR=$(date "+%a %b %d %Y")
|
||||
LOCAL_SPEC_HEAD=$(sed -n '1,/%changelog/{ /%changelog/d; p }' distro/opensuse/dms.spec)
|
||||
{
|
||||
echo "$LOCAL_SPEC_HEAD"
|
||||
echo "%changelog"
|
||||
echo "* $DATE_STR AvengeMedia <maintainer@avengemedia.com> - ${VERSION_NO_V}-1"
|
||||
echo "- Update to stable $VERSION release"
|
||||
} > distro/opensuse/dms.spec
|
||||
|
||||
# Single changelog entry (full history on OBS website)
|
||||
DATE_STR=$(date "+%a %b %d %Y")
|
||||
LOCAL_SPEC_HEAD=$(sed -n '1,/%changelog/{ /%changelog/d; p }' distro/opensuse/dms.spec)
|
||||
{
|
||||
echo "$LOCAL_SPEC_HEAD"
|
||||
echo "%changelog"
|
||||
echo "* $DATE_STR AvengeMedia <maintainer@avengemedia.com> - ${VERSION_NO_V}-1"
|
||||
echo "- Update to stable $VERSION release"
|
||||
} > distro/opensuse/dms.spec
|
||||
|
||||
# Update Debian _service files (both tar_scm and download_url formats)
|
||||
for service in distro/debian/*/_service; do
|
||||
if [[ -f "$service" ]]; then
|
||||
# Update tar_scm revision parameter (for dms-git)
|
||||
sed -i "s|<param name=\"revision\">v[0-9.]*</param>|<param name=\"revision\">$VERSION</param>|" "$service"
|
||||
|
||||
# Update download_url paths (for dms stable)
|
||||
sed -i "s|/v[0-9.]\+/|/$VERSION/|g" "$service"
|
||||
sed -i "s|/tags/v[0-9.]\+\.tar\.gz|/tags/$VERSION.tar.gz|g" "$service"
|
||||
if [[ -f "distro/debian/dms/debian/changelog" ]]; then
|
||||
CHANGELOG_DATE=$(date -R)
|
||||
{
|
||||
echo "dms (${VERSION_NO_V}db1) stable; urgency=medium"
|
||||
echo ""
|
||||
echo " * Update to $VERSION stable release"
|
||||
echo ""
|
||||
echo " -- Avenge Media <AvengeMedia.US@gmail.com> $CHANGELOG_DATE"
|
||||
} > "distro/debian/dms/debian/changelog"
|
||||
echo "✓ Updated dms changelog to ${VERSION_NO_V}db1"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Update Debian changelog for dms stable (single entry, history on OBS website)
|
||||
if [[ -f "distro/debian/dms/debian/changelog" ]]; then
|
||||
# Update dms-greeter changelog when dms-greeter is in the upload list
|
||||
if [[ "$PACKAGES" == *"dms-greeter"* ]] && [[ -f "distro/debian/dms-greeter/debian/changelog" ]]; then
|
||||
CHANGELOG_DATE=$(date -R)
|
||||
{
|
||||
echo "dms (${VERSION_NO_V}db1) stable; urgency=medium"
|
||||
echo "dms-greeter (${VERSION_NO_V}db1) unstable; urgency=medium"
|
||||
echo ""
|
||||
echo " * Update to $VERSION stable release"
|
||||
echo ""
|
||||
echo " -- Avenge Media <AvengeMedia.US@gmail.com> $CHANGELOG_DATE"
|
||||
} > "distro/debian/dms/debian/changelog"
|
||||
echo "✓ Updated Debian changelog to ${VERSION_NO_V}db1"
|
||||
} > "distro/debian/dms-greeter/debian/changelog"
|
||||
echo "✓ Updated dms-greeter changelog to ${VERSION_NO_V}db1"
|
||||
fi
|
||||
|
||||
# Update Debian _service files for packages in upload list (download_url paths)
|
||||
for service in distro/debian/*/_service; do
|
||||
if [[ -f "$service" ]]; then
|
||||
# Update tar_scm revision parameter (for dms-git)
|
||||
sed -i "s|<param name=\"revision\">v[0-9.]*</param>|<param name=\"revision\">$VERSION</param>|" "$service"
|
||||
# Update download_url paths (for dms, dms-greeter stable)
|
||||
sed -i "s|/v[0-9.]\+/|/$VERSION/|g" "$service"
|
||||
sed -i "s|/tags/v[0-9.]\+\.tar\.gz|/tags/$VERSION.tar.gz|g" "$service"
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
@@ -354,6 +366,7 @@ jobs:
|
||||
chmod 600 ~/.config/osc/oscrc
|
||||
|
||||
- name: Upload to OBS
|
||||
id: upload
|
||||
env:
|
||||
REBUILD_RELEASE: ${{ github.event.inputs.rebuild_release }}
|
||||
TAG_VERSION: ${{ steps.packages.outputs.version }}
|
||||
@@ -362,6 +375,8 @@ jobs:
|
||||
|
||||
if [[ -z "$PACKAGES" ]]; then
|
||||
echo "✓ No packages need uploading. All up to date!"
|
||||
echo "uploaded_packages=" >> $GITHUB_OUTPUT
|
||||
echo "skipped_packages=" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -371,6 +386,9 @@ jobs:
|
||||
echo "==> Version being uploaded: ${{ steps.packages.outputs.version }}"
|
||||
fi
|
||||
|
||||
UPLOADED_PACKAGES=()
|
||||
SKIPPED_PACKAGES=()
|
||||
|
||||
# PACKAGES can be space-separated list (e.g., "dms-git dms" from "all" check)
|
||||
# Loop through each package and upload
|
||||
for PKG in $PACKAGES; do
|
||||
@@ -382,13 +400,37 @@ jobs:
|
||||
fi
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
LOG_FILE=$(mktemp)
|
||||
set +e
|
||||
if [[ "$PKG" == "dms-git" ]]; then
|
||||
bash distro/scripts/obs-upload.sh dms-git "Automated git update"
|
||||
bash distro/scripts/obs-upload.sh dms-git "Automated git update" >"$LOG_FILE" 2>&1
|
||||
else
|
||||
bash distro/scripts/obs-upload.sh "$PKG" "$MESSAGE"
|
||||
bash distro/scripts/obs-upload.sh "$PKG" "$MESSAGE" >"$LOG_FILE" 2>&1
|
||||
fi
|
||||
STATUS=$?
|
||||
set -e
|
||||
|
||||
cat "$LOG_FILE"
|
||||
|
||||
if [[ $STATUS -ne 0 ]]; then
|
||||
rm -f "$LOG_FILE"
|
||||
echo "❌ Upload failed for $PKG"
|
||||
exit $STATUS
|
||||
fi
|
||||
|
||||
if grep -Eq "Exiting gracefully \(no changes needed\)|No changes needed for this package\. Exiting gracefully\." "$LOG_FILE"; then
|
||||
echo "ℹ️ $PKG is already up to date. Skipped."
|
||||
SKIPPED_PACKAGES+=("$PKG")
|
||||
else
|
||||
UPLOADED_PACKAGES+=("$PKG")
|
||||
fi
|
||||
|
||||
rm -f "$LOG_FILE"
|
||||
done
|
||||
|
||||
echo "uploaded_packages=${UPLOADED_PACKAGES[*]}" >> $GITHUB_OUTPUT
|
||||
echo "skipped_packages=${SKIPPED_PACKAGES[*]}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
run: |
|
||||
@@ -402,20 +444,59 @@ jobs:
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "All packages are current. Run completed successfully." >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "**Packages Uploaded:**" >> $GITHUB_STEP_SUMMARY
|
||||
UPLOADED_PACKAGES="${{ steps.upload.outputs.uploaded_packages }}"
|
||||
SKIPPED_PACKAGES="${{ steps.upload.outputs.skipped_packages }}"
|
||||
TOTAL_COUNT=$(wc -w <<<"$PACKAGES" | tr -d ' ')
|
||||
UPLOADED_COUNT=0
|
||||
SKIPPED_COUNT=0
|
||||
if [[ -n "$UPLOADED_PACKAGES" ]]; then
|
||||
UPLOADED_COUNT=$(wc -w <<<"$UPLOADED_PACKAGES" | tr -d ' ')
|
||||
fi
|
||||
if [[ -n "$SKIPPED_PACKAGES" ]]; then
|
||||
SKIPPED_COUNT=$(wc -w <<<"$SKIPPED_PACKAGES" | tr -d ' ')
|
||||
fi
|
||||
in_list() {
|
||||
local item="$1"
|
||||
local list="$2"
|
||||
[[ " $list " == *" $item "* ]]
|
||||
}
|
||||
|
||||
if [[ "${{ job.status }}" == "success" ]]; then
|
||||
echo "**Status:** ✅ Completed successfully" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "**Status:** ❌ Completed with errors" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Processed:** $TOTAL_COUNT package(s)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Uploaded:** $UPLOADED_COUNT package(s)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Skipped (up to date):** $SKIPPED_COUNT package(s)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Packages:**" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
for PKG in $PACKAGES; do
|
||||
STATUS_ICON="✅"
|
||||
STATUS_TEXT="uploaded"
|
||||
if in_list "$PKG" "$SKIPPED_PACKAGES"; then
|
||||
STATUS_ICON="ℹ️"
|
||||
STATUS_TEXT="up to date (skipped)"
|
||||
elif ! in_list "$PKG" "$UPLOADED_PACKAGES"; then
|
||||
STATUS_ICON="❌"
|
||||
STATUS_TEXT="failed"
|
||||
fi
|
||||
|
||||
case "$PKG" in
|
||||
dms)
|
||||
echo "- ✅ **dms** → [View builds](https://build.opensuse.org/package/show/home:AvengeMedia:dms/dms)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- $STATUS_ICON **dms** ($STATUS_TEXT) → [View builds](https://build.opensuse.org/package/show/home:AvengeMedia:dms/dms)" >> $GITHUB_STEP_SUMMARY
|
||||
;;
|
||||
dms-git)
|
||||
echo "- ✅ **dms-git** → [View builds](https://build.opensuse.org/package/show/home:AvengeMedia:dms-git/dms-git)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- $STATUS_ICON **dms-git** ($STATUS_TEXT) → [View builds](https://build.opensuse.org/package/show/home:AvengeMedia:dms-git/dms-git)" >> $GITHUB_STEP_SUMMARY
|
||||
;;
|
||||
dms-greeter)
|
||||
echo "- $STATUS_ICON **dms-greeter** ($STATUS_TEXT) → [View builds](https://build.opensuse.org/package/show/home:AvengeMedia:danklinux/dms-greeter)" >> $GITHUB_STEP_SUMMARY
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
if [[ -n "${{ github.event.inputs.rebuild_release }}" ]]; then
|
||||
|
||||
@@ -525,5 +525,6 @@ func getCommonCommands() []*cobra.Command {
|
||||
doctorCmd,
|
||||
configCmd,
|
||||
dlCmd,
|
||||
randrCmd,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,16 +652,14 @@ func checkI2CAvailability() checkResult {
|
||||
func checkImageFormatPlugins() []checkResult {
|
||||
url := doctorDocsURL + "#optional-features"
|
||||
|
||||
pluginDir := findQtPluginDir()
|
||||
if pluginDir == "" {
|
||||
pluginDirs := findQtPluginDirs()
|
||||
if len(pluginDirs) == 0 {
|
||||
return []checkResult{
|
||||
{catOptionalFeatures, "qt6-imageformats", statusInfo, "Cannot detect (plugin dir not found)", "WebP, TIFF, JP2 support", url},
|
||||
{catOptionalFeatures, "kimageformats", statusInfo, "Cannot detect (plugin dir not found)", "AVIF, HEIF, JXL support", url},
|
||||
}
|
||||
}
|
||||
|
||||
imageFormatsDir := filepath.Join(pluginDir, "imageformats")
|
||||
|
||||
type pluginCheck struct {
|
||||
name string
|
||||
desc string
|
||||
@@ -695,9 +693,18 @@ func checkImageFormatPlugins() []checkResult {
|
||||
var results []checkResult
|
||||
for _, c := range checks {
|
||||
var found []string
|
||||
for _, p := range c.plugins {
|
||||
if _, err := os.Stat(filepath.Join(imageFormatsDir, p.file)); err == nil {
|
||||
found = append(found, p.format)
|
||||
var foundDirs []string
|
||||
for _, pluginDir := range pluginDirs {
|
||||
imageFormatsDir := filepath.Join(pluginDir, "imageformats")
|
||||
for _, p := range c.plugins {
|
||||
if _, err := os.Stat(filepath.Join(imageFormatsDir, p.file)); err == nil {
|
||||
if !slices.Contains(found, p.format) {
|
||||
found = append(found, p.format)
|
||||
}
|
||||
if !slices.Contains(foundDirs, imageFormatsDir) {
|
||||
foundDirs = append(foundDirs, imageFormatsDir)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +715,7 @@ func checkImageFormatPlugins() []checkResult {
|
||||
default:
|
||||
details := ""
|
||||
if doctorVerbose {
|
||||
details = fmt.Sprintf("Formats: %s (%s)", strings.Join(found, ", "), imageFormatsDir)
|
||||
details = fmt.Sprintf("Formats: %s (%s)", strings.Join(found, ", "), strings.Join(foundDirs, ":"))
|
||||
}
|
||||
result = checkResult{catOptionalFeatures, c.name, statusOK, fmt.Sprintf("Installed (%d formats)", len(found)), details, url}
|
||||
}
|
||||
@@ -718,22 +725,28 @@ func checkImageFormatPlugins() []checkResult {
|
||||
return results
|
||||
}
|
||||
|
||||
func findQtPluginDir() string {
|
||||
// Check QT_PLUGIN_PATH env var first (used by NixOS and custom setups)
|
||||
func findQtPluginDirs() []string {
|
||||
var dirs []string
|
||||
|
||||
addDir := func(dir string) {
|
||||
if dir != "" {
|
||||
if _, err := os.Stat(filepath.Join(dir, "imageformats")); err == nil {
|
||||
dirs = append(dirs, dir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check all paths in QT_PLUGIN_PATH env var (used by NixOS and custom setups)
|
||||
if envPath := os.Getenv("QT_PLUGIN_PATH"); envPath != "" {
|
||||
for dir := range strings.SplitSeq(envPath, ":") {
|
||||
if _, err := os.Stat(filepath.Join(dir, "imageformats")); err == nil {
|
||||
return dir
|
||||
}
|
||||
addDir(dir)
|
||||
}
|
||||
}
|
||||
|
||||
// Try qtpaths
|
||||
for _, cmd := range []string{"qtpaths6", "qtpaths"} {
|
||||
if output, err := exec.Command(cmd, "-query", "QT_INSTALL_PLUGINS").Output(); err == nil {
|
||||
if dir := strings.TrimSpace(string(output)); dir != "" {
|
||||
return dir
|
||||
}
|
||||
addDir(strings.TrimSpace(string(output)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -744,12 +757,10 @@ func findQtPluginDir() string {
|
||||
"/usr/lib/x86_64-linux-gnu/qt6/plugins",
|
||||
"/usr/lib/aarch64-linux-gnu/qt6/plugins",
|
||||
} {
|
||||
if _, err := os.Stat(filepath.Join(dir, "imageformats")); err == nil {
|
||||
return dir
|
||||
}
|
||||
addDir(dir)
|
||||
}
|
||||
|
||||
return ""
|
||||
return dirs
|
||||
}
|
||||
|
||||
func detectNetworkBackend(stackResult *network.DetectResult) string {
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/distros"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/greeter"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/utils"
|
||||
@@ -77,6 +78,28 @@ func installGreeter() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Debian/openSUSE
|
||||
greeter.TryInstallGreeterPackage(logFunc, "")
|
||||
if isPackageOnlyGreeterDistro() && !greeter.IsGreeterPackaged() {
|
||||
return fmt.Errorf("dms-greeter must be installed from distro packages on this distribution. %s", packageInstallHint())
|
||||
}
|
||||
if greeter.IsGreeterPackaged() && greeter.HasLegacyLocalGreeterWrapper() {
|
||||
return fmt.Errorf("legacy manual wrapper detected at /usr/local/bin/dms-greeter; remove it before using packaged dms-greeter: sudo rm -f /usr/local/bin/dms-greeter")
|
||||
}
|
||||
|
||||
// If already fully configured, prompt the user
|
||||
if isGreeterEnabled() {
|
||||
fmt.Print("\nGreeter is already installed and configured. Re-run to re-sync settings and permissions? [Y/n]: ")
|
||||
var response string
|
||||
fmt.Scanln(&response)
|
||||
response = strings.TrimSpace(strings.ToLower(response))
|
||||
if response == "n" || response == "no" {
|
||||
fmt.Println("Run 'dms greeter sync' to re-sync theme and settings at any time.")
|
||||
return nil
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
fmt.Println("\nDetecting DMS installation...")
|
||||
dmsPath, err := greeter.DetectDMSPath()
|
||||
if err != nil {
|
||||
@@ -114,7 +137,12 @@ func installGreeter() error {
|
||||
}
|
||||
|
||||
fmt.Println("\nConfiguring greetd...")
|
||||
if err := greeter.ConfigureGreetd(dmsPath, selectedCompositor, logFunc, ""); err != nil {
|
||||
// Use empty path when packaged (greeter finds /usr/share/quickshell/dms-greeter); else use user's DMS path
|
||||
greeterPathForConfig := ""
|
||||
if !greeter.IsGreeterPackaged() {
|
||||
greeterPathForConfig = dmsPath
|
||||
}
|
||||
if err := greeter.ConfigureGreetd(greeterPathForConfig, selectedCompositor, logFunc, ""); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -123,11 +151,22 @@ func installGreeter() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := ensureGraphicalTarget(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := handleConflictingDisplayManagers(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := ensureGreetdEnabled(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println("\n=== Installation Complete ===")
|
||||
fmt.Println("\nTo test the greeter, run:")
|
||||
fmt.Println("\nTo start the greeter now, run:")
|
||||
fmt.Println(" sudo systemctl start greetd")
|
||||
fmt.Println("\nTo enable on boot, run:")
|
||||
fmt.Println(" sudo systemctl enable --now greetd")
|
||||
fmt.Println("\nOr reboot to see the greeter at next boot.")
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -327,20 +366,29 @@ func ensureGreetdEnabled() error {
|
||||
fmt.Println(" ✓ Unmasked greetd")
|
||||
}
|
||||
|
||||
switch state.EnabledState {
|
||||
case "disabled", "masked", "masked-runtime":
|
||||
if state.EnabledState == "enabled" || state.EnabledState == "enabled-runtime" {
|
||||
fmt.Println(" Reasserting greetd as active display manager...")
|
||||
} else {
|
||||
fmt.Println(" Enabling greetd service...")
|
||||
enableCmd := exec.Command("sudo", "systemctl", "enable", "greetd")
|
||||
enableCmd.Stdout = os.Stdout
|
||||
enableCmd.Stderr = os.Stderr
|
||||
if err := enableCmd.Run(); err != nil {
|
||||
return fmt.Errorf("failed to enable greetd: %w", err)
|
||||
}
|
||||
|
||||
enableCmd := exec.Command("sudo", "systemctl", "enable", "--force", "greetd")
|
||||
enableCmd.Stdout = os.Stdout
|
||||
enableCmd.Stderr = os.Stderr
|
||||
if err := enableCmd.Run(); err != nil {
|
||||
return fmt.Errorf("failed to enable greetd: %w", err)
|
||||
}
|
||||
|
||||
enabledState, _, verifyErr := checkSystemdServiceEnabled("greetd")
|
||||
if verifyErr != nil {
|
||||
fmt.Printf(" ⚠ Warning: Could not verify greetd enabled state: %v\n", verifyErr)
|
||||
} else {
|
||||
switch enabledState {
|
||||
case "enabled", "enabled-runtime", "static", "indirect", "alias":
|
||||
fmt.Printf(" ✓ greetd enabled (state: %s)\n", enabledState)
|
||||
default:
|
||||
return fmt.Errorf("greetd is still in state '%s' after enable operation", enabledState)
|
||||
}
|
||||
fmt.Println(" ✓ Enabled greetd service")
|
||||
case "enabled", "enabled-runtime":
|
||||
fmt.Println(" ✓ greetd is already enabled")
|
||||
default:
|
||||
fmt.Printf(" ℹ greetd is in state '%s' (should work, no action needed)\n", state.EnabledState)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -446,6 +494,10 @@ func enableGreeter() error {
|
||||
}
|
||||
|
||||
configContent := string(data)
|
||||
if greeter.IsGreeterPackaged() && greeter.HasLegacyLocalGreeterWrapper() {
|
||||
return fmt.Errorf("legacy manual wrapper detected at /usr/local/bin/dms-greeter; remove it before using packaged dms-greeter: sudo rm -f /usr/local/bin/dms-greeter")
|
||||
}
|
||||
|
||||
configAlreadyCorrect := strings.Contains(configContent, "dms-greeter")
|
||||
|
||||
if configAlreadyCorrect {
|
||||
@@ -611,6 +663,48 @@ func detectConfiguredCompositor() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func packageInstallHint() string {
|
||||
osInfo, err := distros.GetOSInfo()
|
||||
if err != nil {
|
||||
return "Install package: dms-greeter"
|
||||
}
|
||||
config, exists := distros.Registry[osInfo.Distribution.ID]
|
||||
if !exists {
|
||||
return "Install package: dms-greeter"
|
||||
}
|
||||
|
||||
switch config.Family {
|
||||
case distros.FamilyDebian:
|
||||
return "Install with 'sudo apt install dms-greeter' (requires DankLinux OBS repo — see https://danklinux.com/docs/dankgreeter/installation#debian)"
|
||||
case distros.FamilySUSE:
|
||||
return "Install with 'sudo zypper install dms-greeter' (requires DankLinux OBS repo — see https://danklinux.com/docs/dankgreeter/installation#opensuse)"
|
||||
case distros.FamilyUbuntu:
|
||||
return "Install with 'sudo apt install dms-greeter' (requires ppa:avengemedia/danklinux: sudo add-apt-repository ppa:avengemedia/danklinux)"
|
||||
case distros.FamilyFedora:
|
||||
return "Install with 'sudo dnf install dms-greeter' (requires COPR: sudo dnf copr enable avengemedia/danklinux)"
|
||||
case distros.FamilyArch:
|
||||
return "Install from AUR with 'paru -S greetd-dms-greeter-git' or 'yay -S greetd-dms-greeter-git'"
|
||||
default:
|
||||
return "Run 'dms greeter install' to install greeter"
|
||||
}
|
||||
}
|
||||
|
||||
func isPackageOnlyGreeterDistro() bool {
|
||||
osInfo, err := distros.GetOSInfo()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
config, exists := distros.Registry[osInfo.Distribution.ID]
|
||||
if !exists {
|
||||
return false
|
||||
}
|
||||
return config.Family == distros.FamilyDebian ||
|
||||
config.Family == distros.FamilySUSE ||
|
||||
config.Family == distros.FamilyUbuntu ||
|
||||
config.Family == distros.FamilyFedora ||
|
||||
config.Family == distros.FamilyArch
|
||||
}
|
||||
|
||||
func promptCompositorChoice(compositors []string) (string, error) {
|
||||
fmt.Println("\nMultiple compositors detected:")
|
||||
for i, comp := range compositors {
|
||||
@@ -679,7 +773,7 @@ func checkGreeterStatus() error {
|
||||
}
|
||||
} else {
|
||||
fmt.Println(" ✗ Greeter config not found")
|
||||
fmt.Println(" Run 'dms greeter install' to install greeter")
|
||||
fmt.Printf(" %s\n", packageInstallHint())
|
||||
}
|
||||
|
||||
fmt.Println("\nGroup Membership:")
|
||||
@@ -689,12 +783,13 @@ func checkGreeterStatus() error {
|
||||
return fmt.Errorf("failed to check groups: %w", err)
|
||||
}
|
||||
|
||||
inGreeterGroup := strings.Contains(string(groupsOutput), "greeter")
|
||||
greeterGroup := greeter.DetectGreeterGroup()
|
||||
inGreeterGroup := strings.Contains(string(groupsOutput), greeterGroup)
|
||||
if inGreeterGroup {
|
||||
fmt.Println(" ✓ User is in greeter group")
|
||||
fmt.Printf(" ✓ User is in %s group\n", greeterGroup)
|
||||
} else {
|
||||
fmt.Println(" ✗ User is NOT in greeter group")
|
||||
fmt.Println(" Run 'dms greeter install' to add user to greeter group")
|
||||
fmt.Printf(" ✗ User is NOT in %s group\n", greeterGroup)
|
||||
fmt.Println(" Run 'dms greeter sync' to set up group membership and permissions")
|
||||
}
|
||||
|
||||
cacheDir := "/var/cache/dms-greeter"
|
||||
@@ -703,7 +798,7 @@ func checkGreeterStatus() error {
|
||||
fmt.Printf(" ✓ %s exists\n", cacheDir)
|
||||
} else {
|
||||
fmt.Printf(" ✗ %s not found\n", cacheDir)
|
||||
fmt.Println(" Run 'dms greeter install' to create cache directory")
|
||||
fmt.Printf(" %s\n", packageInstallHint())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||
@@ -95,7 +97,11 @@ func buildMatugenOptions(cmd *cobra.Command) matugen.Options {
|
||||
|
||||
func runMatugenGenerate(cmd *cobra.Command, args []string) {
|
||||
opts := buildMatugenOptions(cmd)
|
||||
if err := matugen.Run(opts); err != nil {
|
||||
err := matugen.Run(opts)
|
||||
switch {
|
||||
case errors.Is(err, matugen.ErrNoChanges):
|
||||
os.Exit(2)
|
||||
case err != nil:
|
||||
log.Fatalf("Theme generation failed: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -129,7 +135,11 @@ func runMatugenQueue(cmd *cobra.Command, args []string) {
|
||||
if !wait {
|
||||
if err := sendServerRequestFireAndForget(request); err != nil {
|
||||
log.Info("Server unavailable, running synchronously")
|
||||
if err := matugen.Run(opts); err != nil {
|
||||
err := matugen.Run(opts)
|
||||
switch {
|
||||
case errors.Is(err, matugen.ErrNoChanges):
|
||||
os.Exit(2)
|
||||
case err != nil:
|
||||
log.Fatalf("Theme generation failed: %v", err)
|
||||
}
|
||||
return
|
||||
@@ -146,11 +156,15 @@ func runMatugenQueue(cmd *cobra.Command, args []string) {
|
||||
resp, ok := tryServerRequest(request)
|
||||
if !ok {
|
||||
log.Info("Server unavailable, running synchronously")
|
||||
if err := matugen.Run(opts); err != nil {
|
||||
err := matugen.Run(opts)
|
||||
switch {
|
||||
case errors.Is(err, matugen.ErrNoChanges):
|
||||
resultCh <- matugen.ErrNoChanges
|
||||
case err != nil:
|
||||
resultCh <- err
|
||||
return
|
||||
default:
|
||||
resultCh <- nil
|
||||
}
|
||||
resultCh <- nil
|
||||
return
|
||||
}
|
||||
if resp.Error != "" {
|
||||
@@ -162,7 +176,10 @@ func runMatugenQueue(cmd *cobra.Command, args []string) {
|
||||
|
||||
select {
|
||||
case err := <-resultCh:
|
||||
if err != nil {
|
||||
switch {
|
||||
case errors.Is(err, matugen.ErrNoChanges):
|
||||
os.Exit(2)
|
||||
case err != nil:
|
||||
log.Fatalf("Theme generation failed: %v", err)
|
||||
}
|
||||
fmt.Println("Theme generation completed")
|
||||
|
||||
58
core/cmd/dms/commands_randr.go
Normal file
58
core/cmd/dms/commands_randr.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var randrCmd = &cobra.Command{
|
||||
Use: "randr",
|
||||
Short: "Query output display information",
|
||||
Long: "Query Wayland compositor for output names, scales, resolutions and refresh rates via zwlr-output-management",
|
||||
Run: runRandr,
|
||||
}
|
||||
|
||||
func init() {
|
||||
randrCmd.Flags().Bool("json", false, "Output in JSON format")
|
||||
}
|
||||
|
||||
type randrJSON struct {
|
||||
Outputs []randrOutput `json:"outputs"`
|
||||
}
|
||||
|
||||
func runRandr(cmd *cobra.Command, args []string) {
|
||||
outputs, err := queryRandr()
|
||||
if err != nil {
|
||||
log.Fatalf("%v", err)
|
||||
}
|
||||
|
||||
jsonFlag, _ := cmd.Flags().GetBool("json")
|
||||
|
||||
if jsonFlag {
|
||||
data, err := json.Marshal(randrJSON{Outputs: outputs})
|
||||
if err != nil {
|
||||
log.Fatalf("failed to marshal JSON: %v", err)
|
||||
}
|
||||
fmt.Println(string(data))
|
||||
return
|
||||
}
|
||||
|
||||
for i, out := range outputs {
|
||||
if i > 0 {
|
||||
fmt.Println()
|
||||
}
|
||||
status := "enabled"
|
||||
if !out.Enabled {
|
||||
status = "disabled"
|
||||
}
|
||||
fmt.Printf("%s (%s)\n", out.Name, status)
|
||||
fmt.Printf(" Scale: %.4g\n", out.Scale)
|
||||
fmt.Printf(" Resolution: %dx%d\n", out.Width, out.Height)
|
||||
if out.Refresh > 0 {
|
||||
fmt.Printf(" Refresh: %.2f Hz\n", float64(out.Refresh)/1000.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
runCmd.Flags().MarkHidden("daemon-child")
|
||||
|
||||
// Add subcommands to greeter
|
||||
greeterCmd.AddCommand(greeterSyncCmd, greeterEnableCmd, greeterStatusCmd)
|
||||
greeterCmd.AddCommand(greeterInstallCmd, greeterSyncCmd, greeterEnableCmd, greeterStatusCmd)
|
||||
|
||||
// Add subcommands to setup
|
||||
setupCmd.AddCommand(setupBindsCmd, setupLayoutCmd, setupColorsCmd, setupAlttabCmd, setupOutputsCmd, setupCursorCmd, setupWindowrulesCmd)
|
||||
|
||||
172
core/cmd/dms/randr_client.go
Normal file
172
core/cmd/dms/randr_client.go
Normal file
@@ -0,0 +1,172 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/proto/wlr_output_management"
|
||||
wlclient "github.com/AvengeMedia/DankMaterialShell/core/pkg/go-wayland/wayland/client"
|
||||
)
|
||||
|
||||
type randrOutput struct {
|
||||
Name string `json:"name"`
|
||||
Scale float64 `json:"scale"`
|
||||
Width int32 `json:"width"`
|
||||
Height int32 `json:"height"`
|
||||
Refresh int32 `json:"refresh"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
type randrHead struct {
|
||||
name string
|
||||
enabled bool
|
||||
scale float64
|
||||
currentModeID uint32
|
||||
modeIDs []uint32
|
||||
}
|
||||
|
||||
type randrMode struct {
|
||||
width int32
|
||||
height int32
|
||||
refresh int32
|
||||
}
|
||||
|
||||
type randrClient struct {
|
||||
display *wlclient.Display
|
||||
ctx *wlclient.Context
|
||||
manager *wlr_output_management.ZwlrOutputManagerV1
|
||||
heads map[uint32]*randrHead
|
||||
modes map[uint32]*randrMode
|
||||
done bool
|
||||
err error
|
||||
}
|
||||
|
||||
func queryRandr() ([]randrOutput, error) {
|
||||
display, err := wlclient.Connect("")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to connect to Wayland: %w", err)
|
||||
}
|
||||
|
||||
c := &randrClient{
|
||||
display: display,
|
||||
ctx: display.Context(),
|
||||
heads: make(map[uint32]*randrHead),
|
||||
modes: make(map[uint32]*randrMode),
|
||||
}
|
||||
defer c.ctx.Close()
|
||||
|
||||
registry, err := display.GetRegistry()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get registry: %w", err)
|
||||
}
|
||||
|
||||
registry.SetGlobalHandler(func(e wlclient.RegistryGlobalEvent) {
|
||||
if e.Interface == wlr_output_management.ZwlrOutputManagerV1InterfaceName {
|
||||
mgr := wlr_output_management.NewZwlrOutputManagerV1(c.ctx)
|
||||
version := min(e.Version, 4)
|
||||
|
||||
mgr.SetHeadHandler(func(e wlr_output_management.ZwlrOutputManagerV1HeadEvent) {
|
||||
c.handleHead(e)
|
||||
})
|
||||
|
||||
mgr.SetDoneHandler(func(e wlr_output_management.ZwlrOutputManagerV1DoneEvent) {
|
||||
c.done = true
|
||||
})
|
||||
|
||||
if err := registry.Bind(e.Name, e.Interface, version, mgr); err == nil {
|
||||
c.manager = mgr
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// First roundtrip: discover globals and bind manager
|
||||
syncCallback, err := display.Sync()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to sync display: %w", err)
|
||||
}
|
||||
syncCallback.SetDoneHandler(func(e wlclient.CallbackDoneEvent) {
|
||||
if c.manager == nil {
|
||||
c.err = fmt.Errorf("zwlr_output_manager_v1 protocol not supported by compositor")
|
||||
c.done = true
|
||||
}
|
||||
// Otherwise wait for manager's DoneHandler
|
||||
})
|
||||
|
||||
for !c.done {
|
||||
if err := c.ctx.Dispatch(); err != nil {
|
||||
return nil, fmt.Errorf("dispatch error: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if c.err != nil {
|
||||
return nil, c.err
|
||||
}
|
||||
|
||||
return c.buildOutputs(), nil
|
||||
}
|
||||
|
||||
func (c *randrClient) handleHead(e wlr_output_management.ZwlrOutputManagerV1HeadEvent) {
|
||||
handle := e.Head
|
||||
headID := handle.ID()
|
||||
|
||||
head := &randrHead{
|
||||
modeIDs: make([]uint32, 0),
|
||||
}
|
||||
c.heads[headID] = head
|
||||
|
||||
handle.SetNameHandler(func(e wlr_output_management.ZwlrOutputHeadV1NameEvent) {
|
||||
head.name = e.Name
|
||||
})
|
||||
|
||||
handle.SetEnabledHandler(func(e wlr_output_management.ZwlrOutputHeadV1EnabledEvent) {
|
||||
head.enabled = e.Enabled != 0
|
||||
})
|
||||
|
||||
handle.SetScaleHandler(func(e wlr_output_management.ZwlrOutputHeadV1ScaleEvent) {
|
||||
head.scale = e.Scale
|
||||
})
|
||||
|
||||
handle.SetCurrentModeHandler(func(e wlr_output_management.ZwlrOutputHeadV1CurrentModeEvent) {
|
||||
head.currentModeID = e.Mode.ID()
|
||||
})
|
||||
|
||||
handle.SetModeHandler(func(e wlr_output_management.ZwlrOutputHeadV1ModeEvent) {
|
||||
modeHandle := e.Mode
|
||||
modeID := modeHandle.ID()
|
||||
|
||||
head.modeIDs = append(head.modeIDs, modeID)
|
||||
|
||||
mode := &randrMode{}
|
||||
c.modes[modeID] = mode
|
||||
|
||||
modeHandle.SetSizeHandler(func(e wlr_output_management.ZwlrOutputModeV1SizeEvent) {
|
||||
mode.width = e.Width
|
||||
mode.height = e.Height
|
||||
})
|
||||
|
||||
modeHandle.SetRefreshHandler(func(e wlr_output_management.ZwlrOutputModeV1RefreshEvent) {
|
||||
mode.refresh = e.Refresh
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func (c *randrClient) buildOutputs() []randrOutput {
|
||||
outputs := make([]randrOutput, 0, len(c.heads))
|
||||
|
||||
for _, head := range c.heads {
|
||||
out := randrOutput{
|
||||
Name: head.name,
|
||||
Scale: head.scale,
|
||||
Enabled: head.enabled,
|
||||
}
|
||||
|
||||
if mode, ok := c.modes[head.currentModeID]; ok {
|
||||
out.Width = mode.width
|
||||
out.Height = mode.height
|
||||
out.Refresh = mode.refresh
|
||||
}
|
||||
|
||||
outputs = append(outputs, out)
|
||||
}
|
||||
|
||||
return outputs
|
||||
}
|
||||
@@ -97,6 +97,7 @@ func (a *ArchDistribution) DetectDependenciesWithTerminal(ctx context.Context, w
|
||||
dependencies = append(dependencies, a.detectGit())
|
||||
dependencies = append(dependencies, a.detectWindowManager(wm))
|
||||
dependencies = append(dependencies, a.detectQuickshell())
|
||||
dependencies = append(dependencies, a.detectDMSGreeter())
|
||||
dependencies = append(dependencies, a.detectXDGPortal())
|
||||
dependencies = append(dependencies, a.detectAccountsService())
|
||||
|
||||
@@ -124,6 +125,10 @@ func (a *ArchDistribution) detectAccountsService() deps.Dependency {
|
||||
return a.detectPackage("accountsservice", "D-Bus interface for user account query and manipulation", a.packageInstalled("accountsservice"))
|
||||
}
|
||||
|
||||
func (a *ArchDistribution) detectDMSGreeter() deps.Dependency {
|
||||
return a.detectOptionalPackage("dms-greeter", "DankMaterialShell greetd greeter", a.packageInstalled("greetd-dms-greeter-git"))
|
||||
}
|
||||
|
||||
func (a *ArchDistribution) packageInstalled(pkg string) bool {
|
||||
cmd := exec.Command("pacman", "-Q", pkg)
|
||||
err := cmd.Run()
|
||||
@@ -139,6 +144,7 @@ func (a *ArchDistribution) GetPackageMappingWithVariants(wm deps.WindowManager,
|
||||
"dms (DankMaterialShell)": a.getDMSMapping(variants["dms (DankMaterialShell)"]),
|
||||
"git": {Name: "git", Repository: RepoTypeSystem},
|
||||
"quickshell": a.getQuickshellMapping(variants["quickshell"]),
|
||||
"dms-greeter": {Name: "greetd-dms-greeter-git", Repository: RepoTypeAUR},
|
||||
"matugen": a.getMatugenMapping(variants["matugen"]),
|
||||
"dgop": {Name: "dgop", Repository: RepoTypeSystem},
|
||||
"ghostty": {Name: "ghostty", Repository: RepoTypeSystem},
|
||||
|
||||
@@ -102,6 +102,19 @@ func (b *BaseDistribution) detectPackage(name, description string, installed boo
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BaseDistribution) detectOptionalPackage(name, description string, installed bool) deps.Dependency {
|
||||
status := deps.StatusMissing
|
||||
if installed {
|
||||
status = deps.StatusInstalled
|
||||
}
|
||||
return deps.Dependency{
|
||||
Name: name,
|
||||
Status: status,
|
||||
Description: description,
|
||||
Required: false,
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BaseDistribution) detectGit() deps.Dependency {
|
||||
return b.detectCommand("git", "Version control system")
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ func (d *DebianDistribution) DetectDependenciesWithTerminal(ctx context.Context,
|
||||
dependencies = append(dependencies, d.detectGit())
|
||||
dependencies = append(dependencies, d.detectWindowManager(wm))
|
||||
dependencies = append(dependencies, d.detectQuickshell())
|
||||
dependencies = append(dependencies, d.detectDMSGreeter())
|
||||
dependencies = append(dependencies, d.detectXDGPortal())
|
||||
dependencies = append(dependencies, d.detectAccountsService())
|
||||
|
||||
@@ -86,6 +87,10 @@ func (d *DebianDistribution) detectAccountsService() deps.Dependency {
|
||||
return d.detectPackage("accountsservice", "D-Bus interface for user account query and manipulation", d.packageInstalled("accountsservice"))
|
||||
}
|
||||
|
||||
func (d *DebianDistribution) detectDMSGreeter() deps.Dependency {
|
||||
return d.detectOptionalPackage("dms-greeter", "DankMaterialShell greetd greeter", d.packageInstalled("dms-greeter"))
|
||||
}
|
||||
|
||||
func (d *DebianDistribution) packageInstalled(pkg string) bool {
|
||||
cmd := exec.Command("dpkg", "-l", pkg)
|
||||
err := cmd.Run()
|
||||
@@ -108,6 +113,7 @@ func (d *DebianDistribution) GetPackageMappingWithVariants(wm deps.WindowManager
|
||||
// DMS packages from OBS with variant support
|
||||
"dms (DankMaterialShell)": d.getDmsMapping(variants["dms (DankMaterialShell)"]),
|
||||
"quickshell": d.getQuickshellMapping(variants["quickshell"]),
|
||||
"dms-greeter": {Name: "dms-greeter", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
"matugen": {Name: "matugen", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
"dgop": {Name: "dgop", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
"ghostty": {Name: "ghostty", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
|
||||
@@ -13,6 +13,9 @@ func init() {
|
||||
Register("fedora", "#0B57A4", FamilyFedora, func(config DistroConfig, logChan chan<- string) Distribution {
|
||||
return NewFedoraDistribution(config, logChan)
|
||||
})
|
||||
Register("evernight", "#72B8DC", FamilyFedora, func(config DistroConfig, logChan chan<- string) Distribution {
|
||||
return NewFedoraDistribution(config, logChan)
|
||||
})
|
||||
Register("nobara", "#0B57A4", FamilyFedora, func(config DistroConfig, logChan chan<- string) Distribution {
|
||||
return NewFedoraDistribution(config, logChan)
|
||||
})
|
||||
@@ -75,6 +78,7 @@ func (f *FedoraDistribution) DetectDependenciesWithTerminal(ctx context.Context,
|
||||
dependencies = append(dependencies, f.detectGit())
|
||||
dependencies = append(dependencies, f.detectWindowManager(wm))
|
||||
dependencies = append(dependencies, f.detectQuickshell())
|
||||
dependencies = append(dependencies, f.detectDMSGreeter())
|
||||
dependencies = append(dependencies, f.detectXDGPortal())
|
||||
dependencies = append(dependencies, f.detectAccountsService())
|
||||
|
||||
@@ -120,6 +124,7 @@ func (f *FedoraDistribution) GetPackageMappingWithVariants(wm deps.WindowManager
|
||||
|
||||
// COPR packages
|
||||
"quickshell": f.getQuickshellMapping(variants["quickshell"]),
|
||||
"dms-greeter": {Name: "dms-greeter", Repository: RepoTypeCOPR, RepoURL: "avengemedia/danklinux"},
|
||||
"matugen": {Name: "matugen", Repository: RepoTypeCOPR, RepoURL: "avengemedia/danklinux"},
|
||||
"dms (DankMaterialShell)": f.getDmsMapping(variants["dms (DankMaterialShell)"]),
|
||||
"dgop": {Name: "dgop", Repository: RepoTypeCOPR, RepoURL: "avengemedia/danklinux"},
|
||||
@@ -191,6 +196,10 @@ func (f *FedoraDistribution) detectAccountsService() deps.Dependency {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *FedoraDistribution) detectDMSGreeter() deps.Dependency {
|
||||
return f.detectOptionalPackage("dms-greeter", "DankMaterialShell greetd greeter", f.packageInstalled("dms-greeter"))
|
||||
}
|
||||
|
||||
func (f *FedoraDistribution) getPrerequisites() []string {
|
||||
return []string{
|
||||
"dnf-plugins-core",
|
||||
|
||||
@@ -55,6 +55,7 @@ const (
|
||||
PhaseAURPackages
|
||||
PhaseCursorTheme
|
||||
PhaseConfiguration
|
||||
PhaseGreeterSetup
|
||||
PhaseComplete
|
||||
)
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ func (o *OpenSUSEDistribution) DetectDependenciesWithTerminal(ctx context.Contex
|
||||
dependencies = append(dependencies, o.detectGit())
|
||||
dependencies = append(dependencies, o.detectWindowManager(wm))
|
||||
dependencies = append(dependencies, o.detectQuickshell())
|
||||
dependencies = append(dependencies, o.detectDMSGreeter())
|
||||
dependencies = append(dependencies, o.detectXDGPortal())
|
||||
dependencies = append(dependencies, o.detectAccountsService())
|
||||
|
||||
@@ -100,6 +101,10 @@ func (o *OpenSUSEDistribution) packageInstalled(pkg string) bool {
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func (o *OpenSUSEDistribution) detectDMSGreeter() deps.Dependency {
|
||||
return o.detectOptionalPackage("dms-greeter", "DankMaterialShell greetd greeter", o.packageInstalled("dms-greeter"))
|
||||
}
|
||||
|
||||
func (o *OpenSUSEDistribution) GetPackageMapping(wm deps.WindowManager) map[string]PackageMapping {
|
||||
return o.GetPackageMappingWithVariants(wm, make(map[string]deps.PackageVariant))
|
||||
}
|
||||
@@ -116,6 +121,7 @@ func (o *OpenSUSEDistribution) GetPackageMappingWithVariants(wm deps.WindowManag
|
||||
// DMS packages from OBS
|
||||
"dms (DankMaterialShell)": o.getDmsMapping(variants["dms (DankMaterialShell)"]),
|
||||
"quickshell": o.getQuickshellMapping(variants["quickshell"]),
|
||||
"dms-greeter": {Name: "dms-greeter", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
"ghostty": {Name: "ghostty", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
"matugen": {Name: "matugen", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
"dgop": {Name: "dgop", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||
|
||||
@@ -63,6 +63,7 @@ func (u *UbuntuDistribution) DetectDependenciesWithTerminal(ctx context.Context,
|
||||
dependencies = append(dependencies, u.detectGit())
|
||||
dependencies = append(dependencies, u.detectWindowManager(wm))
|
||||
dependencies = append(dependencies, u.detectQuickshell())
|
||||
dependencies = append(dependencies, u.detectDMSGreeter())
|
||||
dependencies = append(dependencies, u.detectXDGPortal())
|
||||
dependencies = append(dependencies, u.detectAccountsService())
|
||||
|
||||
@@ -94,6 +95,10 @@ func (u *UbuntuDistribution) detectAccountsService() deps.Dependency {
|
||||
return u.detectPackage("accountsservice", "D-Bus interface for user account query and manipulation", u.packageInstalled("accountsservice"))
|
||||
}
|
||||
|
||||
func (u *UbuntuDistribution) detectDMSGreeter() deps.Dependency {
|
||||
return u.detectOptionalPackage("dms-greeter", "DankMaterialShell greetd greeter", u.packageInstalled("dms-greeter"))
|
||||
}
|
||||
|
||||
func (u *UbuntuDistribution) packageInstalled(pkg string) bool {
|
||||
cmd := exec.Command("dpkg", "-l", pkg)
|
||||
err := cmd.Run()
|
||||
@@ -116,6 +121,7 @@ func (u *UbuntuDistribution) GetPackageMappingWithVariants(wm deps.WindowManager
|
||||
// DMS packages from PPAs
|
||||
"dms (DankMaterialShell)": u.getDmsMapping(variants["dms (DankMaterialShell)"]),
|
||||
"quickshell": u.getQuickshellMapping(variants["quickshell"]),
|
||||
"dms-greeter": {Name: "dms-greeter", Repository: RepoTypePPA, RepoURL: "ppa:avengemedia/danklinux"},
|
||||
"matugen": {Name: "matugen", Repository: RepoTypePPA, RepoURL: "ppa:avengemedia/danklinux"},
|
||||
"dgop": {Name: "dgop", Repository: RepoTypePPA, RepoURL: "ppa:avengemedia/danklinux"},
|
||||
"ghostty": {Name: "ghostty", Repository: RepoTypePPA, RepoURL: "ppa:avengemedia/danklinux"},
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"github.com/sblinch/kdl-go/document"
|
||||
)
|
||||
|
||||
// DetectDMSPath checks for DMS installation following XDG Base Directory specification
|
||||
func DetectDMSPath() (string, error) {
|
||||
return config.LocateDMSConfig()
|
||||
}
|
||||
@@ -37,7 +36,6 @@ func DetectGreeterGroup() string {
|
||||
return "greeter"
|
||||
}
|
||||
|
||||
// DetectCompositors checks which compositors are installed
|
||||
func DetectCompositors() []string {
|
||||
var compositors []string
|
||||
|
||||
@@ -51,7 +49,6 @@ func DetectCompositors() []string {
|
||||
return compositors
|
||||
}
|
||||
|
||||
// PromptCompositorChoice asks user to choose between compositors
|
||||
func PromptCompositorChoice(compositors []string) (string, error) {
|
||||
fmt.Println("\nMultiple compositors detected:")
|
||||
for i, comp := range compositors {
|
||||
@@ -79,9 +76,18 @@ func PromptCompositorChoice(compositors []string) (string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// EnsureGreetdInstalled checks if greetd is installed and installs it if not
|
||||
// EnsureGreetdInstalled checks if greetd is installed - greetd is a daemon in /usr/sbin on Debian/Ubuntu
|
||||
func EnsureGreetdInstalled(logFunc func(string), sudoPassword string) error {
|
||||
if utils.CommandExists("greetd") {
|
||||
greetdFound := utils.CommandExists("greetd")
|
||||
if !greetdFound {
|
||||
for _, p := range []string{"/usr/sbin/greetd", "/sbin/greetd"} {
|
||||
if _, err := os.Stat(p); err == nil {
|
||||
greetdFound = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if greetdFound {
|
||||
logFunc("✓ greetd is already installed")
|
||||
return nil
|
||||
}
|
||||
@@ -142,6 +148,14 @@ func EnsureGreetdInstalled(logFunc func(string), sudoPassword string) error {
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "apt-get", "install", "-y", "greetd")
|
||||
}
|
||||
|
||||
case distros.FamilyGentoo:
|
||||
if sudoPassword != "" {
|
||||
installCmd = distros.ExecSudoCommand(ctx, sudoPassword,
|
||||
"emerge --ask n sys-apps/greetd")
|
||||
} else {
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "emerge", "--ask", "n", "sys-apps/greetd")
|
||||
}
|
||||
|
||||
case distros.FamilyNix:
|
||||
return fmt.Errorf("on NixOS, please add greetd to your configuration.nix")
|
||||
|
||||
@@ -160,13 +174,124 @@ func EnsureGreetdInstalled(logFunc func(string), sudoPassword string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsGreeterPackaged returns true if dms-greeter was installed from a system package.
|
||||
func IsGreeterPackaged() bool {
|
||||
if !utils.CommandExists("dms-greeter") {
|
||||
return false
|
||||
}
|
||||
packagedPath := "/usr/share/quickshell/dms-greeter"
|
||||
info, err := os.Stat(packagedPath)
|
||||
return err == nil && info.IsDir()
|
||||
}
|
||||
|
||||
// HasLegacyLocalGreeterWrapper returns true when a manually installed wrapper exists.
|
||||
func HasLegacyLocalGreeterWrapper() bool {
|
||||
info, err := os.Stat("/usr/local/bin/dms-greeter")
|
||||
return err == nil && !info.IsDir()
|
||||
}
|
||||
|
||||
// TryInstallGreeterPackage attempts to install dms-greeter from the distro's official repo.
|
||||
func TryInstallGreeterPackage(logFunc func(string), sudoPassword string) bool {
|
||||
osInfo, err := distros.GetOSInfo()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
config, exists := distros.Registry[osInfo.Distribution.ID]
|
||||
if !exists {
|
||||
return false
|
||||
}
|
||||
|
||||
if IsGreeterPackaged() {
|
||||
logFunc("✓ dms-greeter package already installed")
|
||||
return true
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
var installCmd *exec.Cmd
|
||||
var failHint string
|
||||
|
||||
switch config.Family {
|
||||
case distros.FamilyDebian:
|
||||
obsSlug := getDebianOBSSlug(osInfo)
|
||||
keyURL := fmt.Sprintf("https://download.opensuse.org/repositories/home:AvengeMedia:danklinux/%s/Release.key", obsSlug)
|
||||
repoLine := fmt.Sprintf("deb [signed-by=/etc/apt/keyrings/danklinux.gpg] https://download.opensuse.org/repositories/home:/AvengeMedia:/danklinux/%s/ /", obsSlug)
|
||||
failHint = fmt.Sprintf("⚠ dms-greeter install failed. Add OBS repo manually:\ncurl -fsSL %s | sudo gpg --dearmor -o /etc/apt/keyrings/danklinux.gpg\necho '%s' | sudo tee /etc/apt/sources.list.d/danklinux.list\nsudo apt update && sudo apt install dms-greeter", keyURL, repoLine)
|
||||
logFunc(fmt.Sprintf("Adding DankLinux OBS repository (%s)...", obsSlug))
|
||||
addKeyCmd := exec.CommandContext(ctx, "bash", "-c",
|
||||
fmt.Sprintf(`curl -fsSL %s | sudo gpg --dearmor -o /etc/apt/keyrings/danklinux.gpg`, keyURL))
|
||||
addKeyCmd.Stdout = os.Stdout
|
||||
addKeyCmd.Stderr = os.Stderr
|
||||
addKeyCmd.Run()
|
||||
addRepoCmd := exec.CommandContext(ctx, "bash", "-c",
|
||||
fmt.Sprintf(`echo '%s' | sudo tee /etc/apt/sources.list.d/danklinux.list`, repoLine))
|
||||
addRepoCmd.Stdout = os.Stdout
|
||||
addRepoCmd.Stderr = os.Stderr
|
||||
addRepoCmd.Run()
|
||||
exec.CommandContext(ctx, "sudo", "apt-get", "update").Run()
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "apt-get", "install", "-y", "dms-greeter")
|
||||
case distros.FamilySUSE:
|
||||
repoURL := getOpenSUSEOBSRepoURL(osInfo)
|
||||
failHint = fmt.Sprintf("⚠ dms-greeter install failed. Add OBS repo manually:\nsudo zypper addrepo %s\nsudo zypper refresh && sudo zypper install dms-greeter", repoURL)
|
||||
logFunc("Adding DankLinux OBS repository...")
|
||||
addRepoCmd := exec.CommandContext(ctx, "sudo", "zypper", "addrepo", repoURL)
|
||||
addRepoCmd.Stdout = os.Stdout
|
||||
addRepoCmd.Stderr = os.Stderr
|
||||
addRepoCmd.Run()
|
||||
exec.CommandContext(ctx, "sudo", "zypper", "refresh").Run()
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "zypper", "install", "-y", "dms-greeter")
|
||||
case distros.FamilyUbuntu:
|
||||
failHint = "⚠ dms-greeter install failed. Add PPA manually: sudo add-apt-repository ppa:avengemedia/danklinux && sudo apt-get update && sudo apt-get install dms-greeter"
|
||||
logFunc("Enabling PPA ppa:avengemedia/danklinux...")
|
||||
ppacmd := exec.CommandContext(ctx, "sudo", "add-apt-repository", "-y", "ppa:avengemedia/danklinux")
|
||||
ppacmd.Stdout = os.Stdout
|
||||
ppacmd.Stderr = os.Stderr
|
||||
ppacmd.Run()
|
||||
exec.CommandContext(ctx, "sudo", "apt-get", "update").Run()
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "apt-get", "install", "-y", "dms-greeter")
|
||||
case distros.FamilyFedora:
|
||||
failHint = "⚠ dms-greeter install failed. Enable COPR manually: sudo dnf copr enable avengemedia/danklinux && sudo dnf install dms-greeter"
|
||||
logFunc("Enabling COPR avengemedia/danklinux...")
|
||||
coprcmd := exec.CommandContext(ctx, "sudo", "dnf", "copr", "enable", "-y", "avengemedia/danklinux")
|
||||
coprcmd.Stdout = os.Stdout
|
||||
coprcmd.Stderr = os.Stderr
|
||||
coprcmd.Run()
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "dnf", "install", "-y", "dms-greeter")
|
||||
case distros.FamilyArch:
|
||||
aurHelper := ""
|
||||
for _, helper := range []string{"paru", "yay"} {
|
||||
if _, err := exec.LookPath(helper); err == nil {
|
||||
aurHelper = helper
|
||||
break
|
||||
}
|
||||
}
|
||||
if aurHelper == "" {
|
||||
logFunc("⚠ No AUR helper found (paru/yay). Install greetd-dms-greeter-git from AUR: https://aur.archlinux.org/packages/greetd-dms-greeter-git")
|
||||
return false
|
||||
}
|
||||
failHint = fmt.Sprintf("⚠ dms-greeter install failed. Install from AUR: %s -S greetd-dms-greeter-git", aurHelper)
|
||||
installCmd = exec.CommandContext(ctx, aurHelper, "-S", "--noconfirm", "greetd-dms-greeter-git")
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
logFunc("Installing dms-greeter from official repository...")
|
||||
installCmd.Stdout = os.Stdout
|
||||
installCmd.Stderr = os.Stderr
|
||||
|
||||
if err := installCmd.Run(); err != nil {
|
||||
logFunc(failHint)
|
||||
return false
|
||||
}
|
||||
|
||||
logFunc("✓ dms-greeter package installed")
|
||||
return true
|
||||
}
|
||||
|
||||
// CopyGreeterFiles installs the dms-greeter wrapper and sets up cache directory
|
||||
func CopyGreeterFiles(dmsPath, compositor string, logFunc func(string), sudoPassword string) error {
|
||||
// Check if dms-greeter is already in PATH
|
||||
if utils.CommandExists("dms-greeter") {
|
||||
logFunc("✓ dms-greeter wrapper already installed")
|
||||
} else {
|
||||
// Install the wrapper script
|
||||
assetsDir := filepath.Join(dmsPath, "Modules", "Greetd", "assets")
|
||||
wrapperSrc := filepath.Join(assetsDir, "dms-greeter")
|
||||
|
||||
@@ -203,7 +328,6 @@ func CopyGreeterFiles(dmsPath, compositor string, logFunc func(string), sudoPass
|
||||
}
|
||||
}
|
||||
|
||||
// Create cache directory with proper permissions
|
||||
cacheDir := "/var/cache/dms-greeter"
|
||||
if err := runSudoCmd(sudoPassword, "mkdir", "-p", cacheDir); err != nil {
|
||||
return fmt.Errorf("failed to create cache directory: %w", err)
|
||||
@@ -224,14 +348,90 @@ func CopyGreeterFiles(dmsPath, compositor string, logFunc func(string), sudoPass
|
||||
return nil
|
||||
}
|
||||
|
||||
// EnsureACLInstalled installs the acl package (setfacl/getfacl) if not already present
|
||||
func EnsureACLInstalled(logFunc func(string), sudoPassword string) error {
|
||||
if utils.CommandExists("setfacl") {
|
||||
return nil
|
||||
}
|
||||
|
||||
logFunc("setfacl not found – installing acl package...")
|
||||
|
||||
osInfo, err := distros.GetOSInfo()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to detect OS: %w", err)
|
||||
}
|
||||
|
||||
config, exists := distros.Registry[osInfo.Distribution.ID]
|
||||
if !exists {
|
||||
return fmt.Errorf("unsupported distribution for automatic acl installation: %s", osInfo.Distribution.ID)
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
var installCmd *exec.Cmd
|
||||
|
||||
switch config.Family {
|
||||
case distros.FamilyArch:
|
||||
if sudoPassword != "" {
|
||||
installCmd = distros.ExecSudoCommand(ctx, sudoPassword, "pacman -S --needed --noconfirm acl")
|
||||
} else {
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "pacman", "-S", "--needed", "--noconfirm", "acl")
|
||||
}
|
||||
|
||||
case distros.FamilyFedora:
|
||||
if sudoPassword != "" {
|
||||
installCmd = distros.ExecSudoCommand(ctx, sudoPassword, "dnf install -y acl")
|
||||
} else {
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "dnf", "install", "-y", "acl")
|
||||
}
|
||||
|
||||
case distros.FamilySUSE:
|
||||
if sudoPassword != "" {
|
||||
installCmd = distros.ExecSudoCommand(ctx, sudoPassword, "zypper install -y acl")
|
||||
} else {
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "zypper", "install", "-y", "acl")
|
||||
}
|
||||
|
||||
case distros.FamilyUbuntu, distros.FamilyDebian:
|
||||
if sudoPassword != "" {
|
||||
installCmd = distros.ExecSudoCommand(ctx, sudoPassword, "apt-get install -y acl")
|
||||
} else {
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "apt-get", "install", "-y", "acl")
|
||||
}
|
||||
|
||||
case distros.FamilyGentoo:
|
||||
if sudoPassword != "" {
|
||||
installCmd = distros.ExecSudoCommand(ctx, sudoPassword, "emerge --ask n sys-fs/acl")
|
||||
} else {
|
||||
installCmd = exec.CommandContext(ctx, "sudo", "emerge", "--ask", "n", "sys-fs/acl")
|
||||
}
|
||||
|
||||
case distros.FamilyNix:
|
||||
return fmt.Errorf("on NixOS, please add pkgs.acl to your configuration.nix")
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unsupported distribution family for automatic acl installation: %s", config.Family)
|
||||
}
|
||||
|
||||
installCmd.Stdout = os.Stdout
|
||||
installCmd.Stderr = os.Stderr
|
||||
if err := installCmd.Run(); err != nil {
|
||||
return fmt.Errorf("failed to install acl: %w", err)
|
||||
}
|
||||
|
||||
logFunc("✓ acl package installed")
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetupParentDirectoryACLs sets ACLs on parent directories to allow traversal
|
||||
func SetupParentDirectoryACLs(logFunc func(string), sudoPassword string) error {
|
||||
if err := EnsureACLInstalled(logFunc, sudoPassword); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: could not install acl package: %v", err))
|
||||
logFunc(" ACL permissions will be skipped; theme sync may not work correctly.")
|
||||
return nil
|
||||
}
|
||||
if !utils.CommandExists("setfacl") {
|
||||
logFunc("⚠ Warning: setfacl command not found. ACL support may not be available on this filesystem.")
|
||||
logFunc(" If theme sync doesn't work, you may need to install acl package:")
|
||||
logFunc(" - Fedora/RHEL: sudo dnf install acl")
|
||||
logFunc(" - Debian/Ubuntu: sudo apt-get install acl")
|
||||
logFunc(" - Arch: sudo pacman -S acl")
|
||||
// setfacl still not found after install attempt (e.g. unsupported filesystem)
|
||||
logFunc("⚠ Warning: setfacl still not available after install attempt; skipping ACL setup.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -264,7 +464,6 @@ func SetupParentDirectoryACLs(logFunc func(string), sudoPassword string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Set ACL to allow greeter user read+execute permission (for session discovery)
|
||||
if err := runSudoCmd(sudoPassword, "setfacl", "-m", fmt.Sprintf("u:%s:rx", owner), dir.path); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: Failed to set ACL on %s: %v", dir.desc, err))
|
||||
logFunc(fmt.Sprintf(" You may need to run manually: setfacl -m u:%s:x %s", owner, dir.path))
|
||||
@@ -299,7 +498,6 @@ func SetupDMSGroup(logFunc func(string), sudoPassword string) error {
|
||||
if err == nil && strings.Contains(string(groupsOutput), group) {
|
||||
logFunc(fmt.Sprintf("✓ %s is already in %s group", currentUser, group))
|
||||
} else {
|
||||
// Add current user to greeter group for file access permissions
|
||||
if err := runSudoCmd(sudoPassword, "usermod", "-aG", group, currentUser); err != nil {
|
||||
return fmt.Errorf("failed to add %s to %s group: %w", currentUser, group, err)
|
||||
}
|
||||
@@ -339,7 +537,6 @@ func SetupDMSGroup(logFunc func(string), sudoPassword string) error {
|
||||
logFunc(fmt.Sprintf("✓ Set group permissions for %s", dir.desc))
|
||||
}
|
||||
|
||||
// Set up ACLs on parent directories to allow greeter user traversal
|
||||
if err := SetupParentDirectoryACLs(logFunc, sudoPassword); err != nil {
|
||||
return fmt.Errorf("failed to setup parent directory ACLs: %w", err)
|
||||
}
|
||||
@@ -393,7 +590,7 @@ func SyncDMSConfigs(dmsPath, compositor string, logFunc func(string), sudoPasswo
|
||||
}
|
||||
}
|
||||
|
||||
runSudoCmd(sudoPassword, "rm", "-f", link.target) //nolint:errcheck
|
||||
_ = runSudoCmd(sudoPassword, "rm", "-f", link.target)
|
||||
|
||||
if err := runSudoCmd(sudoPassword, "ln", "-sf", link.source, link.target); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: Failed to create symlink for %s: %v", link.desc, err))
|
||||
@@ -787,15 +984,19 @@ user = "%s"
|
||||
}
|
||||
}
|
||||
|
||||
// Determine wrapper command path
|
||||
// If dmsPath is empty (packaged greeter), omit -p; wrapper finds /usr/share/quickshell/dms-greeter
|
||||
wrapperCmd := "dms-greeter"
|
||||
if !utils.CommandExists("dms-greeter") {
|
||||
wrapperCmd = "/usr/local/bin/dms-greeter"
|
||||
}
|
||||
|
||||
// Build command based on compositor and dms path
|
||||
compositorLower := strings.ToLower(compositor)
|
||||
command := fmt.Sprintf(`command = "%s --command %s -p %s"`, wrapperCmd, compositorLower, dmsPath)
|
||||
var command string
|
||||
if dmsPath == "" {
|
||||
command = fmt.Sprintf(`command = "%s --command %s"`, wrapperCmd, compositorLower)
|
||||
} else {
|
||||
command = fmt.Sprintf(`command = "%s --command %s -p %s"`, wrapperCmd, compositorLower, dmsPath)
|
||||
}
|
||||
|
||||
var finalLines []string
|
||||
inDefaultSession := false
|
||||
@@ -832,7 +1033,11 @@ user = "%s"
|
||||
return fmt.Errorf("failed to move config to /etc/greetd: %w", err)
|
||||
}
|
||||
|
||||
logFunc(fmt.Sprintf("✓ Updated greetd configuration (user: %s, command: %s --command %s -p %s)", greeterUser, wrapperCmd, compositorLower, dmsPath))
|
||||
cmdDesc := fmt.Sprintf("%s --command %s", wrapperCmd, compositorLower)
|
||||
if dmsPath != "" {
|
||||
cmdDesc = fmt.Sprintf("%s -p %s", cmdDesc, dmsPath)
|
||||
}
|
||||
logFunc(fmt.Sprintf("✓ Updated greetd configuration (user: %s, command: %s)", greeterUser, cmdDesc))
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -867,6 +1072,47 @@ func stripConfigFlag(command string) string {
|
||||
return command
|
||||
}
|
||||
|
||||
// getDebianOBSSlug returns the OBS repository slug for the running Debian version.
|
||||
func getDebianOBSSlug(osInfo *distros.OSInfo) string {
|
||||
versionID := strings.ToLower(osInfo.VersionID)
|
||||
codename := strings.ToLower(osInfo.VersionCodename)
|
||||
prettyName := strings.ToLower(osInfo.PrettyName)
|
||||
|
||||
if strings.Contains(prettyName, "sid") || strings.Contains(prettyName, "unstable") ||
|
||||
codename == "sid" || versionID == "sid" {
|
||||
return "Debian_Unstable"
|
||||
}
|
||||
if versionID == "testing" || codename == "testing" {
|
||||
return "Debian_Testing"
|
||||
}
|
||||
if versionID != "" {
|
||||
return "Debian_" + versionID // "Debian_13"
|
||||
}
|
||||
return "Debian_Unstable"
|
||||
}
|
||||
|
||||
// getOpenSUSEOBSRepoURL returns the OBS .repo file URL for the running openSUSE variant.
|
||||
func getOpenSUSEOBSRepoURL(osInfo *distros.OSInfo) string {
|
||||
const base = "https://download.opensuse.org/repositories/home:AvengeMedia:danklinux"
|
||||
var slug string
|
||||
switch osInfo.Distribution.ID {
|
||||
case "opensuse-leap":
|
||||
v := osInfo.VersionID
|
||||
if v != "" && !strings.Contains(v, ".") {
|
||||
v += ".0" // "16" → "16.0"
|
||||
}
|
||||
if v == "" {
|
||||
v = "16.0"
|
||||
}
|
||||
slug = v
|
||||
case "opensuse-slowroll":
|
||||
slug = "openSUSE_Slowroll"
|
||||
default: // opensuse-tumbleweed || unknown version
|
||||
slug = "openSUSE_Tumbleweed"
|
||||
}
|
||||
return fmt.Sprintf("%s/%s/home:AvengeMedia:danklinux.repo", base, slug)
|
||||
}
|
||||
|
||||
func runSudoCmd(sudoPassword string, command string, args ...string) error {
|
||||
var cmd *exec.Cmd
|
||||
|
||||
@@ -887,3 +1133,140 @@ func runSudoCmd(sudoPassword string, command string, args ...string) error {
|
||||
cmd.Stderr = os.Stderr
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func checkSystemdEnabled(service string) (string, error) {
|
||||
cmd := exec.Command("systemctl", "is-enabled", service)
|
||||
output, _ := cmd.Output()
|
||||
return strings.TrimSpace(string(output)), nil
|
||||
}
|
||||
|
||||
func DisableConflictingDisplayManagers(sudoPassword string, logFunc func(string)) error {
|
||||
conflictingDMs := []string{"gdm", "gdm3", "lightdm", "sddm", "lxdm", "xdm", "cosmic-greeter"}
|
||||
for _, dm := range conflictingDMs {
|
||||
state, err := checkSystemdEnabled(dm)
|
||||
if err != nil || state == "" || state == "not-found" {
|
||||
continue
|
||||
}
|
||||
switch state {
|
||||
case "enabled", "enabled-runtime", "static", "indirect", "alias":
|
||||
logFunc(fmt.Sprintf("Disabling conflicting display manager: %s", dm))
|
||||
if err := runSudoCmd(sudoPassword, "systemctl", "disable", "--now", dm); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: Failed to disable %s: %v", dm, err))
|
||||
} else {
|
||||
logFunc(fmt.Sprintf("✓ Disabled %s", dm))
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EnableGreetd unmasks and enables greetd, forcing it over any other DM.
|
||||
func EnableGreetd(sudoPassword string, logFunc func(string)) error {
|
||||
state, err := checkSystemdEnabled("greetd")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to check greetd state: %w", err)
|
||||
}
|
||||
if state == "not-found" {
|
||||
return fmt.Errorf("greetd service not found; ensure greetd is installed")
|
||||
}
|
||||
if state == "masked" || state == "masked-runtime" {
|
||||
logFunc(" Unmasking greetd...")
|
||||
if err := runSudoCmd(sudoPassword, "systemctl", "unmask", "greetd"); err != nil {
|
||||
return fmt.Errorf("failed to unmask greetd: %w", err)
|
||||
}
|
||||
logFunc(" ✓ Unmasked greetd")
|
||||
}
|
||||
logFunc(" Enabling greetd service (--force)...")
|
||||
if err := runSudoCmd(sudoPassword, "systemctl", "enable", "--force", "greetd"); err != nil {
|
||||
return fmt.Errorf("failed to enable greetd: %w", err)
|
||||
}
|
||||
logFunc("✓ greetd enabled")
|
||||
return nil
|
||||
}
|
||||
|
||||
func EnsureGraphicalTarget(sudoPassword string, logFunc func(string)) error {
|
||||
cmd := exec.Command("systemctl", "get-default")
|
||||
output, err := cmd.Output()
|
||||
if err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: could not get default systemd target: %v", err))
|
||||
return nil
|
||||
}
|
||||
current := strings.TrimSpace(string(output))
|
||||
if current == "graphical.target" {
|
||||
logFunc("✓ Default target is already graphical.target")
|
||||
return nil
|
||||
}
|
||||
logFunc(fmt.Sprintf(" Setting default target to graphical.target (was: %s)...", current))
|
||||
if err := runSudoCmd(sudoPassword, "systemctl", "set-default", "graphical.target"); err != nil {
|
||||
return fmt.Errorf("failed to set graphical target: %w", err)
|
||||
}
|
||||
logFunc("✓ Default target set to graphical.target")
|
||||
return nil
|
||||
}
|
||||
|
||||
// AutoSetupGreeter performs the full non-interactive greeter setup
|
||||
func AutoSetupGreeter(compositor, sudoPassword string, logFunc func(string)) error {
|
||||
if IsGreeterPackaged() && HasLegacyLocalGreeterWrapper() {
|
||||
return fmt.Errorf("legacy manual wrapper detected at /usr/local/bin/dms-greeter; " +
|
||||
"remove it before using packaged dms-greeter: sudo rm -f /usr/local/bin/dms-greeter")
|
||||
}
|
||||
|
||||
logFunc("Ensuring greetd is installed...")
|
||||
if err := EnsureGreetdInstalled(logFunc, sudoPassword); err != nil {
|
||||
return fmt.Errorf("greetd install failed: %w", err)
|
||||
}
|
||||
|
||||
dmsPath := ""
|
||||
if !IsGreeterPackaged() {
|
||||
detected, err := DetectDMSPath()
|
||||
if err != nil {
|
||||
return fmt.Errorf("DMS installation not found: %w", err)
|
||||
}
|
||||
dmsPath = detected
|
||||
logFunc(fmt.Sprintf("✓ Found DMS at: %s", dmsPath))
|
||||
} else {
|
||||
logFunc("✓ Using packaged dms-greeter (/usr/share/quickshell/dms-greeter)")
|
||||
}
|
||||
|
||||
logFunc("Setting up dms-greeter group and permissions...")
|
||||
if err := SetupDMSGroup(logFunc, sudoPassword); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: group/permissions setup error: %v", err))
|
||||
}
|
||||
|
||||
logFunc("Copying greeter files...")
|
||||
if err := CopyGreeterFiles(dmsPath, compositor, logFunc, sudoPassword); err != nil {
|
||||
return fmt.Errorf("failed to copy greeter files: %w", err)
|
||||
}
|
||||
|
||||
logFunc("Configuring greetd...")
|
||||
greeterPathForConfig := ""
|
||||
if !IsGreeterPackaged() {
|
||||
greeterPathForConfig = dmsPath
|
||||
}
|
||||
if err := ConfigureGreetd(greeterPathForConfig, compositor, logFunc, sudoPassword); err != nil {
|
||||
return fmt.Errorf("failed to configure greetd: %w", err)
|
||||
}
|
||||
|
||||
logFunc("Synchronizing DMS configurations...")
|
||||
if err := SyncDMSConfigs(dmsPath, compositor, logFunc, sudoPassword); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: config sync error: %v", err))
|
||||
}
|
||||
|
||||
logFunc("Checking for conflicting display managers...")
|
||||
if err := DisableConflictingDisplayManagers(sudoPassword, logFunc); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: %v", err))
|
||||
}
|
||||
|
||||
logFunc("Enabling greetd service...")
|
||||
if err := EnableGreetd(sudoPassword, logFunc); err != nil {
|
||||
return fmt.Errorf("failed to enable greetd: %w", err)
|
||||
}
|
||||
|
||||
logFunc("Ensuring graphical.target as default...")
|
||||
if err := EnsureGraphicalTarget(sudoPassword, logFunc); err != nil {
|
||||
logFunc(fmt.Sprintf("⚠ Warning: %v", err))
|
||||
}
|
||||
|
||||
logFunc("✓ DMS greeter setup complete")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package matugen
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
@@ -19,6 +21,8 @@ import (
|
||||
"github.com/lucasb-eyer/go-colorful"
|
||||
)
|
||||
|
||||
var ErrNoChanges = errors.New("no color changes")
|
||||
|
||||
type ColorMode string
|
||||
|
||||
const (
|
||||
@@ -54,7 +58,7 @@ var templateRegistry = []TemplateDef{
|
||||
{ID: "qt6ct", Commands: []string{"qt6ct"}, ConfigFile: "qt6ct.toml"},
|
||||
{ID: "firefox", Commands: []string{"firefox"}, ConfigFile: "firefox.toml"},
|
||||
{ID: "pywalfox", Commands: []string{"pywalfox"}, ConfigFile: "pywalfox.toml"},
|
||||
{ID: "zenbrowser", Commands: []string{"zen", "zen-browser"}, Flatpaks: []string{"app.zen_browser.zen"}, ConfigFile: "zenbrowser.toml"},
|
||||
{ID: "zenbrowser", Commands: []string{"zen", "zen-browser", "zen-beta", "zen-twilight"}, Flatpaks: []string{"app.zen_browser.zen"}, ConfigFile: "zenbrowser.toml"},
|
||||
{ID: "vesktop", Commands: []string{"vesktop"}, Flatpaks: []string{"dev.vencord.Vesktop"}, ConfigFile: "vesktop.toml"},
|
||||
{ID: "equibop", Commands: []string{"equibop"}, ConfigFile: "equibop.toml"},
|
||||
{ID: "ghostty", Commands: []string{"ghostty"}, ConfigFile: "ghostty.toml", Kind: TemplateKindTerminal},
|
||||
@@ -160,8 +164,14 @@ func Run(opts Options) error {
|
||||
|
||||
log.Infof("Building theme: %s %s (%s)", opts.Kind, opts.Value, opts.Mode)
|
||||
|
||||
if err := buildOnce(&opts); err != nil {
|
||||
return err
|
||||
changed, buildErr := buildOnce(&opts)
|
||||
if buildErr != nil {
|
||||
return buildErr
|
||||
}
|
||||
|
||||
if !changed {
|
||||
log.Info("No color changes detected, skipping refresh")
|
||||
return ErrNoChanges
|
||||
}
|
||||
|
||||
if opts.SyncModeWithPortal {
|
||||
@@ -172,25 +182,27 @@ func Run(opts Options) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildOnce(opts *Options) error {
|
||||
func buildOnce(opts *Options) (bool, error) {
|
||||
cfgFile, err := os.CreateTemp("", "matugen-config-*.toml")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create temp config: %w", err)
|
||||
return false, fmt.Errorf("failed to create temp config: %w", err)
|
||||
}
|
||||
defer os.Remove(cfgFile.Name())
|
||||
defer cfgFile.Close()
|
||||
|
||||
tmpDir, err := os.MkdirTemp("", "matugen-templates-*")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create temp dir: %w", err)
|
||||
return false, fmt.Errorf("failed to create temp dir: %w", err)
|
||||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
if err := buildMergedConfig(opts, cfgFile, tmpDir); err != nil {
|
||||
return fmt.Errorf("failed to build config: %w", err)
|
||||
return false, fmt.Errorf("failed to build config: %w", err)
|
||||
}
|
||||
cfgFile.Close()
|
||||
|
||||
oldColors, _ := os.ReadFile(opts.ColorsOutput())
|
||||
|
||||
var primaryDark, primaryLight, surface string
|
||||
var dank16JSON string
|
||||
var importArgs []string
|
||||
@@ -202,7 +214,7 @@ func buildOnce(opts *Options) error {
|
||||
surface = extractNestedColor(opts.StockColors, "surface", "dark")
|
||||
|
||||
if primaryDark == "" {
|
||||
return fmt.Errorf("failed to extract primary dark from stock colors")
|
||||
return false, fmt.Errorf("failed to extract primary dark from stock colors")
|
||||
}
|
||||
if primaryLight == "" {
|
||||
primaryLight = primaryDark
|
||||
@@ -216,14 +228,14 @@ func buildOnce(opts *Options) error {
|
||||
args := []string{"color", "hex", primaryDark, "-m", string(opts.Mode), "-t", opts.MatugenType, "-c", cfgFile.Name()}
|
||||
args = append(args, importArgs...)
|
||||
if err := runMatugen(args); err != nil {
|
||||
return err
|
||||
return false, err
|
||||
}
|
||||
} else {
|
||||
log.Infof("Using dynamic theme from %s: %s", opts.Kind, opts.Value)
|
||||
|
||||
matJSON, err := runMatugenDryRun(opts)
|
||||
if err != nil {
|
||||
return fmt.Errorf("matugen dry-run failed: %w", err)
|
||||
return false, fmt.Errorf("matugen dry-run failed: %w", err)
|
||||
}
|
||||
|
||||
primaryDark = extractMatugenColor(matJSON, "primary", "dark")
|
||||
@@ -231,7 +243,7 @@ func buildOnce(opts *Options) error {
|
||||
surface = extractMatugenColor(matJSON, "surface", "dark")
|
||||
|
||||
if primaryDark == "" {
|
||||
return fmt.Errorf("failed to extract primary color")
|
||||
return false, fmt.Errorf("failed to extract primary color")
|
||||
}
|
||||
if primaryLight == "" {
|
||||
primaryLight = primaryDark
|
||||
@@ -252,10 +264,15 @@ func buildOnce(opts *Options) error {
|
||||
args = append(args, "-m", string(opts.Mode), "-t", opts.MatugenType, "-c", cfgFile.Name())
|
||||
args = append(args, importArgs...)
|
||||
if err := runMatugen(args); err != nil {
|
||||
return err
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
|
||||
newColors, _ := os.ReadFile(opts.ColorsOutput())
|
||||
if bytes.Equal(oldColors, newColors) && len(oldColors) > 0 {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if isDMSGTKActive(opts.ConfigDir) {
|
||||
switch opts.Mode {
|
||||
case ColorModeLight:
|
||||
@@ -273,7 +290,7 @@ func buildOnce(opts *Options) error {
|
||||
|
||||
signalTerminals(opts)
|
||||
|
||||
return nil
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func buildMergedConfig(opts *Options, cfgFile *os.File, tmpDir string) error {
|
||||
|
||||
@@ -2,6 +2,7 @@ package matugen
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||
@@ -93,10 +94,13 @@ func (q *Queue) runWorker() {
|
||||
err := Run(job.Options)
|
||||
|
||||
var result Result
|
||||
if err != nil {
|
||||
result = Result{Success: false, Error: err}
|
||||
} else {
|
||||
switch {
|
||||
case err == nil:
|
||||
result = Result{Success: true}
|
||||
case errors.Is(err, ErrNoChanges):
|
||||
result = Result{Success: true}
|
||||
default:
|
||||
result = Result{Success: false, Error: err}
|
||||
}
|
||||
|
||||
q.finishJob(result)
|
||||
|
||||
@@ -311,6 +311,10 @@ func (m *Manager) handleDevicePropertiesChanged(path dbus.ObjectPath, changed ma
|
||||
select {
|
||||
case m.eventQueue <- func() {
|
||||
time.Sleep(300 * time.Millisecond)
|
||||
log.Infof("[Bluetooth] Auto-trusting newly paired device: %s", devicePath)
|
||||
if err := m.TrustDevice(devicePath, true); err != nil {
|
||||
log.Warnf("[Bluetooth] Auto-trust failed: %v", err)
|
||||
}
|
||||
log.Infof("[Bluetooth] Auto-connecting newly paired device: %s", devicePath)
|
||||
if err := m.ConnectDevice(devicePath); err != nil {
|
||||
log.Warnf("[Bluetooth] Auto-connect failed: %v", err)
|
||||
|
||||
@@ -1599,6 +1599,13 @@ func Start(printDocs bool) error {
|
||||
log.Warnf("Theme mode manager unavailable: %v", err)
|
||||
} else {
|
||||
notifyCapabilityChange()
|
||||
go func() {
|
||||
<-loginctlReady
|
||||
if loginctlManager == nil {
|
||||
return
|
||||
}
|
||||
themeModeManager.WatchLoginctl(loginctlManager)
|
||||
}()
|
||||
}
|
||||
|
||||
fatalErrChan := make(chan error, 1)
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/loginctl"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/wayland"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/pkg/syncmap"
|
||||
)
|
||||
@@ -187,6 +188,29 @@ func (m *Manager) Close() {
|
||||
})
|
||||
}
|
||||
|
||||
func (m *Manager) WatchLoginctl(lm *loginctl.Manager) {
|
||||
ch := lm.Subscribe("thememode")
|
||||
m.wg.Add(1)
|
||||
go func() {
|
||||
defer m.wg.Done()
|
||||
defer lm.Unsubscribe("thememode")
|
||||
for {
|
||||
select {
|
||||
case <-m.stopChan:
|
||||
return
|
||||
case state, ok := <-ch:
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
if state.PreparingForSleep {
|
||||
continue
|
||||
}
|
||||
m.TriggerUpdate()
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (m *Manager) schedulerLoop() {
|
||||
defer m.wg.Done()
|
||||
|
||||
@@ -327,10 +351,12 @@ func statesEqual(a, b *State) bool {
|
||||
}
|
||||
|
||||
func (m *Manager) computeSchedule(now time.Time, config Config) (bool, time.Time) {
|
||||
if config.Mode == "location" {
|
||||
switch config.Mode {
|
||||
case "location":
|
||||
return m.computeLocationSchedule(now, config)
|
||||
default:
|
||||
return computeTimeSchedule(now, config)
|
||||
}
|
||||
return computeTimeSchedule(now, config)
|
||||
}
|
||||
|
||||
func computeTimeSchedule(now time.Time, config Config) (bool, time.Time) {
|
||||
@@ -381,10 +407,10 @@ func (m *Manager) computeLocationSchedule(now time.Time, config Config) (bool, t
|
||||
}
|
||||
|
||||
times, cond := wayland.CalculateSunTimesWithTwilight(*lat, *lon, now, config.ElevationTwilight, config.ElevationDaylight)
|
||||
if cond != wayland.SunNormal {
|
||||
if cond == wayland.SunMidnightSun {
|
||||
return true, startOfNextDay(now)
|
||||
}
|
||||
switch cond {
|
||||
case wayland.SunMidnightSun:
|
||||
return true, startOfNextDay(now)
|
||||
case wayland.SunPolarNight:
|
||||
return false, startOfNextDay(now)
|
||||
}
|
||||
|
||||
@@ -397,10 +423,10 @@ func (m *Manager) computeLocationSchedule(now time.Time, config Config) (bool, t
|
||||
|
||||
nextDay := startOfNextDay(now)
|
||||
nextTimes, nextCond := wayland.CalculateSunTimesWithTwilight(*lat, *lon, nextDay, config.ElevationTwilight, config.ElevationDaylight)
|
||||
if nextCond != wayland.SunNormal {
|
||||
if nextCond == wayland.SunMidnightSun {
|
||||
return true, startOfNextDay(nextDay)
|
||||
}
|
||||
switch nextCond {
|
||||
case wayland.SunMidnightSun:
|
||||
return true, startOfNextDay(nextDay)
|
||||
case wayland.SunPolarNight:
|
||||
return false, startOfNextDay(nextDay)
|
||||
}
|
||||
|
||||
@@ -413,13 +439,7 @@ func startOfNextDay(t time.Time) time.Time {
|
||||
}
|
||||
|
||||
func validateHourMinute(hour, minute int) bool {
|
||||
if hour < 0 || hour > 23 {
|
||||
return false
|
||||
}
|
||||
if minute < 0 || minute > 59 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59
|
||||
}
|
||||
|
||||
func (m *Manager) ValidateSchedule(startHour, startMinute, endHour, endMinute int) error {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/deps"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/distros"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/greeter"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
@@ -80,19 +81,24 @@ func (m Model) viewDependencyReview() string {
|
||||
}
|
||||
}
|
||||
|
||||
note := ""
|
||||
if dep.Name == "dms-greeter" {
|
||||
note = m.styles.Subtle.Render(" (selection replaces your current display manager)")
|
||||
}
|
||||
|
||||
var line string
|
||||
if i == m.selectedDep {
|
||||
line = fmt.Sprintf("▶ %s%s%-25s %s", reinstallMarker, variantMarker, dep.Name, status)
|
||||
if dep.Version != "" {
|
||||
line += fmt.Sprintf(" (%s)", dep.Version)
|
||||
}
|
||||
line = m.styles.SelectedOption.Render(line)
|
||||
line = m.styles.SelectedOption.Render(line) + note
|
||||
} else {
|
||||
line = fmt.Sprintf(" %s%s%-25s %s", reinstallMarker, variantMarker, dep.Name, status)
|
||||
if dep.Version != "" {
|
||||
line += fmt.Sprintf(" (%s)", dep.Version)
|
||||
}
|
||||
line = m.styles.Normal.Render(line)
|
||||
line = m.styles.Normal.Render(line) + note
|
||||
}
|
||||
|
||||
b.WriteString(line)
|
||||
@@ -115,6 +121,13 @@ func (m Model) updateDetectingDepsState(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.state = StateError
|
||||
} else {
|
||||
m.dependencies = depsMsg.deps
|
||||
// dms-greeter is opt-in skipped by default
|
||||
for _, dep := range depsMsg.deps {
|
||||
if dep.Name == "dms-greeter" {
|
||||
m.disabledItems["dms-greeter"] = true
|
||||
break
|
||||
}
|
||||
}
|
||||
m.state = StateDependencyReview
|
||||
}
|
||||
return m, m.listenForLogs()
|
||||
@@ -230,6 +243,41 @@ func (m Model) installPackages() tea.Cmd {
|
||||
// Convert installer messages to TUI messages
|
||||
go func() {
|
||||
for msg := range installerProgressChan {
|
||||
// Run optional greeter setup
|
||||
if msg.Phase == distros.PhaseComplete && msg.IsComplete && msg.Error == nil {
|
||||
greeterSelected := false
|
||||
for _, dep := range m.dependencies {
|
||||
if dep.Name == "dms-greeter" && !m.disabledItems["dms-greeter"] {
|
||||
greeterSelected = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if greeterSelected {
|
||||
compositorName := "niri"
|
||||
if m.selectedWM == 1 {
|
||||
compositorName = "Hyprland"
|
||||
}
|
||||
m.packageProgressChan <- packageInstallProgressMsg{
|
||||
progress: 0.92,
|
||||
step: "Configuring DMS greeter...",
|
||||
logOutput: "Starting automated greeter setup...",
|
||||
}
|
||||
greeterLogFunc := func(line string) {
|
||||
m.packageProgressChan <- packageInstallProgressMsg{
|
||||
progress: 0.94,
|
||||
step: "Configuring DMS greeter...",
|
||||
logOutput: line,
|
||||
}
|
||||
}
|
||||
if err := greeter.AutoSetupGreeter(compositorName, m.sudoPassword, greeterLogFunc); err != nil {
|
||||
m.packageProgressChan <- packageInstallProgressMsg{
|
||||
progress: 0.96,
|
||||
step: "Greeter setup warning",
|
||||
logOutput: fmt.Sprintf("⚠ Greeter auto-setup warning (non-fatal): %v", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tuiMsg := packageInstallProgressMsg{
|
||||
progress: msg.Progress,
|
||||
step: msg.Step,
|
||||
|
||||
@@ -864,10 +864,12 @@ func (p *NiriWritableProvider) formatRule(rule windowrules.WindowRule) string {
|
||||
|
||||
func formatSizeProperty(name, value string) string {
|
||||
parts := strings.SplitN(value, " ", 2)
|
||||
if len(parts) != 2 {
|
||||
return fmt.Sprintf(" %s { }", name)
|
||||
if len(parts) == 2 {
|
||||
return fmt.Sprintf(" %s { %s %s; }", name, parts[0], parts[1])
|
||||
}
|
||||
sizeType := parts[0]
|
||||
sizeValue := parts[1]
|
||||
return fmt.Sprintf(" %s { %s %s; }", name, sizeType, sizeValue)
|
||||
// Bare number without type prefix — default to "fixed"
|
||||
if _, err := strconv.Atoi(value); err == nil {
|
||||
return fmt.Sprintf(" %s { fixed %s; }", name, value)
|
||||
}
|
||||
return fmt.Sprintf(" %s { }", name)
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ Depends: ${misc:Depends},
|
||||
qml6-module-qtquick-templates,
|
||||
qml6-module-qtquick-window,
|
||||
qt6ct
|
||||
Suggests: cups-pk-helper
|
||||
Provides: dms
|
||||
Conflicts: dms
|
||||
Replaces: dms
|
||||
|
||||
9
distro/debian/dms-greeter/_service
Normal file
9
distro/debian/dms-greeter/_service
Normal file
@@ -0,0 +1,9 @@
|
||||
<services>
|
||||
<!-- Download dms-qml source tarball from GitHub releases (greeter + quickshell content) -->
|
||||
<service name="download_url">
|
||||
<param name="protocol">https</param>
|
||||
<param name="host">github.com</param>
|
||||
<param name="path">/AvengeMedia/DankMaterialShell/releases/download/v1.4.2/dms-qml.tar.gz</param>
|
||||
<param name="filename">dms-qml.tar.gz</param>
|
||||
</service>
|
||||
</services>
|
||||
6
distro/debian/dms-greeter/debian/changelog
Normal file
6
distro/debian/dms-greeter/debian/changelog
Normal file
@@ -0,0 +1,6 @@
|
||||
dms-greeter (1.4.2db8) unstable; urgency=medium
|
||||
|
||||
* Initial Debian OBS package
|
||||
* Port from Ubuntu/Fedora packaging
|
||||
|
||||
-- Avenge Media <AvengeMedia.US@gmail.com> Sat, 21 Feb 2026 00:00:00 +0000
|
||||
23
distro/debian/dms-greeter/debian/control
Normal file
23
distro/debian/dms-greeter/debian/control
Normal file
@@ -0,0 +1,23 @@
|
||||
Source: dms-greeter
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: Avenge Media <AvengeMedia.US@gmail.com>
|
||||
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: any
|
||||
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.
|
||||
27
distro/debian/dms-greeter/debian/copyright
Normal file
27
distro/debian/dms-greeter/debian/copyright
Normal file
@@ -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 <AvengeMedia.US@gmail.com>
|
||||
Source: https://github.com/AvengeMedia/DankMaterialShell
|
||||
|
||||
Files: *
|
||||
Copyright: 2026 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.
|
||||
108
distro/debian/dms-greeter/debian/postinst
Normal file
108
distro/debian/dms-greeter/debian/postinst
Normal file
@@ -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
|
||||
14
distro/debian/dms-greeter/debian/postrm
Normal file
14
distro/debian/dms-greeter/debian/postrm
Normal file
@@ -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
|
||||
48
distro/debian/dms-greeter/debian/rules
Normal file
48
distro/debian/dms-greeter/debian/rules
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
export DH_VERBOSE = 1
|
||||
|
||||
DEB_VERSION := $(shell dpkg-parsechangelog -S Version)
|
||||
UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed 's/-[^-]*$$//')
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_build:
|
||||
: nothing to build, we use prebuilt tarball content
|
||||
|
||||
override_dh_auto_install:
|
||||
# Same pattern as dms: upstream from combined tarball (native format)
|
||||
# Build root is either . (we're inside dms-qml) or has dms-qml/ subdir
|
||||
SOURCE_DIR=""; \
|
||||
if [ -d dms-qml ]; then SOURCE_DIR="dms-qml"; \
|
||||
elif [ -f Modules/Greetd/assets/dms-greeter ]; then SOURCE_DIR="."; \
|
||||
fi; \
|
||||
if [ -n "$$SOURCE_DIR" ]; then \
|
||||
mkdir -p debian/dms-greeter/usr/share/quickshell/dms-greeter && \
|
||||
( cd $$SOURCE_DIR && tar cf - --exclude=debian . ) | \
|
||||
( cd debian/dms-greeter/usr/share/quickshell/dms-greeter && tar xf - ) && \
|
||||
install -Dm755 $$SOURCE_DIR/Modules/Greetd/assets/dms-greeter \
|
||||
debian/dms-greeter/usr/bin/dms-greeter && \
|
||||
install -Dm644 $$SOURCE_DIR/Modules/Greetd/README.md \
|
||||
debian/dms-greeter/usr/share/doc/dms-greeter/README.md && \
|
||||
install -Dm644 $$SOURCE_DIR/LICENSE \
|
||||
debian/dms-greeter/usr/share/doc/dms-greeter/LICENSE && \
|
||||
install -Dpm0644 $$SOURCE_DIR/systemd/tmpfiles-dms-greeter.conf \
|
||||
debian/dms-greeter/usr/lib/tmpfiles.d/dms-greeter.conf; \
|
||||
else \
|
||||
echo "ERROR: No upstream source (dms-qml or Modules/Greetd/assets/dms-greeter)!" && \
|
||||
echo "Contents of current directory:" && ls -la && exit 1; \
|
||||
fi
|
||||
|
||||
# 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 dms-qml
|
||||
# When build root is dms-qml itself, we're inside it - nothing extra to remove
|
||||
dh_auto_clean
|
||||
1
distro/debian/dms-greeter/debian/source/format
Normal file
1
distro/debian/dms-greeter/debian/source/format
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (native)
|
||||
1
distro/debian/dms-greeter/debian/source/options
Normal file
1
distro/debian/dms-greeter/debian/source/options
Normal file
@@ -0,0 +1 @@
|
||||
# OBS _service downloads dms-qml.tar.gz; no extra excludes needed
|
||||
@@ -28,6 +28,7 @@ Depends: ${misc:Depends},
|
||||
qml6-module-qtquick-templates,
|
||||
qml6-module-qtquick-window,
|
||||
qt6ct
|
||||
Suggests: cups-pk-helper
|
||||
Conflicts: dms-git
|
||||
Replaces: dms-git
|
||||
Description: DankMaterialShell - Modern Wayland Desktop Shell
|
||||
|
||||
@@ -37,6 +37,7 @@ Recommends: quickshell-git
|
||||
# Recommended system packages
|
||||
Recommends: NetworkManager
|
||||
Recommends: qt6-qtmultimedia
|
||||
Suggests: cups-pk-helper
|
||||
Suggests: qt6ct
|
||||
|
||||
%description
|
||||
|
||||
@@ -28,6 +28,7 @@ Recommends: danksearch
|
||||
Recommends: matugen
|
||||
Recommends: NetworkManager
|
||||
Recommends: qt6-qtmultimedia
|
||||
Suggests: cups-pk-helper
|
||||
Suggests: qt6ct
|
||||
|
||||
%description
|
||||
|
||||
@@ -25,6 +25,7 @@ Recommends: matugen
|
||||
Recommends: quickshell-git
|
||||
Recommends: NetworkManager
|
||||
Recommends: qt6-qtmultimedia
|
||||
Suggests: cups-pk-helper
|
||||
Suggests: qt6ct
|
||||
|
||||
Provides: dms
|
||||
|
||||
322
distro/opensuse/dms-greeter.spec
Normal file
322
distro/opensuse/dms-greeter.spec
Normal file
@@ -0,0 +1,322 @@
|
||||
# Spec for DMS Greeter - OpenSUSE/OBS
|
||||
|
||||
%global debug_package %{nil}
|
||||
%global version VERSION_PLACEHOLDER
|
||||
%global pkg_summary DankMaterialShell greeter for greetd
|
||||
|
||||
Name: dms-greeter
|
||||
Version: %{version}
|
||||
Release: RELEASE_PLACEHOLDER%{?dist}
|
||||
Summary: %{pkg_summary}
|
||||
|
||||
License: MIT
|
||||
URL: https://github.com/AvengeMedia/DankMaterialShell
|
||||
|
||||
Source0: dms-qml.tar.gz
|
||||
|
||||
BuildRequires: gzip
|
||||
BuildRequires: wget
|
||||
BuildRequires: systemd-rpm-macros
|
||||
|
||||
Requires: greetd
|
||||
Requires: (quickshell-git or quickshell)
|
||||
Requires(post): /usr/sbin/useradd
|
||||
Requires(post): /usr/sbin/groupadd
|
||||
|
||||
Recommends: policycoreutils-python-utils
|
||||
Recommends: acl
|
||||
Suggests: niri
|
||||
Suggests: hyprland
|
||||
Suggests: sway
|
||||
|
||||
%description
|
||||
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.
|
||||
|
||||
%prep
|
||||
%setup -q -c -n dms-qml
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
# Install greeter files to shared data location
|
||||
install -dm755 %{buildroot}%{_datadir}/quickshell/dms-greeter
|
||||
cp -r %{_builddir}/dms-qml/* %{buildroot}%{_datadir}/quickshell/dms-greeter/
|
||||
|
||||
install -Dm755 %{_builddir}/dms-qml/Modules/Greetd/assets/dms-greeter %{buildroot}%{_bindir}/dms-greeter
|
||||
|
||||
install -Dm644 %{_builddir}/dms-qml/Modules/Greetd/README.md %{buildroot}%{_docdir}/dms-greeter/README.md
|
||||
|
||||
install -Dpm0644 %{_builddir}/dms-qml/systemd/tmpfiles-dms-greeter.conf %{buildroot}%{_tmpfilesdir}/dms-greeter.conf
|
||||
|
||||
install -Dm644 %{_builddir}/dms-qml/LICENSE %{buildroot}%{_docdir}/dms-greeter/LICENSE
|
||||
|
||||
install -dm755 %{buildroot}%{_sharedstatedir}/greeter
|
||||
|
||||
# Remove build and development files
|
||||
rm -rf %{buildroot}%{_datadir}/quickshell/dms-greeter/.git*
|
||||
rm -f %{buildroot}%{_datadir}/quickshell/dms-greeter/.gitignore
|
||||
rm -rf %{buildroot}%{_datadir}/quickshell/dms-greeter/.github
|
||||
rm -rf %{buildroot}%{_datadir}/quickshell/dms-greeter/distro
|
||||
|
||||
%posttrans
|
||||
if [ -d "%{_sysconfdir}/xdg/quickshell/dms-greeter" ]; then
|
||||
rmdir "%{_sysconfdir}/xdg/quickshell/dms-greeter" 2>/dev/null || true
|
||||
rmdir "%{_sysconfdir}/xdg/quickshell" 2>/dev/null || true
|
||||
rmdir "%{_sysconfdir}/xdg" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
%files
|
||||
%dir %{_docdir}/dms-greeter
|
||||
%license %{_docdir}/dms-greeter/LICENSE
|
||||
%doc %{_docdir}/dms-greeter/README.md
|
||||
%{_bindir}/dms-greeter
|
||||
%dir %{_datadir}/quickshell
|
||||
%{_datadir}/quickshell/dms-greeter/
|
||||
%{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
%pre
|
||||
# Create greeter user/group if they don't exist
|
||||
getent group greeter >/dev/null || groupadd -r greeter
|
||||
getent passwd greeter >/dev/null || \
|
||||
useradd -r -g greeter -d %{_sharedstatedir}/greeter -s /bin/bash \
|
||||
-c "System Greeter" greeter
|
||||
exit 0
|
||||
|
||||
%post
|
||||
# SELinux contexts (no-op on OpenSUSE - semanage/restorecon not present)
|
||||
if [ -x /usr/sbin/semanage ] && [ -x /usr/sbin/restorecon ]; then
|
||||
semanage fcontext -a -t bin_t '%{_bindir}/dms-greeter' >/dev/null 2>&1 || true
|
||||
restorecon %{_bindir}/dms-greeter >/dev/null 2>&1 || true
|
||||
semanage fcontext -a -t user_home_dir_t '%{_sharedstatedir}/greeter(/.*)?' >/dev/null 2>&1 || true
|
||||
restorecon -R %{_sharedstatedir}/greeter >/dev/null 2>&1 || true
|
||||
semanage fcontext -a -t cache_home_t '%{_localstatedir}/cache/dms-greeter(/.*)?' >/dev/null 2>&1 || true
|
||||
restorecon -R %{_localstatedir}/cache/dms-greeter >/dev/null 2>&1 || true
|
||||
semanage fcontext -a -t usr_t '%{_datadir}/quickshell/dms-greeter(/.*)?' >/dev/null 2>&1 || true
|
||||
restorecon -R %{_datadir}/quickshell/dms-greeter >/dev/null 2>&1 || true
|
||||
restorecon %{_sysconfdir}/pam.d/greetd >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
# Resolve greeter runtime account/group for distro differences
|
||||
GREETER_USER="greeter"
|
||||
for candidate in greeter greetd _greeter; do
|
||||
if getent passwd "$candidate" >/dev/null 2>&1; then
|
||||
GREETER_USER="$candidate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
GREETER_GROUP="$GREETER_USER"
|
||||
if ! getent group "$GREETER_GROUP" >/dev/null 2>&1; then
|
||||
for candidate in greeter greetd _greeter; do
|
||||
if getent group "$candidate" >/dev/null 2>&1; then
|
||||
GREETER_GROUP="$candidate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Ensure proper ownership of greeter directories
|
||||
chown -R "$GREETER_USER:$GREETER_GROUP" %{_localstatedir}/cache/dms-greeter 2>/dev/null || true
|
||||
chown -R "$GREETER_USER:$GREETER_GROUP" %{_sharedstatedir}/greeter 2>/dev/null || true
|
||||
|
||||
# Verify PAM configuration
|
||||
PAM_CONFIG="/etc/pam.d/greetd"
|
||||
write_greetd_pam_config() {
|
||||
# openSUSE and Debian families usually expose PAM stacks as common-*
|
||||
if [ -f /etc/pam.d/common-auth ] && [ -f /etc/pam.d/common-account ] && [ -f /etc/pam.d/common-password ] && [ -f /etc/pam.d/common-session ]; then
|
||||
cat > "$PAM_CONFIG" << 'PAM_EOF'
|
||||
#%PAM-1.0
|
||||
auth include common-auth
|
||||
account required pam_nologin.so
|
||||
account include common-account
|
||||
password include common-password
|
||||
session required pam_loginuid.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include common-session
|
||||
PAM_EOF
|
||||
return
|
||||
fi
|
||||
|
||||
# Fedora/RHEL style system-auth/postlogin stack
|
||||
if [ -f /etc/pam.d/system-auth ]; then
|
||||
if [ -f /etc/pam.d/postlogin ]; then
|
||||
cat > "$PAM_CONFIG" << 'PAM_EOF'
|
||||
#%PAM-1.0
|
||||
auth substack system-auth
|
||||
auth include postlogin
|
||||
account required pam_nologin.so
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session required pam_loginuid.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include system-auth
|
||||
session include postlogin
|
||||
PAM_EOF
|
||||
else
|
||||
cat > "$PAM_CONFIG" << 'PAM_EOF'
|
||||
#%PAM-1.0
|
||||
auth include system-auth
|
||||
account required pam_nologin.so
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session required pam_loginuid.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include system-auth
|
||||
PAM_EOF
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
# Last-resort conservative fallback
|
||||
cat > "$PAM_CONFIG" << 'PAM_EOF'
|
||||
#%PAM-1.0
|
||||
auth required pam_unix.so nullok
|
||||
account required pam_unix.so
|
||||
password required pam_unix.so nullok sha512
|
||||
session required pam_unix.so
|
||||
PAM_EOF
|
||||
}
|
||||
|
||||
if [ ! -f "$PAM_CONFIG" ]; then
|
||||
write_greetd_pam_config
|
||||
chmod 644 "$PAM_CONFIG"
|
||||
[ "$1" -eq 1 ] && echo "Created PAM configuration for greetd"
|
||||
else
|
||||
NEEDS_PAM_UPDATE=0
|
||||
if grep -q "common-auth" "$PAM_CONFIG"; then
|
||||
if [ ! -f /etc/pam.d/common-auth ]; then
|
||||
NEEDS_PAM_UPDATE=1
|
||||
fi
|
||||
elif grep -q "system-auth" "$PAM_CONFIG"; then
|
||||
if [ ! -f /etc/pam.d/system-auth ]; then
|
||||
NEEDS_PAM_UPDATE=1
|
||||
fi
|
||||
else
|
||||
NEEDS_PAM_UPDATE=1
|
||||
fi
|
||||
|
||||
if [ "$NEEDS_PAM_UPDATE" -eq 1 ]; then
|
||||
cp "$PAM_CONFIG" "$PAM_CONFIG.backup-dms-greeter"
|
||||
write_greetd_pam_config
|
||||
chmod 644 "$PAM_CONFIG"
|
||||
[ "$1" -eq 1 ] && echo "Updated PAM configuration (old config backed up to $PAM_CONFIG.backup-dms-greeter)"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Auto-configure greetd config
|
||||
GREETD_CONFIG="/etc/greetd/config.toml"
|
||||
CONFIG_STATUS="Not modified (already configured)"
|
||||
|
||||
COMPOSITOR=""
|
||||
for candidate in niri Hyprland sway; do
|
||||
if command -v "$candidate" >/dev/null 2>&1; then
|
||||
case "$candidate" in
|
||||
Hyprland)
|
||||
COMPOSITOR="hyprland"
|
||||
;;
|
||||
*)
|
||||
COMPOSITOR="$candidate"
|
||||
;;
|
||||
esac
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -f "$GREETD_CONFIG" ]; then
|
||||
mkdir -p /etc/greetd
|
||||
if [ -n "$COMPOSITOR" ]; then
|
||||
cat > "$GREETD_CONFIG" << 'GREETD_EOF'
|
||||
[terminal]
|
||||
vt = 1
|
||||
|
||||
[default_session]
|
||||
user = "GREETER_USER_PLACEHOLDER"
|
||||
command = "/usr/bin/dms-greeter --command COMPOSITOR_PLACEHOLDER"
|
||||
GREETD_EOF
|
||||
sed -i "s|GREETER_USER_PLACEHOLDER|$GREETER_USER|" "$GREETD_CONFIG"
|
||||
sed -i "s|COMPOSITOR_PLACEHOLDER|$COMPOSITOR|" "$GREETD_CONFIG"
|
||||
CONFIG_STATUS="Created new config with $COMPOSITOR ✓"
|
||||
else
|
||||
cat > "$GREETD_CONFIG" << 'GREETD_EOF'
|
||||
[terminal]
|
||||
vt = 1
|
||||
|
||||
[default_session]
|
||||
user = "GREETER_USER_PLACEHOLDER"
|
||||
command = "agreety --cmd /bin/login"
|
||||
GREETD_EOF
|
||||
sed -i "s|GREETER_USER_PLACEHOLDER|$GREETER_USER|" "$GREETD_CONFIG"
|
||||
CONFIG_STATUS="Created safe fallback config (no supported compositor detected)"
|
||||
fi
|
||||
elif ! grep -q "dms-greeter" "$GREETD_CONFIG"; then
|
||||
if [ -n "$COMPOSITOR" ]; then
|
||||
BACKUP_FILE="${GREETD_CONFIG}.backup-$(date +%%Y%%m%%d-%%H%%M%%S)"
|
||||
cp "$GREETD_CONFIG" "$BACKUP_FILE" 2>/dev/null || true
|
||||
sed -i "/^\[default_session\]/,/^\[/ s|^command =.*|command = \"/usr/bin/dms-greeter --command $COMPOSITOR\"|" "$GREETD_CONFIG"
|
||||
sed -i "/^\[default_session\]/,/^\[/ s|^user =.*|user = \"$GREETER_USER\"|" "$GREETD_CONFIG"
|
||||
CONFIG_STATUS="Updated existing config (backed up) with $COMPOSITOR ✓"
|
||||
else
|
||||
CONFIG_STATUS="Skipped dms-greeter command update (no supported compositor detected)"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 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
|
||||
|
||||
if [ "$1" -eq 1 ]; 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
|
||||
✓ SELinux contexts: Applied (if applicable)
|
||||
|
||||
Next steps:
|
||||
|
||||
1. Enable the greeter:
|
||||
dms greeter enable
|
||||
|
||||
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
|
||||
|
||||
%postun
|
||||
if [ "$1" -eq 0 ] && [ -x /usr/sbin/semanage ]; then
|
||||
semanage fcontext -d '%{_bindir}/dms-greeter' 2>/dev/null || true
|
||||
semanage fcontext -d '%{_sharedstatedir}/greeter(/.*)?' 2>/dev/null || true
|
||||
semanage fcontext -d '%{_localstatedir}/cache/dms-greeter(/.*)?' 2>/dev/null || true
|
||||
semanage fcontext -d '%{_datadir}/quickshell/dms-greeter(/.*)?' 2>/dev/null || true
|
||||
fi
|
||||
|
||||
%changelog
|
||||
* CHANGELOG_DATE_PLACEHOLDER AvengeMedia <contact@avengemedia.com> - VERSION_PLACEHOLDER-RELEASE_PLACEHOLDER
|
||||
- Stable release VERSION_PLACEHOLDER
|
||||
- Initial OpenSUSE/OBS port from Fedora
|
||||
@@ -27,6 +27,7 @@ Recommends: danksearch
|
||||
Recommends: matugen
|
||||
Recommends: NetworkManager
|
||||
Recommends: qt6-qtmultimedia
|
||||
Suggests: cups-pk-helper
|
||||
Suggests: qt6ct
|
||||
|
||||
%description
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
OBS_BASE_PROJECT="home:AvengeMedia"
|
||||
OBS_BASE="$HOME/.cache/osc-checkouts"
|
||||
|
||||
ALL_PACKAGES=(dms dms-git)
|
||||
ALL_PACKAGES=(dms dms-git dms-greeter)
|
||||
|
||||
REPOS=("Debian_13" "openSUSE_Tumbleweed" "16.0")
|
||||
ARCHES=("x86_64" "aarch64")
|
||||
@@ -41,6 +41,9 @@ for pkg in "${PACKAGES[@]}"; do
|
||||
dms-git)
|
||||
PROJECT="$OBS_BASE_PROJECT:dms-git"
|
||||
;;
|
||||
dms-greeter)
|
||||
PROJECT="$OBS_BASE_PROJECT:danklinux"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown package '$pkg'"
|
||||
continue
|
||||
@@ -74,11 +77,15 @@ for pkg in "${PACKAGES[@]}"; do
|
||||
COLOR="\033[0;32m" # Green
|
||||
SYMBOL="✅"
|
||||
;;
|
||||
failed)
|
||||
failed|broken|broken*)
|
||||
COLOR="\033[0;31m" # Red
|
||||
SYMBOL="❌"
|
||||
FAILED_BUILDS+=("$repo $arch")
|
||||
;;
|
||||
blocked)
|
||||
COLOR="\033[0;33m" # Yellow
|
||||
SYMBOL="⏸️"
|
||||
;;
|
||||
unresolvable)
|
||||
COLOR="\033[0;33m" # Yellow
|
||||
SYMBOL="⚠️"
|
||||
|
||||
@@ -68,13 +68,14 @@ fi
|
||||
|
||||
OBS_BASE_PROJECT="home:AvengeMedia"
|
||||
OBS_BASE="$HOME/.cache/osc-checkouts"
|
||||
AVAILABLE_PACKAGES=(dms dms-git)
|
||||
AVAILABLE_PACKAGES=(dms dms-git dms-greeter)
|
||||
|
||||
if [[ -z "$PACKAGE" ]]; then
|
||||
echo "Available packages:"
|
||||
echo ""
|
||||
echo " 1. dms - Stable DMS"
|
||||
echo " 2. dms-git - Nightly DMS"
|
||||
echo " 3. dms-greeter - DMS greeter for greetd"
|
||||
echo " a. all"
|
||||
echo ""
|
||||
read -r -p "Select package (1-${#AVAILABLE_PACKAGES[@]}, a): " selection
|
||||
@@ -141,7 +142,12 @@ check_obs_version_exists() {
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
echo "⚠️ Could not fetch OBS spec (API may be unavailable), proceeding anyway"
|
||||
# Empty/invalid response: expected on first upload (no spec on server yet), or actual API failure
|
||||
if [[ -z "$OBS_SPEC" ]]; then
|
||||
echo " No existing spec on OBS (first upload?) - proceeding"
|
||||
else
|
||||
echo "⚠️ Could not fetch OBS spec (API may be unavailable), proceeding anyway"
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
return 1
|
||||
@@ -168,6 +174,22 @@ update_debian_dms_service() {
|
||||
sed -i "s|/releases/download/v[0-9][^\"]*/dms-distropkg-arm64\.gz|/releases/download/v${base_version}/dms-distropkg-arm64.gz|" "$service_path"
|
||||
}
|
||||
|
||||
update_debian_dms_greeter_service() {
|
||||
local service_path="$1"
|
||||
if [[ -z "$service_path" || ! -f "$service_path" ]]; then
|
||||
return 0
|
||||
fi
|
||||
if [[ -z "$CHANGELOG_VERSION" ]]; then
|
||||
return 0
|
||||
fi
|
||||
local base_version
|
||||
base_version=$(echo "$CHANGELOG_VERSION" | sed -E 's/^([0-9]+(\.[0-9]+)*).*/\1/')
|
||||
if [[ -z "$base_version" ]]; then
|
||||
return 0
|
||||
fi
|
||||
sed -i "s|/releases/download/v[0-9][^\"]*/dms-qml\.tar\.gz|/releases/download/v${base_version}/dms-qml.tar.gz|" "$service_path"
|
||||
}
|
||||
|
||||
update_opensuse_git_spec() {
|
||||
local spec_path="$1"
|
||||
if [[ -z "$spec_path" || ! -f "$spec_path" ]]; then
|
||||
@@ -248,6 +270,9 @@ dms)
|
||||
dms-git)
|
||||
PROJECT="dms-git"
|
||||
;;
|
||||
dms-greeter)
|
||||
PROJECT="danklinux"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown package '$PACKAGE'"
|
||||
exit 1
|
||||
@@ -329,9 +354,11 @@ if [[ -d "distro/debian/$PACKAGE/debian" ]]; then
|
||||
echo " - Applied rebuild suffix: $CHANGELOG_VERSION"
|
||||
fi
|
||||
|
||||
# Keep Debian dms _service in sync with changelog version
|
||||
# Keep Debian _service in sync with changelog version
|
||||
if [[ "$PACKAGE" == "dms" ]] && [[ -f "distro/debian/$PACKAGE/_service" ]]; then
|
||||
update_debian_dms_service "distro/debian/$PACKAGE/_service"
|
||||
elif [[ "$PACKAGE" == "dms-greeter" ]] && [[ -f "distro/debian/$PACKAGE/_service" ]]; then
|
||||
update_debian_dms_greeter_service "distro/debian/$PACKAGE/_service"
|
||||
fi
|
||||
|
||||
# Check if this version already exists in OBS
|
||||
@@ -341,6 +368,12 @@ if [[ -d "distro/debian/$PACKAGE/debian" ]]; then
|
||||
if [[ "$PACKAGE" == *"-git" ]]; then
|
||||
echo "==> Error: This commit is already uploaded to OBS"
|
||||
echo " The same git commit ($(echo "$CHANGELOG_VERSION" | grep -oP '[a-f0-9]{8}' | tail -1)) already exists on OBS."
|
||||
if [[ -n "${GITHUB_ACTIONS:-}" ]] || [[ -n "${CI:-}" ]]; then
|
||||
echo " CI run detected: skipping upload as a no-op (already up to date)."
|
||||
echo " If you need to force rebuild this same commit, set REBUILD_RELEASE (e.g. 2, 3, ...)."
|
||||
echo "✓ Exiting gracefully (no changes needed)"
|
||||
exit 0
|
||||
fi
|
||||
echo " To rebuild the same commit, specify a rebuild number:"
|
||||
echo " ./distro/scripts/obs-upload.sh $PACKAGE 2"
|
||||
echo " ./distro/scripts/obs-upload.sh $PACKAGE 3"
|
||||
@@ -379,6 +412,13 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ -f "distro/opensuse/$PACKAGE.spec" ]];
|
||||
|
||||
if [[ "$PACKAGE" == *"-git" ]] && [[ -n "$CHANGELOG_VERSION" ]]; then
|
||||
update_opensuse_git_spec "$WORK_DIR/$PACKAGE.spec"
|
||||
elif [[ "$PACKAGE" == "dms-greeter" ]] && [[ -n "$CHANGELOG_VERSION" ]]; then
|
||||
DMS_GREETER_BASE_VERSION=$(echo "$CHANGELOG_VERSION" | sed -E 's/^([0-9]+(\.[0-9]+)*).*/\1/')
|
||||
DMS_GREETER_RELEASE=$(echo "$CHANGELOG_VERSION" | sed -E 's/.*db([0-9]+)$/\1/' || echo "1")
|
||||
CHANGELOG_DATE=$(date '+%a %b %d %Y')
|
||||
sed -i "s/VERSION_PLACEHOLDER/${DMS_GREETER_BASE_VERSION}/g" "$WORK_DIR/$PACKAGE.spec"
|
||||
sed -i "s/RELEASE_PLACEHOLDER/${DMS_GREETER_RELEASE}/g" "$WORK_DIR/$PACKAGE.spec"
|
||||
sed -i "s/CHANGELOG_DATE_PLACEHOLDER/${CHANGELOG_DATE}/g" "$WORK_DIR/$PACKAGE.spec"
|
||||
fi
|
||||
|
||||
if [[ -f "$WORK_DIR/.osc/$PACKAGE.spec" ]]; then
|
||||
@@ -444,6 +484,24 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ "$UPLOAD_DEBIAN" == false ]] && [[ -f
|
||||
fi
|
||||
fi
|
||||
|
||||
# For dms-greeter: download dms-qml.tar.gz from _service URL
|
||||
if [[ -z "${SOURCE_DIR:-}" ]] && [[ "$PACKAGE" == "dms-greeter" ]] && [[ -f "distro/debian/$PACKAGE/_service" ]]; then
|
||||
DMS_GREETER_URL=$(grep -A 5 'name="download_url"' "distro/debian/$PACKAGE/_service" | grep "path" | sed 's/.*<param name="path">\(.*\)<\/param>.*/\1/' | head -1)
|
||||
if [[ -n "$DMS_GREETER_URL" ]]; then
|
||||
DMS_GREETER_FULL_URL="https://github.com${DMS_GREETER_URL}"
|
||||
echo " Downloading dms-greeter source from: $DMS_GREETER_FULL_URL"
|
||||
if wget -q -O "$TEMP_DIR/dms-qml.tar.gz" "$DMS_GREETER_FULL_URL" 2>/dev/null || \
|
||||
curl -L -f -s -o "$TEMP_DIR/dms-qml.tar.gz" "$DMS_GREETER_FULL_URL" 2>/dev/null; then
|
||||
cd "$TEMP_DIR"
|
||||
tar -xzf dms-qml.tar.gz
|
||||
if [[ -f "Modules/Greetd/assets/dms-greeter" ]]; then
|
||||
SOURCE_DIR="$TEMP_DIR"
|
||||
fi
|
||||
cd "$REPO_ROOT"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "$SOURCE_DIR" && -d "$SOURCE_DIR" ]]; then
|
||||
SOURCE0=$(grep "^Source0:" "distro/opensuse/$PACKAGE.spec" | awk '{print $2}' | head -1)
|
||||
|
||||
@@ -452,6 +510,15 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ "$UPLOAD_DEBIAN" == false ]] && [[ -f
|
||||
cd "$OBS_TARBALL_DIR"
|
||||
|
||||
case "$PACKAGE" in
|
||||
dms-greeter)
|
||||
EXPECTED_DIR="dms-qml"
|
||||
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
||||
mkdir -p "$EXPECTED_DIR"
|
||||
cp -a "$SOURCE_DIR"/. "$EXPECTED_DIR/"
|
||||
tar -czf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||
rm -rf "$EXPECTED_DIR"
|
||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||
;;
|
||||
dms)
|
||||
DMS_VERSION=$(grep "^Version:" "$REPO_ROOT/distro/opensuse/$PACKAGE.spec" | sed 's/^Version:[[:space:]]*//' | head -1)
|
||||
EXPECTED_DIR="DankMaterialShell-${DMS_VERSION}"
|
||||
@@ -584,6 +651,17 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
||||
if [[ -z "$SOURCE_DIR" ]]; then
|
||||
SOURCE_DIR=$(find . -maxdepth 1 -type d ! -name "." | head -1)
|
||||
fi
|
||||
# dms-qml.tar.gz extracts flat (quickshell contents, no top-level dir)
|
||||
# Create dms-qml wrapper so combined tarball has correct top-level dir (like dms)
|
||||
if [[ "$PACKAGE" == "dms-greeter" ]] && [[ -f "Modules/Greetd/assets/dms-greeter" ]]; then
|
||||
mkdir -p dms-qml
|
||||
for f in *; do
|
||||
if [[ -e "$f" && "$f" != "dms-qml" && "$f" != "source-archive" ]]; then
|
||||
mv "$f" dms-qml/ 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
SOURCE_DIR="dms-qml"
|
||||
fi
|
||||
if [[ -z "$SOURCE_DIR" || ! -d "$SOURCE_DIR" ]]; then
|
||||
echo "Error: Failed to extract source archive or find source directory"
|
||||
echo "Contents of $TEMP_DIR:"
|
||||
@@ -660,6 +738,21 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
||||
cd "$OBS_TARBALL_DIR"
|
||||
|
||||
case "$PACKAGE" in
|
||||
dms-greeter)
|
||||
EXPECTED_DIR="dms-qml"
|
||||
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
||||
mkdir -p "$EXPECTED_DIR"
|
||||
cp -a "$SOURCE_DIR"/. "$EXPECTED_DIR/"
|
||||
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||
else
|
||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||
fi
|
||||
rm -rf "$EXPECTED_DIR"
|
||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||
;;
|
||||
dms)
|
||||
DMS_VERSION=$(grep "^Version:" "$REPO_ROOT/distro/opensuse/$PACKAGE.spec" | sed 's/^Version:[[:space:]]*//' | head -1)
|
||||
EXPECTED_DIR="DankMaterialShell-${DMS_VERSION}"
|
||||
@@ -709,10 +802,17 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
||||
echo " - OpenSUSE source tarballs created"
|
||||
fi
|
||||
|
||||
# Copy and update OpenSUSE spec file with the correct version (for -git packages)
|
||||
# Copy and update OpenSUSE spec file with the correct version
|
||||
cp "distro/opensuse/$PACKAGE.spec" "$WORK_DIR/"
|
||||
if [[ "$PACKAGE" == *"-git" ]] && [[ -n "$CHANGELOG_VERSION" ]]; then
|
||||
update_opensuse_git_spec "$WORK_DIR/$PACKAGE.spec"
|
||||
elif [[ "$PACKAGE" == "dms-greeter" ]] && [[ -n "$CHANGELOG_VERSION" ]]; then
|
||||
DMS_GREETER_BASE_VERSION=$(echo "$CHANGELOG_VERSION" | sed -E 's/^([0-9]+(\.[0-9]+)*).*/\1/')
|
||||
DMS_GREETER_RELEASE=$(echo "$CHANGELOG_VERSION" | sed -E 's/.*db([0-9]+)$/\1/' || echo "1")
|
||||
CHANGELOG_DATE=$(date '+%a %b %d %Y')
|
||||
sed -i "s/VERSION_PLACEHOLDER/${DMS_GREETER_BASE_VERSION}/g" "$WORK_DIR/$PACKAGE.spec"
|
||||
sed -i "s/RELEASE_PLACEHOLDER/${DMS_GREETER_RELEASE}/g" "$WORK_DIR/$PACKAGE.spec"
|
||||
sed -i "s/CHANGELOG_DATE_PLACEHOLDER/${CHANGELOG_DATE}/g" "$WORK_DIR/$PACKAGE.spec"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -839,8 +939,48 @@ EOF
|
||||
echo " - Quilt format detected: creating debian.tar.gz"
|
||||
tar -czf "$WORK_DIR/debian.tar.gz" -C "distro/debian/$PACKAGE" debian/
|
||||
|
||||
# For dms-greeter: create orig tarball so Debian build gets upstream (OBS only passes .dsc Files to Debian)
|
||||
DSC_FILES_DEBIAN=""
|
||||
if [[ "$PACKAGE" == "dms-greeter" ]]; then
|
||||
UPSTREAM_VER=$(echo "$VERSION" | sed 's/-[^-]*$//')
|
||||
ORIG_TARBALL="${PACKAGE}_${UPSTREAM_VER}.orig.tar.gz"
|
||||
ORIG_DIR="${PACKAGE}-${UPSTREAM_VER}"
|
||||
|
||||
if [[ -f "distro/debian/$PACKAGE/_service" ]] && grep -q "download_url" "distro/debian/$PACKAGE/_service"; then
|
||||
DG_TEMP=$(mktemp -d)
|
||||
DMS_GREETER_PATH=$(grep -A 5 'name="download_url"' "distro/debian/$PACKAGE/_service" | grep "path" | sed 's/.*<param name="path">\(.*\)<\/param>.*/\1/' | head -1)
|
||||
if [[ -n "$DMS_GREETER_PATH" ]]; then
|
||||
DG_URL="https://github.com${DMS_GREETER_PATH}"
|
||||
echo " - Downloading dms-greeter source for orig tarball: $DG_URL"
|
||||
if wget -q -O "$DG_TEMP/dms-qml.tar.gz" "$DG_URL" 2>/dev/null || curl -L -f -s -o "$DG_TEMP/dms-qml.tar.gz" "$DG_URL" 2>/dev/null; then
|
||||
( cd "$DG_TEMP" && tar --no-same-owner -xzf dms-qml.tar.gz && mkdir -p "$ORIG_DIR" && \
|
||||
for f in *; do [[ "$f" != "dms-qml.tar.gz" && "$f" != "$ORIG_DIR" ]] && mv "$f" "$ORIG_DIR/"; done )
|
||||
if [[ -d "$DG_TEMP/$ORIG_DIR/Modules" ]] || [[ -f "$DG_TEMP/$ORIG_DIR/LICENSE" ]]; then
|
||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czf "$WORK_DIR/$ORIG_TARBALL" -C "$DG_TEMP" "$ORIG_DIR"
|
||||
ORIG_MD5=$(md5sum "$WORK_DIR/$ORIG_TARBALL" | cut -d' ' -f1)
|
||||
ORIG_SIZE=$(stat -c%s "$WORK_DIR/$ORIG_TARBALL" 2>/dev/null || stat -f%z "$WORK_DIR/$ORIG_TARBALL" 2>/dev/null)
|
||||
DSC_FILES_DEBIAN=" $ORIG_MD5 $ORIG_SIZE $ORIG_TARBALL
|
||||
"
|
||||
echo " - Created $ORIG_TARBALL for Debian orig"
|
||||
fi
|
||||
rm -rf "$DG_TEMP"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
DEBIAN_MD5=$(md5sum "$WORK_DIR/debian.tar.gz" | cut -d' ' -f1)
|
||||
DEBIAN_SIZE=$(stat -c%s "$WORK_DIR/debian.tar.gz" 2>/dev/null || stat -f%z "$WORK_DIR/debian.tar.gz" 2>/dev/null)
|
||||
|
||||
echo " - Generating $PACKAGE.dsc for quilt format"
|
||||
cat >"$WORK_DIR/$PACKAGE.dsc" <<EOF
|
||||
# debtransform: DEBTRANSFORM-TAR = orig (upstream), DEBTRANSFORM-FILES-TAR = debian archive
|
||||
DEBTRANSFORM_EXTRA=""
|
||||
if [[ -n "$DSC_FILES_DEBIAN" ]] && [[ -n "$ORIG_TARBALL" ]]; then
|
||||
DEBTRANSFORM_EXTRA="DEBTRANSFORM-TAR: $ORIG_TARBALL
|
||||
DEBTRANSFORM-FILES-TAR: debian.tar.gz
|
||||
"
|
||||
fi
|
||||
cat >"$WORK_DIR/$PACKAGE.dsc" <<DSCEOF
|
||||
Format: 3.0 (quilt)
|
||||
Source: $PACKAGE
|
||||
Binary: $PACKAGE
|
||||
@@ -848,10 +988,9 @@ Architecture: any
|
||||
Version: $VERSION
|
||||
Maintainer: Avenge Media <AvengeMedia.US@gmail.com>
|
||||
Build-Depends: debhelper-compat (= 13), wget, gzip
|
||||
DEBTRANSFORM-TAR: debian.tar.gz
|
||||
Files:
|
||||
00000000000000000000000000000000 1 debian.tar.gz
|
||||
EOF
|
||||
${DEBTRANSFORM_EXTRA}Files:${DSC_FILES_DEBIAN}
|
||||
$DEBIAN_MD5 $DEBIAN_SIZE debian.tar.gz
|
||||
DSCEOF
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -882,6 +1021,13 @@ if [[ -n "$OBS_FILES" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Keep current orig tarball for dms-greeter (Debian 3.0 quilt needs it)
|
||||
UPSTREAM_VER_CLEAN=$(echo "$CHANGELOG_VERSION" | sed 's/-[^-]*$//' 2>/dev/null)
|
||||
if [[ "$PACKAGE" == "dms-greeter" ]] && [[ "$old_file" == "${PACKAGE}_${UPSTREAM_VER_CLEAN}.orig.tar.gz" ]]; then
|
||||
echo " - Keeping orig tarball: $old_file"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "$old_file" == "${PACKAGE}-source.tar.gz" ]]; then
|
||||
echo " - Keeping source tarball: $old_file"
|
||||
continue
|
||||
|
||||
@@ -28,8 +28,17 @@ override_dh_auto_build:
|
||||
# Launchpad build environment has no internet access
|
||||
test -d dms-git-repo || (echo "ERROR: dms-git-repo directory not found!" && exit 1)
|
||||
|
||||
# Patch go.mod to use Go 1.24 base version (Ubuntu has 1.24.4, project requires 1.24.6)
|
||||
sed -i 's/^go 1\.24\.[0-9]*/go 1.24/' dms-git-repo/core/go.mod
|
||||
# Patch go.mod for Launchpad: align go directive w/latest Go toolchain
|
||||
GO_VERSION=$$(go env GOVERSION | sed -E 's/^go([0-9]+\.[0-9]+).*/\1/'); \
|
||||
if [ -n "$$GO_VERSION" ]; then \
|
||||
sed -E -i "s/^go 1\.[0-9]+(\.[0-9]+)?/go $$GO_VERSION/" dms-git-repo/core/go.mod; \
|
||||
if [ -f dms-git-repo/core/vendor/modules.txt ]; then \
|
||||
sed -E -i "s/^(## explicit; go )1\.[0-9]+(\.[0-9]+)?$$/\1$$GO_VERSION/" dms-git-repo/core/vendor/modules.txt; \
|
||||
fi; \
|
||||
else \
|
||||
echo "Warning: Could not detect Go version, leaving go.mod go directive unchanged"; \
|
||||
fi
|
||||
sed -E -i '/^toolchain go[0-9.]+$$/d' dms-git-repo/core/go.mod
|
||||
|
||||
# Build dms-cli from source
|
||||
# Detect architecture
|
||||
|
||||
6
flake.lock
generated
6
flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1769018530,
|
||||
"narHash": "sha256-MJ27Cy2NtBEV5tsK+YraYr2g851f3Fl1LpNHDzDX15c=",
|
||||
"lastModified": 1771369470,
|
||||
"narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "88d3861acdd3d2f0e361767018218e51810df8a1",
|
||||
"rev": "0182a361324364ae3f436a63005877674cf45efb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
inherit version;
|
||||
pname = "dms-shell";
|
||||
src = ./core;
|
||||
vendorHash = "sha256-cVUJXgzYMRSM0od1xzDVkMTdxHu3OIQX2bQ8AJbGQ1Q=";
|
||||
vendorHash = "sha256-dEk7IOd6aQwaxZruxQclN7TGMyb8EJOl6NBWRsoZ9HQ=";
|
||||
|
||||
subPackages = [ "cmd/dms" ];
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import QtCore
|
||||
import qs.Services
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
@@ -83,7 +84,12 @@ Singleton {
|
||||
if (desktopEntry && desktopEntry.icon) {
|
||||
return Quickshell.iconPath(desktopEntry.icon, true);
|
||||
}
|
||||
return Quickshell.iconPath(appId, true);
|
||||
|
||||
const icon = Quickshell.iconPath(appId, true);
|
||||
if (icon && icon !== "")
|
||||
return icon;
|
||||
|
||||
return DesktopService.resolveIconPath(appId);
|
||||
}
|
||||
|
||||
function getAppName(appId: string, desktopEntry: var): string {
|
||||
|
||||
@@ -126,6 +126,10 @@ Singleton {
|
||||
property var hiddenOutputDeviceNames: []
|
||||
property var hiddenInputDeviceNames: []
|
||||
|
||||
property string launcherLastMode: "all"
|
||||
property string appDrawerLastMode: "apps"
|
||||
property string niriOverviewLastMode: "apps"
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!isGreeterMode) {
|
||||
loadSettings();
|
||||
@@ -1100,6 +1104,21 @@ Singleton {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function setLauncherLastMode(mode) {
|
||||
launcherLastMode = mode;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function setAppDrawerLastMode(mode) {
|
||||
appDrawerLastMode = mode;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function setNiriOverviewLastMode(mode) {
|
||||
niriOverviewLastMode = mode;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function syncWallpaperForCurrentMode() {
|
||||
if (!perModeWallpaper)
|
||||
return;
|
||||
|
||||
@@ -518,7 +518,7 @@ Singleton {
|
||||
property int osdPosition: SettingsData.Position.BottomCenter
|
||||
property bool osdVolumeEnabled: true
|
||||
property bool osdMediaVolumeEnabled: true
|
||||
property bool osdMediaPlaybackEnabled: true
|
||||
property bool osdMediaPlaybackEnabled: false
|
||||
property bool osdBrightnessEnabled: true
|
||||
property bool osdIdleInhibitorEnabled: true
|
||||
property bool osdMicMuteEnabled: true
|
||||
@@ -572,6 +572,10 @@ Singleton {
|
||||
"widgetTransparency": 1.0,
|
||||
"squareCorners": false,
|
||||
"noBackground": false,
|
||||
"maximizeWidgetIcons": false,
|
||||
"maximizeWidgetText": false,
|
||||
"removeWidgetPadding": false,
|
||||
"widgetPadding": 8,
|
||||
"gothCornersEnabled": false,
|
||||
"gothCornerRadiusOverride": false,
|
||||
"gothCornerRadiusValue": 12,
|
||||
@@ -584,6 +588,7 @@ Singleton {
|
||||
"widgetOutlineOpacity": 1.0,
|
||||
"widgetOutlineThickness": 1,
|
||||
"fontScale": 1.0,
|
||||
"iconScale": 1.0,
|
||||
"autoHide": false,
|
||||
"autoHideDelay": 250,
|
||||
"showOnWindowsOpen": false,
|
||||
@@ -1026,6 +1031,7 @@ Singleton {
|
||||
elif command -v dconf >/dev/null 2>&1; then
|
||||
dconf read /org/gnome/desktop/interface/icon-theme 2>/dev/null | sed "s/'//g"
|
||||
fi`;
|
||||
|
||||
Proc.runCommand("detectCosmicIconTheme", ["sh", "-c", detectScript], (output, exitCode) => {
|
||||
if (exitCode !== 0)
|
||||
return;
|
||||
|
||||
@@ -961,7 +961,6 @@ Singleton {
|
||||
}
|
||||
|
||||
if (!isGreeterMode) {
|
||||
// Skip with matugen because, our script runner will do it.
|
||||
if (!matugenAvailable) {
|
||||
PortalService.setLightMode(light);
|
||||
}
|
||||
@@ -1170,21 +1169,23 @@ Singleton {
|
||||
return (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) < 0.5;
|
||||
}
|
||||
|
||||
function barIconSize(barThickness, offset, noBackground) {
|
||||
function barIconSize(barThickness, offset, maximizeIcon, iconScale) {
|
||||
const defaultOffset = offset !== undefined ? offset : -6;
|
||||
const size = (noBackground ?? false) ? iconSizeLarge : iconSize;
|
||||
const size = (maximizeIcon ?? false) ? iconSizeLarge : iconSize;
|
||||
const s = iconScale !== undefined ? iconScale : 1.0;
|
||||
|
||||
return Math.round((barThickness / 48) * (size + defaultOffset));
|
||||
return Math.round((barThickness / 48) * (size + defaultOffset) * s);
|
||||
}
|
||||
|
||||
function barTextSize(barThickness, fontScale) {
|
||||
function barTextSize(barThickness, fontScale, maximizeText) {
|
||||
const scale = barThickness / 48;
|
||||
const dankBarScale = fontScale !== undefined ? fontScale : 1.0;
|
||||
const maxScale = (maximizeText ?? false) ? 1.5 : 1.0;
|
||||
if (scale <= 0.75)
|
||||
return Math.round(fontSizeSmall * 0.9 * dankBarScale);
|
||||
return Math.round(fontSizeSmall * 0.9 * dankBarScale * maxScale);
|
||||
if (scale >= 1.25)
|
||||
return Math.round(fontSizeMedium * dankBarScale);
|
||||
return Math.round(fontSizeSmall * dankBarScale);
|
||||
return Math.round(fontSizeMedium * dankBarScale * maxScale);
|
||||
return Math.round(fontSizeSmall * dankBarScale * maxScale);
|
||||
}
|
||||
|
||||
function getBatteryIcon(level, isCharging, batteryAvailable) {
|
||||
|
||||
@@ -77,7 +77,11 @@ var SPEC = {
|
||||
|
||||
deviceMaxVolumes: { def: {} },
|
||||
hiddenOutputDeviceNames: { def: [] },
|
||||
hiddenInputDeviceNames: { def: [] }
|
||||
hiddenInputDeviceNames: { def: [] },
|
||||
|
||||
launcherLastMode: { def: "all" },
|
||||
appDrawerLastMode: { def: "apps" },
|
||||
niriOverviewLastMode: { def: "apps" }
|
||||
};
|
||||
|
||||
function getValidKeys() {
|
||||
|
||||
@@ -341,7 +341,7 @@ var SPEC = {
|
||||
osdPosition: { def: 5 },
|
||||
osdVolumeEnabled: { def: true },
|
||||
osdMediaVolumeEnabled: { def: true },
|
||||
osdMediaPlaybackEnabled: { def: true },
|
||||
osdMediaPlaybackEnabled: { def: false },
|
||||
osdBrightnessEnabled: { def: true },
|
||||
osdIdleInhibitorEnabled: { def: true },
|
||||
osdMicMuteEnabled: { def: true },
|
||||
@@ -395,6 +395,10 @@ var SPEC = {
|
||||
widgetTransparency: 1.0,
|
||||
squareCorners: false,
|
||||
noBackground: false,
|
||||
maximizeWidgetIcons: false,
|
||||
maximizeWidgetText: false,
|
||||
removeWidgetPadding: false,
|
||||
widgetPadding: 8,
|
||||
gothCornersEnabled: false,
|
||||
gothCornerRadiusOverride: false,
|
||||
gothCornerRadiusValue: 12,
|
||||
@@ -407,6 +411,7 @@ var SPEC = {
|
||||
widgetOutlineOpacity: 1.0,
|
||||
widgetOutlineThickness: 1,
|
||||
fontScale: 1.0,
|
||||
iconScale: 1.0,
|
||||
autoHide: false,
|
||||
autoHideDelay: 250,
|
||||
showOnWindowsOpen: false,
|
||||
|
||||
@@ -142,25 +142,45 @@ Item {
|
||||
fadeDpmsWindowLoader.item.cancelFade();
|
||||
}
|
||||
}
|
||||
|
||||
function onRequestMonitorOn() {
|
||||
if (!fadeDpmsWindowLoader.item)
|
||||
return;
|
||||
fadeDpmsWindowLoader.item.cancelFade();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property string _barLayoutStateJson: {
|
||||
const configs = SettingsData.barConfigs;
|
||||
const mapped = configs.map(c => ({
|
||||
id: c.id,
|
||||
position: c.position,
|
||||
autoHide: c.autoHide,
|
||||
visible: c.visible
|
||||
})).sort((a, b) => {
|
||||
const aVertical = a.position === SettingsData.Position.Left || a.position === SettingsData.Position.Right;
|
||||
const bVertical = b.position === SettingsData.Position.Left || b.position === SettingsData.Position.Right;
|
||||
if (aVertical !== bVertical) {
|
||||
return aVertical - bVertical;
|
||||
}
|
||||
return String(a.id).localeCompare(String(b.id));
|
||||
});
|
||||
return JSON.stringify(mapped);
|
||||
}
|
||||
|
||||
on_BarLayoutStateJsonChanged: {
|
||||
if (typeof dockRecreateDebounce !== "undefined") {
|
||||
dockRecreateDebounce.restart();
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: dankBarRepeater
|
||||
model: ScriptModel {
|
||||
id: barRepeaterModel
|
||||
values: {
|
||||
const configs = SettingsData.barConfigs;
|
||||
return configs.map(c => ({
|
||||
id: c.id,
|
||||
position: c.position
|
||||
})).sort((a, b) => {
|
||||
const aVertical = a.position === SettingsData.Position.Left || a.position === SettingsData.Position.Right;
|
||||
const bVertical = b.position === SettingsData.Position.Left || b.position === SettingsData.Position.Right;
|
||||
return aVertical - bVertical;
|
||||
});
|
||||
}
|
||||
values: JSON.parse(root._barLayoutStateJson)
|
||||
}
|
||||
|
||||
property var hyprlandOverviewLoaderRef: hyprlandOverviewLoader
|
||||
@@ -207,13 +227,6 @@ Item {
|
||||
PolkitService.polkitAvailable;
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onBarConfigsChanged() {
|
||||
dockRecreateDebounce.restart();
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: dockLoader
|
||||
active: root.dockEnabled
|
||||
@@ -265,6 +278,7 @@ Item {
|
||||
sourceComponent: Component {
|
||||
DankDashPopout {
|
||||
id: dankDashPopout
|
||||
onPopoutClosed: PopoutService.unloadDankDash()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,8 +298,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.notificationCenterLoader = notificationCenterLoader;
|
||||
}
|
||||
|
||||
NotificationCenterPopout {
|
||||
id: notificationCenter
|
||||
onPopoutClosed: PopoutService.unloadNotificationCenter()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.notificationCenterPopout = notificationCenter;
|
||||
@@ -309,10 +328,15 @@ Item {
|
||||
property var modalRef: colorPickerModal
|
||||
property LazyLoader powerModalLoaderRef: powerMenuModalLoader
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.controlCenterLoader = controlCenterLoader;
|
||||
}
|
||||
|
||||
ControlCenterPopout {
|
||||
id: controlCenterPopout
|
||||
colorPickerModal: controlCenterLoader.modalRef
|
||||
powerMenuModalLoader: controlCenterLoader.powerModalLoaderRef
|
||||
onPopoutClosed: PopoutService.unloadControlCenter()
|
||||
|
||||
onLockRequested: {
|
||||
lock.activate();
|
||||
@@ -420,8 +444,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.batteryPopoutLoader = batteryPopoutLoader;
|
||||
}
|
||||
|
||||
BatteryPopout {
|
||||
id: batteryPopout
|
||||
onPopoutClosed: PopoutService.unloadBattery()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.batteryPopout = batteryPopout;
|
||||
@@ -434,8 +463,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.layoutPopoutLoader = layoutPopoutLoader;
|
||||
}
|
||||
|
||||
DWLLayoutPopout {
|
||||
id: layoutPopout
|
||||
onPopoutClosed: PopoutService.unloadLayoutPopout()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.layoutPopout = layoutPopout;
|
||||
@@ -448,8 +482,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.vpnPopoutLoader = vpnPopoutLoader;
|
||||
}
|
||||
|
||||
VpnPopout {
|
||||
id: vpnPopout
|
||||
onPopoutClosed: PopoutService.unloadVpn()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.vpnPopout = vpnPopout;
|
||||
@@ -462,8 +501,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.processListPopoutLoader = processListPopoutLoader;
|
||||
}
|
||||
|
||||
ProcessListPopout {
|
||||
id: processListPopout
|
||||
onPopoutClosed: PopoutService.unloadProcessListPopout()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.processListPopout = processListPopout;
|
||||
@@ -506,8 +550,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.appDrawerLoader = appDrawerLoader;
|
||||
}
|
||||
|
||||
AppDrawerPopout {
|
||||
id: appDrawerPopout
|
||||
onPopoutClosed: PopoutService.unloadAppDrawer()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.appDrawerPopout = appDrawerPopout;
|
||||
@@ -539,8 +588,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.clipboardHistoryPopoutLoader = clipboardHistoryPopoutLoader;
|
||||
}
|
||||
|
||||
ClipboardHistoryPopout {
|
||||
id: clipboardHistoryPopout
|
||||
onPopoutClosed: PopoutService.unloadClipboardHistoryPopout()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.clipboardHistoryPopout = clipboardHistoryPopout;
|
||||
@@ -715,8 +769,13 @@ Item {
|
||||
|
||||
active: false
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.systemUpdateLoader = systemUpdateLoader;
|
||||
}
|
||||
|
||||
SystemUpdatePopout {
|
||||
id: systemUpdatePopout
|
||||
onPopoutClosed: PopoutService.unloadSystemUpdate()
|
||||
|
||||
Component.onCompleted: {
|
||||
PopoutService.systemUpdatePopout = systemUpdatePopout;
|
||||
|
||||
@@ -135,6 +135,7 @@ Rectangle {
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: entryType === "long_text" ? 3 : 1
|
||||
elide: Text.ElideRight
|
||||
textFormat: Text.PlainText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,8 +676,6 @@ Item {
|
||||
|
||||
var apps = searchApps(searchQuery);
|
||||
for (var i = 0; i < apps.length; i++) {
|
||||
if (searchQuery)
|
||||
apps[i]._preScored = 11000 - i;
|
||||
allItems.push(apps[i]);
|
||||
}
|
||||
|
||||
@@ -685,14 +683,11 @@ Item {
|
||||
if (searchQuery && searchQuery.length >= 2) {
|
||||
_pluginPhasePending = true;
|
||||
_phase1Items = allItems.slice();
|
||||
_pluginPhaseForceFirst = shouldResetSelection;
|
||||
pluginPhaseTimer.restart();
|
||||
if (allItems.length === 0) {
|
||||
_pluginPhaseForceFirst = shouldResetSelection;
|
||||
isSearching = true;
|
||||
searchCompleted();
|
||||
return;
|
||||
}
|
||||
_pluginPhaseForceFirst = false;
|
||||
isSearching = true;
|
||||
searchCompleted();
|
||||
return;
|
||||
} else if (!searchQuery) {
|
||||
var emptyTriggerOrdered = getEmptyTriggerPluginsOrdered();
|
||||
for (var i = 0; i < emptyTriggerOrdered.length; i++) {
|
||||
|
||||
@@ -102,7 +102,7 @@ Item {
|
||||
spotlightContent.searchField.text = query;
|
||||
}
|
||||
if (spotlightContent.controller) {
|
||||
var targetMode = mode || "all";
|
||||
var targetMode = mode || SessionData.launcherLastMode || "all";
|
||||
spotlightContent.controller.searchMode = targetMode;
|
||||
spotlightContent.controller.activePluginId = "";
|
||||
spotlightContent.controller.activePluginName = "";
|
||||
@@ -226,6 +226,15 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: spotlightContent?.controller ?? null
|
||||
function onModeChanged(mode) {
|
||||
if (spotlightContent.controller.autoSwitchedToFiles)
|
||||
return;
|
||||
SessionData.setLauncherLastMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
HyprlandFocusGrab {
|
||||
id: focusGrab
|
||||
windows: [launcherWindow]
|
||||
@@ -284,7 +293,7 @@ Item {
|
||||
|
||||
PanelWindow {
|
||||
id: launcherWindow
|
||||
visible: root._windowEnabled && (!root.unloadContentOnClose || spotlightOpen || isClosing)
|
||||
visible: root._windowEnabled && (spotlightOpen || isClosing)
|
||||
color: "transparent"
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
const Weights = {
|
||||
exactMatch: 10000,
|
||||
prefixMatch: 5000,
|
||||
wordBoundary: 1000,
|
||||
wordBoundary: 3000,
|
||||
substring: 500,
|
||||
fuzzy: 100,
|
||||
frecency: 2000,
|
||||
@@ -99,8 +99,8 @@ function getTimeBucketWeight(daysSinceUsed) {
|
||||
function calculateTextScore(name, query) {
|
||||
if (name === query) return Weights.exactMatch
|
||||
if (name.startsWith(query)) return Weights.prefixMatch
|
||||
if (name.includes(query)) return Weights.substring
|
||||
if (hasWordBoundaryMatch(name, query)) return Weights.wordBoundary
|
||||
if (name.includes(query)) return Weights.substring
|
||||
|
||||
if (query.length >= 3) {
|
||||
var fs = fuzzyScore(name, query)
|
||||
@@ -140,7 +140,7 @@ function score(item, query, frecencyData) {
|
||||
|
||||
if (textScore === 0) return 0
|
||||
|
||||
var usageBonus = frecencyData ? Math.min(frecencyData.usageCount * 10, Weights.frecency) : 0
|
||||
var usageBonus = frecencyData ? Math.min(frecencyData.usageCount * 50, Weights.frecency) : 0
|
||||
|
||||
return textScore + usageBonus + typeBonus
|
||||
}
|
||||
|
||||
@@ -631,7 +631,7 @@ FloatingWindow {
|
||||
anchors.fill: parent
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
textColor: Theme.surfaceText
|
||||
placeholderText: "fixed 800"
|
||||
placeholderText: "800"
|
||||
backgroundColor: "transparent"
|
||||
enabled: root.visible
|
||||
}
|
||||
@@ -658,7 +658,7 @@ FloatingWindow {
|
||||
anchors.fill: parent
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
textColor: Theme.surfaceText
|
||||
placeholderText: "fixed 600"
|
||||
placeholderText: "600"
|
||||
backgroundColor: "transparent"
|
||||
enabled: root.visible
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ DankPopout {
|
||||
return;
|
||||
|
||||
const query = _pendingQuery;
|
||||
const mode = _pendingMode || "apps";
|
||||
const mode = _pendingMode || SessionData.appDrawerLastMode || "apps";
|
||||
_pendingMode = "";
|
||||
_pendingQuery = "";
|
||||
|
||||
@@ -83,6 +83,15 @@ DankPopout {
|
||||
lc.actionPanel?.hide();
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: contentLoader.item?.launcherContent?.controller ?? null
|
||||
function onModeChanged(mode) {
|
||||
if (contentLoader.item.launcherContent.controller.autoSwitchedToFiles)
|
||||
return;
|
||||
SessionData.setAppDrawerLastMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
content: Component {
|
||||
Rectangle {
|
||||
id: contentContainer
|
||||
|
||||
@@ -85,12 +85,12 @@ Variants {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (typeof blurWallpaperWindow.updatesEnabled !== "undefined")
|
||||
blurWallpaperWindow.updatesEnabled = Qt.binding(() => root.effectActive || root._renderSettling || currentWallpaper.status === Image.Loading || nextWallpaper.status === Image.Loading);
|
||||
|
||||
if (!source) {
|
||||
isInitialized = true;
|
||||
return;
|
||||
root._renderSettling = false;
|
||||
}
|
||||
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
|
||||
setWallpaperImmediate(formattedSource);
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
@@ -98,8 +98,25 @@ Variants {
|
||||
property real transitionProgress: 0
|
||||
readonly property bool transitioning: transitionAnimation.running
|
||||
property bool effectActive: false
|
||||
property bool _renderSettling: true
|
||||
property bool useNextForEffect: false
|
||||
|
||||
Connections {
|
||||
target: currentWallpaper
|
||||
function onStatusChanged() {
|
||||
if (currentWallpaper.status === Image.Ready) {
|
||||
root._renderSettling = true;
|
||||
renderSettleTimer.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: renderSettleTimer
|
||||
interval: 100
|
||||
onTriggered: root._renderSettling = false
|
||||
}
|
||||
|
||||
onSourceChanged: {
|
||||
if (!source || source.startsWith("#")) {
|
||||
setWallpaperImmediate("");
|
||||
@@ -124,6 +141,8 @@ Variants {
|
||||
transitionAnimation.stop();
|
||||
root.transitionProgress = 0.0;
|
||||
root.effectActive = false;
|
||||
root._renderSettling = true;
|
||||
renderSettleTimer.restart();
|
||||
currentWallpaper.source = newSource;
|
||||
nextWallpaper.source = "";
|
||||
}
|
||||
|
||||
@@ -234,16 +234,7 @@ Rectangle {
|
||||
spacing: Theme.spacingS
|
||||
|
||||
DankIcon {
|
||||
name: {
|
||||
if (modelData.name.includes("bluez"))
|
||||
return "headset";
|
||||
else if (modelData.name.includes("hdmi"))
|
||||
return "tv";
|
||||
else if (modelData.name.includes("usb"))
|
||||
return "headset";
|
||||
else
|
||||
return "speaker";
|
||||
}
|
||||
name: AudioService.sinkIcon(modelData)
|
||||
size: Theme.iconSize - 4
|
||||
color: modelData === AudioService.sink ? Theme.primary : Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
@@ -669,6 +669,30 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: bluetoothContextMenu.currentDevice?.trusted ? I18n.tr("Untrust") : I18n.tr("Trust")
|
||||
height: 32
|
||||
|
||||
contentItem: StyledText {
|
||||
text: parent.text
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
leftPadding: Theme.spacingS
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: parent.hovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : "transparent"
|
||||
radius: Theme.cornerRadius / 2
|
||||
}
|
||||
|
||||
onTriggered: {
|
||||
if (!bluetoothContextMenu.hasDevice)
|
||||
return;
|
||||
bluetoothContextMenu.currentDevice.trusted = !bluetoothContextMenu.currentDevice.trusted;
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: I18n.tr("Forget Device")
|
||||
height: 32
|
||||
|
||||
@@ -21,73 +21,82 @@ Item {
|
||||
property alias centerWidgetsModel: centerWidgetsModel
|
||||
property alias rightWidgetsModel: rightWidgetsModel
|
||||
|
||||
property string _leftWidgetsJson: {
|
||||
root.barConfig;
|
||||
const leftWidgets = root.barConfig?.leftWidgets || [];
|
||||
const mapped = leftWidgets.map((w, index) => {
|
||||
if (typeof w === "string") {
|
||||
return {
|
||||
widgetId: w,
|
||||
id: w + "_" + index,
|
||||
enabled: true
|
||||
};
|
||||
} else {
|
||||
const obj = Object.assign({}, w);
|
||||
obj.widgetId = w.id || w.widgetId;
|
||||
obj.id = (w.id || w.widgetId) + "_" + index;
|
||||
obj.enabled = w.enabled !== false;
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
return JSON.stringify(mapped);
|
||||
}
|
||||
|
||||
property string _centerWidgetsJson: {
|
||||
root.barConfig;
|
||||
const centerWidgets = root.barConfig?.centerWidgets || [];
|
||||
const mapped = centerWidgets.map((w, index) => {
|
||||
if (typeof w === "string") {
|
||||
return {
|
||||
widgetId: w,
|
||||
id: w + "_" + index,
|
||||
enabled: true
|
||||
};
|
||||
} else {
|
||||
const obj = Object.assign({}, w);
|
||||
obj.widgetId = w.id || w.widgetId;
|
||||
obj.id = (w.id || w.widgetId) + "_" + index;
|
||||
obj.enabled = w.enabled !== false;
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
return JSON.stringify(mapped);
|
||||
}
|
||||
|
||||
property string _rightWidgetsJson: {
|
||||
root.barConfig;
|
||||
const rightWidgets = root.barConfig?.rightWidgets || [];
|
||||
const mapped = rightWidgets.map((w, index) => {
|
||||
if (typeof w === "string") {
|
||||
return {
|
||||
widgetId: w,
|
||||
id: w + "_" + index,
|
||||
enabled: true
|
||||
};
|
||||
} else {
|
||||
const obj = Object.assign({}, w);
|
||||
obj.widgetId = w.id || w.widgetId;
|
||||
obj.id = (w.id || w.widgetId) + "_" + index;
|
||||
obj.enabled = w.enabled !== false;
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
return JSON.stringify(mapped);
|
||||
}
|
||||
|
||||
ScriptModel {
|
||||
id: leftWidgetsModel
|
||||
values: {
|
||||
root.barConfig;
|
||||
const leftWidgets = root.barConfig?.leftWidgets || [];
|
||||
return leftWidgets.map((w, index) => {
|
||||
if (typeof w === "string") {
|
||||
return {
|
||||
widgetId: w,
|
||||
id: w + "_" + index,
|
||||
enabled: true
|
||||
};
|
||||
} else {
|
||||
const obj = Object.assign({}, w);
|
||||
obj.widgetId = w.id || w.widgetId;
|
||||
obj.id = (w.id || w.widgetId) + "_" + index;
|
||||
obj.enabled = w.enabled !== false;
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
}
|
||||
values: JSON.parse(root._leftWidgetsJson)
|
||||
}
|
||||
|
||||
ScriptModel {
|
||||
id: centerWidgetsModel
|
||||
values: {
|
||||
root.barConfig;
|
||||
const centerWidgets = root.barConfig?.centerWidgets || [];
|
||||
return centerWidgets.map((w, index) => {
|
||||
if (typeof w === "string") {
|
||||
return {
|
||||
widgetId: w,
|
||||
id: w + "_" + index,
|
||||
enabled: true
|
||||
};
|
||||
} else {
|
||||
const obj = Object.assign({}, w);
|
||||
obj.widgetId = w.id || w.widgetId;
|
||||
obj.id = (w.id || w.widgetId) + "_" + index;
|
||||
obj.enabled = w.enabled !== false;
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
}
|
||||
values: JSON.parse(root._centerWidgetsJson)
|
||||
}
|
||||
|
||||
ScriptModel {
|
||||
id: rightWidgetsModel
|
||||
values: {
|
||||
root.barConfig;
|
||||
const rightWidgets = root.barConfig?.rightWidgets || [];
|
||||
return rightWidgets.map((w, index) => {
|
||||
if (typeof w === "string") {
|
||||
return {
|
||||
widgetId: w,
|
||||
id: w + "_" + index,
|
||||
enabled: true
|
||||
};
|
||||
} else {
|
||||
const obj = Object.assign({}, w);
|
||||
obj.widgetId = w.id || w.widgetId;
|
||||
obj.id = (w.id || w.widgetId) + "_" + index;
|
||||
obj.enabled = w.enabled !== false;
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
}
|
||||
values: JSON.parse(root._rightWidgetsJson)
|
||||
}
|
||||
|
||||
function triggerControlCenterOnFocusedScreen() {
|
||||
|
||||
@@ -561,10 +561,7 @@ Item {
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent)
|
||||
parentScreen: barWindow.screen
|
||||
popoutTarget: {
|
||||
clipboardHistoryPopoutLoader.active = true;
|
||||
return clipboardHistoryPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: clipboardHistoryPopoutLoader.item ?? null
|
||||
|
||||
function openClipboardPopout(initialTab) {
|
||||
clipboardHistoryPopoutLoader.active = true;
|
||||
@@ -759,10 +756,7 @@ Item {
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
section: topBarContent.getWidgetSection(parent) || "center"
|
||||
popoutTarget: {
|
||||
dankDashPopoutLoader.active = true;
|
||||
return dankDashPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: dankDashPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
|
||||
Component.onCompleted: {
|
||||
@@ -826,10 +820,7 @@ Item {
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
section: topBarContent.getWidgetSection(parent) || "center"
|
||||
popoutTarget: {
|
||||
dankDashPopoutLoader.active = true;
|
||||
return dankDashPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: dankDashPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
dankDashPopoutLoader.active = true;
|
||||
@@ -881,10 +872,7 @@ Item {
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
section: topBarContent.getWidgetSection(parent) || "center"
|
||||
popoutTarget: {
|
||||
dankDashPopoutLoader.active = true;
|
||||
return dankDashPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: dankDashPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
dankDashPopoutLoader.active = true;
|
||||
@@ -968,10 +956,7 @@ Item {
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: {
|
||||
processListPopoutLoader.active = true;
|
||||
return processListPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: processListPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
widgetData: parent.widgetData
|
||||
onCpuClicked: {
|
||||
@@ -1004,10 +989,7 @@ Item {
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: {
|
||||
processListPopoutLoader.active = true;
|
||||
return processListPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: processListPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
widgetData: parent.widgetData
|
||||
onRamClicked: {
|
||||
@@ -1054,10 +1036,7 @@ Item {
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: {
|
||||
processListPopoutLoader.active = true;
|
||||
return processListPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: processListPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
widgetData: parent.widgetData
|
||||
onCpuTempClicked: {
|
||||
@@ -1090,10 +1069,7 @@ Item {
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: {
|
||||
processListPopoutLoader.active = true;
|
||||
return processListPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: processListPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
widgetData: parent.widgetData
|
||||
onGpuTempClicked: {
|
||||
@@ -1134,10 +1110,7 @@ Item {
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: {
|
||||
notificationCenterLoader.active = true;
|
||||
return notificationCenterLoader.item;
|
||||
}
|
||||
popoutTarget: notificationCenterLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
notificationCenterLoader.active = true;
|
||||
@@ -1172,10 +1145,7 @@ Item {
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
barSpacing: barConfig?.spacing ?? 4
|
||||
barConfig: topBarContent.barConfig
|
||||
popoutTarget: {
|
||||
batteryPopoutLoader.active = true;
|
||||
return batteryPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: batteryPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
onToggleBatteryPopup: {
|
||||
batteryPopoutLoader.active = true;
|
||||
@@ -1208,10 +1178,7 @@ Item {
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "center"
|
||||
popoutTarget: {
|
||||
layoutPopoutLoader.active = true;
|
||||
return layoutPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: layoutPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
onToggleLayoutPopup: {
|
||||
layoutPopoutLoader.active = true;
|
||||
@@ -1244,10 +1211,7 @@ Item {
|
||||
barSpacing: barConfig?.spacing ?? 4
|
||||
barConfig: topBarContent.barConfig
|
||||
isAutoHideBar: topBarContent.barConfig?.autoHide ?? false
|
||||
popoutTarget: {
|
||||
vpnPopoutLoader.active = true;
|
||||
return vpnPopoutLoader.item;
|
||||
}
|
||||
popoutTarget: vpnPopoutLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
onToggleVpnPopup: {
|
||||
vpnPopoutLoader.active = true;
|
||||
@@ -1281,10 +1245,7 @@ Item {
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: {
|
||||
controlCenterLoader.active = true;
|
||||
return controlCenterLoader.item;
|
||||
}
|
||||
popoutTarget: controlCenterLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
screenName: barWindow.screen?.name || ""
|
||||
screenModel: barWindow.screen?.model || ""
|
||||
@@ -1434,10 +1395,7 @@ Item {
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: {
|
||||
systemUpdateLoader.active = true;
|
||||
return systemUpdateLoader.item;
|
||||
}
|
||||
popoutTarget: systemUpdateLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
systemUpdateLoader.active = true;
|
||||
|
||||
@@ -48,10 +48,11 @@ PanelWindow {
|
||||
return;
|
||||
}
|
||||
|
||||
let section = "center";
|
||||
if (clockButtonRef && clockButtonRef.visualContent && dankDashPopoutLoader.item.setTriggerPosition) {
|
||||
// Calculate barPosition from axis.edge
|
||||
const barPosition = axis?.edge === "left" ? 2 : (axis?.edge === "right" ? 3 : (axis?.edge === "top" ? 0 : 1));
|
||||
const section = clockButtonRef.section || "center";
|
||||
section = clockButtonRef.section || "center";
|
||||
|
||||
let triggerPos, triggerWidth;
|
||||
if (section === "center") {
|
||||
@@ -130,38 +131,55 @@ PanelWindow {
|
||||
readonly property real _wingR: Math.max(0, wingtipsRadius)
|
||||
readonly property color _surfaceContainer: Theme.surfaceContainer
|
||||
readonly property string _barId: barConfig?.id ?? "default"
|
||||
readonly property var _liveBarConfig: SettingsData.barConfigs.find(c => c.id === _barId) || barConfig
|
||||
readonly property real _backgroundAlpha: _liveBarConfig?.transparency ?? 1.0
|
||||
property real _backgroundAlpha: barConfig?.transparency ?? 1.0
|
||||
readonly property color _bgColor: Theme.withAlpha(_surfaceContainer, _backgroundAlpha)
|
||||
|
||||
function _updateBackgroundAlpha() {
|
||||
const live = SettingsData.barConfigs.find(c => c.id === _barId);
|
||||
_backgroundAlpha = (live ?? barConfig)?.transparency ?? 1.0;
|
||||
}
|
||||
readonly property real _dpr: CompositorService.getScreenScale(barWindow.screen)
|
||||
|
||||
property string screenName: modelData.name
|
||||
|
||||
readonly property bool hasMaximizedToplevel: {
|
||||
if (!(barConfig?.maximizeDetection ?? true))
|
||||
return false;
|
||||
if (!CompositorService.isHyprland && !CompositorService.isNiri)
|
||||
return false;
|
||||
property bool hasMaximizedToplevel: false
|
||||
property bool shouldHideForWindows: false
|
||||
|
||||
function _updateHasMaximizedToplevel() {
|
||||
if (!(barConfig?.maximizeDetection ?? true)) {
|
||||
hasMaximizedToplevel = false;
|
||||
return;
|
||||
}
|
||||
if (!CompositorService.isHyprland && !CompositorService.isNiri) {
|
||||
hasMaximizedToplevel = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const filtered = CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, screenName);
|
||||
for (let i = 0; i < filtered.length; i++) {
|
||||
if (filtered[i]?.maximized)
|
||||
return true;
|
||||
if (filtered[i]?.maximized) {
|
||||
hasMaximizedToplevel = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
hasMaximizedToplevel = false;
|
||||
}
|
||||
|
||||
readonly property bool shouldHideForWindows: {
|
||||
if (!(barConfig?.showOnWindowsOpen ?? false))
|
||||
return false;
|
||||
if (!(barConfig?.autoHide ?? false))
|
||||
return false;
|
||||
if (!CompositorService.isNiri && !CompositorService.isHyprland)
|
||||
return false;
|
||||
function _updateShouldHideForWindows() {
|
||||
if (!(barConfig?.showOnWindowsOpen ?? false)) {
|
||||
shouldHideForWindows = false;
|
||||
return;
|
||||
}
|
||||
if (!(barConfig?.autoHide ?? false)) {
|
||||
shouldHideForWindows = false;
|
||||
return;
|
||||
}
|
||||
if (!CompositorService.isNiri && !CompositorService.isHyprland) {
|
||||
shouldHideForWindows = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (CompositorService.isNiri) {
|
||||
NiriService.windows;
|
||||
|
||||
let currentWorkspaceId = null;
|
||||
for (let i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
const ws = NiriService.allWorkspaces[i];
|
||||
@@ -171,8 +189,10 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
if (currentWorkspaceId === null)
|
||||
return false;
|
||||
if (currentWorkspaceId === null) {
|
||||
shouldHideForWindows = false;
|
||||
return;
|
||||
}
|
||||
|
||||
let hasTiled = false;
|
||||
let hasFloatingTouchingBar = false;
|
||||
@@ -216,14 +236,12 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasTiled)
|
||||
return true;
|
||||
|
||||
return hasFloatingTouchingBar;
|
||||
shouldHideForWindows = hasTiled || hasFloatingTouchingBar;
|
||||
return;
|
||||
}
|
||||
|
||||
const filtered = CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, screenName);
|
||||
return filtered.length > 0;
|
||||
shouldHideForWindows = filtered.length > 0;
|
||||
}
|
||||
|
||||
property real effectiveSpacing: hasMaximizedToplevel ? 0 : (barConfig?.spacing ?? 4)
|
||||
@@ -355,6 +373,9 @@ PanelWindow {
|
||||
}
|
||||
|
||||
updateGpuTempConfig();
|
||||
_updateBackgroundAlpha();
|
||||
_updateHasMaximizedToplevel();
|
||||
_updateShouldHideForWindows();
|
||||
|
||||
inhibitorInitTimer.start();
|
||||
}
|
||||
@@ -431,11 +452,37 @@ PanelWindow {
|
||||
Connections {
|
||||
function onBarConfigChanged() {
|
||||
barWindow.updateGpuTempConfig();
|
||||
barWindow._updateBackgroundAlpha();
|
||||
barWindow._updateHasMaximizedToplevel();
|
||||
barWindow._updateShouldHideForWindows();
|
||||
}
|
||||
|
||||
target: rootWindow
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onBarConfigsChanged() {
|
||||
barWindow._updateBackgroundAlpha();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: CompositorService
|
||||
function onToplevelsChanged() {
|
||||
barWindow._updateHasMaximizedToplevel();
|
||||
barWindow._updateShouldHideForWindows();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: NiriService
|
||||
function onAllWorkspacesChanged() {
|
||||
barWindow._updateHasMaximizedToplevel();
|
||||
barWindow._updateShouldHideForWindows();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onNvidiaGpuTempEnabledChanged() {
|
||||
barWindow.updateGpuTempConfig();
|
||||
|
||||
@@ -400,7 +400,7 @@ BasePill {
|
||||
Component.onCompleted: updateModel()
|
||||
|
||||
visible: dockItems.length > 0
|
||||
readonly property real iconCellSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground) + 6
|
||||
readonly property real iconCellSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) + 6
|
||||
|
||||
content: Component {
|
||||
Item {
|
||||
@@ -584,8 +584,7 @@ BasePill {
|
||||
|
||||
property string tooltipText: {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
const moddedId = Paths.moddedAppId(appId);
|
||||
const desktopEntry = moddedId ? DesktopEntries.heuristicLookup(moddedId) : null;
|
||||
const desktopEntry = appId ? DesktopEntries.heuristicLookup(appId) : null;
|
||||
const appName = appId ? Paths.getAppName(appId, desktopEntry) : "Unknown";
|
||||
|
||||
if (modelData.type === "grouped" && windowCount > 1) {
|
||||
@@ -597,7 +596,7 @@ BasePill {
|
||||
readonly property bool enlargeEnabled: (widgetData?.appsDockEnlargeOnHover !== undefined ? widgetData.appsDockEnlargeOnHover : SettingsData.appsDockEnlargeOnHover)
|
||||
readonly property real enlargeScale: enlargeEnabled && mouseArea.containsMouse ? (widgetData?.appsDockEnlargePercentage !== undefined ? widgetData.appsDockEnlargePercentage : SettingsData.appsDockEnlargePercentage) / 100.0 : 1.0
|
||||
readonly property real baseIconSizeMultiplier: (widgetData?.appsDockIconSizePercentage !== undefined ? widgetData.appsDockIconSizePercentage : SettingsData.appsDockIconSizePercentage) / 100.0
|
||||
readonly property real effectiveIconSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground) * baseIconSizeMultiplier
|
||||
readonly property real effectiveIconSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) * baseIconSizeMultiplier
|
||||
|
||||
readonly property color activeOverlayColor: {
|
||||
switch (SettingsData.appsDockActiveColorMode) {
|
||||
@@ -690,9 +689,8 @@ BasePill {
|
||||
if (!appItem.appId)
|
||||
return "";
|
||||
if (modelData.isCoreApp)
|
||||
return ""; // Explicitly skip if core app to avoid flickering or wrong look ups
|
||||
const moddedId = Paths.moddedAppId(appItem.appId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||
return "";
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(appItem.appId);
|
||||
return Paths.getAppIcon(appItem.appId, desktopEntry);
|
||||
}
|
||||
smooth: true
|
||||
@@ -749,8 +747,7 @@ BasePill {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
if (!appItem.appId)
|
||||
return "?";
|
||||
const moddedId = Paths.moddedAppId(appItem.appId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(appItem.appId);
|
||||
const appName = Paths.getAppName(appItem.appId, desktopEntry);
|
||||
return appName.charAt(0).toUpperCase();
|
||||
}
|
||||
@@ -795,7 +792,7 @@ BasePill {
|
||||
anchors.rightMargin: Theme.spacingS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: appItem.windowTitle || appItem.appId
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
||||
@@ -42,7 +42,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: BatteryService.getBatteryIcon()
|
||||
size: Theme.barIconSize(battery.barThickness, undefined, battery.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(battery.barThickness, undefined, battery.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (!BatteryService.batteryAvailable) {
|
||||
return Theme.widgetIconColor;
|
||||
@@ -63,7 +63,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: BatteryService.batteryLevel.toString()
|
||||
font.pixelSize: Theme.barTextSize(battery.barThickness, battery.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(battery.barThickness, battery.barConfig?.fontScale, battery.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: BatteryService.batteryAvailable
|
||||
@@ -78,7 +78,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: BatteryService.getBatteryIcon()
|
||||
size: Theme.barIconSize(battery.barThickness, -4, battery.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(battery.barThickness, -4, battery.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (!BatteryService.batteryAvailable) {
|
||||
return Theme.widgetIconColor;
|
||||
@@ -99,7 +99,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: `${BatteryService.batteryLevel}%`
|
||||
font.pixelSize: Theme.barTextSize(battery.barThickness, battery.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(battery.barThickness, battery.barConfig?.fontScale, battery.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: BatteryService.batteryAvailable
|
||||
|
||||
@@ -54,7 +54,7 @@ BasePill {
|
||||
id: icon
|
||||
anchors.centerIn: parent
|
||||
name: "shift_lock"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.primary
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,6 @@ BasePill {
|
||||
id: root
|
||||
|
||||
property bool isActive: false
|
||||
property var popoutTarget: null
|
||||
property var parentScreen: null
|
||||
property Item windowRoot: (Window.window ? Window.window.contentItem : null)
|
||||
property bool isAutoHideBar: false
|
||||
|
||||
signal clipboardClicked
|
||||
@@ -87,7 +84,7 @@ BasePill {
|
||||
id: icon
|
||||
anchors.centerIn: parent
|
||||
name: "content_paste"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetIconColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ BasePill {
|
||||
const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
|
||||
return String(display).padStart(2, '0').charAt(0);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -53,7 +53,7 @@ BasePill {
|
||||
const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
|
||||
return String(display).padStart(2, '0').charAt(1);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -67,7 +67,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(0)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -76,7 +76,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(1)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -91,7 +91,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(0)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -100,7 +100,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(1)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -135,7 +135,7 @@ BasePill {
|
||||
const value = dayFirst ? String(systemClock?.date?.getDate()).padStart(2, '0') : String(systemClock?.date?.getMonth() + 1).padStart(2, '0');
|
||||
return value.charAt(0);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.primary
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -150,7 +150,7 @@ BasePill {
|
||||
const value = dayFirst ? String(systemClock?.date?.getDate()).padStart(2, '0') : String(systemClock?.date?.getMonth() + 1).padStart(2, '0');
|
||||
return value.charAt(1);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.primary
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -171,7 +171,7 @@ BasePill {
|
||||
const value = dayFirst ? String(systemClock?.date?.getMonth() + 1).padStart(2, '0') : String(systemClock?.date?.getDate()).padStart(2, '0');
|
||||
return value.charAt(0);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.primary
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -186,7 +186,7 @@ BasePill {
|
||||
const value = dayFirst ? String(systemClock?.date?.getMonth() + 1).padStart(2, '0') : String(systemClock?.date?.getDate()).padStart(2, '0');
|
||||
return value.charAt(1);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.primary
|
||||
width: Math.round(font.pixelSize * 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -201,7 +201,7 @@ BasePill {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingS
|
||||
|
||||
property real fontSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
property real fontSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
property real digitWidth: fontSize * 0.6
|
||||
|
||||
property string hoursStr: {
|
||||
|
||||
@@ -19,7 +19,7 @@ BasePill {
|
||||
id: icon
|
||||
anchors.centerIn: parent
|
||||
name: "palette"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: root.isActive ? Theme.primary : Theme.surfaceText
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ BasePill {
|
||||
property real micAccumulator: 0
|
||||
property real volumeAccumulator: 0
|
||||
property real brightnessAccumulator: 0
|
||||
readonly property real vIconSize: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
readonly property real vIconSize: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
property var _hRow: null
|
||||
property var _vCol: null
|
||||
property var _hAudio: null
|
||||
@@ -394,7 +394,7 @@ BasePill {
|
||||
id: audioPercentV
|
||||
visible: root.showAudioPercent
|
||||
text: Math.round((AudioService.sink?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: audioIconV.bottom
|
||||
@@ -420,7 +420,7 @@ BasePill {
|
||||
id: micPercentV
|
||||
visible: root.showMicPercent
|
||||
text: Math.round((AudioService.source?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: micIconV.bottom
|
||||
@@ -446,7 +446,7 @@ BasePill {
|
||||
id: brightnessPercentV
|
||||
visible: root.showBrightnessPercent
|
||||
text: Math.round(getBrightness() * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: brightnessIconV.bottom
|
||||
@@ -502,7 +502,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "screen_record"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: NiriService.hasActiveCast ? Theme.primary : Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.showScreenSharingIcon && NiriService.hasCasts
|
||||
@@ -511,7 +511,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: networkIcon
|
||||
name: root.getNetworkIconName()
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: root.getNetworkIconColor()
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.showNetworkIcon && NetworkService.networkAvailable
|
||||
@@ -520,7 +520,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: vpnIcon
|
||||
name: "vpn_lock"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: NetworkService.vpnConnected ? Theme.primary : Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.showVpnIcon && NetworkService.vpnAvailable && NetworkService.vpnConnected
|
||||
@@ -529,7 +529,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: bluetoothIcon
|
||||
name: "bluetooth"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: BluetoothService.connected ? Theme.primary : Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.showBluetoothIcon && BluetoothService.available && BluetoothService.enabled
|
||||
@@ -545,7 +545,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: audioIcon
|
||||
name: root.getVolumeIconName()
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetIconColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
@@ -556,7 +556,7 @@ BasePill {
|
||||
id: audioPercent
|
||||
visible: root.showAudioPercent
|
||||
text: Math.round((AudioService.sink?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: audioIcon.right
|
||||
@@ -574,7 +574,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: micIcon
|
||||
name: root.getMicIconName()
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: root.getMicIconColor()
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
@@ -585,7 +585,7 @@ BasePill {
|
||||
id: micPercent
|
||||
visible: root.showMicPercent
|
||||
text: Math.round((AudioService.source?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: micIcon.right
|
||||
@@ -603,7 +603,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: brightnessIcon
|
||||
name: root.getBrightnessIconName()
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetIconColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
@@ -614,7 +614,7 @@ BasePill {
|
||||
id: brightnessPercent
|
||||
visible: root.showBrightnessPercent
|
||||
text: Math.round(getBrightness() * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: brightnessIcon.right
|
||||
@@ -625,7 +625,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: batteryIcon
|
||||
name: Theme.getBatteryIcon(BatteryService.batteryLevel, BatteryService.isCharging, BatteryService.batteryAvailable)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: root.getBatteryIconColor()
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.showBatteryIcon && BatteryService.batteryAvailable
|
||||
@@ -634,7 +634,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: printerIcon
|
||||
name: "print"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.showPrinterIcon && CupsService.cupsAvailable && root.hasPrintJobs()
|
||||
@@ -642,7 +642,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "settings"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: root.isActive ? Theme.primary : Theme.widgetIconColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: root.hasNoVisibleIcons()
|
||||
|
||||
@@ -36,7 +36,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "memory"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (DgopService.cpuUsage > 80) {
|
||||
return Theme.tempDanger;
|
||||
@@ -59,7 +59,7 @@ BasePill {
|
||||
|
||||
return DgopService.cpuUsage.toFixed(0);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -74,7 +74,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: cpuIcon
|
||||
name: "memory"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (DgopService.cpuUsage > 80) {
|
||||
return Theme.tempDanger;
|
||||
@@ -93,7 +93,7 @@ BasePill {
|
||||
id: textBox
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
implicitWidth: root.minimumWidth ? Math.max(cpuBaseline.width, cpuText.paintedWidth) : cpuText.paintedWidth
|
||||
implicitWidth: root.minimumWidth ? Math.max(cpuBaseline.width, cpuCurrent.width) : cpuCurrent.width
|
||||
implicitHeight: cpuText.implicitHeight
|
||||
|
||||
width: implicitWidth
|
||||
@@ -101,10 +101,16 @@ BasePill {
|
||||
|
||||
StyledTextMetrics {
|
||||
id: cpuBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: "88%"
|
||||
}
|
||||
|
||||
StyledTextMetrics {
|
||||
id: cpuCurrent
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: cpuText.text
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: cpuText
|
||||
text: {
|
||||
@@ -114,7 +120,7 @@ BasePill {
|
||||
}
|
||||
return v.toFixed(0) + "%";
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -36,7 +36,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "device_thermostat"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (DgopService.cpuTemperature > 85) {
|
||||
return Theme.tempDanger;
|
||||
@@ -59,7 +59,7 @@ BasePill {
|
||||
|
||||
return Math.round(DgopService.cpuTemperature).toString();
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -74,7 +74,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: cpuTempIcon
|
||||
name: "device_thermostat"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (DgopService.cpuTemperature > 85) {
|
||||
return Theme.tempDanger;
|
||||
@@ -101,7 +101,7 @@ BasePill {
|
||||
|
||||
StyledTextMetrics {
|
||||
id: tempBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: "88°"
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ BasePill {
|
||||
|
||||
return Math.round(DgopService.cpuTemperature) + "°";
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -57,14 +57,14 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: layout.getLayoutIcon(layout.currentLayoutSymbol)
|
||||
size: Theme.barIconSize(layout.barThickness, undefined, layout.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(layout.barThickness, undefined, layout.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: layout.currentLayoutSymbol
|
||||
font.pixelSize: Theme.barTextSize(layout.barThickness, layout.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(layout.barThickness, layout.barConfig?.fontScale, layout.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -78,14 +78,14 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: layout.getLayoutIcon(layout.currentLayoutSymbol)
|
||||
size: Theme.barIconSize(layout.barThickness, -4, layout.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(layout.barThickness, -4, layout.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: layout.currentLayoutSymbol
|
||||
font.pixelSize: Theme.barTextSize(layout.barThickness, layout.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(layout.barThickness, layout.barConfig?.fontScale, layout.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "storage"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (root.diskUsagePercent > 90) {
|
||||
return Theme.tempDanger;
|
||||
@@ -132,7 +132,7 @@ BasePill {
|
||||
}
|
||||
return root.diskUsagePercent.toFixed(0);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -146,7 +146,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "storage"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (root.diskUsagePercent > 90) {
|
||||
return Theme.tempDanger;
|
||||
@@ -166,7 +166,7 @@ BasePill {
|
||||
}
|
||||
return root.selectedMount.mount;
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
@@ -180,7 +180,7 @@ BasePill {
|
||||
}
|
||||
return root.diskUsagePercent.toFixed(0) + "%";
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
@@ -188,7 +188,7 @@ BasePill {
|
||||
|
||||
StyledTextMetrics {
|
||||
id: diskBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: "100%"
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ BasePill {
|
||||
return "";
|
||||
return Paths.getAppName(activeWindow.appId, activeDesktopEntry);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
elide: Text.ElideRight
|
||||
@@ -200,7 +200,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: "•"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.outlineButton
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !compactMode && appText.text && titleText.text
|
||||
@@ -225,7 +225,7 @@ BasePill {
|
||||
|
||||
return title;
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
elide: Text.ElideRight
|
||||
|
||||
@@ -104,7 +104,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "auto_awesome_mosaic"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (root.displayTemp > 80) {
|
||||
return Theme.tempDanger;
|
||||
@@ -127,7 +127,7 @@ BasePill {
|
||||
|
||||
return Math.round(root.displayTemp).toString();
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -142,7 +142,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: gpuTempIcon
|
||||
name: "auto_awesome_mosaic"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (root.displayTemp > 80) {
|
||||
return Theme.tempDanger;
|
||||
@@ -169,7 +169,7 @@ BasePill {
|
||||
|
||||
StyledTextMetrics {
|
||||
id: gpuTempBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: "88°"
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ BasePill {
|
||||
|
||||
return Math.round(root.displayTemp) + "°";
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -16,7 +16,7 @@ BasePill {
|
||||
id: icon
|
||||
anchors.centerIn: parent
|
||||
name: SessionService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "keyboard"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -144,7 +144,7 @@ BasePill {
|
||||
const code = root.langCodes[lang] || lang.substring(0, 2);
|
||||
return code.toUpperCase();
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -177,7 +177,7 @@ BasePill {
|
||||
}
|
||||
return root.currentLayout;
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
@@ -21,15 +21,15 @@ BasePill {
|
||||
visible: SettingsData.launcherLogoMode === "apps"
|
||||
anchors.centerIn: parent
|
||||
name: "apps"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetIconColor
|
||||
}
|
||||
|
||||
SystemLogo {
|
||||
visible: SettingsData.launcherLogoMode === "os"
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
colorOverride: Theme.effectiveLogoColor
|
||||
brightnessOverride: SettingsData.launcherLogoBrightness
|
||||
contrastOverride: SettingsData.launcherLogoContrast
|
||||
@@ -38,8 +38,8 @@ BasePill {
|
||||
IconImage {
|
||||
visible: SettingsData.launcherLogoMode === "dank"
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
smooth: true
|
||||
mipmap: true
|
||||
asynchronous: true
|
||||
@@ -57,8 +57,8 @@ BasePill {
|
||||
IconImage {
|
||||
visible: SettingsData.launcherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle || CompositorService.isLabwc)
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
source: {
|
||||
@@ -96,8 +96,8 @@ BasePill {
|
||||
IconImage {
|
||||
visible: SettingsData.launcherLogoMode === "custom" && SettingsData.launcherLogoCustomPath !== ""
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
source: SettingsData.launcherLogoCustomPath ? "file://" + SettingsData.launcherLogoCustomPath.replace("file://", "") : ""
|
||||
|
||||
@@ -284,7 +284,7 @@ BasePill {
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: textContainer.displayText
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
wrapMode: Text.NoWrap
|
||||
x: needsScrolling ? -scrollOffset : 0
|
||||
|
||||
@@ -41,7 +41,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "network_check"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -53,7 +53,7 @@ BasePill {
|
||||
if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K"
|
||||
return (rate / (1024 * 1024)).toFixed(0) + "M"
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.info
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -65,7 +65,7 @@ BasePill {
|
||||
if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K"
|
||||
return (rate / (1024 * 1024)).toFixed(0) + "M"
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.error
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -79,7 +79,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "network_check"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
@@ -90,13 +90,13 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: "↓"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.info
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: DgopService.networkRxRate > 0 ? root.formatNetworkSpeed(DgopService.networkRxRate) : "0 B/s"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
@@ -105,7 +105,7 @@ BasePill {
|
||||
|
||||
StyledTextMetrics {
|
||||
id: rxBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: "88.8 MB/s"
|
||||
}
|
||||
|
||||
@@ -119,13 +119,13 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: "↑"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.error
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: DgopService.networkTxRate > 0 ? root.formatNetworkSpeed(DgopService.networkTxRate) : "0 B/s"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
@@ -134,7 +134,7 @@ BasePill {
|
||||
|
||||
StyledTextMetrics {
|
||||
id: txBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: "88.8 MB/s"
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ BasePill {
|
||||
|
||||
anchors.centerIn: parent
|
||||
name: "assignment"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: root.isActive ? Theme.primary : Theme.surfaceText
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ BasePill {
|
||||
id: notifIcon
|
||||
anchors.centerIn: parent
|
||||
name: SessionData.doNotDisturb ? "notifications_off" : "notifications"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: SessionData.doNotDisturb ? Theme.primary : (root.isActive ? Theme.primary : Theme.widgetIconColor)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ BasePill {
|
||||
id: icon
|
||||
anchors.centerIn: parent
|
||||
name: "power_settings_new"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetIconColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,43 @@ BasePill {
|
||||
readonly property real contentWidth: hasActivePrivacy ? (activeCount * 18 + (activeCount - 1) * Theme.spacingXS) : 0
|
||||
readonly property real contentHeight: hasActivePrivacy ? (activeCount * 18 + (activeCount - 1) * Theme.spacingXS) : 0
|
||||
|
||||
visible: hasActivePrivacy
|
||||
opacity: hasActivePrivacy ? 1 : 0
|
||||
enabled: hasActivePrivacy
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "hidden_horizontal"
|
||||
when: !hasActivePrivacy && !isVerticalOrientation
|
||||
PropertyChanges {
|
||||
target: root
|
||||
width: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hidden_vertical"
|
||||
when: !hasActivePrivacy && isVerticalOrientation
|
||||
PropertyChanges {
|
||||
target: root
|
||||
height: 0
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
NumberAnimation {
|
||||
properties: "width,height"
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
}
|
||||
|
||||
content: Component {
|
||||
Item {
|
||||
@@ -35,7 +69,7 @@ BasePill {
|
||||
Item {
|
||||
width: 18
|
||||
height: 18
|
||||
visible: PrivacyService.microphoneActive
|
||||
visible: root.showMicIcon || PrivacyService.microphoneActive
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
DankIcon {
|
||||
@@ -47,8 +81,8 @@ BasePill {
|
||||
return "mic";
|
||||
}
|
||||
size: Theme.iconSizeSmall
|
||||
color: Theme.error
|
||||
filled: true
|
||||
color: PrivacyService.microphoneActive ? Theme.error : Theme.surfaceText
|
||||
filled: PrivacyService.microphoneActive
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@@ -56,14 +90,14 @@ BasePill {
|
||||
Item {
|
||||
width: 18
|
||||
height: 18
|
||||
visible: PrivacyService.cameraActive
|
||||
visible: root.showCameraIcon || PrivacyService.cameraActive
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
DankIcon {
|
||||
name: "camera_video"
|
||||
size: Theme.iconSizeSmall
|
||||
color: Theme.widgetTextColor
|
||||
filled: true
|
||||
color: PrivacyService.cameraActive ? Theme.error : Theme.surfaceText
|
||||
filled: PrivacyService.cameraActive
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
@@ -76,20 +110,21 @@ BasePill {
|
||||
anchors.top: parent.top
|
||||
anchors.rightMargin: -2
|
||||
anchors.topMargin: -1
|
||||
visible: PrivacyService.cameraActive
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 18
|
||||
height: 18
|
||||
visible: PrivacyService.screensharingActive
|
||||
visible: root.showScreenSharingIcon || PrivacyService.screensharingActive
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
DankIcon {
|
||||
name: "screen_share"
|
||||
size: Theme.iconSizeSmall
|
||||
color: Theme.warning
|
||||
filled: true
|
||||
color: PrivacyService.screensharingActive ? Theme.warning : Theme.surfaceText
|
||||
filled: PrivacyService.screensharingActive
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@@ -116,7 +151,7 @@ BasePill {
|
||||
}
|
||||
size: Theme.iconSizeSmall
|
||||
color: PrivacyService.microphoneActive ? Theme.error : Theme.surfaceText
|
||||
filled: true
|
||||
filled: PrivacyService.microphoneActive
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@@ -131,7 +166,7 @@ BasePill {
|
||||
name: "camera_video"
|
||||
size: Theme.iconSizeSmall
|
||||
color: PrivacyService.cameraActive ? Theme.error : Theme.surfaceText
|
||||
filled: true
|
||||
filled: PrivacyService.cameraActive
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
@@ -158,7 +193,7 @@ BasePill {
|
||||
name: "screen_share"
|
||||
size: Theme.iconSizeSmall
|
||||
color: PrivacyService.screensharingActive ? Theme.warning : Theme.surfaceText
|
||||
filled: true
|
||||
filled: PrivacyService.screensharingActive
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@@ -184,7 +219,7 @@ BasePill {
|
||||
id: tooltipText
|
||||
anchors.centerIn: parent
|
||||
text: PrivacyService.getPrivacySummary()
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
}
|
||||
|
||||
@@ -209,22 +244,4 @@ BasePill {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on width {
|
||||
enabled: hasActivePrivacy && visible && !isVerticalOrientation
|
||||
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on height {
|
||||
enabled: hasActivePrivacy && visible && isVerticalOrientation
|
||||
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: "developer_board"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (DgopService.memoryUsage > 90) {
|
||||
return Theme.tempDanger;
|
||||
@@ -61,7 +61,7 @@ BasePill {
|
||||
|
||||
return DgopService.memoryUsage.toFixed(0);
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -69,7 +69,7 @@ BasePill {
|
||||
StyledText {
|
||||
visible: root.showSwap && DgopService.totalSwapKB > 0
|
||||
text: root.swapUsage.toFixed(0)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -84,7 +84,7 @@ BasePill {
|
||||
DankIcon {
|
||||
id: ramIcon
|
||||
name: "developer_board"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (DgopService.memoryUsage > 90) {
|
||||
return Theme.tempDanger;
|
||||
@@ -111,7 +111,7 @@ BasePill {
|
||||
|
||||
StyledTextMetrics {
|
||||
id: ramBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: {
|
||||
if (!root.showSwap) {
|
||||
return "88%";
|
||||
@@ -136,7 +136,7 @@ BasePill {
|
||||
}
|
||||
return ramText;
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -135,7 +135,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
readonly property int windowCount: _groupByApp ? (groupedWindows?.length || 0) : (sortedToplevels?.length || 0)
|
||||
readonly property real iconCellSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground) + 6
|
||||
readonly property real iconCellSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) + 6
|
||||
|
||||
readonly property string focusedAppId: {
|
||||
if (!sortedToplevels || sortedToplevels.length === 0)
|
||||
@@ -241,14 +241,17 @@ BasePill {
|
||||
property var toplevelData: isGrouped ? (modelData.windows.length > 0 ? modelData.windows[0].toplevel : null) : modelData
|
||||
property bool isFocused: isGrouped ? (root.focusedAppId === appId) : (toplevelData ? toplevelData.activated : false)
|
||||
property string appId: isGrouped ? modelData.appId : (modelData.appId || "")
|
||||
readonly property string effectiveAppId: {
|
||||
root._appIdSubstitutionsTrigger;
|
||||
return Paths.moddedAppId(appId);
|
||||
}
|
||||
property string windowTitle: toplevelData ? (toplevelData.title || "(Unnamed)") : "(Unnamed)"
|
||||
property var toplevelObject: toplevelData
|
||||
property int windowCount: isGrouped ? modelData.windows.length : 1
|
||||
property string tooltipText: {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
const moddedId = Paths.moddedAppId(appId);
|
||||
const desktopEntry = moddedId ? DesktopEntries.heuristicLookup(moddedId) : null;
|
||||
const appName = appId ? Paths.getAppName(appId, desktopEntry) : "Unknown";
|
||||
const desktopEntry = effectiveAppId ? DesktopEntries.heuristicLookup(effectiveAppId) : null;
|
||||
const appName = effectiveAppId ? Paths.getAppName(effectiveAppId, desktopEntry) : "Unknown";
|
||||
|
||||
if (isGrouped && windowCount > 1) {
|
||||
return appName + " (" + windowCount + " windows)";
|
||||
@@ -277,18 +280,17 @@ BasePill {
|
||||
IconImage {
|
||||
id: iconImg
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)) / 2) : Theme.spacingXS
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)) / 2) : Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
source: {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
root._appIdSubstitutionsTrigger;
|
||||
if (!appId)
|
||||
if (!effectiveAppId)
|
||||
return "";
|
||||
const moddedId = Paths.moddedAppId(appId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||
return Paths.getAppIcon(appId, desktopEntry);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId);
|
||||
return Paths.getAppIcon(effectiveAppId, desktopEntry);
|
||||
}
|
||||
smooth: true
|
||||
mipmap: true
|
||||
@@ -306,25 +308,23 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)) / 2) : Theme.spacingXS
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)) / 2) : Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
name: "sports_esports"
|
||||
color: Theme.widgetTextColor
|
||||
visible: !iconImg.visible && Paths.isSteamApp(appId)
|
||||
visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId)
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !iconImg.visible && !Paths.isSteamApp(appId)
|
||||
visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId)
|
||||
text: {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
if (!appId)
|
||||
if (!effectiveAppId)
|
||||
return "?";
|
||||
|
||||
const moddedId = Paths.moddedAppId(appId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||
const appName = Paths.getAppName(appId, desktopEntry);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId);
|
||||
const appName = Paths.getAppName(effectiveAppId, desktopEntry);
|
||||
return appName.charAt(0).toUpperCase();
|
||||
}
|
||||
font.pixelSize: 10
|
||||
@@ -359,7 +359,7 @@ BasePill {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !(widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode)
|
||||
text: windowTitle
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
@@ -496,14 +496,17 @@ BasePill {
|
||||
property var toplevelData: isGrouped ? (modelData.windows.length > 0 ? modelData.windows[0].toplevel : null) : modelData
|
||||
property bool isFocused: isGrouped ? (root.focusedAppId === appId) : (toplevelData ? toplevelData.activated : false)
|
||||
property string appId: isGrouped ? modelData.appId : (modelData.appId || "")
|
||||
readonly property string effectiveAppId: {
|
||||
root._appIdSubstitutionsTrigger;
|
||||
return Paths.moddedAppId(appId);
|
||||
}
|
||||
property string windowTitle: toplevelData ? (toplevelData.title || "(Unnamed)") : "(Unnamed)"
|
||||
property var toplevelObject: toplevelData
|
||||
property int windowCount: isGrouped ? modelData.windows.length : 1
|
||||
property string tooltipText: {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
const moddedId = Paths.moddedAppId(appId);
|
||||
const desktopEntry = moddedId ? DesktopEntries.heuristicLookup(moddedId) : null;
|
||||
const appName = appId ? Paths.getAppName(appId, desktopEntry) : "Unknown";
|
||||
const desktopEntry = effectiveAppId ? DesktopEntries.heuristicLookup(effectiveAppId) : null;
|
||||
const appName = effectiveAppId ? Paths.getAppName(effectiveAppId, desktopEntry) : "Unknown";
|
||||
|
||||
if (isGrouped && windowCount > 1) {
|
||||
return appName + " (" + windowCount + " windows)";
|
||||
@@ -531,18 +534,17 @@ BasePill {
|
||||
IconImage {
|
||||
id: iconImg
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)) / 2) : Theme.spacingXS
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)) / 2) : Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
source: {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
root._appIdSubstitutionsTrigger;
|
||||
if (!appId)
|
||||
if (!effectiveAppId)
|
||||
return "";
|
||||
const moddedId = Paths.moddedAppId(appId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||
return Paths.getAppIcon(appId, desktopEntry);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId);
|
||||
return Paths.getAppIcon(effectiveAppId, desktopEntry);
|
||||
}
|
||||
smooth: true
|
||||
mipmap: true
|
||||
@@ -560,25 +562,23 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)) / 2) : Theme.spacingXS
|
||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)) / 2) : Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
name: "sports_esports"
|
||||
color: Theme.widgetTextColor
|
||||
visible: !iconImg.visible && Paths.isSteamApp(appId)
|
||||
visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId)
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !iconImg.visible && !Paths.isSteamApp(appId)
|
||||
visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId)
|
||||
text: {
|
||||
root._desktopEntriesUpdateTrigger;
|
||||
if (!appId)
|
||||
if (!effectiveAppId)
|
||||
return "?";
|
||||
|
||||
const moddedId = Paths.moddedAppId(appId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||
const appName = Paths.getAppName(appId, desktopEntry);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId);
|
||||
const appName = Paths.getAppName(effectiveAppId, desktopEntry);
|
||||
return appName.charAt(0).toUpperCase();
|
||||
}
|
||||
font.pixelSize: 10
|
||||
@@ -613,7 +613,7 @@ BasePill {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !(widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode)
|
||||
text: windowTitle
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
||||
@@ -137,7 +137,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property real trayItemSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground) + 6
|
||||
readonly property real trayItemSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) + 6
|
||||
|
||||
readonly property real minTooltipY: {
|
||||
if (!parentScreen || !isVerticalOrientation) {
|
||||
@@ -277,8 +277,8 @@ BasePill {
|
||||
IconImage {
|
||||
id: iconImg
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
source: delegateRoot.iconSource
|
||||
asynchronous: true
|
||||
smooth: true
|
||||
@@ -405,7 +405,7 @@ BasePill {
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: root.menuOpen ? "expand_less" : "expand_more"
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
}
|
||||
|
||||
@@ -534,8 +534,8 @@ BasePill {
|
||||
IconImage {
|
||||
id: iconImg
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
source: delegateRoot.iconSource
|
||||
asynchronous: true
|
||||
smooth: true
|
||||
@@ -669,7 +669,7 @@ BasePill {
|
||||
return root.menuOpen ? "chevron_right" : "chevron_left";
|
||||
}
|
||||
}
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetTextColor
|
||||
}
|
||||
|
||||
@@ -1029,8 +1029,8 @@ BasePill {
|
||||
IconImage {
|
||||
id: menuIconImg
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground)
|
||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
source: parent.iconSource
|
||||
asynchronous: true
|
||||
smooth: true
|
||||
|
||||
@@ -72,7 +72,7 @@ BasePill {
|
||||
return "system_update_alt";
|
||||
return "check_circle";
|
||||
}
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (SystemUpdateService.hasError)
|
||||
return Theme.error;
|
||||
@@ -106,8 +106,8 @@ BasePill {
|
||||
color: Theme.error
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.rightMargin: (barConfig?.noBackground ?? false) ? 0 : 6
|
||||
anchors.topMargin: (barConfig?.noBackground ?? false) ? 0 : 6
|
||||
anchors.rightMargin: (barConfig?.removeWidgetPadding ?? false) ? 0 : 6
|
||||
anchors.topMargin: (barConfig?.removeWidgetPadding ?? false) ? 0 : 6
|
||||
visible: root.isVerticalOrientation && root.hasUpdates && !root.isChecking
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ BasePill {
|
||||
return "system_update_alt";
|
||||
return "check_circle";
|
||||
}
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: {
|
||||
if (SystemUpdateService.hasError)
|
||||
return Theme.error;
|
||||
@@ -160,7 +160,7 @@ BasePill {
|
||||
id: countText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: SystemUpdateService.updateCount.toString()
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
visible: root.hasUpdates && !root.isChecking
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ BasePill {
|
||||
id: icon
|
||||
|
||||
name: DMSNetworkService.connected ? "vpn_lock" : "vpn_key_off"
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: DMSNetworkService.connected ? Theme.primary : Theme.widgetIconColor
|
||||
opacity: DMSNetworkService.isBusy ? 0.5 : 1.0
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -30,7 +30,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: WeatherService.getWeatherIcon(WeatherService.weather.wCode)
|
||||
size: Theme.barIconSize(root.barThickness, -6, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -6, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetIconColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -43,7 +43,7 @@ BasePill {
|
||||
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp;
|
||||
return temp;
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
@@ -57,7 +57,7 @@ BasePill {
|
||||
|
||||
DankIcon {
|
||||
name: WeatherService.getWeatherIcon(WeatherService.weather.wCode)
|
||||
size: Theme.barIconSize(root.barThickness, -6, root.barConfig?.noBackground)
|
||||
size: Theme.barIconSize(root.barThickness, -6, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
color: Theme.widgetIconColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
@@ -70,7 +70,7 @@ BasePill {
|
||||
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp;
|
||||
return temp + "°" + (SettingsData.useFahrenheit ? "F" : "C");
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
@@ -282,14 +282,15 @@ Item {
|
||||
}
|
||||
|
||||
const keyBase = (w.app_id || w.appId || w.class || w.windowClass || "unknown");
|
||||
const key = isActiveWs || !SettingsData.groupWorkspaceApps ? `${keyBase}_${i}` : keyBase;
|
||||
const moddedId = Paths.moddedAppId(keyBase);
|
||||
const key = isActiveWs || !SettingsData.groupWorkspaceApps ? `${moddedId}_${i}` : moddedId;
|
||||
|
||||
if (!byApp[key]) {
|
||||
const isQuickshell = keyBase === "org.quickshell";
|
||||
const isSteamApp = Paths.isSteamApp(keyBase);
|
||||
const moddedId = Paths.moddedAppId(keyBase);
|
||||
const isSteamApp = Paths.isSteamApp(moddedId);
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||
const icon = Paths.getAppIcon(keyBase, desktopEntry);
|
||||
const icon = Paths.getAppIcon(moddedId, desktopEntry);
|
||||
const appName = Paths.getAppName(moddedId, desktopEntry);
|
||||
byApp[key] = {
|
||||
"type": "icon",
|
||||
"icon": icon,
|
||||
@@ -298,7 +299,7 @@ Item {
|
||||
"active": !!((w.activated || w.is_focused) || (CompositorService.isNiri && w.is_focused)),
|
||||
"count": 1,
|
||||
"windowId": w.address || w.id,
|
||||
"fallbackText": w.appId || w.class || w.title || ""
|
||||
"fallbackText": appName || ""
|
||||
};
|
||||
} else {
|
||||
byApp[key].count++;
|
||||
@@ -515,10 +516,11 @@ Item {
|
||||
return activeWs ? (activeWs.id || activeWs.name || "1") : "1";
|
||||
}
|
||||
|
||||
readonly property real padding: Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||
readonly property real dpr: parentScreen ? CompositorService.getScreenScale(parentScreen) : 1
|
||||
readonly property real padding: (root.barConfig?.removeWidgetPadding ?? false) ? 0 : Theme.snap((root.barConfig?.widgetPadding ?? 12) * (widgetHeight / 30), dpr)
|
||||
readonly property real visualWidth: isVertical ? widgetHeight : (workspaceRow.implicitWidth + padding * 2)
|
||||
readonly property real visualHeight: isVertical ? (workspaceRow.implicitHeight + padding * 2) : widgetHeight
|
||||
readonly property real appIconSize: Theme.barIconSize(barThickness, -6 + SettingsData.workspaceAppIconSizeOffset, root.barConfig?.noBackground)
|
||||
readonly property real appIconSize: Theme.barIconSize(barThickness, -6 + SettingsData.workspaceAppIconSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||
|
||||
function getRealWorkspaces() {
|
||||
return root.workspaceList.filter(ws => {
|
||||
@@ -925,9 +927,11 @@ Item {
|
||||
return false;
|
||||
}
|
||||
readonly property var loadedIconData: {
|
||||
if (isPlaceholder) return null;
|
||||
if (isPlaceholder)
|
||||
return null;
|
||||
const name = modelData?.name;
|
||||
if (!name) return null;
|
||||
if (!name)
|
||||
return null;
|
||||
return SettingsData.getWorkspaceNameIcon(name);
|
||||
}
|
||||
readonly property bool loadedHasIcon: loadedIconData !== null
|
||||
@@ -987,12 +991,12 @@ Item {
|
||||
return (SettingsData.groupWorkspaceApps && !isActive) ? groupedCount : totalCount;
|
||||
}
|
||||
|
||||
readonly property real baseWidth: root.isVertical ? (SettingsData.showWorkspaceApps ? Math.max(widgetHeight * 0.7, root.appIconSize + Theme.spacingXS * 2) : widgetHeight * 0.5) : (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7)
|
||||
readonly property real baseHeight: root.isVertical ? (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7) : (SettingsData.showWorkspaceApps ? Math.max(widgetHeight * 0.7, root.appIconSize + Theme.spacingXS * 2) : widgetHeight * 0.5)
|
||||
readonly property real baseWidth: root.isVertical ? (SettingsData.showWorkspaceApps ? Math.max(widgetHeight * 0.7, root.appIconSize + Theme.spacingXS * 2) : widgetHeight * 0.5) : (isActive ? Math.max(root.widgetHeight * 1.05, root.appIconSize * 1.6) : Math.max(root.widgetHeight * 0.7, root.appIconSize * 1.2))
|
||||
readonly property real baseHeight: root.isVertical ? (isActive ? Math.max(root.widgetHeight * 1.05, root.appIconSize * 1.6) : Math.max(root.widgetHeight * 0.7, root.appIconSize * 1.2)) : (SettingsData.showWorkspaceApps ? Math.max(widgetHeight * 0.7, root.appIconSize + Theme.spacingXS * 2) : widgetHeight * 0.5)
|
||||
readonly property bool hasWorkspaceName: SettingsData.showWorkspaceName && modelData?.name && modelData.name !== ""
|
||||
readonly property bool workspaceNamesEnabled: SettingsData.showWorkspaceName && (CompositorService.isNiri || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
readonly property real contentImplicitWidth: hasWorkspaceName ? (appIconsLoader.item?.contentWidth ?? 0) : 0
|
||||
readonly property real contentImplicitHeight: workspaceNamesEnabled ? (appIconsLoader.item?.contentHeight ?? 0) : 0
|
||||
readonly property real contentImplicitWidth: appIconsLoader.item?.contentWidth ?? 0
|
||||
readonly property real contentImplicitHeight: appIconsLoader.item?.contentHeight ?? 0
|
||||
|
||||
readonly property real iconsExtraWidth: {
|
||||
if (!root.isVertical && SettingsData.showWorkspaceApps && stableIconCount > 0) {
|
||||
@@ -1423,7 +1427,7 @@ Item {
|
||||
id: wsIcon
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
name: loadedIconData?.value ?? ""
|
||||
size: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
size: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
color: (isActive || isUrgent) ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
|
||||
weight: (isActive && !isPlaceholder) ? 500 : 400
|
||||
}
|
||||
@@ -1439,7 +1443,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: loadedIconData?.value ?? ""
|
||||
color: (isActive || isUrgent) ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
font.weight: (isActive && !isPlaceholder) ? Font.DemiBold : Font.Normal
|
||||
}
|
||||
}
|
||||
@@ -1454,7 +1458,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: loadedHasIcon ? (modelData?.name ?? "") : root.getWorkspaceIndex(modelData, index)
|
||||
color: (isActive || isUrgent) ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
font.weight: (isActive && !isPlaceholder) ? Font.DemiBold : Font.Normal
|
||||
}
|
||||
}
|
||||
@@ -1470,9 +1474,44 @@ Item {
|
||||
IconImage {
|
||||
id: rowAppIcon
|
||||
anchors.fill: parent
|
||||
source: modelData.icon
|
||||
source: modelData.icon || ""
|
||||
opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||
visible: !modelData.isQuickshell && !modelData.isSteamApp
|
||||
visible: !modelData.isQuickshell && !modelData.isSteamApp && status === Image.Ready
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: !modelData.isQuickshell && !modelData.isSteamApp && rowAppIcon.status !== Image.Ready
|
||||
color: Theme.surfaceContainer
|
||||
radius: Theme.cornerRadius * (root.appIconSize / 40)
|
||||
border.width: 1
|
||||
border.color: Theme.primarySelected
|
||||
opacity: (modelData.active || isActive) ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: (modelData.fallbackText || "?").charAt(0).toUpperCase()
|
||||
font.pixelSize: parent.width * 0.45
|
||||
color: Theme.primary
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: !modelData.isQuickshell && modelData.isSteamApp && rowSteamIcon.status !== Image.Ready
|
||||
color: Theme.surfaceContainer
|
||||
radius: Theme.cornerRadius * (root.appIconSize / 40)
|
||||
border.width: 1
|
||||
border.color: Theme.primarySelected
|
||||
opacity: (modelData.active || isActive) ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
size: parent.width * 0.7
|
||||
name: "sports_esports"
|
||||
color: Theme.primary
|
||||
}
|
||||
}
|
||||
|
||||
IconImage {
|
||||
@@ -1555,7 +1594,7 @@ Item {
|
||||
visible: loadedHasIcon && loadedIconData?.type === "icon"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
name: loadedIconData?.value ?? ""
|
||||
size: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
size: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
color: (isActive || isUrgent) ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
|
||||
weight: (isActive && !isPlaceholder) ? 500 : 400
|
||||
}
|
||||
@@ -1565,7 +1604,7 @@ Item {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: loadedIconData?.value ?? ""
|
||||
color: (isActive || isUrgent) ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
font.weight: (isActive && !isPlaceholder) ? Font.DemiBold : Font.Normal
|
||||
}
|
||||
|
||||
@@ -1574,7 +1613,7 @@ Item {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: loadedHasIcon ? (root.isVertical ? (modelData?.name ?? "").charAt(0) : (modelData?.name ?? "")) : root.getWorkspaceIndex(modelData, index)
|
||||
color: (isActive || isUrgent) ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale)
|
||||
font.pixelSize: Theme.barTextSize(barThickness, barConfig?.fontScale, barConfig?.maximizeWidgetText)
|
||||
font.weight: (isActive && !isPlaceholder) ? Font.DemiBold : Font.Normal
|
||||
}
|
||||
|
||||
@@ -1589,9 +1628,44 @@ Item {
|
||||
IconImage {
|
||||
id: colAppIcon
|
||||
anchors.fill: parent
|
||||
source: modelData.icon
|
||||
source: modelData.icon || ""
|
||||
opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||
visible: !modelData.isQuickshell && !modelData.isSteamApp
|
||||
visible: !modelData.isQuickshell && !modelData.isSteamApp && status === Image.Ready
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: !modelData.isQuickshell && !modelData.isSteamApp && colAppIcon.status !== Image.Ready
|
||||
color: Theme.surfaceContainer
|
||||
radius: Theme.cornerRadius * (root.appIconSize / 40)
|
||||
border.width: 1
|
||||
border.color: Theme.primarySelected
|
||||
opacity: (modelData.active || isActive) ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: (modelData.fallbackText || "?").charAt(0).toUpperCase()
|
||||
font.pixelSize: parent.width * 0.45
|
||||
color: Theme.primary
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: !modelData.isQuickshell && modelData.isSteamApp && colSteamIcon.status !== Image.Ready
|
||||
color: Theme.surfaceContainer
|
||||
radius: Theme.cornerRadius * (root.appIconSize / 40)
|
||||
border.width: 1
|
||||
border.color: Theme.primarySelected
|
||||
opacity: (modelData.active || isActive) ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
size: parent.width * 0.7
|
||||
name: "sports_esports"
|
||||
color: Theme.primary
|
||||
}
|
||||
}
|
||||
|
||||
IconImage {
|
||||
@@ -1665,7 +1739,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: updateAllData()
|
||||
|
||||
@@ -26,7 +26,14 @@ Item {
|
||||
property bool usePlayerVolume: activePlayer && activePlayer.volumeSupported && !__isChromeBrowser
|
||||
property real currentVolume: usePlayerVolume ? activePlayer.volume : (AudioService.sink?.audio?.volume ?? 0)
|
||||
property bool volumeAvailable: (activePlayer && activePlayer.volumeSupported && !__isChromeBrowser) || (AudioService.sink && AudioService.sink.audio)
|
||||
property var availableDevices: Pipewire.nodes.values.filter(node => node.audio && node.isSink && !node.isStream)
|
||||
property var availableDevices: {
|
||||
const hidden = SessionData.hiddenOutputDeviceNames ?? [];
|
||||
return Pipewire.nodes.values.filter(node => {
|
||||
if (!node.audio || !node.isSink || node.isStream)
|
||||
return false;
|
||||
return !hidden.includes(node.name);
|
||||
});
|
||||
}
|
||||
|
||||
signal closeRequested
|
||||
signal deviceSelected(var device)
|
||||
|
||||
@@ -34,6 +34,8 @@ Variants {
|
||||
property bool groupByApp: SettingsData.dockGroupByApp
|
||||
readonly property int borderThickness: SettingsData.dockBorderEnabled ? SettingsData.dockBorderThickness : 0
|
||||
|
||||
readonly property int hasApps: dockApps.implicitWidth > 0 || dockApps.implicitHeight > 0
|
||||
|
||||
readonly property real widgetHeight: SettingsData.dockIconSize
|
||||
readonly property real effectiveBarHeight: widgetHeight + SettingsData.dockSpacing * 2 + 10 + borderThickness * 2
|
||||
function getBarHeight(barConfig) {
|
||||
@@ -376,21 +378,27 @@ Variants {
|
||||
const screenY = dock.screen ? (dock.screen.y || 0) : 0;
|
||||
const screenHeight = dock.screen ? dock.screen.height : 0;
|
||||
|
||||
const gap = Theme.spacingS;
|
||||
const bgMargin = barSpacing + SettingsData.dockMargin + 1 + dock.borderThickness;
|
||||
const btnW = dock.hoveredButton.width;
|
||||
const btnH = dock.hoveredButton.height;
|
||||
|
||||
if (!dock.isVertical) {
|
||||
const isBottom = SettingsData.dockPosition === SettingsData.Position.Bottom;
|
||||
const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2 + adjacentLeftBarWidth;
|
||||
const globalX = buttonGlobalPos.x + btnW / 2 + adjacentLeftBarWidth;
|
||||
const tooltipHeight = 32;
|
||||
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + barSpacing + Theme.spacingM;
|
||||
const screenRelativeY = isBottom ? (screenHeight - tooltipOffset - tooltipHeight) : tooltipOffset;
|
||||
const totalFromEdge = bgMargin + dockBackground.height + dock.borderThickness + gap;
|
||||
const screenRelativeY = isBottom ? (screenHeight - totalFromEdge - tooltipHeight) : totalFromEdge;
|
||||
dockTooltip.show(tooltipText, globalX, screenRelativeY, dock.screen, false, false);
|
||||
return;
|
||||
}
|
||||
|
||||
const isLeft = SettingsData.dockPosition === SettingsData.Position.Left;
|
||||
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + barSpacing + Theme.spacingM;
|
||||
const tooltipX = isLeft ? tooltipOffset : (dock.screen.width - tooltipOffset);
|
||||
const screenRelativeY = buttonGlobalPos.y - screenY + dock.hoveredButton.height / 2 + adjacentTopBarHeight;
|
||||
dockTooltip.show(tooltipText, screenX + tooltipX, screenRelativeY, dock.screen, isLeft, !isLeft);
|
||||
const screenWidth = dock.screen ? dock.screen.width : 0;
|
||||
const totalFromEdge = bgMargin + dockBackground.width + dock.borderThickness + gap;
|
||||
const tooltipX = isLeft ? (screenX + totalFromEdge) : (screenX + screenWidth - totalFromEdge);
|
||||
const screenRelativeY = buttonGlobalPos.y - screenY + btnH / 2 + adjacentTopBarHeight;
|
||||
dockTooltip.show(tooltipText, tooltipX, screenRelativeY, dock.screen, isLeft, !isLeft);
|
||||
}
|
||||
|
||||
Connections {
|
||||
@@ -564,7 +572,7 @@ Variants {
|
||||
y: dockBackground.y - borderThickness
|
||||
width: dockBackground.width + borderThickness * 2
|
||||
height: dockBackground.height + borderThickness * 2
|
||||
visible: SettingsData.dockBorderEnabled
|
||||
visible: SettingsData.dockBorderEnabled && dock.hasApps
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
|
||||
readonly property real borderThickness: Math.max(1, dock.borderThickness)
|
||||
|
||||
@@ -7,7 +7,7 @@ A greeter for [greetd](https://github.com/kennylevinsen/greetd) that follows the
|
||||
- **Multi user**: Login with any system user
|
||||
- **dms sync**: Sync settings with dms for consistent styling between shell and greeter
|
||||
- **Multiple compositors**: Supports niri, Hyprland, Sway, or mangowc.
|
||||
- **Custom PAM**: Supports custom PAM configuration in `/etc/pam.d/dankshell`
|
||||
- **Custom PAM**: Supports custom PAM configuration in `/etc/pam.d/greetd`
|
||||
- **Session Memory**: Remembers last selected session and user
|
||||
|
||||
## Installation
|
||||
@@ -22,11 +22,32 @@ paru -S greetd-dms-greeter-git
|
||||
yay -S greetd-dms-greeter-git
|
||||
```
|
||||
|
||||
Once installed, disable any existing display manager and enable greetd:
|
||||
### Debian / openSUSE
|
||||
|
||||
Official packages are available from the [DankLinux OBS repository](https://software.opensuse.org/download/package?package=dms-greeter&project=home%3AAvengeMedia%3Adanklinux). Add the repo for your distribution and install:
|
||||
|
||||
```bash
|
||||
sudo systemctl disable gdm sddm lightdm
|
||||
sudo systemctl enable greetd
|
||||
# Debian 13
|
||||
sudo apt install dms-greeter # after adding the repo
|
||||
|
||||
# openSUSE Tumbleweed
|
||||
zypper install dms-greeter # after adding the repo
|
||||
```
|
||||
|
||||
See the [Installation guide](https://danklinux.com/docs/dankgreeter/installation) for full repository setup.
|
||||
|
||||
If you previously installed manually, remove legacy files first:
|
||||
|
||||
```bash
|
||||
sudo rm -f /usr/local/bin/dms-greeter
|
||||
sudo rm -rf /etc/xdg/quickshell/dms-greeter
|
||||
```
|
||||
|
||||
Then complete setup:
|
||||
|
||||
```bash
|
||||
dms greeter enable
|
||||
dms greeter sync
|
||||
```
|
||||
|
||||
#### Syncing themes (Optional)
|
||||
@@ -79,43 +100,32 @@ The package automatically:
|
||||
- Sets up directories and permissions
|
||||
- Configures greetd with auto-detected compositor
|
||||
- Applies SELinux contexts
|
||||
- Installs the `dms-greeter-sync` helper script
|
||||
|
||||
Then disable existing display manager and enable greetd:
|
||||
Then complete setup:
|
||||
|
||||
```bash
|
||||
sudo systemctl disable gdm sddm lightdm
|
||||
sudo systemctl enable greetd
|
||||
dms greeter enable
|
||||
dms greeter sync
|
||||
```
|
||||
|
||||
#### Syncing themes (Optional)
|
||||
|
||||
The RPM package includes the `dms-greeter-sync` helper for easy theme syncing:
|
||||
Run:
|
||||
|
||||
```bash
|
||||
dms-greeter-sync
|
||||
dms greeter sync
|
||||
```
|
||||
|
||||
Then logout/login to see your wallpaper on the greeter!
|
||||
|
||||
<details>
|
||||
<summary>What does dms-greeter-sync do?</summary>
|
||||
|
||||
The `dms-greeter-sync` helper automatically:
|
||||
- Adds you to the greeter group
|
||||
- Sets minimal ACL permissions on parent directories (traverse only)
|
||||
- Sets group ownership on your DMS config directories
|
||||
- Creates symlinks to share your theme files with the greeter
|
||||
|
||||
This uses standard Linux ACLs (Access Control Lists) - the same security model used by GNOME, KDE, and systemd. The greeter user only gets traverse permission through your directories and can only read the specific theme files you share.
|
||||
|
||||
</details>
|
||||
Then logout/login to see your wallpaper on the greeter.
|
||||
|
||||
### Automatic
|
||||
|
||||
The easiest thing is to run `dms greeter install` or `dms` for interactive installation.
|
||||
On Debian/openSUSE, this now prefers the `dms-greeter` package when the OBS repo is configured.
|
||||
|
||||
### Manual
|
||||
### Manual (fallback only)
|
||||
|
||||
Use this only if no package is available for your distro.
|
||||
|
||||
1. Install `greetd` (in most distro's standard repositories) and `quickshell`
|
||||
|
||||
@@ -211,7 +221,7 @@ vt = 1
|
||||
|
||||
[default_session]
|
||||
user = "greeter"
|
||||
command = "/usr/local/bin/dms-greeter --command niri"
|
||||
command = "/usr/bin/dms-greeter --command niri"
|
||||
```
|
||||
|
||||
### Manual usage
|
||||
@@ -234,7 +244,7 @@ Simply edit `/etc/greetd/dms-niri.kdl` or `/etc/greetd/dms-hypr.conf` to change
|
||||
|
||||
The greeter can be personalized with wallpapers, themes, weather, clock formats, and more - configured exactly the same as dms.
|
||||
|
||||
**Easiest method:** Run `dms-greeter-sync` to automatically sync your DMS theme with the greeter.
|
||||
**Easiest method:** Run `dms greeter sync` to automatically sync your DMS theme with the greeter.
|
||||
|
||||
**Manual method:** You can manually synchronize configurations if you want greeter settings to always mirror your shell:
|
||||
|
||||
|
||||
@@ -35,6 +35,14 @@ Examples:
|
||||
EOF
|
||||
}
|
||||
|
||||
require_command() {
|
||||
local cmd="$1"
|
||||
if ! command -v "$cmd" >/dev/null 2>&1; then
|
||||
echo "Error: required command '$cmd' was not found in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--command)
|
||||
@@ -107,14 +115,23 @@ export DMS_GREET_CFG_DIR="$CACHE_DIR"
|
||||
|
||||
mkdir -p "$CACHE_DIR"
|
||||
|
||||
QS_CMD="qs"
|
||||
if command -v qs >/dev/null 2>&1; then
|
||||
QS_BIN="qs"
|
||||
elif command -v quickshell >/dev/null 2>&1; then
|
||||
QS_BIN="quickshell"
|
||||
else
|
||||
echo "Error: neither 'qs' nor 'quickshell' was found in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
QS_CMD="$QS_BIN"
|
||||
if [[ "$DMS_PATH" == /* ]]; then
|
||||
QS_CMD="qs -p $DMS_PATH"
|
||||
QS_CMD="$QS_BIN -p $DMS_PATH"
|
||||
else
|
||||
RESOLVED_PATH=$(locate_dms_config "$DMS_PATH")
|
||||
if [[ $? -eq 0 && -n "$RESOLVED_PATH" ]]; then
|
||||
echo "Located DMS config at: $RESOLVED_PATH" >&2
|
||||
QS_CMD="qs -p $RESOLVED_PATH"
|
||||
QS_CMD="$QS_BIN -p $RESOLVED_PATH"
|
||||
else
|
||||
echo "Error: Could not find DMS config '$DMS_PATH' (shell.qml) in any valid config path" >&2
|
||||
exit 1
|
||||
@@ -123,6 +140,7 @@ fi
|
||||
|
||||
case "$COMPOSITOR" in
|
||||
niri)
|
||||
require_command "niri"
|
||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
# base/default config
|
||||
@@ -178,6 +196,10 @@ NIRI_EOF
|
||||
;;
|
||||
|
||||
hyprland)
|
||||
if ! command -v start-hyprland >/dev/null 2>&1 && ! command -v Hyprland >/dev/null 2>&1; then
|
||||
echo "Error: neither 'start-hyprland' nor 'Hyprland' was found in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
cat > "$TEMP_CONFIG" << HYPRLAND_EOF
|
||||
@@ -207,6 +229,7 @@ HYPRLAND_EOF
|
||||
;;
|
||||
|
||||
sway)
|
||||
require_command "sway"
|
||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
cat > "$TEMP_CONFIG" << SWAY_EOF
|
||||
@@ -226,6 +249,7 @@ SWAY_EOF
|
||||
;;
|
||||
|
||||
scroll)
|
||||
require_command "scroll"
|
||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
cat > "$TEMP_CONFIG" << SCROLL_EOF
|
||||
@@ -245,6 +269,7 @@ SCROLL_EOF
|
||||
;;
|
||||
|
||||
miracle|miracle-wm)
|
||||
require_command "miracle-wm"
|
||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
cat > "$TEMP_CONFIG" << MIRACLE_EOF
|
||||
@@ -264,6 +289,7 @@ MIRACLE_EOF
|
||||
;;
|
||||
|
||||
labwc)
|
||||
require_command "labwc"
|
||||
if [[ -n "$COMPOSITOR_CONFIG" ]]; then
|
||||
exec labwc --config "$COMPOSITOR_CONFIG" --session "$QS_CMD"
|
||||
else
|
||||
@@ -272,6 +298,7 @@ MIRACLE_EOF
|
||||
;;
|
||||
|
||||
mango|mangowc)
|
||||
require_command "mango"
|
||||
if [[ -n "$COMPOSITOR_CONFIG" ]]; then
|
||||
exec mango -c "$COMPOSITOR_CONFIG" -s "$QS_CMD && mmsg -d quit"
|
||||
else
|
||||
|
||||
@@ -282,7 +282,7 @@ Item {
|
||||
|
||||
onFileSelected: path => {
|
||||
root.fileDialogOpen = false;
|
||||
const cleanPath = path.toString().replace(/^file:\/\//, '');
|
||||
const cleanPath = decodeURI(path.toString().replace(/^file:\/\//, ''));
|
||||
const fileName = cleanPath.split('/').pop();
|
||||
const fileUrl = "file://" + cleanPath;
|
||||
|
||||
|
||||
@@ -22,27 +22,14 @@ DankOSD {
|
||||
text: root.deviceName
|
||||
}
|
||||
|
||||
function getIconForSink(sink) {
|
||||
if (!sink)
|
||||
return "speaker";
|
||||
const name = sink.name || "";
|
||||
if (name.includes("bluez"))
|
||||
return "headset";
|
||||
if (name.includes("hdmi"))
|
||||
return "tv";
|
||||
if (name.includes("usb"))
|
||||
return "headset";
|
||||
return "speaker";
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AudioService
|
||||
|
||||
function onAudioOutputCycled(name) {
|
||||
function onAudioOutputCycled(name, icon) {
|
||||
if (!SettingsData.osdAudioOutputEnabled)
|
||||
return;
|
||||
root.deviceName = name;
|
||||
root.deviceIcon = getIconForSink(AudioService.sink);
|
||||
root.deviceIcon = icon;
|
||||
root.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ Item {
|
||||
property bool isTopBarEdge: false
|
||||
property bool isBottomBarEdge: false
|
||||
readonly property real dpr: parentScreen ? CompositorService.getScreenScale(parentScreen) : 1
|
||||
readonly property real horizontalPadding: (barConfig?.noBackground ?? false) ? 0 : Theme.snap(Math.max(Theme.spacingXS, Theme.spacingS * (widgetThickness / 30)), dpr)
|
||||
readonly property real horizontalPadding: (barConfig?.removeWidgetPadding ?? false) ? 0 : Theme.snap((barConfig?.widgetPadding ?? 12) * (widgetThickness / 30), dpr)
|
||||
readonly property real visualWidth: Theme.snap(isVerticalOrientation ? widgetThickness : (contentLoader.item ? (contentLoader.item.implicitWidth + horizontalPadding * 2) : 0), dpr)
|
||||
readonly property real visualHeight: Theme.snap(isVerticalOrientation ? (contentLoader.item ? (contentLoader.item.implicitHeight + horizontalPadding * 2) : 0) : widgetThickness, dpr)
|
||||
readonly property alias visualContent: visualContent
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user