1{
2 config,
3 pkgs,
4 ...
5}:
6let
7 run-as-service =
8 slice:
9 pkgs.writeShellScript "as-systemd-transient" ''
10 exec ${pkgs.systemd}/bin/systemd-run \
11 --slice=app-${slice}.slice \
12 --property=ExitType=cgroup \
13 --user \
14 --wait \
15 bash -lc "exec apply-hm-env $@"
16 '';
17 launcher = "rofi";
18 launcherCmd = "${launcher} -show drun";
19 term = config.settings.terminal.name;
20in
21{
22 wayland.windowManager.hyprland.extraConfig = ''
23 # should be configured per-profile
24 monitor=eDP-1,preferred,0x0,1.6
25 monitor=HDMI-A-1,1920x1080@75,auto,1
26 workspace=eDP-1,1
27 workspace=HDMI-A-1,2
28
29 exec-once=xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
30 exec-once=swaybg -i ~/.config/wallpaper
31 exec-once=eww open bar
32
33 input {
34 kb_layout=tr
35 follow_mouse=1
36 force_no_accel=1
37 touchpad {
38 natural_scroll=1
39 }
40 }
41 general {
42 main_mod=SUPER
43 gaps_in=5
44 gaps_out=5
45 border_size=0
46 }
47 decoration {
48 rounding=16
49 blur=0
50 blur_size=3
51 blur_passes=3
52 blur_new_optimizations=1
53 drop_shadow=0
54 shadow_ignore_window=1
55 }
56 animations {
57 enabled=1
58 animation=windows,1,3,default,popin 80%
59 animation=border,1,2,default
60 animation=fade,1,4,default
61 animation=workspaces,1,2,default,slide
62 }
63 dwindle {
64 pseudotile=1
65 preserve_split=1
66 no_gaps_when_only=1
67 }
68 misc {
69 no_vfr=0
70 }
71
72 # window rules
73 windowrulev2=float,title:^(Media viewer)$
74 windowrulev2=float,title:^(Picture-in-Picture)$
75 windowrulev2=pin,title:^(Picture-in-Picture)$
76 windowrulev2=float,title:^(Firefox — Sharing Indicator)$
77 windowrulev2=move 0 0,title:^(Firefox — Sharing Indicator)$
78
79 # window rules for organization
80 windowrulev2=workspace 1,title:^(Firefox)$
81 windowrulev2=workspace 2,title:^(Discord)$
82 windowrulev2=workspace 2,title:^(WebCord)$
83 windowrulev2=workspace 3,title:^(foot)$
84
85 # make blueberry device-specific window proper size
86 windowrulev2 = tile, class:^(blueberry.py)$, title:^(?!Sound).+$
87
88 # mouse
89 bindm=SUPER,mouse:272,movewindow
90 bindm=SUPER,mouse:273,resizewindow
91 bindm=SUPERALT,mouse:272,resizewindow
92
93 # compositor binds
94 bind=SUPERSHIFT,E,exec,pkill Hyprland
95 bind=SUPER,Q,killactive,
96 bind=SUPER,F,fullscreen,
97 bind=SUPER,P,pseudo,
98 bind=SUPERSHIFT,T,togglefloating,
99
100 # utilities
101 bind=SUPER,L,exec,swaylock
102 bind=SUPER,RETURN,exec, ${term}
103 bind=SUPER,D,exec,pkill ${launcher} || ${launcherCmd}
104 bind=SUPER,Escape,exec,wlogout -p layer-shell
105
106 # media management
107 bind=,XF86AudioPlay,exec,playerctl play-pause
108 bind=,XF86AudioPrev,exec,playerctl previous
109 bind=,XF86AudioNext,exec,playerctl next
110
111 # volume management
112 bindle=,XF86AudioRaiseVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%+
113 bindle=,XF86AudioLowerVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%-
114 bind=,XF86AudioMute,exec,wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
115 bind=,XF86AudioMicMute,exec,wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
116
117 # brightness management
118 bind=,XF86MonBrightnessUp,exec,light -A 5
119 bind=,XF86MonBrightnessDown,exec,light -U 5
120
121 # move focus
122 bind=SUPER,left,movefocus,l
123 bind=SUPER,right,movefocus,r
124 bind=SUPER,up,movefocus,u
125 bind=SUPER,down,movefocus,d
126
127 # cycle workspaces
128 bind=SUPER,bracketleft,workspace,m-1
129 bind=SUPER,bracketright,workspace,m+1
130
131 # cycle monitors
132 bind=SUPERSHIFT,braceleft,focusmonitor,l
133 bind=SUPERSHIFT,braceright,focusmonitor,r
134
135 # workspaces
136 ${builtins.concatStringsSep "\n" (
137 builtins.genList (
138 x:
139 let
140 ws =
141 let
142 c = (x + 1) / 10;
143 in
144 builtins.toString (x + 1 - (c * 10));
145 in
146 ''
147 bind=SUPER,${ws},workspace,${toString (x + 1)}
148 bind=SHIFTSUPER,${ws},movetoworkspacesilent,${toString (x + 1)}
149 ''
150 ) 10
151 )}
152
153 # screenshot
154 bind=,Print,exec,grimblast --notify copysave area
155 bind=SUPERSHIFT,R,exec,grimblast --notify copysave area
156 bind=CTRL,Print,exec,grimblast --notify --cursor copysave output
157 bind=SUPERSHIFTCTRL,R,exec,grimblast --notify --cursor copysave output
158 bind=ALT,Print,exec,grimblast --notify --cursor copysave screen
159 bind=SUPERSHIFTALT,R,exec,grimblast --notify --cursor copysave screen
160 '';
161}