From fdbf3e4453c29e7e40dc8b989370fa3b63870f39 Mon Sep 17 00:00:00 2001 From: EdenQwQ Date: Mon, 6 Oct 2025 00:22:19 +0800 Subject: [PATCH] add dms --- flake.lock | 87 +++++++ flake.nix | 4 + home/default.nix | 18 +- home/programs/desktop/dank.nix | 59 ----- home/programs/desktop/default.nix | 2 +- home/programs/desktop/dms.nix | 250 +++++++++++++++++++ home/programs/desktop/fonts.nix | 1 + home/programs/desktop/niri/waybar.nix | 2 +- home/programs/desktop/scripts/tofi/powermenu | 2 +- home/programs/shell/starship.nix | 12 +- home/programs/terminal/kitty.nix | 14 ++ home/programs/utils/ai.nix | 6 - home/tweaks/default.nix | 1 + hosts/default.nix | 1 + modules/home-manager/default.nix | 1 + modules/home-manager/desktop-shell.nix | 13 + 16 files changed, 395 insertions(+), 78 deletions(-) delete mode 100644 home/programs/desktop/dank.nix create mode 100644 home/programs/desktop/dms.nix create mode 100644 modules/home-manager/desktop-shell.nix diff --git a/flake.lock b/flake.lock index a9abbf5..9e86d74 100644 --- a/flake.lock +++ b/flake.lock @@ -88,6 +88,29 @@ "type": "github" } }, + "dankMaterialShell": { + "inputs": { + "dgop": "dgop", + "dms-cli": "dms-cli", + "nixpkgs": [ + "nixpkgs" + ], + "quickshell": "quickshell" + }, + "locked": { + "lastModified": 1759633142, + "narHash": "sha256-iRN4xtctVGELGkuhFPZLJYSAk0O/f7xLTQussuaaoDo=", + "owner": "AvengeMedia", + "repo": "DankMaterialShell", + "rev": "804bf879edc17c20e3b2810b74c7f8187c2ec538", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "repo": "DankMaterialShell", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -110,6 +133,48 @@ "type": "github" } }, + "dgop": { + "inputs": { + "nixpkgs": [ + "dankMaterialShell", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757252286, + "narHash": "sha256-QwWQzlxAGvIi6VAc8DQ6ONCKKwtPyaHQW1cQyGbP7Og=", + "owner": "AvengeMedia", + "repo": "dgop", + "rev": "a65a02ddf8bade9c109d055e644e4bd851183bd5", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "repo": "dgop", + "type": "github" + } + }, + "dms-cli": { + "inputs": { + "nixpkgs": [ + "dankMaterialShell", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757296630, + "narHash": "sha256-3H236F5oIKkqpfnwrvZQs4Y5imKb6JCMFGDkHs8VDjQ=", + "owner": "AvengeMedia", + "repo": "danklinux", + "rev": "dac591711ab30d6b071a5cec674a3d2e04665ee1", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "repo": "danklinux", + "type": "github" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -1123,9 +1188,31 @@ "type": "github" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "dankMaterialShell", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756981260, + "narHash": "sha256-GhuD9QVimjynHI0OOyZsqJsnlXr2orowh9H+HYz4YMs=", + "ref": "refs/heads/master", + "rev": "6eb12551baf924f8fdecdd04113863a754259c34", + "revCount": 672, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + } + }, "root": { "inputs": { "agenix": "agenix", + "dankMaterialShell": "dankMaterialShell", "flake-parts": "flake-parts", "ghostty": "ghostty", "home-manager": "home-manager_2", diff --git a/flake.nix b/flake.nix index cde6dd3..14dee31 100644 --- a/flake.nix +++ b/flake.nix @@ -90,5 +90,9 @@ }; ghostty.url = "github:ghostty-org/ghostty"; nixGL.url = "github:nix-community/nixGL"; + dankMaterialShell = { + url = "github:AvengeMedia/DankMaterialShell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; } diff --git a/home/default.nix b/home/default.nix index 048e92b..8700dc3 100644 --- a/home/default.nix +++ b/home/default.nix @@ -37,17 +37,27 @@ '' run ${pkgs.niri-unstable}/bin/niri msg action do-screen-transition ''; - reload-waybar = + reload-swhkd = lib.hm.dag.entryAfter [ "niri-transition" ] + # bash + '' + run --quiet ${pkgs.procps}/bin/pkill -HUP swhkd + ''; + } + // lib.mkIf (config.desktopShell == "waybar") { + reload-waybar = + lib.hm.dag.entryAfter [ "reload-swhkd" ] # bash '' run --quiet ${pkgs.systemd}/bin/systemctl --user reload waybar.service ''; - reload-swhkd = - lib.hm.dag.entryAfter [ "reload-waybar" ] + } + // lib.mkIf (config.desktopShell == "dms") { + reload-dms = + lib.hm.dag.entryAfter [ "reload-swhkd" ] # bash '' - run --quiet ${pkgs.procps}/bin/pkill -HUP swhkd + run --quiet ${pkgs.systemd}/bin/systemctl --user reload dms.service ''; }; }; diff --git a/home/programs/desktop/dank.nix b/home/programs/desktop/dank.nix deleted file mode 100644 index 9c06351..0000000 --- a/home/programs/desktop/dank.nix +++ /dev/null @@ -1,59 +0,0 @@ -# copied from https://github.com/nix-community/stylix/pull/1932 -{ config, ... }: -let - inherit (config.lib.stylix) colors; - colorTheme = { - dark = with colors.withHashtag; { - name = "Stylix generatated dark theme"; - primary = base0D; - primaryText = base00; - primaryContainer = base0C; - secondary = base0E; - surface = base01; - surfaceText = base05; - surfaceVariant = base02; - surfaceVariantText = base04; - surfaceTint = base0D; - background = base00; - backgroundText = base05; - outline = base03; - surfaceContainer = base01; - surfaceContainerHigh = base02; - surfaceContainerHighest = base03; - error = base08; - warning = base0A; - info = base0C; - }; - light = with colors.withHashtag; { - name = "Stylix generatated light theme"; - primary = base0D; - primaryText = base07; - primaryContainer = base0C; - secondary = base0E; - surface = base06; - surfaceText = base01; - surfaceVariant = base07; - surfaceVariantText = base02; - surfaceTint = base0D; - background = base07; - backgroundText = base00; - outline = base04; - surfaceContainer = base06; - surfaceContainerHigh = base05; - surfaceContainerHighest = base04; - error = base08; - warning = base0A; - info = base0C; - }; - }; - - configDir = ".config/DankMaterialShell"; - colorThemePath = "${configDir}/stylix-colors.json"; -in -{ - home.file."${colorThemePath}".text = builtins.toJSON colorTheme; - home.file."${configDir}/settings.json".text = builtins.toJSON { - currentThemeName = "custom"; - currentThemeFile = colorThemePath; - }; -} diff --git a/home/programs/desktop/default.nix b/home/programs/desktop/default.nix index 7be7571..dbd9902 100644 --- a/home/programs/desktop/default.nix +++ b/home/programs/desktop/default.nix @@ -6,7 +6,7 @@ ./mako.nix ./niri ./swhkd.nix - ./dank.nix + ./dms.nix # ./scroll # ./mango ]; diff --git a/home/programs/desktop/dms.nix b/home/programs/desktop/dms.nix new file mode 100644 index 0000000..2dcbb45 --- /dev/null +++ b/home/programs/desktop/dms.nix @@ -0,0 +1,250 @@ +# copied from https://github.com/nix-community/stylix/pull/1932 +{ + inputs, + config, + lib, + pkgs, + ... +}: +let + inherit (config.lib.stylix) colors; + colorTheme = { + dark = with colors.withHashtag; { + name = "Stylix generatated dark theme"; + primary = base0D; + primaryText = base00; + primaryContainer = base0C; + secondary = base0E; + surface = base01; + surfaceText = base05; + surfaceVariant = base02; + surfaceVariantText = base04; + surfaceTint = base0F; + background = base00; + backgroundText = base05; + outline = base03; + surfaceContainer = base01; + surfaceContainerHigh = base02; + surfaceContainerHighest = base03; + error = base08; + warning = base0A; + info = base0C; + }; + light = with colors.withHashtag; { + name = "Stylix generatated light theme"; + primary = base0D; + primaryText = base07; + primaryContainer = base0C; + secondary = base0E; + surface = base06; + surfaceText = base01; + surfaceVariant = base07; + surfaceVariantText = base02; + surfaceTint = base0D; + background = base07; + backgroundText = base00; + outline = base04; + surfaceContainer = base06; + surfaceContainerHigh = base05; + surfaceContainerHighest = base04; + error = base08; + warning = base0A; + info = base0C; + }; + }; +in +{ + # programs.quickshell.configs.dms = + # let + # dankMaterialShell = + # inputs.dankMaterialShell.packages.${pkgs.system}.dankMaterialShell.overrideAttrs + # { + # installPhase = '' + # mkdir -p $out/etc/xdg/quickshell/DankMaterialShell + # cp -r . $out/etc/xdg/quickshell/DankMaterialShell + # ln -s $out/etc/xdg/quickshell/DankMaterialShell $out/etc/xdg/quickshell/dms + # substituteInPlace $out/etc/xdg/quickshell/DankMaterialShell/Widgets/DankIcon.qml \ + # --replace "Material Symbols Rounded" "Monofur Nerd Font" + # ''; + # }; + # in + # "${dankMaterialShell}/etc/xdg/quickshell/DankMaterialShell" |> lib.mkForce; + xdg.configFile."DankMaterialShell/stylix-colors.json".text = builtins.toJSON colorTheme; + xdg.configFile."DankMaterialShell/settings.json".text = # json + '' + { + "currentThemeName": "custom", + "customThemeFile": "/home/eden/.config/DankMaterialShell/stylix-colors.json", + "matugenScheme": "scheme-tonal-spot", + "dankBarTransparency": 0.5, + "dankBarWidgetTransparency": 0.56, + "popupTransparency": 1, + "dockTransparency": 1, + "use24HourClock": true, + "useFahrenheit": false, + "nightModeEnabled": false, + "weatherLocation": "西湖区, 浙江省", + "weatherCoordinates": "30.2616958,120.1256628", + "useAutoLocation": false, + "weatherEnabled": true, + "showLauncherButton": true, + "showWorkspaceSwitcher": true, + "showFocusedWindow": true, + "showWeather": true, + "showMusic": true, + "showClipboard": true, + "showCpuUsage": true, + "showMemUsage": true, + "showCpuTemp": true, + "showGpuTemp": true, + "selectedGpuIndex": 0, + "enabledGpuPciIds": [], + "showSystemTray": true, + "showClock": true, + "showNotificationButton": true, + "showBattery": true, + "showControlCenterButton": true, + "controlCenterShowNetworkIcon": true, + "controlCenterShowBluetoothIcon": true, + "controlCenterShowAudioIcon": true, + "controlCenterWidgets": [ + { + "id": "volumeSlider", + "enabled": true, + "width": 50 + }, + { + "id": "brightnessSlider", + "enabled": true, + "width": 50 + }, + { + "id": "wifi", + "enabled": true, + "width": 50 + }, + { + "id": "bluetooth", + "enabled": true, + "width": 50 + }, + { + "id": "audioOutput", + "enabled": true, + "width": 50 + }, + { + "id": "audioInput", + "enabled": true, + "width": 50 + }, + { + "id": "nightMode", + "enabled": true, + "width": 50 + }, + { + "id": "darkMode", + "enabled": true, + "width": 50 + } + ], + "showWorkspaceIndex": false, + "showWorkspacePadding": false, + "showWorkspaceApps": false, + "maxWorkspaceIcons": 3, + "workspacesPerMonitor": true, + "workspaceNameIcons": {}, + "waveProgressEnabled": true, + "clockCompactMode": false, + "focusedWindowCompactMode": false, + "runningAppsCompactMode": true, + "runningAppsCurrentWorkspace": false, + "clockDateFormat": "", + "lockDateFormat": "", + "mediaSize": 0, + "dankBarLeftWidgets": [ + "launcherButton", + "workspaceSwitcher", + "focusedWindow" + ], + "dankBarCenterWidgets": ["music", "clock", "weather"], + "dankBarRightWidgets": [ + { + "id": "notepadButton", + "enabled": true + }, + { + "id": "cpuUsage", + "enabled": true + }, + { + "id": "battery", + "enabled": true + }, + { + "id": "controlCenterButton", + "enabled": true + } + ], + "appLauncherViewMode": "list", + "spotlightModalViewMode": "list", + "networkPreference": "auto", + "iconTheme": "System Default", + "useOSLogo": true, + "osLogoColorOverride": "#7daea3", + "osLogoBrightness": 0.5, + "osLogoContrast": 1, + "fontFamily": "Hug Me Tight", + "monoFontFamily": "Maple Mono", + "fontWeight": 400, + "fontScale": 1, + "notepadUseMonospace": true, + "notepadFontFamily": "", + "notepadFontSize": 14, + "notepadShowLineNumbers": false, + "notepadTransparencyOverride": -1, + "notepadLastCustomTransparency": 0.95, + "gtkThemingEnabled": false, + "qtThemingEnabled": false, + "showDock": false, + "dockAutoHide": false, + "dockGroupByApp": false, + "dockOpenOnOverview": false, + "dockPosition": 2, + "dockSpacing": 4, + "dockBottomGap": 0, + "cornerRadius": 12, + "notificationOverlayEnabled": false, + "dankBarAutoHide": false, + "dankBarOpenOnOverview": false, + "dankBarVisible": true, + "dankBarSpacing": 7, + "dankBarBottomGap": 0, + "dankBarInnerPadding": 4, + "dankBarSquareCorners": false, + "dankBarNoBackground": false, + "dankBarGothCornersEnabled": false, + "dankBarPosition": 0, + "lockScreenShowPowerActions": true, + "hideBrightnessSlider": false, + "widgetBackgroundColor": "sch", + "surfaceBase": "s", + "notificationTimeoutLow": 5000, + "notificationTimeoutNormal": 5000, + "notificationTimeoutCritical": 0, + "notificationPopupPosition": 0, + "osdAlwaysShowValue": false, + "screenPreferences": { + "wallpaper": [] + }, + "pluginSettings": {}, + "animationSpeed": 2 + } + ''; + programs.dankMaterialShell.enableSystemd = true; + home.sessionVariables = { + DMS_DISABLE_MATUGEN = "1"; + QT_QPA_PLATFORM = "gtk3"; + }; +} diff --git a/home/programs/desktop/fonts.nix b/home/programs/desktop/fonts.nix index 6c99ea9..1768053 100644 --- a/home/programs/desktop/fonts.nix +++ b/home/programs/desktop/fonts.nix @@ -3,5 +3,6 @@ home.packages = [ pkgs.kose-font pkgs.hugmetight-font + pkgs.material-symbols ]; } diff --git a/home/programs/desktop/niri/waybar.nix b/home/programs/desktop/niri/waybar.nix index 045d826..d8b90c5 100644 --- a/home/programs/desktop/niri/waybar.nix +++ b/home/programs/desktop/niri/waybar.nix @@ -134,7 +134,7 @@ let in { programs.waybar = { - enable = true; + # enable = true; systemd = { enable = true; target = config.wayland.systemd.target; diff --git a/home/programs/desktop/scripts/tofi/powermenu b/home/programs/desktop/scripts/tofi/powermenu index e48a5bd..3b60597 100755 --- a/home/programs/desktop/scripts/tofi/powermenu +++ b/home/programs/desktop/scripts/tofi/powermenu @@ -2,7 +2,7 @@ . ~/scripts/tofi/config -entry=$(printf " poweroff\n reboot\n mode\n exit\n suspend" | tofi_full "power") +entry=$(printf "󰐥 poweroff\n󰜉 reboot\n󰁽 mode\n󰿅 exit\n󰽧 suspend" | tofi_full "power") entry=$(echo $entry | cut -d' ' -f2 ) if [ "$entry" = "poweroff" ] || [ "$entry" = "reboot" ]; then diff --git a/home/programs/shell/starship.nix b/home/programs/shell/starship.nix index 569d4ea..fec859f 100644 --- a/home/programs/shell/starship.nix +++ b/home/programs/shell/starship.nix @@ -44,12 +44,12 @@ [character] format = "$symbol " - success_symbol = "[╰─](bold iris)[ ](bold iris)" - error_symbol = "[╰─](bold iris)[ ](bold love)" - vimcmd_symbol = "[╰─](bold iris)[ ](bold foam)" - vimcmd_visual_symbol = "[╰─](bold iris)[ ](bold pine)" - vimcmd_replace_symbol = "[╰─](bold iris)[ ](bold gold)" - vimcmd_replace_one_symbol = "[╰─](bold iris)[ ](bold gold)" + success_symbol = "[╰─](bold iris)[ 󰈺](bold iris)" + error_symbol = "[╰─](bold iris)[ 󰈺](bold love)" + vimcmd_symbol = "[╰─](bold iris)[ 󰈺](bold foam)" + vimcmd_visual_symbol = "[╰─](bold iris)[ 󰈺](bold pine)" + vimcmd_replace_symbol = "[╰─](bold iris)[ 󰈺](bold gold)" + vimcmd_replace_one_symbol = "[╰─](bold iris)[ 󰈺](bold gold)" [container] format = ' [$symbol $name]($style) ' diff --git a/home/programs/terminal/kitty.nix b/home/programs/terminal/kitty.nix index e56b327..15a97b0 100644 --- a/home/programs/terminal/kitty.nix +++ b/home/programs/terminal/kitty.nix @@ -27,6 +27,20 @@ symbol_map U+30000-U+3134F Xiaolai Mono SC symbol_map U+F900-U+FAFF Xiaolai Mono SC symbol_map U+2F800-U+2FA1F Xiaolai Mono SC + + symbol_map U+E000-U+E00D Symbols Nerd Font + symbol_map U+e0a0-U+e0a2,U+e0b0-U+e0b3 Symbols Nerd Font + symbol_map U+e0a3-U+e0a3,U+e0b4-U+e0c8,U+e0cc-U+e0d2,U+e0d4-U+e0d4 Symbols Nerd Font + symbol_map U+e5fa-U+e62b Symbols Nerd Font + symbol_map U+e700-U+e7c5 Symbols Nerd Font + symbol_map U+f000-U+f2e0 Symbols Nerd Font + symbol_map U+e200-U+e2a9 Symbols Nerd Font + symbol_map U+f400-U+f4a8,U+2665-U+2665,U+26A1-U+26A1,U+f27c-U+f27c Symbols Nerd Font + symbol_map U+F300-U+F313 Symbols Nerd Font + symbol_map U+23fb-U+23fe,U+2b58-U+2b58 Symbols Nerd Font + symbol_map U+f500-U+fd46 Symbols Nerd Font + symbol_map U+e300-U+e3eb Symbols Nerd Font + symbol_map U+21B5,U+25B8,U+2605,U+2630,U+2632,U+2714,U+E0A3,U+E615,U+E62B Symbols Nerd Font ''; }; stylix.targets.kitty.enable = true; diff --git a/home/programs/utils/ai.nix b/home/programs/utils/ai.nix index ebbf1ca..a1702a2 100644 --- a/home/programs/utils/ai.nix +++ b/home/programs/utils/ai.nix @@ -2,12 +2,6 @@ { programs.gemini-cli = { enable = true; - settings = { - theme = "ANSI"; - vimMode = true; - preferredEditor = "nvim"; - autoAccept = false; - }; }; programs.claude-code = { enable = true; diff --git a/home/tweaks/default.nix b/home/tweaks/default.nix index 9ced03a..511deee 100644 --- a/home/tweaks/default.nix +++ b/home/tweaks/default.nix @@ -7,4 +7,5 @@ ./wallpaper.nix ./colorscheme.nix ]; + desktopShell = "dank"; } diff --git a/hosts/default.nix b/hosts/default.nix index 35c2611..96d8f32 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -22,6 +22,7 @@ let inputs.agenix.homeManagerModules.default ../secrets/age.nix # inputs.mangowc.hmModules.mango + inputs.dankMaterialShell.homeModules.dankMaterialShell.default ] ++ (builtins.attrValues self.homeManagerModules); diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 235553d..c55fdf0 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -2,4 +2,5 @@ monitors = import ./monitors.nix; colorscheme = import ./colorscheme.nix; wallpapers = import ./wallpaper.nix; + desktopShell = import ./desktop-shell.nix; } diff --git a/modules/home-manager/desktop-shell.nix b/modules/home-manager/desktop-shell.nix new file mode 100644 index 0000000..bb4bbed --- /dev/null +++ b/modules/home-manager/desktop-shell.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +with lib; +{ + options.desktopShell = mkOption { + type = types.str; + description = "The desktop shell to use."; + }; + + config = { + programs.waybar.enable = config.desktopShell == "waybar"; + programs.dankMaterialShell.enable = config.desktopShell == "dank"; + }; +}