From 2adf37e15176b4303d3ce5c36635840a9b39fe21 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 27 Jun 2025 13:28:03 +0200 Subject: [PATCH] new hyprland config. waybar still sucks --- home/lukas/brave.nix | 1 + home/lukas/default.nix | 2 + home/lukas/hyprland.nix | 81 ++++++++++++++++++++++++ home/lukas/rofi.nix | 115 +++++++++++++++++++++++++++++++++++ modules/desktop/hyprland.nix | 28 ++++++++- 5 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 home/lukas/hyprland.nix create mode 100644 home/lukas/rofi.nix diff --git a/home/lukas/brave.nix b/home/lukas/brave.nix index 682f72d..a4a782f 100644 --- a/home/lukas/brave.nix +++ b/home/lukas/brave.nix @@ -12,6 +12,7 @@ # Sponsorblock for YouTube { id = "mnjggcdmjocbbbhaepdhchncahnbgone"; } ]; + }; } diff --git a/home/lukas/default.nix b/home/lukas/default.nix index b05efb2..a8863b0 100644 --- a/home/lukas/default.nix +++ b/home/lukas/default.nix @@ -11,6 +11,8 @@ ./shell.nix ./terminal.nix ./xgd.nix + ./hyprland.nix + ./rofi.nix ]; home.username = "lukas"; diff --git a/home/lukas/hyprland.nix b/home/lukas/hyprland.nix new file mode 100644 index 0000000..ef9b9dc --- /dev/null +++ b/home/lukas/hyprland.nix @@ -0,0 +1,81 @@ +{ + wayland.windowManager.hyprland = { + enable = true; + settings = { + "$mod" = "ALT"; + + exec-once = [ + "waybar" + "dunst" + "nm-applet" + "blueman-applet" + "swww-daemon" + ]; + + binds = { + allow_workspace_cycles = true; + }; + + xwayland = { + force_zero_scaling = true; + }; + + + bind = [ + + # terminal + "$mod, Return, exec, alacritty" + + # kill current window + "$mod, Q, killactive," + + # lock screen + "$mod, L, exec, hyprlock" + + # emacs + "$mod, e, exec, emacs" + + # Rofi launcher + "$mod, SPACE, exec, rofi -show drun -theme ~/.config/rofi/theme.rasi" + + # Toggle fullscreen + "$mod, M, fullscreen, 2" + + # cycle windows + "$mod, N, cyclenext" + + # cycle workspaces + "$mod, TAB, workspace, r+1" + + + # Switch to workspace 1–3 + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + + ]; + + general = { + gaps_in = 4; + gaps_out = 8; + border_size = 0; + layout = "dwindle"; + }; + + input = { + kb_layout = "de"; + touchpad.disable_while_typing = true; + }; + + cursor = { + inactive_timeout = 5; + }; + + decoration = { + rounding = 6; + blur.enabled = false; + shadow.enabled = false; + }; + }; + }; +} diff --git a/home/lukas/rofi.nix b/home/lukas/rofi.nix new file mode 100644 index 0000000..c4e30ee --- /dev/null +++ b/home/lukas/rofi.nix @@ -0,0 +1,115 @@ +let + fullTheme = '' + * { + bg0: #2E3440F2; + bg1: #3B4252; + bg2: #4C566A80; + bg3: #88C0D0F2; + fg0: #D8DEE9; + fg1: #ECEFF4; + fg2: #D8DEE9; + fg3: #4C566A; + } + + * { + font: "Fira Code 12"; + background-color: transparent; + text-color: @fg0; + + margin: 0px; + padding: 0px; + spacing: 0px; + } + + window { + location: north; + y-offset: calc(50% - 176px); + width: 480; + border-radius: 24px; + + background-color: @bg0; + } + + mainbox { + padding: 12px; + } + + inputbar { + background-color: @bg1; + border-color: @bg3; + + border: 2px; + border-radius: 16px; + + padding: 8px 16px; + spacing: 8px; + children: [ prompt, entry ]; + } + + prompt { + text-color: @fg2; + } + + entry { + placeholder: "Search"; + placeholder-color: @fg3; + } + + message { + margin: 12px 0 0; + border-radius: 16px; + border-color: @bg2; + background-color: @bg2; + } + + textbox { + padding: 8px 24px; + } + + listview { + background-color: transparent; + + margin: 12px 0 0; + lines: 8; + columns: 1; + + fixed-height: false; + } + + element { + padding: 8px 16px; + spacing: 8px; + border-radius: 16px; + } + + element normal active { + text-color: @bg3; + } + + element alternate active { + text-color: @bg3; + } + + element selected normal, element selected active { + background-color: @bg3; + } + + element-icon { + size: 1em; + vertical-align: 0.5; + } + + element-text { + text-color: inherit; + } + + /* your override */ + element selected { + text-color: @bg1; + } + ''; +in { + programs.rofi.enable = true; + + home.file.".config/rofi/theme.rasi".text = fullTheme; +} diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 78aad24..e6bf3d8 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -1,13 +1,13 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: { programs.hyprland = { enable = true; + withUWSM = true; xwayland.enable = true; }; environment.sessionVariables = { - WLR_NO_HARDWARE_CURSORS = "1"; NIXOS_OZONE_WL = "1"; }; @@ -22,11 +22,33 @@ pkgs.dunst pkgs.libnotify pkgs.swww - pkgs.kitty pkgs.rofi-wayland + pkgs.hyprlock + + pkgs.brightnessctl # adjust backlight via keybindings + pkgs.scrot # simple screenshot + pkgs.slurp # region selector + pkgs.grim # wayland screenshot backend + pkgs.networkmanagerapplet + pkgs.pavucontrol ]; xdg.portal.enable = true; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + services.greetd = { + enable = true; + settings = { + initial_session = { + command = "${pkgs.hyprland}/bin/Hyprland"; + user = "lukas"; + }; + + default_session = { + command = "${pkgs.hyprland}/bin/Hyprland"; + user = "lukas"; + }; + }; + }; + }