From fb323ec2274a6ac0bb73673d1ed53ae7021c7f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sun, 21 Jan 2024 01:24:23 -0300 Subject: [PATCH] hyprland: more improvements --- user/chat.nix | 6 ++++++ user/home.nix | 7 +++++++ user/hyprland/default.nix | 18 +++++++++++++++--- user/hyprland/hyprland.conf | 34 +++++++++++++++++++++++++++++++--- user/sway/mako.nix | 3 ++- user/variables.nix | 2 +- user/waybar/default.nix | 4 ++-- 7 files changed, 64 insertions(+), 10 deletions(-) diff --git a/user/chat.nix b/user/chat.nix index 34ddd84..7e27892 100644 --- a/user/chat.nix +++ b/user/chat.nix @@ -7,6 +7,12 @@ ''; }; + wayland.windowManager.hyprland.extraConfig = '' + exec-once = thunderbird + exec-once = webcord + exec-once = telegram-desktop + ''; + home.packages = with pkgs; [ tdesktop webcord diff --git a/user/home.nix b/user/home.nix index 8defc45..7dfc0ed 100644 --- a/user/home.nix +++ b/user/home.nix @@ -172,6 +172,13 @@ exec nicotine ''; + wayland.windowManager.hyprland.extraConfig = lib.optionalString (osConfig.networking.hostName or "" == "monolith") '' + exec-once = steam + exec-once = obs --startreplaybuffer + exec-once = deluge-gtk + exec-once = nicotine + ''; + systemd.user.services.rm-target = { Unit = { Description = "Remove directories named 'target'"; diff --git a/user/hyprland/default.nix b/user/hyprland/default.nix index eacb59f..6eaa16f 100644 --- a/user/hyprland/default.nix +++ b/user/hyprland/default.nix @@ -1,4 +1,8 @@ -{ config, pkgs, lib, ... }: { +{ config, pkgs, lib, ... }: +let + inherit (pkgs.uservars) theme; +in +{ imports = [ ../sway/kanshi.nix ../sway/mako.nix @@ -11,11 +15,19 @@ ]; config = lib.mkIf (pkgs.uservars.desktop == "hyprland") { + services.mako.enable = true; + wayland.windowManager.hyprland = { - enable = false; - extraConfig = lib.readFile ./hyprland.conf; + enable = true; + extraConfig = '' + source = /home/lelgenio/projects/nixos-config/user/hyprland/hyprland.conf + ''; systemd.enable = true; }; + home.file.".config/hypr/hyprpaper.conf".text = '' + preload = ${theme.background} + wallpaper = ,${theme.background} + ''; # home.file.".config/eww".source = ./eww; packages.firefox.hideTitleBar = true; diff --git a/user/hyprland/hyprland.conf b/user/hyprland/hyprland.conf index bba5a18..f84aa97 100644 --- a/user/hyprland/hyprland.conf +++ b/user/hyprland/hyprland.conf @@ -14,12 +14,12 @@ OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,auto - +monitor=DP-1,1920x1080@144,auto,auto # See https://wiki.hyprland.org/Configuring/Keywords/ for more # Execute your favorite apps at launch -exec-once = waybar & hyprpaper & firefox +exec-once = hyprpaper & firefox # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf @@ -99,7 +99,7 @@ dwindle { master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_is_master = true + new_is_master = false no_gaps_when_only = 1 } @@ -164,6 +164,9 @@ bind = $mainMod, X, killactive, # bind = $mainMod, M, exit, bind = $mainMod Control, Return, exec, thunar bind = $mainMod Shift, Space, togglefloating, + +bind = $mainMod Control, z, exec, swaylock & systemctl suspend + bind = $mainMod, R, exec, wofi --show drun bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle @@ -213,6 +216,9 @@ bindm = $mainMod, mouse:273, resizewindow bind = $mainMod, S, exec, wlauncher bind = $mainMod, B, layoutmsg, swapwithmaster +bind = $mainMod Shift, E, layoutmsg, swapnext +bind = $mainMod Shift, I, layoutmsg, swapprev + bind=$mainMod,f,fullscreen bind=$mainMod,n,movefocus,l @@ -252,3 +258,25 @@ bind = $mainMod, B, layoutmsg, swapwithmaster bind=$mainMod,mouse_down,workspace,e-1 bind=$mainMod,mouse_up,workspace,e+1 + +# Music mode + +bind=$mainMod,M,submap,music +submap=music + +binde=,Space,exec,mpc toggle + +binde=,U,exec,volumesh -i 10 +binde=,Y,exec,volumesh -d 10 +binde=,O,exec,mpc next +binde=,N,exec,mpc prev +binde=,I,exec,volumesh --mpd -i 10 +binde=,E,exec,volumesh --mpd -d 10 + +binde=,s,exec,pulse_sink + +# use reset to go back to the global submap +bind=,escape,submap,reset + +# will reset the submap, meaning end the current one and return to the global one +submap=reset diff --git a/user/sway/mako.nix b/user/sway/mako.nix index 2fced8d..2089d22 100644 --- a/user/sway/mako.nix +++ b/user/sway/mako.nix @@ -1,11 +1,12 @@ { config, pkgs, lib, ... }: let - inherit (pkgs.uservars) key accent font theme; + inherit (pkgs.uservars) key accent font theme desktop; inherit (theme) color; in { services.mako = { borderSize = 2; + borderRadius = if desktop == "sway" then 0 else 5; padding = "5"; margin = "15"; layer = "overlay"; diff --git a/user/variables.nix b/user/variables.nix index b8d7cce..1357a63 100644 --- a/user/variables.nix +++ b/user/variables.nix @@ -128,7 +128,7 @@ rec { pass = "disroot.org"; }; - dmenu = "bmenu"; + dmenu = "rofi"; desktop = "hyprland"; browser = "firefox"; editor = "kakoune"; diff --git a/user/waybar/default.nix b/user/waybar/default.nix index f6163b8..3de9b36 100644 --- a/user/waybar/default.nix +++ b/user/waybar/default.nix @@ -1,6 +1,6 @@ { config, osConfig, pkgs, lib, font, ... }: let - inherit (pkgs.uservars) key theme accent font; + inherit (pkgs.uservars) key theme accent font desktop; inherit (theme) color; in { @@ -8,7 +8,7 @@ in programs.waybar = { enable = true; systemd.enable = true; - systemd.target = "sway-session.target"; + systemd.target = "${desktop}-session.target"; settings = [{ layer = "top"; modules-left = [