aboutsummaryrefslogtreecommitdiff
path: root/home-manager/homeModules/hyprland.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/homeModules/hyprland.nix')
-rw-r--r--home-manager/homeModules/hyprland.nix204
1 files changed, 204 insertions, 0 deletions
diff --git a/home-manager/homeModules/hyprland.nix b/home-manager/homeModules/hyprland.nix
new file mode 100644
index 0000000..3304636
--- /dev/null
+++ b/home-manager/homeModules/hyprland.nix
@@ -0,0 +1,204 @@
+{ pkgs, lib, config, ... }:
+
+{
+ imports = [
+ ./waybar.nix
+ ./rofi.nix
+ ./mako.nix
+ ];
+
+ options = {
+ hyprland.enable = lib.mkEnableOption "enable hyprland";
+ };
+
+ config = lib.mkIf config.hyprland.enable {
+ waybar.enable = true;
+ rofi.enable = true;
+ mako.enable = true;
+
+ home.packages = with pkgs; [
+ swww
+ brightnessctl
+ grimblast
+ cliphist
+ polkit_gnome
+ xwaylandvideobridge
+ wl-clipboard
+ ];
+
+ xdg.portal = {
+ enable = true;
+ extraPortals = with pkgs; [
+ xdg-desktop-portal-hyprland
+ ];
+ configPackages = with pkgs; [
+ xdg-desktop-portal-hyprland
+ ];
+ };
+
+ wayland.windowManager.hyprland = {
+ enable = true;
+ package = pkgs.hyprland;
+ settings = {
+ "$scripts" = "${./attachments/hypr-scripts}";
+ "$mainMod" = "SUPER";
+ "$terminal" = "alacritty";
+
+ exec-once = [
+ "emacs --daemon"
+ "swww-daemon"
+ "swww img ${config.wallpaper}"
+ ];
+
+ monitor = ",preferred,auto,1,mirror,eDP-1";
+
+ input = {
+ kb_layout = "us,ru";
+ kb_options = "grp:win_space_toggle";
+ touchpad = {
+ natural_scroll = "yes";
+ disable_while_typing = "no";
+ };
+ sensitivity = 0.1;
+ };
+
+ general = {
+ gaps_in = 5;
+ gaps_out = 20;
+ border_size = 3;
+ layout = "dwindle";
+ allow_tearing = false;
+ };
+
+ decoration = {
+ rounding = 7;
+ drop_shadow = "yes";
+ shadow_range = 4;
+ shadow_render_power = 3;
+ blur = {
+ enabled = true;
+ size = 3;
+ passes = 1;
+ };
+ };
+
+ animations = {
+ enabled = 1;
+ bezier = "overshot,0.13,0.99,0.29,1.1,";
+ animation = [
+ "fade,1,4,default"
+ "workspaces,1,4,default,fade"
+ "windows,1,4,overshot,popin 95%"
+ ];
+ };
+
+ dwindle = {
+ pseudotile = "yes";
+ preserve_split = "yes";
+ };
+
+ master.new_is_master = true;
+ gestures.workspace_swipe = "on";
+ misc.force_default_wallpaper = 1;
+
+ windowrulev2 = [
+ "float, title:^(Firrfox — Sharing Indicator)$"
+ "noborder, title:^(Firefox — Sharing Indicator)$"
+ "rounding 0, title:^(Firefox — Sharing Indicator)$"
+ "float, title:^(firefox)$, title:^(Picture-in-Picture)$"
+ "pin, title:^(firefox)$, title:^(Picture-in-Picture)$"
+ "float, title:^(Save File)$"
+ "pin, title:^(Save File)$"
+ "float, title:^(Torrent Options)$"
+ "pin, title:^(Torrent Options)$"
+ "opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$"
+ "noanim,class:^(xwaylandvideobridge)$"
+ "noinitialfocus,class:^(xwaylandvideobridge)$"
+ "maxsize 1 1,class:^(xwaylandvideobridge)$"
+ "noblur,class:^(xwaylandvideobridge)$"
+ "windowdance,class:^(kompas.exe)$,title:^(RoamingWindow)$"
+ "stayfocused,class:^(kompas.exe)$,title:^(RoamingWindow)$"
+ ];
+
+ windowrule = [
+ "windowdance,title:^(Rhythm Doctor)$"
+ "forceinput,title:^(Rhythm Doctor)$"
+ ];
+
+ layerrule = "blur, waybar";
+
+ bind = [
+ "$mainMod, V, togglefloating, "
+ "$mainMod, P, pseudo,"
+ "$mainMod, I, togglesplit,"
+ "$mainMod, F, fullscreen, 0"
+ "$mainMod, M, fullscreen, 1"
+ "$mainMod SHIFT,F,fakefullscreen"
+ "$mainMod SHIFT, Q, killactive, "
+ "$mainMod SHIFT, E, exit,"
+
+ # Apps
+ "$mainMod, D, exec, killall rofi || rofi -show-icons -show drun"
+ "$mainMod, Q, exec, $terminal"
+ "$mainMod, B, exec, brave --enable-features=TouchpadOverscrollHistoryNavigation"
+ "$mainMod, T, exec, telegram-desktop"
+ "$mainMod, E, exec, emacsclient -c -a emacs"
+ "$mainMod CONTROL, E, exec, emacs"
+ "$mainMod SHIFT, Esc, exec, swww img ${config.wallpaper}"
+
+ # Screenshooting
+ ", Print, exec, grimblast save screen"
+ "ALT, Print, exec, grimblast save active"
+ "SHIFT, Print, exec, grimblast save area"
+ "CONTROL, Print, exec, grimblast copy screen"
+ "ALT_CONTROL, Print, exec, grimblast copy active"
+ "CONTROL_SHIFT, Print, exec, grimblast copy area "
+
+ # Volume
+ ",0x1008FF11,exec,wpctl set-volume @DEFAULT_SINK@ 5%-"
+ ",0x1008FF13,exec,wpctl set-volume @DEFAULT_SINK@ 5%+"
+ ",0x1008FF12,exec,wpctl set-mute @DEFAULT_SINK@ toggle"
+ ",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle"
+
+ # Brightness
+ ",XF86MonBrightnessUp,exec,brightnessctl s +5%"
+ ",XF86MonBrightnessDown,exec,brightnessctl s 5%-"
+
+ # Windows
+ "$mainMod, J, movefocus, d"
+ "$mainMod, K, movefocus, u"
+ "$mainMod, H, movefocus, l"
+ "$mainMod, L, movefocus, r"
+ "SUPER_SHIFT,J,movewindow,d"
+ "SUPER_SHIFT,K,movewindow,u"
+ "SUPER_SHIFT,H,movewindow,l"
+ "SUPER_SHIFT,L,movewindow,r"
+ "$mainMod, S, togglespecialworkspace, magic"
+ "$mainMod SHIFT, S, movetoworkspace, special:magic"
+ "$mainMod, mouse_down, workspace, e+1"
+ "$mainMod, mouse_up, workspace, e-1"
+ ] ++ (
+ # workspaces
+ # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
+ builtins.concatLists (builtins.genList (
+ x: let
+ ws = let
+ c = (x + 1) / 10;
+ in
+ builtins.toString (x + 1 - (c * 10));
+ in [
+ "$mainMod, ${ws}, workspace, ${toString (x + 1)}"
+ "$mainMod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
+ ]
+ )
+ 10)
+ );
+
+ bindm = [
+ "$mainMod, mouse:272, movewindow"
+ "$mainMod, mouse:273, resizewindow"
+ ];
+ };
+ };
+ };
+}