mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-31 17:02:51 -05:00
Compare commits
3 Commits
72cfd37ab7
...
e573bdba92
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e573bdba92 | ||
|
|
d8cd15d361 | ||
|
|
1db3907838 |
@@ -9,8 +9,6 @@ let
|
|||||||
cfg = config.programs.dankMaterialShell;
|
cfg = config.programs.dankMaterialShell;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
qmlPath = "${dmsPkgs.dms-shell}/share/quickshell/dms";
|
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
dmsPkgs.dms-shell
|
dmsPkgs.dms-shell
|
||||||
]
|
]
|
||||||
@@ -25,6 +23,9 @@ in
|
|||||||
]
|
]
|
||||||
++ lib.optional cfg.enableDynamicTheming pkgs.matugen
|
++ lib.optional cfg.enableDynamicTheming pkgs.matugen
|
||||||
++ lib.optional cfg.enableAudioWavelength pkgs.cava
|
++ lib.optional cfg.enableAudioWavelength pkgs.cava
|
||||||
++ lib.optional cfg.enableCalendarEvents pkgs.khal
|
++ lib.optional cfg.enableCalendarEvents pkgs.khal;
|
||||||
++ lib.optional cfg.enableSystemSound pkgs.kdePackages.qtmultimedia;
|
|
||||||
|
plugins = lib.mapAttrs (name: plugin: {
|
||||||
|
source = plugin.src;
|
||||||
|
}) (lib.filterAttrs (n: v: v.enable) cfg.plugins);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,10 +139,32 @@ in
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
if [ -f session.json ]; then
|
if [ -f session.json ]; then
|
||||||
if cp "$(${jq} -r '.wallpaperPath' session.json)" wallpaper.jpg; then
|
copy_wallpaper() {
|
||||||
mv session.json session.orig.json
|
local path=$(${jq} -r ".$1 // empty" session.json)
|
||||||
${jq} '.wallpaperPath = "${cacheDir}/wallpaper.jpg"' session.orig.json > session.json
|
if [ -f "$path" ]; then
|
||||||
|
cp "$path" "$2"
|
||||||
|
${jq} ".$1 = \"${cacheDir}/$2\"" session.json > session.tmp
|
||||||
|
mv session.tmp session.json
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
copy_monitor_wallpapers() {
|
||||||
|
${jq} -r ".$1 // {} | to_entries[] | .key + \":\" + .value" session.json 2>/dev/null | while IFS=: read monitor path; do
|
||||||
|
local dest="$2-$(echo "$monitor" | tr -c '[:alnum:]' '-')"
|
||||||
|
if [ -f "$path" ]; then
|
||||||
|
cp "$path" "$dest"
|
||||||
|
${jq} --arg m "$monitor" --arg p "${cacheDir}/$dest" ".$1[\$m] = \$p" session.json > session.tmp
|
||||||
|
mv session.tmp session.json
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
copy_wallpaper "wallpaperPath" "wallpaper"
|
||||||
|
copy_wallpaper "wallpaperPathLight" "wallpaper-light"
|
||||||
|
copy_wallpaper "wallpaperPathDark" "wallpaper-dark"
|
||||||
|
copy_monitor_wallpapers "monitorWallpapers" "wallpaper-monitor"
|
||||||
|
copy_monitor_wallpapers "monitorWallpapersLight" "wallpaper-monitor-light"
|
||||||
|
copy_monitor_wallpapers "monitorWallpapersDark" "wallpaper-monitor-dark"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f settings.json ]; then
|
if [ -f settings.json ]; then
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ in
|
|||||||
plugins = lib.mkOption {
|
plugins = lib.mkOption {
|
||||||
type = attrsOf (
|
type = attrsOf (
|
||||||
types.submodule (
|
types.submodule (
|
||||||
{ config, ... }:
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
@@ -73,8 +72,6 @@ in
|
|||||||
programs.quickshell = {
|
programs.quickshell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit (cfg.quickshell) package;
|
inherit (cfg.quickshell) package;
|
||||||
|
|
||||||
configs.dms = common.qmlPath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
||||||
@@ -82,7 +79,6 @@ in
|
|||||||
Description = "DankMaterialShell";
|
Description = "DankMaterialShell";
|
||||||
PartOf = [ config.wayland.systemd.target ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
After = [ config.wayland.systemd.target ];
|
After = [ config.wayland.systemd.target ];
|
||||||
X-Restart-Triggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
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 [ ];
|
||||||
@@ -31,7 +29,7 @@ in
|
|||||||
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;
|
restartIfChanged = cfg.systemd.restartIfChanged;
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session";
|
ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session";
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
(lib.mkRemovedOptionModule (path ++ [ "enableBrightnessControl" ]) builtInRemovedMsg)
|
(lib.mkRemovedOptionModule (path ++ [ "enableBrightnessControl" ]) builtInRemovedMsg)
|
||||||
(lib.mkRemovedOptionModule (path ++ [ "enableColorPicker" ]) builtInRemovedMsg)
|
(lib.mkRemovedOptionModule (path ++ [ "enableColorPicker" ]) builtInRemovedMsg)
|
||||||
|
(lib.mkRemovedOptionModule (
|
||||||
|
path ++ [ "enableSystemSound" ]
|
||||||
|
) "qtmultimedia is now included on dms-shell package.")
|
||||||
];
|
];
|
||||||
|
|
||||||
options.programs.dankMaterialShell = {
|
options.programs.dankMaterialShell = {
|
||||||
@@ -58,15 +61,46 @@ in
|
|||||||
default = true;
|
default = true;
|
||||||
description = "Add calendar events support via khal";
|
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 = {
|
quickshell = {
|
||||||
package = lib.mkPackageOption dmsPkgs "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).";
|
extraDescription = "The quickshell package to use (defaults to be built from source, in the commit 26531f due to unreleased features used by DMS).";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugins = lib.mkOption {
|
||||||
|
type = types.attrsOf (
|
||||||
|
types.submodule {
|
||||||
|
options = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to enable this plugin";
|
||||||
|
};
|
||||||
|
src = lib.mkOption {
|
||||||
|
type = types.package;
|
||||||
|
description = "Source of the plugin package or path";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
default = { };
|
||||||
|
description = "DMS Plugins to install and enable";
|
||||||
|
example = lib.literalExpression ''
|
||||||
|
{
|
||||||
|
DockerManager = {
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "LuckShiba";
|
||||||
|
repo = "DmsDockerManager";
|
||||||
|
rev = "v1.2.0";
|
||||||
|
sha256 = "sha256-VoJCaygWnKpv0s0pqTOmzZnPM922qPDMHk4EPcgVnaU=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
AnotherPlugin = {
|
||||||
|
enable = true;
|
||||||
|
src = pkgs.another-plugin;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
28
flake.nix
28
flake.nix
@@ -40,6 +40,16 @@
|
|||||||
(import path (args // { dmsPkgs = buildDmsPkgs pkgs; }))
|
(import path (args // { dmsPkgs = buildDmsPkgs pkgs; }))
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
mkQmlImportPath =
|
||||||
|
pkgs: qmlPkgs:
|
||||||
|
pkgs.lib.concatStringsSep ":" (map (o: "${o}/${pkgs.qt6.qtbase.qtQmlPrefix}") qmlPkgs);
|
||||||
|
|
||||||
|
qmlPkgs =
|
||||||
|
pkgs: with pkgs.kdePackages; [
|
||||||
|
kirigami.unwrapped
|
||||||
|
sonnet
|
||||||
|
qtmultimedia
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = forEachSystem (
|
packages = forEachSystem (
|
||||||
@@ -96,7 +106,9 @@
|
|||||||
install -D ${rootSrc}/core/assets/danklogo.svg \
|
install -D ${rootSrc}/core/assets/danklogo.svg \
|
||||||
$out/share/hicolor/scalable/apps/danklogo.svg
|
$out/share/hicolor/scalable/apps/danklogo.svg
|
||||||
|
|
||||||
wrapProgram $out/bin/dms --add-flags "-c $out/share/quickshell/dms"
|
wrapProgram $out/bin/dms \
|
||||||
|
--add-flags "-c $out/share/quickshell/dms" \
|
||||||
|
--prefix "NIXPKGS_QT6_QML_IMPORT_PATH" ":" "${mkQmlImportPath pkgs (qmlPkgs pkgs)}"
|
||||||
|
|
||||||
install -Dm644 ${rootSrc}/assets/systemd/dms.service \
|
install -Dm644 ${rootSrc}/assets/systemd/dms.service \
|
||||||
$out/lib/systemd/user/dms.service
|
$out/lib/systemd/user/dms.service
|
||||||
@@ -143,15 +155,11 @@
|
|||||||
devShells = forEachSystem (
|
devShells = forEachSystem (
|
||||||
system: pkgs:
|
system: pkgs:
|
||||||
let
|
let
|
||||||
qmlPkgs = [
|
devQmlPkgs = [
|
||||||
quickshell.packages.${system}.default
|
quickshell.packages.${system}.default
|
||||||
|
pkgs.kdePackages.qtdeclarative
|
||||||
]
|
]
|
||||||
++ (with pkgs.kdePackages; [
|
++ (qmlPkgs pkgs);
|
||||||
qtdeclarative
|
|
||||||
kirigami.unwrapped
|
|
||||||
sonnet
|
|
||||||
qtmultimedia
|
|
||||||
]);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
@@ -164,13 +172,13 @@
|
|||||||
go-tools
|
go-tools
|
||||||
gnumake
|
gnumake
|
||||||
]
|
]
|
||||||
++ qmlPkgs;
|
++ devQmlPkgs;
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
touch quickshell/.qmlls.ini 2>/dev/null
|
touch quickshell/.qmlls.ini 2>/dev/null
|
||||||
'';
|
'';
|
||||||
|
|
||||||
QML2_IMPORT_PATH = pkgs.lib.concatStringsSep ":" (map (o: "${o}/lib/qt-6/qml") qmlPkgs);
|
QML2_IMPORT_PATH = mkQmlImportPath pkgs devQmlPkgs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user