dotfiles

My PC Dotfiles & Website
commit 28bf60332872c2c1d8f61c711bc7e0d33ca1bafa
parent 386b2e763647ef5ca1802a7745c035f9d0c411d2
Author: maydayv7 <maydayv7@gmail.com>
Date:   Fri,  2 Feb 2024 22:40:01 +0530

feat: Hyprland Overview

Also add `wlogout` Configuration

Diffstat:

Mfiles/colors/catppuccin.yaml | 2+-
Mflake.lock | 165+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Mflake.nix | 24+++++++++++++++++++++---
Mmodules/gui/desktop/hyprland/apps/bar.nix | 104+++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
Mmodules/gui/desktop/hyprland/apps/default.nix | 1+
Mmodules/gui/desktop/hyprland/apps/security.nix | 40++++++++++++++++++++++++++++++++++++++++
Mmodules/gui/desktop/hyprland/default.nix | 4++--
Mmodules/gui/desktop/hyprland/settings/default.nix | 23++++++++++++++++++++++-
Mmodules/gui/desktop/hyprland/settings/keybindings.nix | 8++++++++
Mmodules/gui/desktop/hyprland/settings/rules.nix | 43++++++++++++++++++++++++++-----------------
Mpackages/flake.nix | 4++++
11 files changed, 351 insertions(+), 67 deletions(-)

diff --git a/files/colors/catppuccin.yaml b/files/colors/catppuccin.yaml @@ -1,5 +1,5 @@ scheme: "Catppuccin Macchiato" -author: "maydayv7" +author: "catppuccin" base00: "24273A" base01: "1E2030" base02: "363A4F" diff --git a/flake.lock b/flake.lock @@ -540,6 +540,96 @@ "type": "github" } }, + "hycov": { + "inputs": { + "hyprland": [ + "hyprland" + ] + }, + "locked": { + "lastModified": 1706697179, + "narHash": "sha256-PmjBRO+yi63O4geyaGj88Q3Vsryxr7kuu3U/kYSfyd8=", + "owner": "DreamMaoMao", + "repo": "hycov", + "rev": "171800deb10b568aa8a01b58a1677c3d0dd6ffa7", + "type": "github" + }, + "original": { + "owner": "DreamMaoMao", + "repo": "hycov", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs_2", + "systems": [ + "systems" + ], + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1704110595, + "narHash": "sha256-WSrjBI3k2dM/kGF20At0E6NlrJSB4+pE+WGJ6dFzWEs=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "03ebbe18ed8517ee22591eac82cd54322f42cb7d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "ref": "v0.34.0", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-plugins": { + "inputs": { + "hyprland": [ + "hyprland" + ] + }, + "locked": { + "lastModified": 1706478736, + "narHash": "sha256-V1T0x16p4r+/fdWR5RU2lV0tTW0YrA8K9+GIibsZAeQ=", + "owner": "hyprwm", + "repo": "hyprland-plugins", + "rev": "24e33780589f5c15132fc86c97ea033e56b06f59", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-plugins", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, "impermanence": { "locked": { "lastModified": 1706639736, @@ -609,6 +699,22 @@ }, "nixpkgs_2": { "locked": { + "lastModified": 1703438236, + "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { "lastModified": 1706747148, "narHash": "sha256-fOwHK+cjfYL5vo8epmbSefChzlsQx6QLjch2xezx1Rc=", "owner": "NixOS", @@ -702,9 +808,12 @@ "generators": "generators", "hardware": "hardware", "home-manager": "home-manager", + "hycov": "hycov", + "hyprland": "hyprland", + "hyprland-plugins": "hyprland-plugins", "impermanence": "impermanence", "index": "index", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nur": "nur", "proprietary": "proprietary", "sops": "sops", @@ -786,11 +895,11 @@ ] }, "locked": { - "lastModified": 1706466685, - "narHash": "sha256-R6D+3wBQvn7sCZLbM3WrHbKtVNSflkruGQ/5bHfslhg=", + "lastModified": 1706043974, + "narHash": "sha256-L81/nhZLqmAApEZhGfa27h6OOE0EL0XNDG66/vF+Ok8=", "owner": "danth", "repo": "stylix", - "rev": "7a7c90015de7454060e103e94bb4e6010b5aa062", + "rev": "bf31640f49cb115508c31bf3bd0b4b80bb8ab71d", "type": "github" }, "original": { @@ -980,6 +1089,54 @@ "type": "github" } }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1701368958, + "narHash": "sha256-7kvyoA91etzVEl9mkA/EJfB6z/PltxX7Xc4gcr7/xlo=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "5d639394f3e83b01596dcd166a44a9a1a2583350", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "rev": "5d639394f3e83b01596dcd166a44a9a1a2583350", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1703514399, + "narHash": "sha256-VRr5Xc4S/VPr/gU3fiOD3vSIL2+GJ+LUrmFTWTwnTz4=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "0a318a7a217a6402b0b705837cd5b50b0e94b31b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, "yafas": { "inputs": { "flake-schemas": [ diff --git a/flake.nix b/flake.nix @@ -153,6 +153,22 @@ }; }; + # Hyprland + hyprland = { + url = "github:hyprwm/Hyprland?ref=v0.34.0"; + inputs.systems.follows = "systems"; + }; + + hyprland-plugins = { + url = "github:hyprwm/hyprland-plugins"; + inputs.hyprland.follows = "hyprland"; + }; + + hycov = { + url = "github:DreamMaoMao/hycov"; + inputs.hyprland.follows = "hyprland"; + }; + # Declarative Flatpak Wrapper flatpak.url = "github:gmodena/nix-flatpak"; @@ -230,21 +246,23 @@ # Binary Caches trusted-substituters = [ "https://cache.nixos.org" + "https://hyprland.cachix.org" "https://nix-community.cachix.org" + "https://nix-gaming.cachix.org" "https://nixpkgs-unfree.cachix.org" "https://nyx.chaotic.cx/" - "https://nix-gaming.cachix.org" "https://maydayv7-dotfiles.cachix.org" ]; # Public Keys trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs=" "nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" - "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" - "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" "maydayv7-dotfiles.cachix.org-1:dpECO0Z2ZMttY6JgWHuAR5M7cqeyfFjUsvHdnMz+j6U=" ]; }; diff --git a/modules/gui/desktop/hyprland/apps/bar.nix b/modules/gui/desktop/hyprland/apps/bar.nix @@ -16,7 +16,7 @@ in rec { }; # Environment Setup - home.packages = [pkgs.font-awesome]; + home.packages = with pkgs; [font-awesome wttrbar]; systemd.user = { # nix-community/home-manager/4099 services.waybar.Service.ExecStart = lib.mkForce (pkgs.writeShellScript "waybar-wrapper.sh" '' @@ -48,36 +48,6 @@ in rec { }; }); - style = '' - * { - font-family: ${sys.stylix.fonts.sansSerif.name}, "Font Awesome 6 Free"; - font-size: 16px; - font-weight: 500; - border-radius: 10px; - } - - #waybar.empty #window { - background: none; - } - - #backlight, - #battery, - #bluetooth, - #keyboard-state, - #network, - #taskbar, - #tray, - #window, - #wireplumber, - #workspaces { - padding: 1px 6px 1px 6px; - } - - #network { - padding-right: 11px; - } - ''; - # Panel settings = [ { @@ -91,7 +61,7 @@ in rec { margin-right = 5; margin-bottom = 5; - modules-left = ["hyprland/workspaces" "hyprland/window"]; + modules-left = ["custom/logo" "hyprland/workspaces" "hyprland/window"]; modules-center = ["wlr/taskbar"]; modules-right = [ "tray" @@ -102,8 +72,15 @@ in rec { "wireplumber" "battery" "clock" + "custom/weather" ]; + "custom/logo" = { + format = ""; + tooltip = false; + on-click = "wlogout -p layer-shell"; + }; + "hyprland/workspaces" = { all-outputs = true; show-special = true; @@ -138,6 +115,7 @@ in rec { "bash" = "Terminal"; "zsh" = "Terminal"; "(.*) - kitty" = "Terminal"; + "Ulauncher(.*)" = "Launcher"; }; }; @@ -175,7 +153,7 @@ in rec { format-linked = "󰈁 {ifname}"; tooltip-format = "Network= <big><b>{essid}</b></big>\nStrength= <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency= <b>{frequency}MHz</b>\nInterface= <b>{ifname}</b>\nIP= <b>{ipaddr}/{cidr}</b>\nGateway= <b>{gwaddr}</b>\nNetmask= <b>{netmask}</b>"; tooltip-format-disconnected = "󰌙 Disconnected"; - on-click = "nmtui"; + on-click = "kitty nmtui"; }; keyboard-state = { @@ -237,16 +215,64 @@ in rec { today = "<span color='#FF6699'><b><u>{}</u></b></span>"; }; }; + + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; }; - actions = { - on-click-right = "mode"; - on-click-forward = "tz_up"; - on-click-backward = "tz_down"; - on-scroll-up = "shift_up"; - on-scroll-down = "shift_down"; + "custom/weather" = { + format = "{}°"; + tooltip = true; + interval = 3600; + exec = "wttrbar"; + return-type = "json"; }; } ]; + + style = '' + * { + font-family: ${sys.stylix.fonts.sansSerif.name}, "Font Awesome 6 Free"; + font-size: 16px; + font-weight: 500; + border-radius: 10px; + } + + #waybar.empty #window { background: none; } + #taskbar button.active { background: @base03; } + #clock { + color: @base00; + background-color: @base0A; + } + + #custom-logo { + color: @base00; + background-color: @base06; + } + + #custom-weather { + color: @base00; + background-color: @base08; + } + + #backlight, + #battery, + #bluetooth, + #clock, + #custom-weather, + #keyboard-state, + #taskbar, + #tray, + #window, + #wireplumber, + #workspaces { padding: 3px 6px 3px 6px; } + #network, + #custom-logo { padding: 3px 11px 3px 6px; } + ''; }; } diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -68,6 +68,7 @@ in { "$mod, Return, exec, missioncenter" "$mod, slash, exec, ulauncher-toggle" ", XF86Calculator, exec, qalculate-gtk" + "$mod, Escape, exec, wlogout -p layer-shell" ]; # Utilities diff --git a/modules/gui/desktop/hyprland/apps/security.nix b/modules/gui/desktop/hyprland/apps/security.nix @@ -1,5 +1,6 @@ { sys, + lib, pkgs, ... }: let @@ -56,6 +57,45 @@ in { ]; }; + # Logout + programs.wlogout = { + enable = true; + style = '' + * { background: none; } + window { background-color: rgba(0, 0, 0, .5); } + + button { + background: rgba(0, 0, 0, .05); + border-radius: 8px; + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 rgba(0, 0, 0, .5); + margin: 1rem; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + } + + button:focus, button:active, button:hover { + background-color: rgba(255, 255, 255, 0.2); + outline-style: none; + } + + ${lib.concatMapStringsSep "\n" ( + name: '' + #${name} { + background-image: image(url("${pkgs.wlogout}/share/wlogout/icons/${name}.png")); + } + '' + ) [ + "lock" + "logout" + "suspend" + "hibernate" + "shutdown" + "reboot" + ]} + ''; + }; + # Authorization Agent systemd.user.services.polkit = { Unit.Description = "polkit-gnome-authentication-agent-1"; diff --git a/modules/gui/desktop/hyprland/default.nix b/modules/gui/desktop/hyprland/default.nix @@ -22,7 +22,7 @@ in { hyprland = { enable = true; xwayland.enable = true; - package = pkgs.unstable.hyprland; + package = pkgs.hyprworld.hyprland; }; regreet = { @@ -44,7 +44,7 @@ in { # Boot Splash boot.plymouth = { theme = with theme; "${name}-${variant}"; - themePackages = [pkgs.catppuccin-plymouth]; + themePackages = [(pkgs.catppuccin-plymouth.override {inherit (theme) variant;})]; }; # Settings diff --git a/modules/gui/desktop/hyprland/settings/default.nix b/modules/gui/desktop/hyprland/settings/default.nix @@ -2,6 +2,7 @@ sys, lib, util, + pkgs, ... }: { ## Hyprland Settings @@ -9,7 +10,9 @@ stylix.targets.hyprland.enable = true; dconf.settings."org/gnome/desktop/wm/preferences".button-layout = "appmenu"; wayland.windowManager.hyprland = { - enable = true; + inherit (sys.programs.hyprland) enable package; + plugins = with pkgs.hyprworld; [hycov]; + settings = { debug.disable_logs = false; env = ["QT_WAYLAND_DISABLE_WINDOWDECORATION,1"]; @@ -75,6 +78,13 @@ border_size = 2; }; + group.groupbar = with sys.lib.stylix.colors; { + enabled = true; + render_titles = false; + "col.active" = "rgb(${base06})"; + "col.locked_active" = "rgb(${base0D})"; + }; + decoration = lib.mkIf sys.gui.fancy { rounding = 10; drop_shadow = true; @@ -90,6 +100,17 @@ passes = 2; }; }; + + # Overview + plugin.hycov = { + overview_gappo = 60; + overview_gappi = 24; + hotarea_size = 10; + enable_hotarea = 1; + enable_gesture = 1; + swipe_fingers = 4; + only_active_workspace = 1; + }; }; }; } diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -38,6 +38,14 @@ _: { "ALT CTRL, Tab, cyclenext, prev" "ALT CTRL, Tab, bringactivetotop," + # Overview + "ALT, grave, hycov:toggleoverview" + "ALT SHIFT, grave, hycov:toggleoverview, forceall" + "ALT, left, hycov:movefocus, l" + "ALT, right, hycov:movefocus, r" + "ALT, up, hycov:movefocus, u" + "ALT, down, hycov:movefocus, d" + # Cycle Workspaces "$mod, period, workspace, m-1" "$mod, comma, workspace, m+1" diff --git a/modules/gui/desktop/hyprland/settings/rules.nix b/modules/gui/desktop/hyprland/settings/rules.nix @@ -1,22 +1,31 @@ _: { - ## Window Rules - wayland.windowManager.hyprland.settings.windowrulev2 = [ - # PiP Window - "float, title:^(Picture-in-Picture)$" - "pin, title:^(Picture-in-Picture)$" + wayland.windowManager.hyprland.settings = { + ## Layer Rules + layerrule = [ + "blur, ^(gtk-layer-shell)$" + "xray 1, ^(gtk-layer-shell)$" + "ignorealpha 0.2, ^(gtk-layer-shell)$" + ]; - # Throw away Sharing Window - "workspace special silent, title:^(Firefox — Sharing Indicator)$" - "workspace special silent, title:^(.*is sharing (your screen|a window)\.)$" + ## Window Rules + windowrulev2 = [ + # PiP Window + "float, title:^(Picture-in-Picture)$" + "pin, title:^(Picture-in-Picture)$" - # Idle Inhibit during media consumption - "idleinhibit focus, class:^(mpv|.+exe)$" - "idleinhibit focus, class:^(firefox|google-chrome)$, title:^(.*YouTube.*)$" - "idleinhibit fullscreen, class:^(firefox|google-chrome)$" + # Throw away Sharing Window + "workspace special silent, title:^(Firefox — Sharing Indicator)$" + "workspace special silent, title:^(.*is sharing (your screen|a window)\.)$" - # Prompt Windows - "dimaround, class:^(gcr-prompter)$" - "dimaround, class:^(xdg-desktop-portal-gtk)$" - "dimaround, class:^(polkit-gnome-authentication-agent-1)$" - ]; + # Idle Inhibit during media consumption + "idleinhibit focus, class:^(mpv|.+exe)$" + "idleinhibit focus, class:^(firefox|google-chrome)$, title:^(.*YouTube.*)$" + "idleinhibit fullscreen, class:^(firefox|google-chrome)$" + + # Prompt Windows + "dimaround, class:^(gcr-prompter)$" + "dimaround, class:^(xdg-desktop-portal-gtk)$" + "dimaround, class:^(polkit-gnome-authentication-agent-1)$" + ]; + }; } diff --git a/packages/flake.nix b/packages/flake.nix @@ -57,6 +57,10 @@ in { code = vscode.extensions."${system}"; gaming = gaming.packages."${system}"; wine = windows.packages."${system}"; + hyprworld = + hycov.packages."${system}" + // hyprland-plugins.packages."${system}" + // hyprland.packages."${system}"; }) ]; };