1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-31 08:52:49 -05:00

Compare commits

..

19 Commits

Author SHA1 Message Date
bbedward
119b5df6df gamma: fix initial night mode enablement 2025-12-12 10:15:38 -05:00
bbedward
8ede810d32 settings: make default height screen-aware 2025-12-12 10:14:33 -05:00
bbedward
830dd93af5 chore: bump version to v1.0.1 2025-12-12 10:04:47 -05:00
bbedward
75f28c5ea7 ci: switch to dispatch-based release flow 2025-12-12 10:04:20 -05:00
bbedward
6c9b8c590e dankinstall: call add-wants for niri/hyprland with dms service 2025-12-12 10:04:20 -05:00
bbedward
24d9b77307 niri: fix keybind handling of cooldown-ms parameter 2025-12-12 10:04:20 -05:00
bbedward
d4be68912c workspaces: make icons scale with bar size, fixi valign of numbers fixes #990 2025-12-12 10:04:20 -05:00
bbedward
a443721000 core: fix socket reported CLI version 2025-12-12 10:03:32 -05:00
bbedward
786b097187 plugins: hide uninstall and update buttons for system plugins 2025-12-12 10:03:18 -05:00
bbedward
8ca60c7d2a dwl: fix layout popout not opening fixes #980 2025-12-12 10:03:04 -05:00
bbedward
406dc64aba wf: disable update-versions job 2025-12-10 10:50:47 -05:00
dms-ci[bot]
af5d6a2015 chore: bump version to v1.0.0 2025-12-10 15:43:36 +00:00
bbedward
61c6f509ae i18n: update translations 2025-12-10 09:32:57 -05:00
Marcus Ramberg
98769ecd88 nix: switch to standard nixpkgs rfc formatting (#962) 2025-12-10 04:55:45 -03:00
bbedward
8615950bd6 cc: allow 75 width sliders 2025-12-10 00:48:27 -05:00
bbedward
1bec8dfc48 vpn: make import modal floating variant 2025-12-10 00:30:45 -05:00
bbedward
460486fe25 media: fix media player updates 2025-12-09 23:59:04 -05:00
bbedward
318c50bc6c media: block scrolling media volume in widget when no player vol avail 2025-12-09 23:45:01 -05:00
purian23
3e08bac7f3 distros: Prep dms-git build versioning 2025-12-09 23:25:34 -05:00
37 changed files with 969 additions and 716 deletions

View File

@@ -1,16 +1,19 @@
name: Release name: Release
on: on:
push: workflow_dispatch:
tags: inputs:
- 'v*' tag:
description: 'Tag to release (e.g., v1.0.1)'
required: true
type: string
permissions: permissions:
contents: write contents: write
actions: write actions: write
concurrency: concurrency:
group: release-${{ github.ref_name }} group: release-${{ inputs.tag }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
@@ -24,10 +27,14 @@ jobs:
run: run:
working-directory: core working-directory: core
env:
TAG: ${{ inputs.tag }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ inputs.tag }}
fetch-depth: 0 fetch-depth: 0
- name: Set up Go - name: Set up Go
@@ -54,7 +61,7 @@ jobs:
run: | run: |
set -eux set -eux
cd cmd/dankinstall cd cmd/dankinstall
go build -trimpath -ldflags "-s -w -X main.Version=${GITHUB_REF#refs/tags/}" \ go build -trimpath -ldflags "-s -w -X main.Version=${TAG}" \
-o ../../dankinstall-${{ matrix.arch }} -o ../../dankinstall-${{ matrix.arch }}
cd ../.. cd ../..
gzip -9 -k dankinstall-${{ matrix.arch }} gzip -9 -k dankinstall-${{ matrix.arch }}
@@ -68,7 +75,7 @@ jobs:
run: | run: |
set -eux set -eux
cd cmd/dms cd cmd/dms
go build -trimpath -ldflags "-s -w -X main.Version=${GITHUB_REF#refs/tags/}" \ go build -trimpath -ldflags "-s -w -X main.Version=${TAG}" \
-o ../../dms-${{ matrix.arch }} -o ../../dms-${{ matrix.arch }}
cd ../.. cd ../..
gzip -9 -k dms-${{ matrix.arch }} gzip -9 -k dms-${{ matrix.arch }}
@@ -91,7 +98,7 @@ jobs:
run: | run: |
set -eux set -eux
cd cmd/dms cd cmd/dms
go build -trimpath -tags distro_binary -ldflags "-s -w -X main.Version=${GITHUB_REF#refs/tags/}" \ go build -trimpath -tags distro_binary -ldflags "-s -w -X main.Version=${TAG}" \
-o ../../dms-distropkg-${{ matrix.arch }} -o ../../dms-distropkg-${{ matrix.arch }}
cd ../.. cd ../..
gzip -9 -k dms-distropkg-${{ matrix.arch }} gzip -9 -k dms-distropkg-${{ matrix.arch }}
@@ -128,60 +135,61 @@ jobs:
core/completion.zsh core/completion.zsh
if-no-files-found: error if-no-files-found: error
update-versions: # update-versions:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: build-core # needs: build-core
steps: # steps:
- name: Create GitHub App token # - name: Create GitHub App token
id: app_token # id: app_token
uses: actions/create-github-app-token@v1 # uses: actions/create-github-app-token@v1
with: # with:
app-id: ${{ secrets.APP_ID }} # app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }} # private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout # - name: Checkout
uses: actions/checkout@v4 # uses: actions/checkout@v4
with: # with:
token: ${{ steps.app_token.outputs.token }} # token: ${{ steps.app_token.outputs.token }}
fetch-depth: 0 # fetch-depth: 0
- name: Update VERSION # - name: Update VERSION
env: # env:
GH_TOKEN: ${{ steps.app_token.outputs.token }} # GH_TOKEN: ${{ steps.app_token.outputs.token }}
run: | # run: |
set -euo pipefail # set -euo pipefail
git config user.name "dms-ci[bot]" # git config user.name "dms-ci[bot]"
git config user.email "dms-ci[bot]@users.noreply.github.com" # git config user.email "dms-ci[bot]@users.noreply.github.com"
version="${GITHUB_REF#refs/tags/}" # version="${GITHUB_REF#refs/tags/}"
echo "Updating to version: $version" # echo "Updating to version: $version"
echo "${version}" > quickshell/VERSION # echo "${version}" > quickshell/VERSION
git add quickshell/VERSION # git add quickshell/VERSION
if ! git diff --cached --quiet; then # if ! git diff --cached --quiet; then
git commit -m "chore: bump version to $version" # git commit -m "chore: bump version to $version"
git pull --rebase origin master # git pull --rebase origin master
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git HEAD:master # git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git HEAD:master
fi # fi
git tag -f "${version}" # git tag -f "${version}"
git push -f https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git "${version}" # git push -f https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git "${version}"
release: release:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
needs: [build-core, update-versions] needs: [build-core] #, update-versions]
env: env:
TAG: ${{ github.ref_name }} TAG: ${{ inputs.tag }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ inputs.tag }}
fetch-depth: 0 fetch-depth: 0
- name: Fetch updated tag after version bump - name: Fetch updated tag after version bump
run: | run: |
git fetch origin --force tag ${{ github.ref_name }} git fetch origin --force tag ${TAG}
git checkout ${{ github.ref_name }} git checkout ${TAG}
- name: Download core artifacts - name: Download core artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
@@ -391,9 +399,13 @@ jobs:
trigger-obs-update: trigger-obs-update:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: release needs: release
env:
TAG: ${{ inputs.tag }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Install OSC - name: Install OSC
run: | run: |
@@ -413,16 +425,19 @@ jobs:
- name: Update OBS packages - name: Update OBS packages
run: | run: |
VERSION="${{ github.ref_name }}"
cd distro cd distro
bash scripts/obs-upload.sh dms "Update to $VERSION" bash scripts/obs-upload.sh dms "Update to ${TAG}"
trigger-ppa-update: trigger-ppa-update:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: release needs: release
env:
TAG: ${{ inputs.tag }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Install build dependencies - name: Install build dependencies
run: | run: |
@@ -446,7 +461,6 @@ jobs:
- name: Upload to PPA - name: Upload to PPA
run: | run: |
VERSION="${{ github.ref_name }}"
cd distro/ubuntu/ppa cd distro/ubuntu/ppa
bash create-and-upload.sh ../dms dms questing bash create-and-upload.sh ../dms dms questing
@@ -454,11 +468,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: release needs: release
env: env:
TAG: ${{ github.ref_name }} TAG: ${{ inputs.tag }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Determine version - name: Determine version
id: version id: version

View File

@@ -1 +0,0 @@
indentation = "FourSpaces"

View File

@@ -155,6 +155,7 @@ func runShellInteractive(session bool) {
errChan <- fmt.Errorf("server panic: %v", r) errChan <- fmt.Errorf("server panic: %v", r)
} }
}() }()
server.CLIVersion = Version
if err := server.Start(false); err != nil { if err := server.Start(false); err != nil {
errChan <- fmt.Errorf("server error: %w", err) errChan <- fmt.Errorf("server error: %w", err)
} }

View File

@@ -344,7 +344,7 @@ func (a *ArchDistribution) InstallPackages(ctx context.Context, dependencies []d
a.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err)) a.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err))
} }
if err := a.EnableDMSService(ctx); err != nil { if err := a.EnableDMSService(ctx, wm); err != nil {
a.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err)) a.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err))
} }

View File

@@ -597,12 +597,24 @@ TERMINAL=%s
return nil return nil
} }
func (b *BaseDistribution) EnableDMSService(ctx context.Context) error { func (b *BaseDistribution) EnableDMSService(ctx context.Context, wm deps.WindowManager) error {
cmd := exec.CommandContext(ctx, "systemctl", "--user", "enable", "--now", "dms") cmd := exec.CommandContext(ctx, "systemctl", "--user", "enable", "--now", "dms")
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
return fmt.Errorf("failed to enable dms service: %w", err) return fmt.Errorf("failed to enable dms service: %w", err)
} }
b.log("Enabled dms systemd user service") b.log("Enabled dms systemd user service")
switch wm {
case deps.WindowManagerNiri:
if err := exec.CommandContext(ctx, "systemctl", "--user", "add-wants", "niri.service", "dms").Run(); err != nil {
b.log("Warning: failed to add dms as a want for niri.service")
}
case deps.WindowManagerHyprland:
if err := exec.CommandContext(ctx, "systemctl", "--user", "add-wants", "hyprland-session.target", "dms").Run(); err != nil {
b.log("Warning: failed to add dms as a want for hyprland-session.target")
}
}
return nil return nil
} }

View File

@@ -312,7 +312,7 @@ func (d *DebianDistribution) InstallPackages(ctx context.Context, dependencies [
d.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err)) d.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err))
} }
if err := d.EnableDMSService(ctx); err != nil { if err := d.EnableDMSService(ctx, wm); err != nil {
d.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err)) d.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err))
} }

View File

@@ -353,7 +353,7 @@ func (f *FedoraDistribution) InstallPackages(ctx context.Context, dependencies [
f.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err)) f.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err))
} }
if err := f.EnableDMSService(ctx); err != nil { if err := f.EnableDMSService(ctx, wm); err != nil {
f.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err)) f.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err))
} }

View File

@@ -410,7 +410,7 @@ func (g *GentooDistribution) InstallPackages(ctx context.Context, dependencies [
g.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err)) g.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err))
} }
if err := g.EnableDMSService(ctx); err != nil { if err := g.EnableDMSService(ctx, wm); err != nil {
g.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err)) g.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err))
} }

View File

@@ -371,7 +371,7 @@ func (o *OpenSUSEDistribution) InstallPackages(ctx context.Context, dependencies
o.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err)) o.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err))
} }
if err := o.EnableDMSService(ctx); err != nil { if err := o.EnableDMSService(ctx, wm); err != nil {
o.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err)) o.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err))
} }

View File

@@ -331,7 +331,7 @@ func (u *UbuntuDistribution) InstallPackages(ctx context.Context, dependencies [
u.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err)) u.log(fmt.Sprintf("Warning: failed to write window manager config: %v", err))
} }
if err := u.EnableDMSService(ctx); err != nil { if err := u.EnableDMSService(ctx, wm); err != nil {
u.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err)) u.log(fmt.Sprintf("Warning: failed to enable dms service: %v", err))
} }

View File

@@ -6,6 +6,7 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"sort" "sort"
"strconv"
"strings" "strings"
"github.com/AvengeMedia/DankMaterialShell/core/internal/keybinds" "github.com/AvengeMedia/DankMaterialShell/core/internal/keybinds"
@@ -153,6 +154,7 @@ func (n *NiriProvider) convertKeybind(kb *NiriKeyBinding, subcategory string, co
Subcategory: subcategory, Subcategory: subcategory,
Source: source, Source: source,
HideOnOverlay: kb.HideOnOverlay, HideOnOverlay: kb.HideOnOverlay,
CooldownMs: kb.CooldownMs,
} }
if source == "dms" && conflicts != nil { if source == "dms" && conflicts != nil {
@@ -310,7 +312,9 @@ func (n *NiriProvider) extractOptions(node *document.Node) map[string]any {
opts["repeat"] = val.String() == "true" opts["repeat"] = val.String() == "true"
} }
if val, ok := node.Properties.Get("cooldown-ms"); ok { if val, ok := node.Properties.Get("cooldown-ms"); ok {
opts["cooldown-ms"] = val.String() if ms, err := strconv.Atoi(val.String()); err == nil {
opts["cooldown-ms"] = ms
}
} }
if val, ok := node.Properties.Get("allow-when-locked"); ok { if val, ok := node.Properties.Get("allow-when-locked"); ok {
opts["allow-when-locked"] = val.String() == "true" opts["allow-when-locked"] = val.String() == "true"
@@ -336,7 +340,14 @@ func (n *NiriProvider) buildBindNode(bind *overrideBind) *document.Node {
node.AddProperty("repeat", false, "") node.AddProperty("repeat", false, "")
} }
if v, ok := bind.Options["cooldown-ms"]; ok { if v, ok := bind.Options["cooldown-ms"]; ok {
node.AddProperty("cooldown-ms", v, "") switch val := v.(type) {
case int:
node.AddProperty("cooldown-ms", val, "")
case string:
if ms, err := strconv.Atoi(val); err == nil {
node.AddProperty("cooldown-ms", ms, "")
}
}
} }
if v, ok := bind.Options["allow-when-locked"]; ok && v == true { if v, ok := bind.Options["allow-when-locked"]; ok && v == true {
node.AddProperty("allow-when-locked", true, "") node.AddProperty("allow-when-locked", true, "")

View File

@@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"strconv"
"strings" "strings"
"github.com/sblinch/kdl-go" "github.com/sblinch/kdl-go"
@@ -17,6 +18,7 @@ type NiriKeyBinding struct {
Args []string Args []string
Description string Description string
HideOnOverlay bool HideOnOverlay bool
CooldownMs int
Source string Source string
} }
@@ -275,6 +277,7 @@ func (p *NiriParser) parseKeybindNode(node *document.Node, _ string) *NiriKeyBin
var description string var description string
var hideOnOverlay bool var hideOnOverlay bool
var cooldownMs int
if node.Properties != nil { if node.Properties != nil {
if val, ok := node.Properties.Get("hotkey-overlay-title"); ok { if val, ok := node.Properties.Get("hotkey-overlay-title"); ok {
switch val.ValueString() { switch val.ValueString() {
@@ -284,6 +287,9 @@ func (p *NiriParser) parseKeybindNode(node *document.Node, _ string) *NiriKeyBin
description = val.ValueString() description = val.ValueString()
} }
} }
if val, ok := node.Properties.Get("cooldown-ms"); ok {
cooldownMs, _ = strconv.Atoi(val.String())
}
} }
return &NiriKeyBinding{ return &NiriKeyBinding{
@@ -293,6 +299,7 @@ func (p *NiriParser) parseKeybindNode(node *document.Node, _ string) *NiriKeyBin
Args: args, Args: args,
Description: description, Description: description,
HideOnOverlay: hideOnOverlay, HideOnOverlay: hideOnOverlay,
CooldownMs: cooldownMs,
Source: p.currentSource, Source: p.currentSource,
} }
} }

View File

@@ -7,6 +7,7 @@ type Keybind struct {
Subcategory string `json:"subcat,omitempty"` Subcategory string `json:"subcat,omitempty"`
Source string `json:"source,omitempty"` Source string `json:"source,omitempty"`
HideOnOverlay bool `json:"hideOnOverlay,omitempty"` HideOnOverlay bool `json:"hideOnOverlay,omitempty"`
CooldownMs int `json:"cooldownMs,omitempty"`
Conflict *Keybind `json:"conflict,omitempty"` Conflict *Keybind `json:"conflict,omitempty"`
} }

View File

@@ -643,6 +643,16 @@ func (m *Manager) applyCurrentTemp() {
return return
} }
m.configMutex.RLock()
low, high := m.config.LowTemp, m.config.HighTemp
m.configMutex.RUnlock()
if low == high {
m.applyGamma(low)
m.updateStateFromSchedule()
return
}
if !m.hasValidSchedule() { if !m.hasValidSchedule() {
m.updateStateFromSchedule() m.updateStateFromSchedule()
return return

View File

@@ -5,7 +5,7 @@
%global pkg_summary DankMaterialShell - Material 3 inspired shell for Wayland compositors %global pkg_summary DankMaterialShell - Material 3 inspired shell for Wayland compositors
Name: dms Name: dms
Epoch: 1 Epoch: 2
Version: %{version} Version: %{version}
Release: 1%{?dist} Release: 1%{?dist}
Summary: %{pkg_summary} Summary: %{pkg_summary}

View File

@@ -1,33 +1,40 @@
{ {
config, config,
lib, lib,
pkgs, pkgs,
dmsPkgs, dmsPkgs,
... ...
}: let }:
cfg = config.programs.dankMaterialShell; let
in { cfg = config.programs.dankMaterialShell;
qmlPath = "${dmsPkgs.dms-shell}/share/quickshell/dms"; in
{
qmlPath = "${dmsPkgs.dms-shell}/share/quickshell/dms";
packages = packages = [
[ pkgs.material-symbols
pkgs.material-symbols pkgs.inter
pkgs.inter pkgs.fira-code
pkgs.fira-code
pkgs.ddcutil pkgs.ddcutil
pkgs.libsForQt5.qt5ct pkgs.libsForQt5.qt5ct
pkgs.kdePackages.qt6ct pkgs.kdePackages.qt6ct
dmsPkgs.dms-shell dmsPkgs.dms-shell
] ]
++ lib.optional cfg.enableSystemMonitoring dmsPkgs.dgop ++ lib.optional cfg.enableSystemMonitoring dmsPkgs.dgop
++ lib.optionals cfg.enableClipboard [pkgs.cliphist pkgs.wl-clipboard] ++ lib.optionals cfg.enableClipboard [
++ lib.optionals cfg.enableVPN [pkgs.glib pkgs.networkmanager] pkgs.cliphist
++ lib.optional cfg.enableBrightnessControl pkgs.brightnessctl pkgs.wl-clipboard
++ lib.optional cfg.enableColorPicker pkgs.hyprpicker ]
++ lib.optional cfg.enableDynamicTheming pkgs.matugen ++ lib.optionals cfg.enableVPN [
++ lib.optional cfg.enableAudioWavelength pkgs.cava pkgs.glib
++ lib.optional cfg.enableCalendarEvents pkgs.khal pkgs.networkmanager
++ lib.optional cfg.enableSystemSound pkgs.kdePackages.qtmultimedia; ]
++ lib.optional cfg.enableBrightnessControl pkgs.brightnessctl
++ lib.optional cfg.enableColorPicker pkgs.hyprpicker
++ lib.optional cfg.enableDynamicTheming pkgs.matugen
++ lib.optional cfg.enableAudioWavelength pkgs.cava
++ lib.optional cfg.enableCalendarEvents pkgs.khal
++ lib.optional cfg.enableSystemSound pkgs.kdePackages.qtmultimedia;
} }

View File

@@ -1,140 +1,164 @@
{ {
lib, lib,
config, config,
pkgs, pkgs,
dmsPkgs, dmsPkgs,
... ...
}: let }:
inherit (lib) types; let
cfg = config.programs.dankMaterialShell.greeter; inherit (lib) types;
cfg = config.programs.dankMaterialShell.greeter;
user = config.services.greetd.settings.default_session.user; inherit (config.services.greetd.settings.default_session) user;
cacheDir = "/var/lib/dms-greeter"; cacheDir = "/var/lib/dms-greeter";
greeterScript = pkgs.writeShellScriptBin "dms-greeter" '' greeterScript = pkgs.writeShellScriptBin "dms-greeter" ''
export PATH=$PATH:${lib.makeBinPath [cfg.quickshell.package config.programs.${cfg.compositor.name}.package]} export PATH=$PATH:${
${lib.escapeShellArgs ([ lib.makeBinPath [
"sh" cfg.quickshell.package
"${../../quickshell/Modules/Greetd/assets/dms-greeter}" config.programs.${cfg.compositor.name}.package
"--cache-dir" ]
cacheDir }
"--command" ${
cfg.compositor.name lib.escapeShellArgs (
"-p" [
"${dmsPkgs.dms-shell}/share/quickshell/dms" "sh"
"${../../quickshell/Modules/Greetd/assets/dms-greeter}"
"--cache-dir"
cacheDir
"--command"
cfg.compositor.name
"-p"
"${dmsPkgs.dms-shell}/share/quickshell/dms"
] ]
++ lib.optionals (cfg.compositor.customConfig != "") [ ++ lib.optionals (cfg.compositor.customConfig != "") [
"-C" "-C"
"${pkgs.writeText "dmsgreeter-compositor-config" cfg.compositor.customConfig}" "${pkgs.writeText "dmsgreeter-compositor-config" cfg.compositor.customConfig}"
])} ${lib.optionalString cfg.logs.save "> ${cfg.logs.path} 2>&1"} ]
''; )
} ${lib.optionalString cfg.logs.save "> ${cfg.logs.path} 2>&1"}
'';
jq = lib.getExe pkgs.jq; jq = lib.getExe pkgs.jq;
in { in
imports = let {
msg = "The option 'programs.dankMaterialShell.greeter.compositor.extraConfig' is deprecated. Please use 'programs.dankMaterialShell.greeter.compositor.customConfig' instead."; imports =
in [(lib.mkRemovedOptionModule ["programs" "dankMaterialShell" "greeter" "compositor" "extraConfig"] msg)]; let
msg = "The option 'programs.dankMaterialShell.greeter.compositor.extraConfig' is deprecated. Please use 'programs.dankMaterialShell.greeter.compositor.customConfig' instead.";
in
[
(lib.mkRemovedOptionModule [
"programs"
"dankMaterialShell"
"greeter"
"compositor"
"extraConfig"
] msg)
];
options.programs.dankMaterialShell.greeter = { options.programs.dankMaterialShell.greeter = {
enable = lib.mkEnableOption "DankMaterialShell greeter"; enable = lib.mkEnableOption "DankMaterialShell greeter";
compositor.name = lib.mkOption { compositor.name = lib.mkOption {
type = types.enum ["niri" "hyprland" "sway" "scroll"]; type = types.enum [
description = "Compositor to run greeter in"; "niri"
}; "hyprland"
compositor.customConfig = lib.mkOption { "sway"
type = types.lines; ];
default = ""; description = "Compositor to run greeter in";
description = "Custom compositor config";
};
configFiles = lib.mkOption {
type = types.listOf types.path;
default = [];
description = "Config files to copy into data directory";
example = [
"/home/user/.config/DankMaterialShell/settings.json"
];
};
configHome = lib.mkOption {
type = types.nullOr types.str;
default = null;
example = "/home/user";
description = ''
User home directory to copy configurations for greeter
If DMS config files are in non-standard locations then use the configFiles option instead
'';
};
quickshell = {
package = lib.mkPackageOption dmsPkgs "quickshell" {
extraDescription = "The quickshell package to use (defaults to be built from source, in the commit 26531f due to unreleased features used by DMS).";
};
};
logs.save = lib.mkEnableOption "saving logs from DMS greeter to file";
logs.path = lib.mkOption {
type = types.path;
default = "/tmp/dms-greeter.log";
description = ''
File path to save DMS greeter logs to
'';
};
}; };
config = lib.mkIf cfg.enable { compositor.customConfig = lib.mkOption {
assertions = [ type = types.lines;
{ default = "";
assertion = (config.users.users.${user} or {}) != {}; description = "Custom compositor config";
message = '' };
dmsgreeter: user set for greetd default_session ${user} does not exist. Please create it before referencing it. configFiles = lib.mkOption {
''; type = types.listOf types.path;
} default = [ ];
]; description = "Config files to copy into data directory";
services.greetd = { example = [
enable = lib.mkDefault true; "/home/user/.config/DankMaterialShell/settings.json"
settings.default_session.command = lib.mkDefault (lib.getExe greeterScript); ];
}; };
fonts.packages = with pkgs; [ configHome = lib.mkOption {
fira-code type = types.nullOr types.str;
inter default = null;
material-symbols example = "/home/user";
]; description = ''
systemd.tmpfiles.settings."10-dmsgreeter" = { User home directory to copy configurations for greeter
${cacheDir}.d = { If DMS config files are in non-standard locations then use the configFiles option instead
user = user; '';
group = };
if config.users.users.${user}.group != "" quickshell = {
then config.users.users.${user}.group package = lib.mkPackageOption dmsPkgs "quickshell" {
else "greeter"; extraDescription = "The quickshell package to use (defaults to be built from source, in the commit 26531f due to unreleased features used by DMS).";
mode = "0750"; };
}; };
}; logs.save = lib.mkEnableOption "saving logs from DMS greeter to file";
systemd.services.greetd.preStart = '' logs.path = lib.mkOption {
cd ${cacheDir} type = types.path;
${lib.concatStringsSep "\n" (lib.map (f: '' default = "/tmp/dms-greeter.log";
if [ -f "${f}" ]; then description = ''
cp "${f}" . File path to save DMS greeter logs to
fi '';
'') };
cfg.configFiles)} };
config = lib.mkIf cfg.enable {
if [ -f session.json ]; then assertions = [
if cp "$(${jq} -r '.wallpaperPath' session.json)" wallpaper.jpg; then {
mv session.json session.orig.json assertion = (config.users.users.${user} or { }) != { };
${jq} '.wallpaperPath = "${cacheDir}/wallpaper.jpg"' session.orig.json > session.json message = ''
fi dmsgreeter: user set for greetd default_session ${user} does not exist. Please create it before referencing it.
fi
if [ -f settings.json ]; then
if cp "$(${jq} -r '.customThemeFile' settings.json)" custom-theme.json; then
mv settings.json settings.orig.json
${jq} '.customThemeFile = "${cacheDir}/custom-theme.json"' settings.orig.json > settings.json
fi
fi
mv dms-colors.json colors.json || :
chown ${user}: * || :
''; '';
programs.dankMaterialShell.greeter.configFiles = lib.mkIf (cfg.configHome != null) [ }
"${cfg.configHome}/.config/DankMaterialShell/settings.json" ];
"${cfg.configHome}/.local/state/DankMaterialShell/session.json" services.greetd = {
"${cfg.configHome}/.cache/DankMaterialShell/dms-colors.json" enable = lib.mkDefault true;
]; settings.default_session.command = lib.mkDefault (lib.getExe greeterScript);
}; };
fonts.packages = with pkgs; [
fira-code
inter
material-symbols
];
systemd.tmpfiles.settings."10-dmsgreeter" = {
${cacheDir}.d = {
inherit user;
group =
if config.users.users.${user}.group != "" then config.users.users.${user}.group else "greeter";
mode = "0750";
};
};
systemd.services.greetd.preStart = ''
cd ${cacheDir}
${lib.concatStringsSep "\n" (
lib.map (f: ''
if [ -f "${f}" ]; then
cp "${f}" .
fi
'') cfg.configFiles
)}
if [ -f session.json ]; then
if cp "$(${jq} -r '.wallpaperPath' session.json)" wallpaper.jpg; then
mv session.json session.orig.json
${jq} '.wallpaperPath = "${cacheDir}/wallpaper.jpg"' session.orig.json > session.json
fi
fi
if [ -f settings.json ]; then
if cp "$(${jq} -r '.customThemeFile' settings.json)" custom-theme.json; then
mv settings.json settings.orig.json
${jq} '.customThemeFile = "${cacheDir}/custom-theme.json"' settings.orig.json > settings.json
fi
fi
mv dms-colors.json colors.json || :
chown ${user}: * || :
'';
programs.dankMaterialShell.greeter.configFiles = lib.mkIf (cfg.configHome != null) [
"${cfg.configHome}/.config/DankMaterialShell/settings.json"
"${cfg.configHome}/.local/state/DankMaterialShell/session.json"
"${cfg.configHome}/.cache/DankMaterialShell/dms-colors.json"
];
};
} }

View File

@@ -1,94 +1,114 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
dmsPkgs, dmsPkgs,
... ...
} @ args: let }@args:
cfg = config.programs.dankMaterialShell; let
jsonFormat = pkgs.formats.json {}; cfg = config.programs.dankMaterialShell;
common = import ./common.nix {inherit config pkgs lib dmsPkgs;}; jsonFormat = pkgs.formats.json { };
in { common = import ./common.nix {
imports = [ inherit
(import ./options.nix args) config
(lib.mkRemovedOptionModule ["programs" "dankMaterialShell" "enableNightMode"] "Night mode is now always available.") pkgs
(lib.mkRenamedOptionModule ["programs" "dankMaterialShell" "enableSystemd"] ["programs" "dankMaterialShell" "systemd" "enable"]) lib
dmsPkgs
;
};
in
{
imports = [
(import ./options.nix args)
(lib.mkRemovedOptionModule [
"programs"
"dankMaterialShell"
"enableNightMode"
] "Night mode is now always available.")
(lib.mkRenamedOptionModule
[ "programs" "dankMaterialShell" "enableSystemd" ]
[ "programs" "dankMaterialShell" "systemd" "enable" ]
)
];
options.programs.dankMaterialShell = with lib.types; {
default = {
settings = lib.mkOption {
type = jsonFormat.type;
default = { };
description = "The default settings are only read if the settings.json file don't exist";
};
session = lib.mkOption {
type = jsonFormat.type;
default = { };
description = "The default session are only read if the session.json file don't exist";
};
};
plugins = lib.mkOption {
type = attrsOf (
types.submodule (
{ config, ... }:
{
options = {
enable = lib.mkOption {
type = types.bool;
default = true;
description = "Whether to link this plugin";
};
src = lib.mkOption {
type = types.path;
description = "Source to link to DMS plugins directory";
};
};
}
)
);
default = { };
description = "DMS Plugins to install";
};
};
config = lib.mkIf cfg.enable {
programs.quickshell = {
enable = true;
inherit (cfg.quickshell) package;
configs.dms = common.qmlPath;
};
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
Unit = {
Description = "DankMaterialShell";
PartOf = [ config.wayland.systemd.target ];
After = [ config.wayland.systemd.target ];
X-Restart-Triggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath;
};
Service = {
ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session";
Restart = "on-failure";
};
Install.WantedBy = [ config.wayland.systemd.target ];
};
xdg.stateFile."DankMaterialShell/default-session.json" = lib.mkIf (cfg.default.session != { }) {
source = jsonFormat.generate "default-session.json" cfg.default.session;
};
xdg.configFile = lib.mkMerge [
(lib.mapAttrs' (name: plugin: {
name = "DankMaterialShell/plugins/${name}";
value.source = plugin.src;
}) (lib.filterAttrs (n: v: v.enable) cfg.plugins))
{
"DankMaterialShell/default-settings.json" = lib.mkIf (cfg.default.settings != { }) {
source = jsonFormat.generate "default-settings.json" cfg.default.settings;
};
}
]; ];
options.programs.dankMaterialShell = with lib.types; { home.packages = common.packages;
default = { };
settings = lib.mkOption {
type = jsonFormat.type;
default = {};
description = "The default settings are only read if the settings.json file don't exist";
};
session = lib.mkOption {
type = jsonFormat.type;
default = {};
description = "The default session are only read if the session.json file don't exist";
};
};
plugins = lib.mkOption {
type = attrsOf (types.submodule ({config, ...}: {
options = {
enable = lib.mkOption {
type = types.bool;
default = true;
description = "Whether to link this plugin";
};
src = lib.mkOption {
type = types.path;
description = "Source to link to DMS plugins directory";
};
};
}));
default = {};
description = "DMS Plugins to install";
};
};
config = lib.mkIf cfg.enable
{
programs.quickshell = {
enable = true;
package = cfg.quickshell.package;
configs.dms = common.qmlPath;
};
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
Unit = {
Description = "DankMaterialShell";
PartOf = [config.wayland.systemd.target];
After = [config.wayland.systemd.target];
X-Restart-Triggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath;
};
Service = {
ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session";
Restart = "on-failure";
};
Install.WantedBy = [config.wayland.systemd.target];
};
xdg.stateFile."DankMaterialShell/default-session.json" = lib.mkIf (cfg.default.session != {}) {
source = jsonFormat.generate "default-session.json" cfg.default.session;
};
xdg.configFile = lib.mkMerge [
(lib.mapAttrs' (name: plugin: {
name = "DankMaterialShell/plugins/${name}";
value.source = plugin.src;
}) (lib.filterAttrs (n: v: v.enable) cfg.plugins))
{
"DankMaterialShell/default-settings.json" = lib.mkIf (cfg.default.settings != {}) {
source = jsonFormat.generate "default-settings.json" cfg.default.settings;
};
}
];
home.packages = common.packages;
};
} }

View File

@@ -1,105 +1,118 @@
{ {
config, config,
lib, lib,
... ...
}: let }:
cfg = config.programs.dankMaterialShell; let
in { cfg = config.programs.dankMaterialShell;
options.programs.dankMaterialShell = { in
niri = { {
enableKeybinds = lib.mkEnableOption "DankMaterialShell niri keybinds"; options.programs.dankMaterialShell = {
enableSpawn = lib.mkEnableOption "DankMaterialShell niri spawn-at-startup"; niri = {
}; enableKeybinds = lib.mkEnableOption "DankMaterialShell niri keybinds";
enableSpawn = lib.mkEnableOption "DankMaterialShell niri spawn-at-startup";
}; };
};
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.niri.settings = lib.mkMerge [ programs.niri.settings = lib.mkMerge [
(lib.mkIf cfg.niri.enableKeybinds { (lib.mkIf cfg.niri.enableKeybinds {
binds = with config.lib.niri.actions; let binds =
dms-ipc = spawn "dms" "ipc"; with config.lib.niri.actions;
in let
{ dms-ipc = spawn "dms" "ipc";
"Mod+Space" = { in
action = dms-ipc "spotlight" "toggle"; {
hotkey-overlay.title = "Toggle Application Launcher"; "Mod+Space" = {
}; action = dms-ipc "spotlight" "toggle";
"Mod+N" = { hotkey-overlay.title = "Toggle Application Launcher";
action = dms-ipc "notifications" "toggle"; };
hotkey-overlay.title = "Toggle Notification Center"; "Mod+N" = {
}; action = dms-ipc "notifications" "toggle";
"Mod+Comma" = { hotkey-overlay.title = "Toggle Notification Center";
action = dms-ipc "settings" "toggle"; };
hotkey-overlay.title = "Toggle Settings"; "Mod+Comma" = {
}; action = dms-ipc "settings" "toggle";
"Mod+P" = { hotkey-overlay.title = "Toggle Settings";
action = dms-ipc "notepad" "toggle"; };
hotkey-overlay.title = "Toggle Notepad"; "Mod+P" = {
}; action = dms-ipc "notepad" "toggle";
"Super+Alt+L" = { hotkey-overlay.title = "Toggle Notepad";
action = dms-ipc "lock" "lock"; };
hotkey-overlay.title = "Toggle Lock Screen"; "Super+Alt+L" = {
}; action = dms-ipc "lock" "lock";
"Mod+X" = { hotkey-overlay.title = "Toggle Lock Screen";
action = dms-ipc "powermenu" "toggle"; };
hotkey-overlay.title = "Toggle Power Menu"; "Mod+X" = {
}; action = dms-ipc "powermenu" "toggle";
"XF86AudioRaiseVolume" = { hotkey-overlay.title = "Toggle Power Menu";
allow-when-locked = true; };
action = dms-ipc "audio" "increment" "3"; "XF86AudioRaiseVolume" = {
}; allow-when-locked = true;
"XF86AudioLowerVolume" = { action = dms-ipc "audio" "increment" "3";
allow-when-locked = true; };
action = dms-ipc "audio" "decrement" "3"; "XF86AudioLowerVolume" = {
}; allow-when-locked = true;
"XF86AudioMute" = { action = dms-ipc "audio" "decrement" "3";
allow-when-locked = true; };
action = dms-ipc "audio" "mute"; "XF86AudioMute" = {
}; allow-when-locked = true;
"XF86AudioMicMute" = { action = dms-ipc "audio" "mute";
allow-when-locked = true; };
action = dms-ipc "audio" "micmute"; "XF86AudioMicMute" = {
}; allow-when-locked = true;
"Mod+Alt+N" = { action = dms-ipc "audio" "micmute";
allow-when-locked = true; };
action = dms-ipc "night" "toggle"; "Mod+Alt+N" = {
hotkey-overlay.title = "Toggle Night Mode"; allow-when-locked = true;
}; action = dms-ipc "night" "toggle";
} hotkey-overlay.title = "Toggle Night Mode";
// lib.attrsets.optionalAttrs cfg.enableSystemMonitoring { };
"Mod+M" = { }
action = dms-ipc "processlist" "toggle"; // lib.attrsets.optionalAttrs cfg.enableSystemMonitoring {
hotkey-overlay.title = "Toggle Process List"; "Mod+M" = {
}; action = dms-ipc "processlist" "toggle";
} hotkey-overlay.title = "Toggle Process List";
// lib.attrsets.optionalAttrs cfg.enableClipboard { };
"Mod+V" = { }
action = dms-ipc "clipboard" "toggle"; // lib.attrsets.optionalAttrs cfg.enableClipboard {
hotkey-overlay.title = "Toggle Clipboard Manager"; "Mod+V" = {
}; action = dms-ipc "clipboard" "toggle";
} hotkey-overlay.title = "Toggle Clipboard Manager";
// lib.attrsets.optionalAttrs cfg.enableBrightnessControl { };
"XF86MonBrightnessUp" = { }
allow-when-locked = true; // lib.attrsets.optionalAttrs cfg.enableBrightnessControl {
action = dms-ipc "brightness" "increment" "5" ""; "XF86MonBrightnessUp" = {
}; allow-when-locked = true;
"XF86MonBrightnessDown" = { action = dms-ipc "brightness" "increment" "5" "";
allow-when-locked = true; };
action = dms-ipc "brightness" "decrement" "5" ""; "XF86MonBrightnessDown" = {
}; allow-when-locked = true;
}; action = dms-ipc "brightness" "decrement" "5" "";
}) };
};
})
(lib.mkIf cfg.niri.enableSpawn { (lib.mkIf cfg.niri.enableSpawn {
spawn-at-startup = spawn-at-startup = [
[ {
{command = ["dms" "run"];} command = [
] "dms"
++ lib.optionals cfg.enableClipboard [ "run"
{ ];
command = ["wl-paste" "--watch" "cliphist" "store"]; }
} ]
]; ++ lib.optionals cfg.enableClipboard [
}) {
command = [
"wl-paste"
"--watch"
"cliphist"
"store"
];
}
]; ];
}; })
];
};
} }

View File

@@ -1,36 +1,44 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
dmsPkgs, dmsPkgs,
... ...
} @ args: let }@args:
cfg = config.programs.dankMaterialShell; let
common = import ./common.nix {inherit config pkgs lib dmsPkgs;}; cfg = config.programs.dankMaterialShell;
in { common = import ./common.nix {
imports = [ inherit
(import ./options.nix args) config
]; pkgs
lib
dmsPkgs
;
};
in
{
imports = [
(import ./options.nix args)
];
config = lib.mkIf cfg.enable config = lib.mkIf cfg.enable {
{ environment.etc."xdg/quickshell/dms".source = "${dmsPkgs.dms-shell}/share/quickshell/dms";
environment.etc."xdg/quickshell/dms".source = "${dmsPkgs.dms-shell}/share/quickshell/dms";
systemd.user.services.dms = lib.mkIf cfg.systemd.enable { systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
description = "DankMaterialShell"; description = "DankMaterialShell";
path = lib.mkForce []; path = lib.mkForce [ ];
partOf = ["graphical-session.target"]; partOf = [ "graphical-session.target" ];
after = ["graphical-session.target"]; after = [ "graphical-session.target" ];
wantedBy = ["graphical-session.target"]; wantedBy = [ "graphical-session.target" ];
restartTriggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath; restartTriggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath;
serviceConfig = { serviceConfig = {
ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session"; ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session";
Restart = "on-failure"; Restart = "on-failure";
}; };
};
environment.systemPackages = [cfg.quickshell.package] ++ common.packages;
}; };
environment.systemPackages = [ cfg.quickshell.package ] ++ common.packages;
};
} }

View File

@@ -1,70 +1,72 @@
{ {
lib, lib,
dmsPkgs, dmsPkgs,
... ...
}: let }:
inherit (lib) types; let
in { inherit (lib) types;
options.programs.dankMaterialShell = { in
enable = lib.mkEnableOption "DankMaterialShell"; {
options.programs.dankMaterialShell = {
enable = lib.mkEnableOption "DankMaterialShell";
systemd = { systemd = {
enable = lib.mkEnableOption "DankMaterialShell systemd startup"; enable = lib.mkEnableOption "DankMaterialShell systemd startup";
restartIfChanged = lib.mkOption { restartIfChanged = lib.mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Auto-restart dms.service when dankMaterialShell changes"; description = "Auto-restart dms.service when dankMaterialShell changes";
}; };
};
enableSystemMonitoring = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to use system monitoring widgets";
};
enableClipboard = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to use the clipboard widget";
};
enableVPN = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to use the VPN widget";
};
enableBrightnessControl = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have brightness/backlight support";
};
enableColorPicker = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have color picking support";
};
enableDynamicTheming = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have dynamic theming support";
};
enableAudioWavelength = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have audio wavelength support";
};
enableCalendarEvents = lib.mkOption {
type = types.bool;
default = true;
description = "Add calendar events support via khal";
};
enableSystemSound = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have system sound support";
};
quickshell = {
package = lib.mkPackageOption dmsPkgs "quickshell" {
extraDescription = "The quickshell package to use (defaults to be built from source, in the commit 26531f due to unreleased features used by DMS).";
};
};
}; };
enableSystemMonitoring = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to use system monitoring widgets";
};
enableClipboard = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to use the clipboard widget";
};
enableVPN = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to use the VPN widget";
};
enableBrightnessControl = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have brightness/backlight support";
};
enableColorPicker = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have color picking support";
};
enableDynamicTheming = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have dynamic theming support";
};
enableAudioWavelength = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have audio wavelength support";
};
enableCalendarEvents = lib.mkOption {
type = types.bool;
default = true;
description = "Add calendar events support via khal";
};
enableSystemSound = lib.mkOption {
type = types.bool;
default = true;
description = "Add needed dependencies to have system sound support";
};
quickshell = {
package = lib.mkPackageOption dmsPkgs "quickshell" {
extraDescription = "The quickshell package to use (defaults to be built from source, in the commit 26531f due to unreleased features used by DMS).";
};
};
};
} }

View File

@@ -2,8 +2,8 @@
Name: dms-git Name: dms-git
Version: 0.6.2+git2147.03073f68 Version: 0.6.2+git2147.03073f68
Release: 5%{?dist} Release: 1%{?dist}
Epoch: 1 Epoch: 2
Summary: DankMaterialShell - Material 3 inspired shell (git nightly) Summary: DankMaterialShell - Material 3 inspired shell (git nightly)
License: MIT License: MIT

287
flake.nix
View File

@@ -1,167 +1,178 @@
{ {
description = "Dank Material Shell"; description = "Dank Material Shell";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
dgop = { dgop = {
url = "github:AvengeMedia/dgop"; url = "github:AvengeMedia/dgop";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
};
quickshell = {
url = "git+https://git.outfoxxed.me/quickshell/quickshell?rev=26531fc46ef17e9365b03770edd3fb9206fcb460";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
quickshell = {
url = "git+https://git.outfoxxed.me/quickshell/quickshell?rev=26531fc46ef17e9365b03770edd3fb9206fcb460";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { outputs =
self, {
nixpkgs, self,
dgop, nixpkgs,
quickshell, dgop,
... quickshell,
}: let ...
forEachSystem = fn: }:
nixpkgs.lib.genAttrs ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"] ( let
system: fn system nixpkgs.legacyPackages.${system} forEachSystem =
); fn:
buildDmsPkgs = pkgs: { nixpkgs.lib.genAttrs [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ] (
dms-shell = self.packages.${pkgs.stdenv.hostPlatform.system}.default; system: fn system nixpkgs.legacyPackages.${system}
dgop = dgop.packages.${pkgs.stdenv.hostPlatform.system}.dgop; );
quickshell = quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default; buildDmsPkgs = pkgs: {
dms-shell = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
inherit (dgop.packages.${pkgs.stdenv.hostPlatform.system}) dgop;
quickshell = quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default;
};
mkModuleWithDmsPkgs =
path:
args@{ pkgs, ... }:
{
imports = [
(import path (args // { dmsPkgs = buildDmsPkgs pkgs; }))
];
}; };
mkModuleWithDmsPkgs = path: args @ {pkgs, ...}: { in
imports = [ {
(import path (args // {dmsPkgs = buildDmsPkgs pkgs;})) packages = forEachSystem (
system: pkgs:
let
mkDate =
longDate:
pkgs.lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]; ];
}; version =
in { pkgs.lib.removePrefix "v" (pkgs.lib.trim (builtins.readFile ./quickshell/VERSION))
formatter = forEachSystem (_: pkgs: pkgs.alejandra); + "+date="
+ mkDate (self.lastModifiedDate or "19700101")
+ "_"
+ (self.shortRev or "dirty");
in
{
dms-shell = pkgs.buildGoModule (
let
rootSrc = ./.;
in
{
inherit version;
pname = "dms-shell";
src = ./core;
vendorHash = "sha256-2PCqiW4frxME8IlmwWH5ktznhd/G1bah5Ae4dp0HPTQ=";
packages = forEachSystem ( subPackages = [ "cmd/dms" ];
system: pkgs: let
mkDate = longDate:
pkgs.lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
];
version =
pkgs.lib.removePrefix "v" (pkgs.lib.trim (builtins.readFile ./quickshell/VERSION))
+ "+date="
+ mkDate (self.lastModifiedDate or "19700101")
+ "_"
+ (self.shortRev or "dirty");
in {
dms-shell = pkgs.buildGoModule (
let
rootSrc = ./.;
in {
inherit version;
pname = "dms-shell";
src = ./core;
vendorHash = "sha256-2PCqiW4frxME8IlmwWH5ktznhd/G1bah5Ae4dp0HPTQ=";
subPackages = ["cmd/dms"]; ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
ldflags = [ nativeBuildInputs = with pkgs; [
"-s" installShellFiles
"-w" makeWrapper
"-X main.Version=${version}" ];
];
nativeBuildInputs = with pkgs; [ postInstall = ''
installShellFiles mkdir -p $out/share/quickshell/dms
makeWrapper cp -r ${rootSrc}/quickshell/. $out/share/quickshell/dms/
];
postInstall = '' chmod u+w $out/share/quickshell/dms/VERSION
mkdir -p $out/share/quickshell/dms echo "${version}" > $out/share/quickshell/dms/VERSION
cp -r ${rootSrc}/quickshell/. $out/share/quickshell/dms/
chmod u+w $out/share/quickshell/dms/VERSION # Install desktop file and icon
echo "${version}" > $out/share/quickshell/dms/VERSION install -D ${rootSrc}/assets/dms-open.desktop \
$out/share/applications/dms-open.desktop
install -D ${rootSrc}/core/assets/danklogo.svg \
$out/share/hicolor/scalable/apps/danklogo.svg
# Install desktop file and icon wrapProgram $out/bin/dms --add-flags "-c $out/share/quickshell/dms"
install -D ${rootSrc}/assets/dms-open.desktop \
$out/share/applications/dms-open.desktop
install -D ${rootSrc}/core/assets/danklogo.svg \
$out/share/hicolor/scalable/apps/danklogo.svg
wrapProgram $out/bin/dms --add-flags "-c $out/share/quickshell/dms" install -Dm644 ${rootSrc}/assets/systemd/dms.service \
$out/lib/systemd/user/dms.service
install -Dm644 ${rootSrc}/assets/systemd/dms.service \ substituteInPlace $out/lib/systemd/user/dms.service \
$out/lib/systemd/user/dms.service --replace-fail /usr/bin/dms $out/bin/dms \
--replace-fail /usr/bin/pkill ${pkgs.procps}/bin/pkill
substituteInPlace $out/lib/systemd/user/dms.service \ substituteInPlace $out/share/quickshell/dms/Modules/Greetd/assets/dms-greeter \
--replace-fail /usr/bin/dms $out/bin/dms \ --replace-fail /bin/bash ${pkgs.bashInteractive}/bin/bash
--replace-fail /usr/bin/pkill ${pkgs.procps}/bin/pkill
substituteInPlace $out/share/quickshell/dms/Modules/Greetd/assets/dms-greeter \ substituteInPlace $out/share/quickshell/dms/assets/pam/fprint \
--replace-fail /bin/bash ${pkgs.bashInteractive}/bin/bash --replace-fail pam_fprintd.so ${pkgs.fprintd}/lib/security/pam_fprintd.so
substituteInPlace $out/share/quickshell/dms/assets/pam/fprint \ installShellCompletion --cmd dms \
--replace-fail pam_fprintd.so ${pkgs.fprintd}/lib/security/pam_fprintd.so --bash <($out/bin/dms completion bash) \
--fish <($out/bin/dms completion fish) \
--zsh <($out/bin/dms completion zsh)
'';
installShellCompletion --cmd dms \ meta = {
--bash <($out/bin/dms completion bash) \ description = "Desktop shell for wayland compositors built with Quickshell & GO";
--fish <($out/bin/dms completion fish) \ homepage = "https://danklinux.com";
--zsh <($out/bin/dms completion zsh) changelog = "https://github.com/AvengeMedia/DankMaterialShell/releases/tag/v${version}";
''; license = pkgs.lib.licenses.mit;
mainProgram = "dms";
meta = { platforms = pkgs.lib.platforms.linux;
description = "Desktop shell for wayland compositors built with Quickshell & GO"; };
homepage = "https://danklinux.com";
changelog = "https://github.com/AvengeMedia/DankMaterialShell/releases/tag/v${version}";
license = pkgs.lib.licenses.mit;
mainProgram = "dms";
platforms = pkgs.lib.platforms.linux;
};
}
);
default = self.packages.${system}.dms-shell;
} }
); );
homeModules.dankMaterialShell.default = mkModuleWithDmsPkgs ./distro/nix/home.nix; default = self.packages.${system}.dms-shell;
}
);
homeModules.dankMaterialShell.niri = import ./distro/nix/niri.nix; homeModules.dankMaterialShell.default = mkModuleWithDmsPkgs ./distro/nix/home.nix;
nixosModules.dankMaterialShell = mkModuleWithDmsPkgs ./distro/nix/nixos.nix; homeModules.dankMaterialShell.niri = import ./distro/nix/niri.nix;
nixosModules.greeter = mkModuleWithDmsPkgs ./distro/nix/greeter.nix; nixosModules.dankMaterialShell = mkModuleWithDmsPkgs ./distro/nix/nixos.nix;
devShells = forEachSystem ( nixosModules.greeter = mkModuleWithDmsPkgs ./distro/nix/greeter.nix;
system: pkgs: let
qmlPkgs =
[
quickshell.packages.${system}.default
]
++ (with pkgs.kdePackages; [
qtdeclarative
kirigami.unwrapped
sonnet
qtmultimedia
]);
in {
default = pkgs.mkShell {
buildInputs = with pkgs;
[
go_1_24
gopls
delve
go-tools
gnumake
]
++ qmlPkgs;
shellHook = '' devShells = forEachSystem (
touch quickshell/.qmlls.ini 2>/dev/null system: pkgs:
''; let
qmlPkgs = [
quickshell.packages.${system}.default
]
++ (with pkgs.kdePackages; [
qtdeclarative
kirigami.unwrapped
sonnet
qtmultimedia
]);
in
{
default = pkgs.mkShell {
buildInputs =
with pkgs;
[
go_1_24
gopls
delve
go-tools
gnumake
]
++ qmlPkgs;
QML2_IMPORT_PATH = pkgs.lib.concatStringsSep ":" (map (o: "${o}/lib/qt-6/qml") qmlPkgs); shellHook = ''
}; touch quickshell/.qmlls.ini 2>/dev/null
} '';
);
QML2_IMPORT_PATH = pkgs.lib.concatStringsSep ":" (map (o: "${o}/lib/qt-6/qml") qmlPkgs);
};
}
);
}; };
} }

View File

@@ -59,7 +59,7 @@ FloatingWindow {
title: I18n.tr("Settings", "settings window title") title: I18n.tr("Settings", "settings window title")
minimumSize: Qt.size(500, 400) minimumSize: Qt.size(500, 400)
implicitWidth: 800 implicitWidth: 800
implicitHeight: 940 implicitHeight: screen ? Math.min(940, screen.height - 100) : 940
color: Theme.surfaceContainer color: Theme.surfaceContainer
visible: false visible: false

View File

@@ -12,7 +12,7 @@ Row {
signal sizeChanged(int newSize) signal sizeChanged(int newSize)
readonly property var availableSizes: isSlider ? [50, 100] : [25, 50, 75, 100] readonly property var availableSizes: isSlider ? [50, 75, 100] : [25, 50, 75, 100]
spacing: 2 spacing: 2

View File

@@ -1088,6 +1088,7 @@ Item {
id: layoutComponent id: layoutComponent
DWLLayout { DWLLayout {
id: layoutWidget
layoutPopupVisible: layoutPopoutLoader.item ? layoutPopoutLoader.item.shouldBeVisible : false layoutPopupVisible: layoutPopoutLoader.item ? layoutPopoutLoader.item.shouldBeVisible : false
widgetThickness: barWindow.widgetThickness widgetThickness: barWindow.widgetThickness
barThickness: barWindow.effectiveBarThickness barThickness: barWindow.effectiveBarThickness
@@ -1100,14 +1101,19 @@ Item {
parentScreen: barWindow.screen parentScreen: barWindow.screen
onToggleLayoutPopup: { onToggleLayoutPopup: {
layoutPopoutLoader.active = true; layoutPopoutLoader.active = true;
if (!layoutPopoutLoader.item)
return;
const effectiveBarConfig = topBarContent.barConfig; const effectiveBarConfig = topBarContent.barConfig;
const barPosition = barWindow.axis?.edge === "left" ? 2 : (barWindow.axis?.edge === "right" ? 3 : (barWindow.axis?.edge === "top" ? 0 : 1)); const barPosition = barWindow.axis?.edge === "left" ? 2 : (barWindow.axis?.edge === "right" ? 3 : (barWindow.axis?.edge === "top" ? 0 : 1));
if (layoutPopoutLoader.item && layoutPopoutLoader.item.setBarContext) {
layoutPopoutLoader.item.setBarContext(barPosition, effectiveBarConfig?.bottomGap ?? 0); if (layoutPopoutLoader.item.setTriggerPosition) {
} const globalPos = layoutWidget.mapToGlobal(0, 0);
if (layoutPopoutLoader.item) { const pos = SettingsData.getPopupTriggerPosition(globalPos, barWindow.screen, barWindow.effectiveBarThickness, layoutWidget.width, effectiveBarConfig?.spacing ?? 4, barPosition, effectiveBarConfig);
PopoutManager.requestPopout(layoutPopoutLoader.item, undefined, "layout"); const widgetSection = topBarContent.getWidgetSection(parent) || "center";
layoutPopoutLoader.item.setTriggerPosition(pos.x, pos.y, pos.width, widgetSection, barWindow.screen, barPosition, barWindow.effectiveBarThickness, effectiveBarConfig?.spacing ?? 4, effectiveBarConfig);
} }
PopoutManager.requestPopout(layoutPopoutLoader.item, undefined, "layout");
} }
} }
} }

View File

@@ -49,15 +49,12 @@ BasePill {
} }
onWheel: function (wheelEvent) { onWheel: function (wheelEvent) {
if (!activePlayer) {
wheelEvent.accepted = false;
return;
}
wheelEvent.accepted = true; wheelEvent.accepted = true;
if (!usePlayerVolume)
return;
const delta = wheelEvent.angleDelta.y; const delta = wheelEvent.angleDelta.y;
const currentVolume = usePlayerVolume ? (activePlayer.volume * 100) : ((AudioService.sink?.audio?.volume ?? 0) * 100); const currentVolume = activePlayer.volume * 100;
let newVolume; let newVolume;
if (delta > 0) { if (delta > 0) {
@@ -66,11 +63,7 @@ BasePill {
newVolume = Math.max(0, currentVolume - 5); newVolume = Math.max(0, currentVolume - 5);
} }
if (usePlayerVolume) { activePlayer.volume = newVolume / 100;
activePlayer.volume = newVolume / 100;
} else if (AudioService.sink?.audio) {
AudioService.sink.audio.volume = newVolume / 100;
}
} }
content: Component { content: Component {

View File

@@ -1,4 +1,5 @@
import QtQuick import QtQuick
import QtQuick.Effects
import Quickshell import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import Quickshell.Hyprland import Quickshell.Hyprland
@@ -245,11 +246,14 @@ Item {
if (!byApp[key]) { if (!byApp[key]) {
const moddedId = Paths.moddedAppId(keyBase); const moddedId = Paths.moddedAppId(keyBase);
const isSteamApp = moddedId.toLowerCase().includes("steam_app"); const isSteamApp = moddedId.toLowerCase().includes("steam_app");
const icon = isSteamApp ? "" : DesktopService.resolveIconPath(moddedId); const isQuickshell = keyBase === "org.quickshell";
const desktopEntry = DesktopEntries.heuristicLookup(keyBase);
const icon = isSteamApp ? "" : Paths.getAppIcon(keyBase, desktopEntry);
byApp[key] = { byApp[key] = {
"type": "icon", "type": "icon",
"icon": icon, "icon": icon,
"isSteamApp": isSteamApp, "isSteamApp": isSteamApp,
"isQuickshell": isQuickshell,
"active": !!((w.activated || w.is_focused) || (CompositorService.isNiri && w.is_focused)), "active": !!((w.activated || w.is_focused) || (CompositorService.isNiri && w.is_focused)),
"count": 1, "count": 1,
"windowId": w.address || w.id, "windowId": w.address || w.id,
@@ -446,6 +450,7 @@ Item {
readonly property real padding: Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30)) readonly property real padding: Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
readonly property real visualWidth: isVertical ? widgetHeight : (workspaceRow.implicitWidth + padding * 2) readonly property real visualWidth: isVertical ? widgetHeight : (workspaceRow.implicitWidth + padding * 2)
readonly property real visualHeight: isVertical ? (workspaceRow.implicitHeight + padding * 2) : widgetHeight readonly property real visualHeight: isVertical ? (workspaceRow.implicitHeight + padding * 2) : widgetHeight
readonly property real appIconSize: Theme.barIconSize(barThickness, -6)
function getRealWorkspaces() { function getRealWorkspaces() {
return root.workspaceList.filter(ws => { return root.workspaceList.filter(ws => {
@@ -719,14 +724,14 @@ Item {
readonly property real iconsExtraWidth: { readonly property real iconsExtraWidth: {
if (!root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) { if (!root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons); const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons);
return numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0); return numIcons * root.appIconSize + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0);
} }
return 0; return 0;
} }
readonly property real iconsExtraHeight: { readonly property real iconsExtraHeight: {
if (root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) { if (root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons); const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons);
return numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0); return numIcons * root.appIconSize + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0);
} }
return 0; return 0;
} }
@@ -897,7 +902,7 @@ Item {
Item { Item {
visible: loadedHasIcon && loadedIconData?.type === "icon" visible: loadedHasIcon && loadedIconData?.type === "icon"
width: wsIcon.width + (isActive && loadedIcons.length > 0 ? 4 : 0) width: wsIcon.width + (isActive && loadedIcons.length > 0 ? 4 : 0)
height: 18 height: root.appIconSize
DankIcon { DankIcon {
id: wsIcon id: wsIcon
@@ -912,7 +917,7 @@ Item {
Item { Item {
visible: loadedHasIcon && loadedIconData?.type === "text" visible: loadedHasIcon && loadedIconData?.type === "text"
width: wsText.implicitWidth + (isActive && loadedIcons.length > 0 ? 4 : 0) width: wsText.implicitWidth + (isActive && loadedIcons.length > 0 ? 4 : 0)
height: 18 height: root.appIconSize
StyledText { StyledText {
id: wsText id: wsText
@@ -927,7 +932,7 @@ Item {
Item { Item {
visible: SettingsData.showWorkspaceIndex && !loadedHasIcon visible: SettingsData.showWorkspaceIndex && !loadedHasIcon
width: wsIndexText.implicitWidth + (isActive && loadedIcons.length > 0 ? 4 : 0) width: wsIndexText.implicitWidth + (isActive && loadedIcons.length > 0 ? 4 : 0)
height: 18 height: root.appIconSize
StyledText { StyledText {
id: wsIndexText id: wsIndexText
@@ -944,48 +949,61 @@ Item {
values: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons) values: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons)
} }
delegate: Item { delegate: Item {
width: 18 width: root.appIconSize
height: 18 height: root.appIconSize
IconImage { IconImage {
id: appIcon id: rowAppIcon
property var windowId: modelData.windowId
anchors.fill: parent anchors.fill: parent
source: modelData.icon source: modelData.icon
opacity: modelData.active ? 1.0 : appMouseArea.containsMouse ? 0.8 : 0.6 opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
visible: !modelData.isSteamApp visible: !modelData.isSteamApp && !modelData.isQuickshell
}
IconImage {
anchors.fill: parent
source: modelData.icon
opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
visible: modelData.isQuickshell
layer.enabled: true
layer.effect: MultiEffect {
saturation: 0
colorization: 1
colorizationColor: isActive ? Theme.primaryContainer : Theme.primary
}
} }
DankIcon { DankIcon {
anchors.centerIn: parent anchors.centerIn: parent
size: 18 size: root.appIconSize
name: "sports_esports" name: "sports_esports"
color: Theme.widgetTextColor color: Theme.widgetTextColor
opacity: modelData.active ? 1.0 : appMouseArea.containsMouse ? 0.8 : 0.6 opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
visible: modelData.isSteamApp visible: modelData.isSteamApp
} }
MouseArea { MouseArea {
id: appMouseArea id: rowAppMouseArea
anchors.fill: parent anchors.fill: parent
enabled: isActive enabled: isActive
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (!appIcon.windowId) const winId = modelData.windowId;
if (!winId)
return; return;
if (CompositorService.isHyprland) { if (CompositorService.isHyprland) {
Hyprland.dispatch(`focuswindow address:${appIcon.windowId}`); Hyprland.dispatch(`focuswindow address:${winId}`);
} else if (CompositorService.isNiri) { } else if (CompositorService.isNiri) {
NiriService.focusWindow(appIcon.windowId); NiriService.focusWindow(winId);
} }
} }
} }
Rectangle { Rectangle {
visible: modelData.count > 1 && !isActive visible: modelData.count > 1 && !isActive
width: 12 width: root.appIconSize * 0.67
height: 12 height: root.appIconSize * 0.67
radius: 6 radius: root.appIconSize * 0.33
color: "black" color: "black"
border.color: "white" border.color: "white"
border.width: 1 border.width: 1
@@ -996,7 +1014,7 @@ Item {
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: modelData.count text: modelData.count
font.pixelSize: 8 font.pixelSize: root.appIconSize * 0.44
color: "white" color: "white"
} }
} }
@@ -1034,48 +1052,61 @@ Item {
values: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons) values: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons)
} }
delegate: Item { delegate: Item {
width: 18 width: root.appIconSize
height: 18 height: root.appIconSize
IconImage { IconImage {
id: appIcon id: colAppIcon
property var windowId: modelData.windowId
anchors.fill: parent anchors.fill: parent
source: modelData.icon source: modelData.icon
opacity: modelData.active ? 1.0 : appMouseArea.containsMouse ? 0.8 : 0.6 opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
visible: !modelData.isSteamApp visible: !modelData.isSteamApp && !modelData.isQuickshell
}
IconImage {
anchors.fill: parent
source: modelData.icon
opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
visible: modelData.isQuickshell
layer.enabled: true
layer.effect: MultiEffect {
saturation: 0
colorization: 1
colorizationColor: isActive ? Theme.primaryContainer : Theme.primary
}
} }
DankIcon { DankIcon {
anchors.centerIn: parent anchors.centerIn: parent
size: 18 size: root.appIconSize
name: "sports_esports" name: "sports_esports"
color: Theme.widgetTextColor color: Theme.widgetTextColor
opacity: modelData.active ? 1.0 : appMouseArea.containsMouse ? 0.8 : 0.6 opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
visible: modelData.isSteamApp visible: modelData.isSteamApp
} }
MouseArea { MouseArea {
id: appMouseArea id: colAppMouseArea
anchors.fill: parent anchors.fill: parent
enabled: isActive enabled: isActive
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (!appIcon.windowId) const winId = modelData.windowId;
if (!winId)
return; return;
if (CompositorService.isHyprland) { if (CompositorService.isHyprland) {
Hyprland.dispatch(`focuswindow address:${appIcon.windowId}`); Hyprland.dispatch(`focuswindow address:${winId}`);
} else if (CompositorService.isNiri) { } else if (CompositorService.isNiri) {
NiriService.focusWindow(appIcon.windowId); NiriService.focusWindow(winId);
} }
} }
} }
Rectangle { Rectangle {
visible: modelData.count > 1 && !isActive visible: modelData.count > 1 && !isActive
width: 12 width: root.appIconSize * 0.67
height: 12 height: root.appIconSize * 0.67
radius: 6 radius: root.appIconSize * 0.33
color: "black" color: "black"
border.color: "white" border.color: "white"
border.width: 1 border.width: 1
@@ -1086,7 +1117,7 @@ Item {
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: modelData.count text: modelData.count
font.pixelSize: 8 font.pixelSize: root.appIconSize * 0.44
color: "white" color: "white"
} }
} }

View File

@@ -227,6 +227,13 @@ Item {
property bool isSeeking: false property bool isSeeking: false
Timer {
interval: 1000
running: activePlayer?.playbackState === MprisPlaybackState.Playing && !isSeeking
repeat: true
onTriggered: activePlayer?.positionChanged()
}
Item { Item {
id: bgContainer id: bgContainer
anchors.fill: parent anchors.fill: parent

View File

@@ -157,6 +157,8 @@ Item {
anchors.fill: parent anchors.fill: parent
screenName: root.screenName screenName: root.screenName
visible: { visible: {
var _ = SessionData.perMonitorWallpaper
var __ = SessionData.monitorWallpapers
var currentWallpaper = SessionData.getMonitorWallpaper(screenName) var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
return !currentWallpaper || currentWallpaper === "" || (currentWallpaper && currentWallpaper.startsWith("#")) return !currentWallpaper || currentWallpaper === "" || (currentWallpaper && currentWallpaper.startsWith("#"))
} }
@@ -167,6 +169,8 @@ Item {
anchors.fill: parent anchors.fill: parent
source: { source: {
var _ = SessionData.perMonitorWallpaper
var __ = SessionData.monitorWallpapers
var currentWallpaper = SessionData.getMonitorWallpaper(screenName) var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : "" return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
} }

View File

@@ -23,7 +23,7 @@ Item {
NetworkService.removeRef(); NetworkService.removeRef();
} }
FileBrowserSurfaceModal { FileBrowserModal {
id: vpnFileBrowser id: vpnFileBrowser
browserTitle: I18n.tr("Import VPN") browserTitle: I18n.tr("Import VPN")
browserIcon: "vpn_key" browserIcon: "vpn_key"

View File

@@ -28,6 +28,7 @@ StyledRect {
property string pluginSettingsPath: pluginData ? (pluginData.settingsPath || "") : "" property string pluginSettingsPath: pluginData ? (pluginData.settingsPath || "") : ""
property var pluginPermissions: pluginData ? (pluginData.permissions || []) : [] property var pluginPermissions: pluginData ? (pluginData.permissions || []) : []
property bool hasSettings: pluginData && pluginData.settings !== undefined && pluginData.settings !== "" property bool hasSettings: pluginData && pluginData.settings !== undefined && pluginData.settings !== ""
property bool isSystemPlugin: pluginData ? (pluginData.source === "system") : false
property bool isExpanded: expandedPluginId === pluginId property bool isExpanded: expandedPluginId === pluginId
property bool isLoaded: { property bool isLoaded: {
PluginService.loadedPlugins; PluginService.loadedPlugins;
@@ -116,7 +117,7 @@ StyledRect {
height: 28 height: 28
radius: 14 radius: 14
color: updateArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency) : "transparent" color: updateArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency) : "transparent"
visible: DMSService.dmsAvailable && root.isLoaded && root.hasUpdate visible: DMSService.dmsAvailable && root.isLoaded && root.hasUpdate && !root.isSystemPlugin
DankIcon { DankIcon {
anchors.centerIn: parent anchors.centerIn: parent
@@ -160,7 +161,7 @@ StyledRect {
height: 28 height: 28
radius: 14 radius: 14
color: uninstallArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency) : "transparent" color: uninstallArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency) : "transparent"
visible: DMSService.dmsAvailable visible: DMSService.dmsAvailable && !root.isSystemPlugin
DankIcon { DankIcon {
anchors.centerIn: parent anchors.centerIn: parent

View File

@@ -314,7 +314,8 @@ Singleton {
const keyData = { const keyData = {
key: bind.key || "", key: bind.key || "",
source: bind.source || "config", source: bind.source || "config",
isOverride: bind.source === "dms" isOverride: bind.source === "dms",
cooldownMs: bind.cooldownMs || 0
}; };
if (actionMap[action]) { if (actionMap[action]) {
actionMap[action].keys.push(keyData); actionMap[action].keys.push(keyData);
@@ -378,6 +379,8 @@ Singleton {
const cmd = ["dms", "keybinds", "set", currentProvider, bindData.key, bindData.action, "--desc", bindData.desc || ""]; const cmd = ["dms", "keybinds", "set", currentProvider, bindData.key, bindData.action, "--desc", bindData.desc || ""];
if (originalKey && originalKey !== bindData.key) if (originalKey && originalKey !== bindData.key)
cmd.push("--replace-key", originalKey); cmd.push("--replace-key", originalKey);
if (bindData.cooldownMs > 0)
cmd.push("--cooldown-ms", String(bindData.cooldownMs));
saveProcess.command = cmd; saveProcess.command = cmd;
saveProcess.running = true; saveProcess.running = true;
bindSaved(bindData.key); bindSaved(bindData.key);

View File

@@ -1 +1 @@
v0.6.2 v1.0.1

View File

@@ -23,6 +23,8 @@ Item {
property string editKey: "" property string editKey: ""
property string editAction: "" property string editAction: ""
property string editDesc: "" property string editDesc: ""
property int editCooldownMs: 0
property int _savedCooldownMs: -1
property bool hasChanges: false property bool hasChanges: false
property string _actionType: "" property string _actionType: ""
property bool addingNewKey: false property bool addingNewKey: false
@@ -90,6 +92,12 @@ Item {
editKey = keyToFind; editKey = keyToFind;
editAction = bindData.action || ""; editAction = bindData.action || "";
editDesc = bindData.desc || ""; editDesc = bindData.desc || "";
if (_savedCooldownMs >= 0) {
editCooldownMs = _savedCooldownMs;
_savedCooldownMs = -1;
} else {
editCooldownMs = keys[i].cooldownMs || 0;
}
hasChanges = false; hasChanges = false;
_actionType = Actions.getActionType(editAction); _actionType = Actions.getActionType(editAction);
useCustomCompositor = _actionType === "compositor" && editAction && !Actions.isKnownCompositorAction(editAction); useCustomCompositor = _actionType === "compositor" && editAction && !Actions.isKnownCompositorAction(editAction);
@@ -109,6 +117,7 @@ Item {
editKey = editingKeyIndex >= 0 ? keys[editingKeyIndex].key : ""; editKey = editingKeyIndex >= 0 ? keys[editingKeyIndex].key : "";
editAction = bindData.action || ""; editAction = bindData.action || "";
editDesc = bindData.desc || ""; editDesc = bindData.desc || "";
editCooldownMs = editingKeyIndex >= 0 ? (keys[editingKeyIndex].cooldownMs || 0) : 0;
hasChanges = false; hasChanges = false;
_actionType = Actions.getActionType(editAction); _actionType = Actions.getActionType(editAction);
useCustomCompositor = _actionType === "compositor" && editAction && !Actions.isKnownCompositorAction(editAction); useCustomCompositor = _actionType === "compositor" && editAction && !Actions.isKnownCompositorAction(editAction);
@@ -127,6 +136,7 @@ Item {
addingNewKey = false; addingNewKey = false;
editingKeyIndex = index; editingKeyIndex = index;
editKey = keys[index].key; editKey = keys[index].key;
editCooldownMs = keys[index].cooldownMs || 0;
hasChanges = false; hasChanges = false;
} }
@@ -137,8 +147,11 @@ Item {
editAction = changes.action; editAction = changes.action;
if (changes.desc !== undefined) if (changes.desc !== undefined)
editDesc = changes.desc; editDesc = changes.desc;
if (changes.cooldownMs !== undefined)
editCooldownMs = changes.cooldownMs;
const origKey = editingKeyIndex >= 0 && editingKeyIndex < keys.length ? keys[editingKeyIndex].key : ""; const origKey = editingKeyIndex >= 0 && editingKeyIndex < keys.length ? keys[editingKeyIndex].key : "";
hasChanges = editKey !== origKey || editAction !== (bindData.action || "") || editDesc !== (bindData.desc || ""); const origCooldown = editingKeyIndex >= 0 && editingKeyIndex < keys.length ? (keys[editingKeyIndex].cooldownMs || 0) : 0;
hasChanges = editKey !== origKey || editAction !== (bindData.action || "") || editDesc !== (bindData.desc || "") || editCooldownMs !== origCooldown;
} }
function canSave() { function canSave() {
@@ -156,10 +169,12 @@ Item {
let desc = editDesc; let desc = editDesc;
if (expandedLoader.item?.currentTitle !== undefined) if (expandedLoader.item?.currentTitle !== undefined)
desc = expandedLoader.item.currentTitle; desc = expandedLoader.item.currentTitle;
_savedCooldownMs = editCooldownMs;
saveBind(origKey, { saveBind(origKey, {
key: editKey, key: editKey,
action: editAction, action: editAction,
desc: desc desc: desc,
cooldownMs: editCooldownMs
}); });
hasChanges = false; hasChanges = false;
addingNewKey = false; addingNewKey = false;
@@ -1431,6 +1446,57 @@ Item {
} }
} }
RowLayout {
Layout.fillWidth: true
spacing: Theme.spacingM
StyledText {
text: I18n.tr("Cooldown")
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
color: Theme.surfaceVariantText
Layout.preferredWidth: 60
}
DankTextField {
id: cooldownField
Layout.preferredWidth: 100
Layout.preferredHeight: 40
placeholderText: "0"
Connections {
target: root
function onEditCooldownMsChanged() {
const newText = root.editCooldownMs > 0 ? String(root.editCooldownMs) : "";
if (cooldownField.text !== newText)
cooldownField.text = newText;
}
}
Component.onCompleted: {
text = root.editCooldownMs > 0 ? String(root.editCooldownMs) : "";
}
onTextChanged: {
const val = parseInt(text) || 0;
if (val !== root.editCooldownMs)
root.updateEdit({
cooldownMs: val
});
}
}
StyledText {
text: I18n.tr("ms")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
Item {
Layout.fillWidth: true
}
}
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 1 Layout.preferredHeight: 1

View File

@@ -3554,7 +3554,7 @@
{ {
"term": "No Active Players", "term": "No Active Players",
"context": "No Active Players", "context": "No Active Players",
"reference": "Modules/DankDash/MediaPlayerTab.qml:308", "reference": "Modules/DankDash/MediaPlayerTab.qml:315",
"comment": "" "comment": ""
}, },
{ {
@@ -5300,7 +5300,7 @@
{ {
"term": "Switch User", "term": "Switch User",
"context": "Switch User", "context": "Switch User",
"reference": "Modules/Greetd/GreeterContent.qml:662", "reference": "Modules/Greetd/GreeterContent.qml:666",
"comment": "" "comment": ""
}, },
{ {

View File

@@ -1926,7 +1926,7 @@
"None": "Nulla" "None": "Nulla"
}, },
"Normal Font": { "Normal Font": {
"Normal Font": "Carattere Normale" "Normal Font": "Font Normale"
}, },
"Normal Priority": { "Normal Priority": {
"Normal Priority": "Priorità Normale" "Normal Priority": "Priorità Normale"
@@ -2481,7 +2481,7 @@
"Select driver...": "Seleziona un driver..." "Select driver...": "Seleziona un driver..."
}, },
"Select font weight for UI text": { "Select font weight for UI text": {
"Select font weight for UI text": "Seleziona lo spessore del carattere per il testo dell'interfaccia utente" "Select font weight for UI text": "Seleziona lo spessore del font per il testo dell'interfaccia utente"
}, },
"Select monitor to configure wallpaper": { "Select monitor to configure wallpaper": {
"Select monitor to configure wallpaper": "Selezionare il monitor per configurare lo sconto" "Select monitor to configure wallpaper": "Selezionare il monitor per configurare lo sconto"
@@ -2493,7 +2493,7 @@
"Select system sound theme": "Seleziona tema suoni di sistema" "Select system sound theme": "Seleziona tema suoni di sistema"
}, },
"Select the font family for UI text": { "Select the font family for UI text": {
"Select the font family for UI text": "Seleziona la famiglia di caratteri per il testo dell'interfaccia utente" "Select the font family for UI text": "Seleziona la famiglia di font per il testo dell'interfaccia utente"
}, },
"Select the palette algorithm used for wallpaper-based colors": { "Select the palette algorithm used for wallpaper-based colors": {
"Select the palette algorithm used for wallpaper-based colors": "Seleziona l'algoritmo tavolozza usato per i colori basati sullo sfondo" "Select the palette algorithm used for wallpaper-based colors": "Seleziona l'algoritmo tavolozza usato per i colori basati sullo sfondo"
@@ -2946,7 +2946,7 @@
"Typography": "Tipografia" "Typography": "Tipografia"
}, },
"Typography & Motion": { "Typography & Motion": {
"Typography & Motion": "Tipografia e Movimento" "Typography & Motion": "Tipografia e Animazioni"
}, },
"Unavailable": { "Unavailable": {
"Unavailable": "Non disponibile" "Unavailable": "Non disponibile"