From 025ca36f970663c4ef3b80d76ddc8319aa62ad2f Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Fri, 1 Dec 2023 22:16:07 +0100 Subject: [PATCH] add css to waybar and update flake --- flake.lock | 30 +-- modules/graphical/hyprland.nix | 359 ++++++++++++++++++++++++++++++++- 2 files changed, 363 insertions(+), 26 deletions(-) diff --git a/flake.lock b/flake.lock index e2b2317..21edbf0 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1696775529, - "narHash": "sha256-TYlE4B0ktPtlJJF9IFxTWrEeq+XKG8Ny0gc2FGEAdj0=", + "lastModified": 1701216516, + "narHash": "sha256-jKSeJn+7hZ1dZdiH1L+NWUGT2i/BGomKAJ54B9kT06Q=", "owner": "ryantm", "repo": "agenix", - "rev": "daf42cb35b2dc614d1551e37f96406e4c4a2d3e4", + "rev": "13ac9ac6d68b9a0896e3d43a082947233189e247", "type": "github" }, "original": { @@ -138,11 +138,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1701020860, - "narHash": "sha256-NwnRn04C8s+hH+KdVtGmVB1FFNIG7DtPJmQSCBDaET4=", + "lastModified": 1701250978, + "narHash": "sha256-ohu3cz4edjpGxs2qUTgbs0WrnewOX4crnUJNEB6Jox4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "b006ec52fce23b1d57f6ab4a42d7400732e9a0a2", + "rev": "8772491ed75f150f02552c60694e1beff9f46013", "type": "github" }, "original": { @@ -161,11 +161,11 @@ ] }, "locked": { - "lastModified": 1700665566, - "narHash": "sha256-+AU2AdpA2eHlVwH3LL1qCWCTJyOJwCw/7pwampP3Jy8=", + "lastModified": 1701387264, + "narHash": "sha256-uGZycEJqOZSYvpmoFuyDrboe5e1t0F/HB9r7HsWgssc=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "a9287f7191467138d6203ea44b3a0b9c745cb145", + "rev": "1a50ab3fe98934d8f109f05528874c9ab324707b", "type": "github" }, "original": { @@ -192,11 +192,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1700794826, - "narHash": "sha256-RyJTnTNKhO0yqRpDISk03I/4A67/dp96YRxc86YOPgU=", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5a09cb4b393d58f9ed0d9ca1555016a8543c2ac8", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", "type": "github" }, "original": { @@ -223,11 +223,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1701058557, - "narHash": "sha256-fux7HlrnoNs93MN0kET4AfiYwg/expoasndRCFeDRyk=", + "lastModified": 1701263465, + "narHash": "sha256-lNXUIlkfyDyp9Ox21hr+wsEf/IBklLvb6bYcyeXbdRc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "070b5cf9f70bc7ef2dfd739a1f7d6c563fe64bd1", + "rev": "50aa30a13c4ab5e7ba282da460a3e3d44e9d0eb3", "type": "github" }, "original": { diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index ae9c10a..361a6a3 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -5,9 +5,9 @@ let mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; }); - patchedHyprland = pkgs.hyprland.overrideAttrs (oldAttrs: { - version = "0.28.0"; - }); + #patchedHyprland = pkgs.hyprland.overrideAttrs (oldAttrs: { + # version = "0.28.0"; + #}); in { @@ -37,11 +37,11 @@ in nvidia.modesetting.enable = true; }; + xdg.portal.enable = true; + xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ]; + programs.hyprland = { enable = true; - enableNvidiaPatches = true; - xwayland.enable = true; - package = patchedHyprland; }; home-manager.users.kopatz = { @@ -49,7 +49,8 @@ in wayland.windowManager.hyprland = { enable = true; - package = patchedHyprland; + enableNvidiaPatches = true; + xwayland.enable = true; settings = { # # Please note not all available settings / options are set here. @@ -260,7 +261,7 @@ in #systemd.target = "sway-session.target"; settings.main = { layer = "top"; - position = "bottom"; + position = "top"; #output = lib.mapAttrsToList (n: v: v.monitor) outputs; height = 25; spacing = 4; @@ -316,12 +317,348 @@ in "on-click" = "activate"; }; }; + style = '' + * { + font-family: FiraCode , Noto Sans,FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; + } + + #clock, + #battery, + #cpu, + #memory, + #disk, + #temperature, + #backlight, + #network, + #pulseaudio, + #custom-media, + #tray, + #mode, + #idle_inhibitor, + #custom-expand, + #custom-cycle_wall, + #custom-ss, + #custom-dynamic_pill, + #mpd { + padding: 0 10px; + border-radius: 15px; + background: #11111b; + color: #b4befe; + box-shadow: rgba(0, 0, 0, 0.116) 2 2 5 2px; + margin-top: 10px; + margin-bottom: 10px; + margin-right: 10px; + } + + window#waybar { + background-color: transparent; + } + + #custom-dynamic_pill label { + color: #11111b; + font-weight: bold; + } + + #custom-dynamic_pill.paused label { + color: #89b4fa ; + font-weight: bolder; + } + + #workspaces button label{ + color: #89b4fa ; + font-weight: bolder; + } + + #workspaces button.active label{ + color: #11111b; + font-weight: bolder; + } + + #workspaces{ + background-color: transparent; + margin-top: 10px; + margin-bottom: 10px; + margin-right: 10px; + margin-left: 25px; + } + #workspaces button{ + box-shadow: rgba(0, 0, 0, 0.116) 2 2 5 2px; + background-color: #11111b ; + border-radius: 15px; + margin-right: 10px; + padding: 10px; + padding-top: 4px; + padding-bottom: 2px; + font-weight: bolder; + color: #89b4fa ; + transition: all 0.5s cubic-bezier(.55,-0.68,.48,1.68); + } + + #workspaces button.active{ + padding-right: 20px; + box-shadow: rgba(0, 0, 0, 0.288) 2 2 5 2px; + padding-left: 20px; + padding-bottom: 3px; + background: rgb(203,166,247); + background: radial-gradient(circle, rgba(203,166,247,1) 0%, rgba(193,168,247,1) 12%, rgba(249,226,175,1) 19%, rgba(189,169,247,1) 20%, rgba(182,171,247,1) 24%, rgba(198,255,194,1) 36%, rgba(177,172,247,1) 37%, rgba(170,173,248,1) 48%, rgba(255,255,255,1) 52%, rgba(166,174,248,1) 52%, rgba(160,175,248,1) 59%, rgba(148,226,213,1) 66%, rgba(155,176,248,1) 67%, rgba(152,177,248,1) 68%, rgba(205,214,244,1) 77%, rgba(148,178,249,1) 78%, rgba(144,179,250,1) 82%, rgba(180,190,254,1) 83%, rgba(141,179,250,1) 90%, rgba(137,180,250,1) 100%); + background-size: 400% 400%; + animation: gradient_f 20s ease-in-out infinite; + transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682); + } + + @keyframes gradient { + 0% { + background-position: 0% 50%; + } + 50% { + background-position: 100% 30%; + } + 100% { + background-position: 0% 50%; + } + } + + @keyframes gradient_f { + 0% { + background-position: 0% 200%; + } + 50% { + background-position: 200% 0%; + } + 100% { + background-position: 400% 200%; + } + } + + @keyframes gradient_f_nh { + 0% { + background-position: 0% 200%; + } + 100% { + background-position: 200% 200%; + } + } + + + + #custom-dynamic_pill.low{ + background: rgb(148,226,213); + background: linear-gradient(52deg, rgba(148,226,213,1) 0%, rgba(137,220,235,1) 19%, rgba(116,199,236,1) 43%, rgba(137,180,250,1) 56%, rgba(180,190,254,1) 80%, rgba(186,187,241,1) 100%); + background-size: 300% 300%; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); + animation: gradient 15s ease infinite; + font-weight: bolder; + color: #fff; + } + #custom-dynamic_pill.normal{ + background: rgb(148,226,213); + background: radial-gradient(circle, rgba(148,226,213,1) 0%, rgba(156,227,191,1) 21%, rgba(249,226,175,1) 34%, rgba(158,227,186,1) 35%, rgba(163,227,169,1) 59%, rgba(148,226,213,1) 74%, rgba(164,227,167,1) 74%, rgba(166,227,161,1) 100%); + background-size: 400% 400%; + animation: gradient_f 4s ease infinite; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); + font-weight: bolder; + color: #fff; + } + #custom-dynamic_pill.critical{ + background: rgb(235,160,172); + background: linear-gradient(52deg, rgba(235,160,172,1) 0%, rgba(243,139,168,1) 30%, rgba(231,130,132,1) 48%, rgba(250,179,135,1) 77%, rgba(249,226,175,1) 100%); + background-size: 300% 300%; + animation: gradient 15s cubic-bezier(.55,-0.68,.48,1.68) infinite; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); + font-weight: bolder; + color: #fff; + } + + #custom-dynamic_pill.playing{ + background: rgb(137,180,250); + background: radial-gradient(circle, rgba(137,180,250,120) 0%, rgba(142,179,250,120) 6%, rgba(148,226,213,1) 14%, rgba(147,178,250,1) 14%, rgba(155,176,249,1) 18%, rgba(245,194,231,1) 28%, rgba(158,175,249,1) 28%, rgba(181,170,248,1) 58%, rgba(205,214,244,1) 69%, rgba(186,169,248,1) 69%, rgba(195,167,247,1) 72%, rgba(137,220,235,1) 73%, rgba(198,167,247,1) 78%, rgba(203,166,247,1) 100%); + background-size: 400% 400%; + animation: gradient_f 9s cubic-bezier(.72,.39,.21,1) infinite; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); + font-weight: bold; + color: #fff ; + } + + #custom-dynamic_pill.paused{ + background: #11111b ; + font-weight: bolder; + color: #b4befe; + } + + #custom-ss{ + background: #11111b; + color: #89b4fa; + font-weight: bolder; + padding: 5px; + padding-left: 20px; + padding-right: 20px; + border-radius: 15px; + } + + + #custom-cycle_wall{ + background: rgb(245,194,231); + background: linear-gradient(45deg, rgba(245,194,231,1) 0%, rgba(203,166,247,1) 0%, rgba(243,139,168,1) 13%, rgba(235,160,172,1) 26%, rgba(250,179,135,1) 34%, rgba(249,226,175,1) 49%, rgba(166,227,161,1) 65%, rgba(148,226,213,1) 77%, rgba(137,220,235,1) 82%, rgba(116,199,236,1) 88%, rgba(137,180,250,1) 95%); + color: #fff; + background-size: 500% 500%; + animation: gradient 7s linear infinite; + font-weight: bolder; + border-radius: 15px; + } + + #clock label{ + color: #11111b; + font-weight: bolder; + } + + #clock { + background: rgb(205,214,244); + background: linear-gradient(118deg, rgba(205,214,244,1) 5%, rgba(243,139,168,1) 5%, rgba(243,139,168,1) 20%, rgba(205,214,244,1) 20%, rgba(205,214,244,1) 40%, rgba(243,139,168,1) 40%, rgba(243,139,168,1) 60%, rgba(205,214,244,1) 60%, rgba(205,214,244,1) 80%, rgba(243,139,168,1) 80%, rgba(243,139,168,1) 95%, rgba(205,214,244,1) 95%); + + background-size: 200% 300%; + + animation: gradient_f_nh 4s linear infinite; + margin-right: 25px; + color: #fff ; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); + + font-size: 15px; + padding-top: 5px; + padding-right: 21px; + font-weight: bolder; + padding-left: 20px; + } + + #battery.charging, #battery.plugged { + background-color: #94e2d5 ; + } + + #battery { + background-color: #11111b; + color:#a6e3a1; + font-weight: bolder; + font-size: 20px; + padding-left: 15px; + padding-right: 15px; + } + + @keyframes blink { + to { + background-color: #f9e2af; + color:#96804e; + } + } + + + + #battery.critical:not(.charging) { + background-color: #f38ba8; + color:#bf5673; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + #cpu label{ + color:#89dceb; + } + + #cpu { + background: rgb(30,30,46); + background: radial-gradient(circle, rgba(30,30,46,1) 30%, rgba(17,17,27,1) 100%); + color: #89b4fa; + } + + #memory { + background-color: #cba6f7; + color: #9a75c7; + font-weight: bolder; + } + + #disk { + color: #964B00; + } + + #backlight { + color: #90b1b1; + } + + #network{ + color:#000; + } + + #network.disabled{ + background-color: #45475a; + } + + #network.disconnected{ + background: rgb(243,139,168); + background: linear-gradient(45deg, rgba(243,139,168,1) 0%, rgba(250,179,135,1) 100%); + color: #fff; + font-weight: bolder; + padding-top: 3px; + padding-right: 11px; + } + + #network.linked, #network.wifi{ + background-color: #a6e3a1 ; + } + + #network.ethernet{ + background-color:#f9e2af ; + } + + #pulseaudio { + background-color: #fab387; + color: #bf7d54; + font-weight: bolder; + } + + #pulseaudio.muted { + background-color: #90b1b1; + } + + #custom-media { + color: #66cc99; + } + + #custom-media.custom-spotify { + background-color: #66cc99; + } + + #custom-media.custom-vlc { + background-color: #ffa000; + } + + #temperature { + background-color: #f9e2af; + color:#96804e; + } + + #temperature.critical { + background-color: #f38ba8 ; + color:#bf5673; + } + + #tray { + background-color: #2980b9; + } + + #tray > .passive { + -gtk-icon-effect: dim; + } + + #tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; + } + ''; }; }; - # XDG portal - xdg.portal.enable = true; - xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ]; # List packages installed in system profile. To search, run: # $ nix search wget