dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 9e00aeb74bf380c092f24f0d51aa9eeff9c5c9c7 parent 264e5420b1d0bc9a1eda72af712d8c07ce3e4198 Author: maydayv7 <maydayv7@gmail.com> Date: Wed, 26 Mar 2025 19:47:31 +0530 feat: Use `hyprsunset` Also migrate from `catppuccin/vscode` to `catppuccin/nix`
Diffstat:
| M | files/hyprland/theme/waybar.css | | | 5 | +++++ |
| M | flake.lock | | | 62 | ++++++++++++++++++++++++-------------------------------------- |
| M | flake.nix | | | 7 | ++++++- |
| M | modules/gui/desktop/hyprland/apps/misc.nix | | | 25 | +++++++++++-------------- |
| M | modules/gui/desktop/hyprland/apps/panel.nix | | | 20 | +++++++++++++++++--- |
| M | modules/gui/desktop/hyprland/apps/settings.nix | | | 3 | +++ |
| M | modules/gui/desktop/hyprland/apps/utilities.nix | | | 17 | ++--------------- |
| M | packages/flake.nix | | | 5 | ++--- |
| D | packages/patches/hyprland.patch | | | 97 | ------------------------------------------------------------------------------- |
| D | packages/patches/pyprland.patch | | | 31 | ------------------------------- |
| M | scripts/hyprutils.nix | | | 38 | ++++++++++++++++++++++++++++++++++---- |
11 files changed, 104 insertions(+), 206 deletions(-)
diff --git a/files/hyprland/theme/waybar.css b/files/hyprland/theme/waybar.css @@ -93,6 +93,10 @@ window#waybar { margin-right: 3px; } +#custom-temperature { + color: @base07; +} + @keyframes blink { to { background-color: #ffffff; @@ -138,6 +142,7 @@ window#waybar { #custom-dunst, #custom-logo, #custom-power, +#custom-temperature, #custom-weather, #keyboard-state, #mpris, diff --git a/flake.lock b/flake.lock @@ -95,6 +95,26 @@ "type": "github" } }, + "catppuccin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742599566, + "narHash": "sha256-xr6ntmiUPXSh9o9mJ7og9vxALMQs1EQhIhWUAO2D1M0=", + "owner": "catppuccin", + "repo": "nix", + "rev": "5e303e8d7e251868fa79f83bbda69da90aa62402", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "nix", + "type": "github" + } + }, "crane": { "inputs": { "nixpkgs": "nixpkgs" @@ -553,22 +573,6 @@ "type": "github" } }, - "nixpkgs_3": { - "locked": { - "lastModified": 1732837521, - "narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "inputs": { "flake-parts": "flake-parts", @@ -643,6 +647,7 @@ "root": { "inputs": { "boot": "boot", + "catppuccin": "catppuccin", "filters": "filters", "flatpak": "flatpak", "formatter": "formatter", @@ -665,7 +670,6 @@ "unstable": "unstable", "utils": "utils_2", "vscode": "vscode", - "vsppuccin": "vsppuccin", "windows": "windows" } }, @@ -946,11 +950,11 @@ }, "unstable": { "locked": { - "lastModified": 1742669843, - "narHash": "sha256-G5n+FOXLXcRx+3hCJ6Rt6ZQyF1zqQ0DL0sWAMn2Nk0w=", + "lastModified": 1742889210, + "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1e5b653dff12029333a6546c11e108ede13052eb", + "rev": "698214a32beb4f4c8e3942372c694f40848b360d", "type": "github" }, "original": { @@ -1021,24 +1025,6 @@ "type": "github" } }, - "vsppuccin": { - "inputs": { - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1742659101, - "narHash": "sha256-eGQYBQujuLskplnAHaLOfD37ct8Idc6jrR4E57cQY2o=", - "owner": "catppuccin", - "repo": "vscode", - "rev": "9bcff9eba7ab54a842e60ab7b68f3ee6f5bae34c", - "type": "github" - }, - "original": { - "owner": "catppuccin", - "repo": "vscode", - "type": "github" - } - }, "windows": { "inputs": { "flake-compat": "flake-compat_3", diff --git a/flake.nix b/flake.nix @@ -151,8 +151,13 @@ }; }; + # Catppuccin Theme + catppuccin = { + url = "github:catppuccin/nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # VS Code Extensions - vsppuccin.url = "github:catppuccin/vscode"; vscode = { url = "github:nix-community/nix-vscode-extensions"; inputs = { diff --git a/modules/gui/desktop/hyprland/apps/misc.nix b/modules/gui/desktop/hyprland/apps/misc.nix @@ -1,6 +1,7 @@ { config, lib, + inputs, pkgs, theme, ... @@ -10,23 +11,19 @@ in { ## 3rd Party Apps Configuration user.homeConfig = { + # Theme + imports = [inputs.catppuccin.homeManagerModules.catppuccin]; + catppuccin = with theme; { + inherit accent; + flavor = variant; + vscode.enable = true; + thunderbird.enable = true; + }; + # Code Editor programs.vscode.profiles.default = lib.mkIf (exists "vscode") { - extensions = with pkgs; [ - vscode-extensions.catppuccin.catppuccin-vsc-icons - (catppuccin-vsc.override { - inherit (theme) accent; - boldKeywords = true; - italicComments = true; - italicKeywords = true; - extraBordersEnabled = false; - workbenchMode = "default"; - bracketMode = "rainbow"; - }) - ]; - + extensions = [pkgs.vscode-extensions.catppuccin.catppuccin-vsc-icons]; userSettings = with theme; { - "workbench.colorTheme" = "${name-alt} ${variant-alt}"; "workbench.iconTheme" = "${name}-${variant}"; "terminal.external.linuxExec" = config.gui.launcher.terminal; }; diff --git a/modules/gui/desktop/hyprland/apps/panel.nix b/modules/gui/desktop/hyprland/apps/panel.nix @@ -51,7 +51,7 @@ "bluetooth" "network" "group/media" - "backlight" + "group/display" "group/power" "custom/weather" "clock" @@ -210,15 +210,29 @@ on-click-middle = "hyprutils media previous"; }; + "group/display" = { + orientation = "horizontal"; + modules = ["backlight" "custom/temperature"]; + drawer.transition-left-to-right = false; + }; + backlight = { format = "{icon}"; tooltip-format = "Backlight: {percent}%"; format-icons = ["" "" "" "" "" "" "" "" ""]; - on-scroll-down = "brillo -u 300000 -A 5"; - on-scroll-up = "brillo -u 300000 -U 5"; + on-scroll-up = "hyprutils brightness down"; + on-scroll-down = "hyprutils brightness up"; on-click = "nwg-displays"; }; + "custom/temperature" = { + format = ""; + tooltip = false; + on-scroll-up = "hyprutils temperature up"; + on-scroll-down = "hyprutils temperature down"; + on-click = "hyprutils temperature reset"; + }; + "group/power" = { orientation = "horizontal"; modules = ["battery" "power-profiles-daemon"]; diff --git a/modules/gui/desktop/hyprland/apps/settings.nix b/modules/gui/desktop/hyprland/apps/settings.nix @@ -64,6 +64,9 @@ in { # Desktop Icons "pcmanfm-qt --desktop" + # Display Temperature + "hyprsunset -i" + # Window Switcher "hyprswitch init --workspaces-per-row 3 --custom-css ${toFile "style.css" (build.theme { inherit colors; diff --git a/modules/gui/desktop/hyprland/apps/utilities.nix b/modules/gui/desktop/hyprland/apps/utilities.nix @@ -30,6 +30,7 @@ in { grimblast hyprkeys hyprshade + hyprsunset pavucontrol pyprland slurp @@ -59,18 +60,11 @@ in { ]; ## Essential Utilities + # Power services = { - # Power power-profiles-daemon.enable = true; upower.enable = true; - - # Location - geoclue2 = { - enable = true; - geoProviderUrl = "https://beacondb.net/v1/geolocate"; - }; }; - location.provider = "geoclue2"; # Backlight user.groups = ["input" "video"]; @@ -88,13 +82,6 @@ in { }; }; - # Display Temperature - services.gammastep = { - enable = true; - provider = "geoclue2"; - tray = true; - }; - home.file = with files.hyprland; { # Application Drawer ".config/nwg-drawer/drawer.css".text = drawer; diff --git a/packages/flake.nix b/packages/flake.nix @@ -42,16 +42,15 @@ in { overlays = (attrValues self.overlays or {}) ++ [ - vsppuccin.overlays.default (_: _: { custom = self.packages."${system}"; + unstable = import unstable {inherit system config;}; code = vscode.extensions."${system}"; gaming = gaming.packages."${system}"; wine = windows.packages."${system}"; }) - ] - ++ [(_: _: {unstable = import unstable {inherit system config;};})]; + ]; }; } // (let diff --git a/packages/patches/hyprland.patch b/packages/patches/hyprland.patch @@ -1,97 +0,0 @@ -From 84b02d3375ad1ebb0002105701e835b22c9ac3b3 Mon Sep 17 00:00:00 2001 -From: Mihai Fufezan <mihai@fufexan.net> -Date: Sun, 23 Mar 2025 18:19:05 +0200 -Subject: [PATCH 1/2] hyprland: 0.47.2 -> 0.48.0 - ---- - pkgs/by-name/hy/hyprland/info.json | 10 +++++----- - pkgs/by-name/hy/hyprland/package.nix | 8 +++++--- - 2 files changed, 10 insertions(+), 8 deletions(-) - -diff --git a/pkgs/by-name/hy/hyprland/info.json b/pkgs/by-name/hy/hyprland/info.json -index 32a0404a26a554..f01f9233f05eb2 100644 ---- a/pkgs/by-name/hy/hyprland/info.json -+++ b/pkgs/by-name/hy/hyprland/info.json -@@ -1,7 +1,7 @@ - { -- "branch": "v0.47.2-b", -- "commit_hash": "882f7ad7d2bbfc7440d0ccaef93b1cdd78e8e3ff", -- "commit_message": "version: bump to 0.47.2", -- "date": "2025-02-02", -- "tag": "v0.47.2" -+ "branch": "main", -+ "commit_hash": "5ee35f914f921e5696030698e74fb5566a804768", -+ "commit_message": "version: bump to 0.48.0", -+ "date": "2025-03-23", -+ "tag": "v0.48.0" - } -diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix -index eca4e58f5761b9..59b7302af842c3 100644 ---- a/pkgs/by-name/hy/hyprland/package.nix -+++ b/pkgs/by-name/hy/hyprland/package.nix -@@ -86,14 +86,14 @@ assert assertMsg (!hidpiXWayland) - - customStdenv.mkDerivation (finalAttrs: { - pname = "hyprland" + optionalString debug "-debug"; -- version = "0.47.2"; -+ version = "0.48.0"; - - src = fetchFromGitHub { - owner = "hyprwm"; - repo = "hyprland"; - fetchSubmodules = true; - tag = "v${finalAttrs.version}"; -- hash = "sha256-dSKR1VpjpdJVZ5dmLgIvAu3K+DYrSbohZkqxSQhjw8U="; -+ hash = "sha256-QfXnNrQSa9xDrlzl/dJvsFgMmPECveyU/7cKJ2YyIzI="; - }; - - postPatch = '' -@@ -176,7 +176,7 @@ customStdenv.mkDerivation (finalAttrs: { - (optionals withSystemd [ systemd ]) - ]; - -- mesonBuildType = if debug then "debugoptimized" else "release"; -+ mesonBuildType = if debug then "debug" else "release"; - - dontStrip = debug; - strictDeps = true; -@@ -186,6 +186,8 @@ customStdenv.mkDerivation (finalAttrs: { - "xwayland" = enableXWayland; - "legacy_renderer" = legacyRenderer; - "systemd" = withSystemd; -+ "uwsm" = false; -+ "hyprpm" = false; - }) - (mapAttrsToList mesonBool { - # PCH provides no benefits when building with Nix - -From a7547840f3b2cce404439b76b053c595e196add0 Mon Sep 17 00:00:00 2001 -From: Mihai Fufezan <mihai@fufexan.net> -Date: Sun, 23 Mar 2025 18:26:50 +0200 -Subject: [PATCH 2/2] hyprlandPlugins/hyprland-plugins: 0.47.0 -> 0.48.0 - ---- - .../hyprwm/hyprland-plugins/hyprland-plugins.nix | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix -index 753386fef4ea8e..5c41bc86d71903 100644 ---- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix -+++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix -@@ -14,13 +14,13 @@ let - mkHyprlandPlugin, - }: - let -- version = "0.47.0"; -+ version = "0.48.0"; - - hyprland-plugins-src = fetchFromGitHub { - owner = "hyprwm"; - repo = "hyprland-plugins"; -- rev = "refs/tags/v${version}"; -- hash = "sha256-zys4H2zSSIw54ecnYnBh2NUKZQraWD4B7qftuClrXho="; -+ tag = "v${version}"; -+ hash = "sha256-q6v3nkJZdu45bwCuymQ+q3U7uwfA+M3GqsvZ0TgNsi4="; - }; - in - mkHyprlandPlugin hyprland { diff --git a/packages/patches/pyprland.patch b/packages/patches/pyprland.patch @@ -1,31 +0,0 @@ -From 38b8cafd5546e26279542400c68888a97aa73207 Mon Sep 17 00:00:00 2001 -From: John Titor <50095635+JohnRTitor@users.noreply.github.com> -Date: Mon, 24 Mar 2025 12:41:45 +0000 -Subject: [PATCH] pyprland: 2.4.3 -> 2.4.4 - ---- - pkgs/by-name/py/pyprland/package.nix | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pkgs/by-name/py/pyprland/package.nix b/pkgs/by-name/py/pyprland/package.nix -index 00fcd1b4b052ed..3a1b8c5da185eb 100644 ---- a/pkgs/by-name/py/pyprland/package.nix -+++ b/pkgs/by-name/py/pyprland/package.nix -@@ -7,7 +7,7 @@ - - python3Packages.buildPythonApplication rec { - pname = "pyprland"; -- version = "2.4.3"; -+ version = "2.4.4"; - format = "pyproject"; - - disabled = python3Packages.pythonOlder "3.10"; -@@ -16,7 +16,7 @@ python3Packages.buildPythonApplication rec { - owner = "hyprland-community"; - repo = "pyprland"; - tag = version; -- hash = "sha256-0vI8f5XXYi7LG6wMH2Uw05pDbozO2eBzLCuaCHBY7BQ="; -+ hash = "sha256-Vj4Gn9zV0opvLaaMGv8zdS4tYqek0z6ppAhY+nnY6FM="; - }; - - nativeBuildInputs = with python3Packages; [ poetry-core ]; diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -13,6 +13,7 @@ # Usage # help - Show this information brightness [up,down] - Screen Brightness Controls + temperature [up,down] - Display Temperature Controls backlight [up,down] - Keyboard Backlight Controls volume [up,down,mute] - Volume Controls media [next,previous,toggle] - Media Controls @@ -49,22 +50,24 @@ in } (pkgs.writeShellApplication { name = "hyprutils"; runtimeInputs = with pkgs; [ + coreutils + gnugrep + socat + wget + dunst zenity hyprshade + hyprsunset hyprland custom.hyprshellevents alsa-utils brightnessctl brillo - coreutils - gnugrep libnotify playerctl - socat systemd - wget ]; text = '' @@ -141,6 +144,33 @@ in *) error "Unexpected Option 'brightness $2'" "Try 'hyprutils help' for more information" ;; esac ;; + "temperature") + if [[ ! $(pgrep hyprsunset) ]] + then + hyprsunset -i & + fi + temperature_notification() { + temperature=$(hyprctl hyprsunset temperature) + notify temperature -i "display" " $temperature K" + } + case "$2" in + "up") + hyprctl hyprsunset temperature +400 + temperature_notification + ;; + "down") + hyprctl hyprsunset temperature -400 + temperature_notification + ;; + "reset") + hyprctl hyprsunset temperature 6000 + hyprctl hyprsunset identity + notify temperature -i "display" " Reset" + ;; + "") error "Expected an Option" "Try 'hyprutils help' for more information" ;; + *) error "Unexpected Option 'temperature $2'" "Try 'hyprutils help' for more information" ;; + esac + ;; "volume") volume_notification() { volume=$(amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1)