From be430a28ff425f264e398aaef8203415d38b8b88 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Mon, 31 Jul 2023 20:27:12 +1200 Subject: [PATCH] fixes to hyprland config --- home/ooks/opt/desktop/hyprland/binds.nix | 103 +++++++++++---------- home/ooks/opt/desktop/hyprland/config.nix | 79 ---------------- home/ooks/opt/desktop/hyprland/default.nix | 81 +--------------- system/common/global/default.nix | 2 +- 4 files changed, 54 insertions(+), 211 deletions(-) delete mode 100644 home/ooks/opt/desktop/hyprland/config.nix diff --git a/home/ooks/opt/desktop/hyprland/binds.nix b/home/ooks/opt/desktop/hyprland/binds.nix index 03f886f..2f0f445 100644 --- a/home/ooks/opt/desktop/hyprland/binds.nix +++ b/home/ooks/opt/desktop/hyprland/binds.nix @@ -1,4 +1,5 @@ -{ +{ lib, config, pkgs, ... }: { + wayland.windowManager.hyprland.settings = { bind = let terminal = config.home.sessionVariables.TERMINAL; @@ -13,80 +14,80 @@ in [ # Program Launch - "SUPER,b,exec,${browser}"; - "SUPER,return,exec,${terminal}"; - "SUPER,e,exec,${editor}"; + "SUPER,b,exec,${browser}" + "SUPER,return,exec,${terminal}" + "SUPER,e,exec,${editor}" #Media - ",XF86AudioNext,exec,${playerctl} next"; - ",XF86AudioPrev,exec,${playerctl} previous"; - ",XF86AudioPlay,exec,${playerctl} play-pause"; - ",XF86AudioStop,exec,${playerctl} stop"; + ",XF86AudioNext,exec,${playerctl} next" + ",XF86AudioPrev,exec,${playerctl} previous" + ",XF86AudioPlay,exec,${playerctl} play-pause" + ",XF86AudioStop,exec,${playerctl} stop" # Window Management - "SUPER,Q,killactive"; - "SUPERSHIFT ALT,delete,exit"; - "SUPER,F,fullscreen"; - "SUPER,Space,togglefloating"; - "SUPER,P,pseudo"; # dwindle - "SUPER,S,togglesplit"; # dwindle + "SUPER,Q,killactive" + "SUPERSHIFT ALT,delete,exit" + "SUPER,F,fullscreen" + "SUPER,Space,togglefloating" + "SUPER,P,pseudo" # dwindle + "SUPER,S,togglesplit" # dwindle # Focus - "SUPER,left,movefocus,l"; - "SUPER,right,movefocus,r"; - "SUPER,up,movefocus,u"; - "SUPER,down,movefocus,d"; + "SUPER,left,movefocus,l" + "SUPER,right,movefocus,r" + "SUPER,up,movefocus,u" + "SUPER,down,movefocus,d" # Move - "SUPERSHIFT,left,movewindow,l"; - "SUPERSHIFT,right,movewindow,r"; - "SUPERSHIFT,up,movewindow,u"; - "SUPERSHIFT,down,movewindow,d"; + "SUPERSHIFT,left,movewindow,l" + "SUPERSHIFT,right,movewindow,r" + "SUPERSHIFT,up,movewindow,u" + "SUPERSHIFT,down,movewindow,d" #Resize - "SUPER CTRL,left,resizeactive,-20 0"; - "SUPERCTRL,right,resizeactive,20 0"; - "SUPER CTRL,up,resizeactive, 0 -20"; - "SUPERCTRL,down,resizeactive, 0 20"; + "SUPER CTRL,left,resizeactive,-20 0" + "SUPERCTRL,right,resizeactive,20 0" + "SUPER CTRL,up,resizeactive, 0 -20" + "SUPERCTRL,down,resizeactive, 0 20" # Switch workspace - "SUPER,1,workspace,1"; - "SUPER,2,workspace,2"; - "SUPER,3,workspace,3"; - "SUPER,4,workspace,4"; - "SUPER,5,workspace,5"; - "SUPER,6,workspace,6"; - "SUPER,7,workspace,7"; - "SUPER,8,workspace,8"; - "SUPER,9,workspace,9"; - "SUPER,0,workspace,10"; - "SUPERALT,up,workspace,e+1"; - "SUPERALT,down,workspace,e-1"; - "SUPER,tab,focusCurrentOrLast"; + "SUPER,1,workspace,1" + "SUPER,2,workspace,2" + "SUPER,3,workspace,3" + "SUPER,4,workspace,4" + "SUPER,5,workspace,5" + "SUPER,6,workspace,6" + "SUPER,7,workspace,7" + "SUPER,8,workspace,8" + "SUPER,9,workspace,9" + "SUPER,0,workspace,10" + "SUPERALT,up,workspace,e+1" + "SUPERALT,down,workspace,e-1" + "SUPER,tab,focusCurrentOrLast" # Move workspace - "SUPERSHIFT,1,movetoworkspace,1"; - "SUPERSHIFT,2,movetoworkspace,2"; - "SUPERSHIFT,3,movetoworkspace,3"; - "SUPERSHIFT,4,movetoworkspace,4"; - "SUPERSHIFT,5,movetoworkspace,5"; - "SUPERSHIFT,6,movetoworkspace,6"; - "SUPERSHIFT,7,movetoworkspace,7"; - "SUPERSHIFT,8,movetoworkspace,8"; - "SUPERSHIFT,9,movetoworkspace,9"; - "SUPERSHIFT,0,movetoworkspace,10"; + "SUPERSHIFT,1,movetoworkspace,1" + "SUPERSHIFT,2,movetoworkspace,2" + "SUPERSHIFT,3,movetoworkspace,3" + "SUPERSHIFT,4,movetoworkspace,4" + "SUPERSHIFT,5,movetoworkspace,5" + "SUPERSHIFT,6,movetoworkspace,6" + "SUPERSHIFT,7,movetoworkspace,7" + "SUPERSHIFT,8,movetoworkspace,8" + "SUPERSHIFT,9,movetoworkspace,9" + "SUPERSHIFT,0,movetoworkspace,10" ]; # ----- MOUSE KEYBINDS ----- # bindm = [ - "SUPER,mouse:272,movewindow"; - "SUPER,mouse:273,resizewindow": + "SUPER,mouse:272,movewindow" + "SUPER,mouse:273,resizewindow" ]; }; diff --git a/home/ooks/opt/desktop/hyprland/config.nix b/home/ooks/opt/desktop/hyprland/config.nix deleted file mode 100644 index ffa4abf..0000000 --- a/home/ooks/opt/desktop/hyprland/config.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ home, colorscheme }: -let - inherit (home.sessionVariables) TERMINAL BROWSER EDITOR; -in - d -'' - general { - gaps_in=15 - gaps_out=20 - - border_size=2.7 - col.active_border=0xff${colorscheme.colors.base0C} - col.inactive_border=0xff${colorscheme.colors.base02} - col.group_border_active=0xff${colorscheme.colors.base0B} - col.group_border=0xff${colorscheme.colors.base04} - - cursor_inactive_timeout=4 - } - - decoration { - active_opacity=0.94 - inactive_opacity=0.84 - fullscreen_opacity=1.0 - - rounding=5 - - blur=true - blur_size=5 - blur_passes=3 - blur_new_optimizations=true - blur_ignore_opacity=true - - drop_shadow=true - shadow_range=12 - shadow_offset=3 3 - col.shadow=0x44000000 - col.shadow_inactive=0x66000000 - } - - animations { - enabled=true - - bezier=easein,0.11, 0, 0.5, 0 - bezier=easeout,0.5, 1, 0.89, 1 - bezier=easeinout,0.45, 0, 0.55, 1 - - animation=windowsIn,1,3,easeout,slide - animation=windowsOut,1,3,easein,slide - animation=windowsMove,1,3,easeout - - animation=fadeIn,1,3,easeout - animation=fadeOut,1,3,easein - animation=fadeSwitch,1,3,easeout - animation=fadeShadow,1,3,easeout - animation=fadeDim,1,3,easeout - animation=border,1,3,easeout - - animation=workspaces,1,2,easeout,slide - } - - misc { - animate_manual_resizes = false - enable_swallow = true - swallow_regex = ^(kitty)$ - focus_on_activate = true - disable_hyprland_logo = true - vfr = on - } - - dwindle { - pseudotile = yes - preserve_split = yes - } - - master { - new_is_master = true - } - - diff --git a/home/ooks/opt/desktop/hyprland/default.nix b/home/ooks/opt/desktop/hyprland/default.nix index 6b82c84..81d12ce 100644 --- a/home/ooks/opt/desktop/hyprland/default.nix +++ b/home/ooks/opt/desktop/hyprland/default.nix @@ -74,87 +74,8 @@ }; exec = [ - # need to fix "${pkgs.swaybg}/bin/swaybg -i --mode fill" + need to fix "${pkgs.swaybg}/bin/swaybg -i ~/.dotfiles/walls/everforest/megacity.png --mode fill" ]; - - bind = let - playerctl = "${config.services.playerctld.package}/bin/playerctl"; - playerctld = "${config.services.playerctld.package}/bin/playerctld"; - makoctl = "${config.services.mako.package}/bin/makoctl"; - - grimblast = "${pkgs.inputs.hyprwm-contrib.grimblast}/bin/grimblast"; - pactl = "${pkgs.pulseaudio}/bin/pactl"; - - gtk-launch = "${pkgs.gtk3}/bin/gtk-launch"; - xdg-mime = "${pkgs.xdg-utils}/bin/xdg-mime"; - defaultApp = type: "${gtk-launch} $(${xdg-mime} query default ${type})"; - - terminal = config.home.sessionVariables.TERMINAL; - browser = defaultApp "x-scheme-handler/https"; - editor = defaultApp "text/plain"; - in [ - # Program bindings - "SUPER,Return,exec,${terminal}" - "SUPER,e,exec,${editor}" - "SUPER,b,exec,${browser}" - # Brightness control (only works if the system has lightd) - ",XF86MonBrightnessUp,exec,light -A 10" - ",XF86MonBrightnessDown,exec,light -U 10" - # Volume - ",XF86AudioRaiseVolume,exec,${pactl} set-sink-volume @DEFAULT_SINK@ +5%" - ",XF86AudioLowerVolume,exec,${pactl} set-sink-volume @DEFAULT_SINK@ -5%" - ",XF86AudioMute,exec,${pactl} set-sink-mute @DEFAULT_SINK@ toggle" - "SHIFT,XF86AudioMute,exec,${pactl} set-source-mute @DEFAULT_SOURCE@ toggle" - ",XF86AudioMicMute,exec,${pactl} set-source-mute @DEFAULT_SOURCE@ toggle" - # Screenshotting - ",Print,exec,${grimblast} --notify copy output" - "SHIFT,Print,exec,${grimblast} --notify copy active" - "CONTROL,Print,exec,${grimblast} --notify copy screen" - "SUPER,Print,exec,${grimblast} --notify copy window" - "ALT,Print,exec,${grimblast} --notify copy area" - ] ++ - - (lib.optionals config.services.playerctld.enable [ - # Media control - ",XF86AudioNext,exec,${playerctl} next" - ",XF86AudioPrev,exec,${playerctl} previous" - ",XF86AudioPlay,exec,${playerctl} play-pause" - ",XF86AudioStop,exec,${playerctl} stop" - "ALT,XF86AudioNext,exec,${playerctld} shift" - "ALT,XF86AudioPrev,exec,${playerctld} unshift" - "ALT,XF86AudioPlay,exec,systemctl --user restart playerctld" - ]) ++ - # Screen lock - (lib.optionals config.programs.swaylock.enable [ - ",XF86Launch5,exec,${swaylock} -S" - ",XF86Launch4,exec,${swaylock} -S" - "SUPER,backspace,exec,${swaylock} -S" - ]) ++ - # Notification manager - (lib.optionals config.services.mako.enable [ - "SUPER,w,exec,${makoctl} dismiss" - ]) ++ - - - monitor = map (m: let - resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}"; - position = "${toString m.x}x${toString m.y}"; - in - "${m.name},${if m.enabled then "${resolution},${position},1" else "disable"}" - ) (config.monitors); - - workspace = map (m: - "${m.name},${m.workspace}" - ) (lib.filter (m: m.enabled && m.workspace != null) config.monitors); - }; - # This is order sensitive, so it has to come here. - extraConfig = '' - # Passthrough mode (e.g. for VNC) - bind=SUPER,P,submap,passthrough - submap=passthrough - bind=SUPER,P,submap,reset - submap=reset - ''; }; } diff --git a/system/common/global/default.nix b/system/common/global/default.nix index 9130a5f..f3a20dd 100644 --- a/system/common/global/default.nix +++ b/system/common/global/default.nix @@ -22,7 +22,7 @@ }; - hardware.enableRedistibutableFirmware = true; + #hardware.enableRedistibutableFirmware = true; environment.enableAllTerminfo = true; }