From 7b2f97155fdae3d1eb5a9039e4bba8163d6cb6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Mon, 15 Jan 2024 22:37:11 -0300 Subject: [PATCH] WIP: use hyprland --- flake.nix | 2 +- system/configuration.nix | 10 ++++++++++ user/home.nix | 2 +- user/hyprland.nix | 24 ++++++++++++------------ user/variables.nix | 2 +- user/waybar/default.nix | 33 +++++++++++++++++++++++++++++++-- 6 files changed, 56 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index b9293df..2716537 100644 --- a/flake.nix +++ b/flake.nix @@ -99,7 +99,7 @@ { login-manager.greetd.enable = desktop == "sway" || desktop == "hyprland"; } inputs.agenix.nixosModules.default - inputs.hyprland.nixosModules.default + # inputs.hyprland.nixosModules.default inputs.dzgui-nix.nixosModules.default { programs.hyprland.enable = (desktop == "hyprland"); } inputs.home-manager.nixosModules.home-manager diff --git a/system/configuration.nix b/system/configuration.nix index dc5ac8e..2e3eed5 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -99,6 +99,16 @@ # Enable touchpad support (enabled default in most desktopManager). services.xserver.libinput.enable = true; + xdg.portal = { + config.common.default = "*"; + enable = true; + wlr.enable = true; + # Always pick the first monitor, this is fine since I only ever use a single monitor + wlr.settings.screencast.chooser_type = "none"; + # gtk portal needed to make gtk apps happy + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + # Define a user account. Don't forget to set a password with ‘passwd’. users.mutableUsers = false; users.users.lelgenio = { diff --git a/user/home.nix b/user/home.nix index f27c0e0..fac2170 100644 --- a/user/home.nix +++ b/user/home.nix @@ -36,7 +36,7 @@ ./gnome.nix ./thunar.nix ./xdg-dirs.nix - inputs.hyprland.homeManagerModules.default + # inputs.hyprland.homeManagerModules.default inputs.nix-index-database.hmModules.nix-index ]; diff --git a/user/hyprland.nix b/user/hyprland.nix index 992964a..4b29468 100644 --- a/user/hyprland.nix +++ b/user/hyprland.nix @@ -32,18 +32,18 @@ apply_sens_to_raw=0 # whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse) - damage_tracking=full # leave it on full unless you hate your GPU and want to make it suffer + # damage_tracking=full # leave it on full unless you hate your GPU and want to make it suffer } - decoration { - rounding=5 - blur=1 - blur_size=3 # minimum 1 - blur_passes=1 # minimum 1, more passes = more resource intensive. - # Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts. - # if you want heavy blur, you need to up the blur_passes. - # the more passes, the more you can up the blur_size without noticing artifacts. - } + # decoration { + # rounding=5 + # blur=1 + # # blur_size=3 # minimum 1 + # # blur_passes=1 # minimum 1, more passes = more resource intensive. + # # Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts. + # # if you want heavy blur, you need to up the blur_passes. + # # the more passes, the more you can up the blur_size without noticing artifacts. + # } animations { enabled=1 @@ -121,7 +121,7 @@ bind=SUPER,mouse_up,workspace,e+1 ''; }; - home.file.".config/eww".source = ./eww; - home.packages = with pkgs; [ eww-wayland jq ]; + # home.file.".config/eww".source = ./eww; + # home.packages = with pkgs; [ eww-wayland jq ]; }; } diff --git a/user/variables.nix b/user/variables.nix index b8bb262..b8d7cce 100644 --- a/user/variables.nix +++ b/user/variables.nix @@ -129,7 +129,7 @@ rec { }; dmenu = "bmenu"; - desktop = "sway"; + desktop = "hyprland"; browser = "firefox"; editor = "kakoune"; email-client = "thunderbird"; diff --git a/user/waybar/default.nix b/user/waybar/default.nix index a0008c6..90d2f49 100644 --- a/user/waybar/default.nix +++ b/user/waybar/default.nix @@ -11,10 +11,18 @@ in systemd.target = "sway-session.target"; settings = [{ layer = "top"; - modules-left = [ "sway/workspaces" "sway/mode" "sway/window" ]; + modules-left = [ + "sway/workspaces" + "sway/mode" + "sway/window" + "hyprland/workspaces" + "hyprland/mode" + "hyprland/window" + ]; modules-center = [ "clock" ]; modules-right = lib.flatten [ "sway/language" + "hyprland/language" "mpd" "custom/playerctl" # "tray" @@ -68,6 +76,28 @@ in }; }; "sway/window" = { max-length = 40; }; + "sway/language" = { format = "{short} {variant}"; }; + "hyprland/workspaces" = { + enable-bar-scroll = true; + format = "{icon}"; + format-icons = { + "1" = ""; + "2" = ""; + "3" = "󰅩"; + "4" = ""; + "5" = ""; + "6" = ""; + "7" = "󰇮"; + "8" = ""; + "9" = ""; + "10" = ""; + urgent = ""; + # focused = ""; + default = ""; + }; + }; + "hyprland/window" = { max-length = 40; }; + "hyprland/language" = { format = "{short} {variant}"; }; "tray" = { "spacing" = 7; "icon-size" = 19; @@ -123,7 +153,6 @@ in interval = 1; tooltip = false; }; - "sway/language" = { format = "{short} {variant}"; }; "custom/caffeine" = { format = "{}"; exec = "systemctl --user status swayidle > /dev/null && echo 󰒲 || echo 󰒳";