aboutsummaryrefslogtreecommitdiff
path: root/home-manager/hyprland/default.nix
blob: 4a0b9f33f64d3e5faf958e83f47695901c53b752 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
    pkgs,
    lib,
    inputs,
    ...
}:
{
    imports = [
        ../rofi
        ../kitty
        ../waybar
        ../hyprpaper
    ];

    home.file.".config/hypr/hyprlock.conf".source = ./hyprlock.conf;
    
    wayland.windowManager.hyprland= {
        enable = true;
        xwayland.enable = true;
	    systemd.variables = ["--all"];
        #package = inputs.hyprland.packages.${pkgs.system}.hyprland;
        #portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
        settings = {
            "$mod" = "SUPER";
            exec-once = [
                "waybar"
                "xss-lock --transfer-sleep-lock -- hyprlock"
                "nm-applet"
                "hyprpaper"
            ];
            bind =
                [
                    "$mod, C, exec, firefox"
                    ", Print, exec, grimblast copy area"
                    "$mod, D, exec, rofi -i -show drun -disable-history"
                    "$mod Shift, E, exit"
                    "$mod, Return, exec, kitty"
                    "$mod, T, togglesplit"
                    "$mod Control, left, workspace, m-1"
                    "$mod Control, h, workspace, m-1"
                    "$mod Control, right, workspace, m+1"
                    "$mod Control, l, workspace, m+1"
                    "$mod, x, exec, hyprlock"
                    "$mod Shift, x, exec, hyprlock"
                    "$mod Shift, x, exec, systemctl suspend"
                    "$mod Shift, MINUS, exec, emacsclient -c"
                    "ALT, Tab, focusmonitor, +1"
                    "$mod, G, exec, bash /home/boss/bin/rofi-passmenu"
                    ", XF86AudioRaiseVolume, exec, pamixer -i 5"
                    ", XF86AudioLowerVolume, exec, pamixer -d 5"
                    "$mod Shift, Q, killactive"
                    "$mod, F, fullscreen"
                    "$mod Shift, space, togglefloating"
                    "$mod, mouse:272, movewindow"
                    ", XF86AudioPlay, exec, playerctl play-pause"
                    "$mod, bracketleft, exec, playerctl -p firefox play-pause"
                    "$mod, bracketright, exec, playerctl -p spotify play-pause"
                    "$mod Shift, S, exec spectacle -r"
                ]
                ++ (
                    # workspaces
                    # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
                    builtins.concatLists (builtins.genList (
                        x: let
                            key = let
                                c = (x + 1) / 10;
                            in toString (x + 1 - (c * 10));
                        in [
                            "$mod, ${key}, workspace, ${toString (x + 1)}"
                            "$mod SHIFT, ${key}, movetoworkspace, ${toString (x + 1)}"
                            (lib.mkIf (x < 5)
                                "$mod Control, ${key}, workspace, ${toString (x + 6)}"
                            )
                            "$mod Control, ${key}, workspace, ${toString (x + 1)}"
                        ]
                    )
                        10)
                )
                ++ (
                    builtins.map (
                        x: "$mod, ${ builtins.elemAt x 0}, movefocus, ${builtins.elemAt x 1}\nbind=$mod Shift, ${builtins.elemAt x 0}, movewindow, ${builtins.elemAt x 1}"
                    )
                        [
                            ["h" "l"]
                            ["left" "l"]
                            ["j" "d"]
                            ["down" "d"]
                            ["k" "u"]
                            ["up" "u"]
                            ["l" "r"]
                            ["right" "r"]
                        ]
                );
            monitor =
                [
                    "eDP-1, highrr, 0x0, 1"
                    "HDMI-A-1, highrr, 1920x0, 1"
                ];
            workspace =
                (builtins.genList
                    (x : "${toString (x + 1)},monitor:eDP-1")
                    5
                )
                ++ (builtins.genList
                    (x : "${toString (x + 6)},monitor:HDMI-A-1")
                    5
                );
            
            
            input = {
                touchpad.natural_scroll = true;
                #touchpad.scroll_factor = 0.5;
                accel_profile = "flat";
                follow_mouse = true;
                kb_options = "caps:super";
                #sensitivity = 0.00;
            };
            decoration = {
                rounding = 10;
                drop_shadow = false;
            };
            animation = [
                "workspaces,1,5,easeOutQuint,slide"
            ];
            bezier = [
                "easeInOutCubic,0.65,0,0.35,1"
                "easeOutQuint,0.22,1,0.36,1"
            ];
            general = {
                #"col.inactive_border" = "rgb(2f2e43)";
                #"col.active_border" = "rgb(ab47bc)";
                border_size = 2;
                gaps_in = 6;
                gaps_out = 12;
            };
            windowrulev2 = [
                "opacity 0.8 override 0.8 override, title:Spotify$"
            ];
        };
    };

    home.packages = with pkgs; [
        ydotool
        xss-lock
        pamixer
        grimblast
        playerctl
        libsForQt5.spectacle
        inputs.hyprlock.packages.${system}.hyprlock
    ];
}