forked from librephoenix/nixos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhyprland.nix
1334 lines (1192 loc) · 44.2 KB
/
hyprland.nix
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{ inputs, config, lib, pkgs, userSettings, systemSettings, pkgs-nwg-dock-hyprland, ... }: let
pkgs-hyprland = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
imports = [
../../app/terminal/alacritty.nix
../../app/terminal/kitty.nix
(import ../../app/dmenu-scripts/networkmanager-dmenu.nix {
dmenu_command = "fuzzel -d"; inherit config lib pkgs;
})
../input/nihongo.nix
] ++
(if (systemSettings.profile == "personal") then
[ (import ./hyprprofiles/hyprprofiles.nix {
dmenuCmd = "fuzzel -d"; inherit config lib pkgs; })]
else
[]);
gtk.cursorTheme = {
package = pkgs.quintom-cursor-theme;
name = if (config.stylix.polarity == "light") then "Quintom_Ink" else "Quintom_Snow";
size = 36;
};
wayland.windowManager.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
plugins = [ ];
settings = { };
extraConfig = ''
exec-once = dbus-update-activation-environment --systemd DISPLAY XAUTHORITY WAYLAND_DISPLAY XDG_SESSION_DESKTOP=Hyprland XDG_CURRENT_DESKTOP=Hyprland XDG_SESSION_TYPE=wayland
exec-once = hyprctl setcursor '' + config.gtk.cursorTheme.name + " " + builtins.toString config.gtk.cursorTheme.size + ''
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = WLR_DRM_DEVICES,/dev/dri/card2:/dev/dri/card1
env = GDK_BACKEND,wayland,x11,*
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_QPA_PLATFORMTHEME,qt5ct
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = CLUTTER_BACKEND,wayland
env = GDK_PIXBUF_MODULE_FILE,${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
exec-once = hyprprofile Default
exec-once = ydotoold
#exec-once = STEAM_FRAME_FORCE_CLOSE=1 steam -silent
exec-once = nm-applet
exec-once = blueman-applet
exec-once = GOMAXPROCS=1 syncthing --no-browser
exec-once = protonmail-bridge --noninteractive
exec-once = waybar
exec-once = emacs --daemon
exec-once = hypridle
exec-once = sleep 5 && libinput-gestures
exec-once = obs-notification-mute-daemon
exec-once = hyprpaper
bezier = wind, 0.05, 0.9, 0.1, 1.05
bezier = winIn, 0.1, 1.1, 0.1, 1.0
bezier = winOut, 0.3, -0.3, 0, 1
bezier = liner, 1, 1, 1, 1
bezier = linear, 0.0, 0.0, 1.0, 1.0
animations {
enabled = yes
animation = windowsIn, 1, 6, winIn, popin
animation = windowsOut, 1, 5, winOut, popin
animation = windowsMove, 1, 5, wind, slide
animation = border, 1, 10, default
animation = borderangle, 1, 100, linear, loop
animation = fade, 1, 10, default
animation = workspaces, 1, 5, wind
animation = windows, 1, 6, wind, slide
animation = specialWorkspace, 1, 6, default, slidefadevert -50%
}
general {
layout = master
border_size = 5
col.active_border = 0xff'' + config.lib.stylix.colors.base08 + " " + ''0xff'' + config.lib.stylix.colors.base09 + " " + ''0xff'' + config.lib.stylix.colors.base0A + " " + ''0xff'' + config.lib.stylix.colors.base0B + " " + ''0xff'' + config.lib.stylix.colors.base0C + " " + ''0xff'' + config.lib.stylix.colors.base0D + " " + ''0xff'' + config.lib.stylix.colors.base0E + " " + ''0xff'' + config.lib.stylix.colors.base0F + " " + ''270deg
col.inactive_border = 0xaa'' + config.lib.stylix.colors.base02 + ''
resize_on_border = true
gaps_in = 7
gaps_out = 7
}
cursor {
no_warps = false
inactive_timeout = 30
}
bind=SUPER,code:9,exec,nwggrid-wrapper
bind=SUPER,code:66,exec,nwggrid-wrapper
bind=SUPER,SPACE,fullscreen,1
bind=SUPERSHIFT,F,fullscreen,0
bind=SUPER,Y,workspaceopt,allfloat
bind=ALT,TAB,cyclenext
bind=ALT,TAB,bringactivetotop
bind=ALTSHIFT,TAB,cyclenext,prev
bind=ALTSHIFT,TAB,bringactivetotop
bind=SUPER,V,exec,wl-copy $(wl-paste | tr '\n' ' ')
bind=SUPERSHIFT,T,exec,screenshot-ocr
bind=CTRLALT,Delete,exec,hyprctl kill
bind=SUPERSHIFT,K,exec,hyprctl kill
bind=SUPER,W,exec,nwg-dock-wrapper
bind=,code:172,exec,lollypop -t
bind=,code:208,exec,lollypop -t
bind=,code:209,exec,lollypop -t
bind=,code:174,exec,lollypop -s
bind=,code:171,exec,lollypop -n
bind=,code:173,exec,lollypop -p
bind = SUPER,R,pass,^(com\.obsproject\.Studio)$
bind = SUPERSHIFT,R,pass,^(com\.obsproject\.Studio)$
bind=SUPER,RETURN,exec,'' + userSettings.term + ''
bind=SUPERSHIFT,RETURN,exec,'' + userSettings.term + " " + '' --class float_term
bind=SUPER,A,exec,'' + userSettings.spawnEditor + ''
bind=SUPER,S,exec,'' + userSettings.spawnBrowser + ''
bind=SUPERCTRL,S,exec,container-open # qutebrowser only
bind=SUPERCTRL,P,pin
bind=SUPER,code:47,exec,fuzzel
bind=SUPER,X,exec,fnottctl dismiss
bind=SUPERSHIFT,X,exec,fnottctl dismiss all
bind=SUPER,Q,killactive
bind=SUPERSHIFT,Q,exit
bindm=SUPER,mouse:272,movewindow
bindm=SUPER,mouse:273,resizewindow
bind=SUPER,T,togglefloating
bind=SUPER,G,exec,hyprctl dispatch focusworkspaceoncurrentmonitor 9 && pegasus-fe;
bind=,code:148,exec,''+ userSettings.term + " "+''-e numbat
bind=,code:107,exec,grim -g "$(slurp)"
bind=SHIFT,code:107,exec,grim -g "$(slurp -o)"
bind=SUPER,code:107,exec,grim
bind=CTRL,code:107,exec,grim -g "$(slurp)" - | wl-copy
bind=SHIFTCTRL,code:107,exec,grim -g "$(slurp -o)" - | wl-copy
bind=SUPERCTRL,code:107,exec,grim - | wl-copy
bind=,code:122,exec,swayosd-client --output-volume lower
bind=,code:123,exec,swayosd-client --output-volume raise
bind=,code:121,exec,swayosd-client --output-volume mute-toggle
bind=,code:256,exec,swayosd-client --output-volume mute-toggle
bind=SHIFT,code:122,exec,swayosd-client --output-volume lower
bind=SHIFT,code:123,exec,swayosd-client --output-volume raise
bind=,code:232,exec,swayosd-client --brightness lower
bind=,code:233,exec,swayosd-client --brightness raise
bind=,code:237,exec,brightnessctl --device='asus::kbd_backlight' set 1-
bind=,code:238,exec,brightnessctl --device='asus::kbd_backlight' set +1
bind=,code:255,exec,airplane-mode
bind=SUPER,C,exec,wl-copy $(hyprpicker)
bind=SUPERSHIFT,S,exec,systemctl suspend
bindl=,switch:on:Lid Switch,exec,loginctl lock-session
bind=SUPERCTRL,L,exec,loginctl lock-session
bind=SUPER,H,movefocus,l
bind=SUPER,J,movefocus,d
bind=SUPER,K,movefocus,u
bind=SUPER,L,movefocus,r
bind=SUPERSHIFT,H,movewindow,l
bind=SUPERSHIFT,J,movewindow,d
bind=SUPERSHIFT,K,movewindow,u
bind=SUPERSHIFT,L,movewindow,r
bind=SUPER,1,focusworkspaceoncurrentmonitor,1
bind=SUPER,2,focusworkspaceoncurrentmonitor,2
bind=SUPER,3,focusworkspaceoncurrentmonitor,3
bind=SUPER,4,focusworkspaceoncurrentmonitor,4
bind=SUPER,5,focusworkspaceoncurrentmonitor,5
bind=SUPER,6,focusworkspaceoncurrentmonitor,6
bind=SUPER,7,focusworkspaceoncurrentmonitor,7
bind=SUPER,8,focusworkspaceoncurrentmonitor,8
bind=SUPER,9,focusworkspaceoncurrentmonitor,9
bind=SUPERCTRL,right,exec,hyprnome
bind=SUPERCTRL,left,exec,hyprnome --previous
bind=SUPERSHIFT,right,exec,hyprnome --move
bind=SUPERSHIFT,left,exec,hyprnome --previous --move
bind=SUPERSHIFT,1,movetoworkspace,1
bind=SUPERSHIFT,2,movetoworkspace,2
bind=SUPERSHIFT,3,movetoworkspace,3
bind=SUPERSHIFT,4,movetoworkspace,4
bind=SUPERSHIFT,5,movetoworkspace,5
bind=SUPERSHIFT,6,movetoworkspace,6
bind=SUPERSHIFT,7,movetoworkspace,7
bind=SUPERSHIFT,8,movetoworkspace,8
bind=SUPERSHIFT,9,movetoworkspace,9
bind=SUPER,Z,exec,if hyprctl clients | grep scratch_term; then echo "scratch_term respawn not needed"; else alacritty --class scratch_term; fi
bind=SUPER,Z,togglespecialworkspace,scratch_term
bind=SUPER,F,exec,if hyprctl clients | grep scratch_ranger; then echo "scratch_ranger respawn not needed"; else kitty --class scratch_ranger -e ranger; fi
bind=SUPER,F,togglespecialworkspace,scratch_ranger
bind=SUPER,N,exec,if hyprctl clients | grep scratch_numbat; then echo "scratch_ranger respawn not needed"; else alacritty --class scratch_numbat -e numbat; fi
bind=SUPER,N,togglespecialworkspace,scratch_numbat
bind=SUPER,M,exec,if hyprctl clients | grep lollypop; then echo "scratch_ranger respawn not needed"; else lollypop; fi
bind=SUPER,M,togglespecialworkspace,scratch_music
bind=SUPER,B,exec,if hyprctl clients | grep scratch_btm; then echo "scratch_ranger respawn not needed"; else alacritty --class scratch_btm -e btm; fi
bind=SUPER,B,togglespecialworkspace,scratch_btm
bind=SUPER,D,exec,if hyprctl clients | grep Element; then echo "scratch_ranger respawn not needed"; else element-desktop; fi
bind=SUPER,D,togglespecialworkspace,scratch_element
bind=SUPER,code:172,exec,togglespecialworkspace,scratch_pavucontrol
bind=SUPER,code:172,exec,if hyprctl clients | grep pavucontrol; then echo "scratch_ranger respawn not needed"; else pavucontrol; fi
$scratchpadsize = size 80% 85%
$scratch_term = class:^(scratch_term)$
windowrulev2 = float,$scratch_term
windowrulev2 = $scratchpadsize,$scratch_term
windowrulev2 = workspace special:scratch_term ,$scratch_term
windowrulev2 = center,$scratch_term
$float_term = class:^(float_term)$
windowrulev2 = float,$float_term
windowrulev2 = center,$float_term
$scratch_ranger = class:^(scratch_ranger)$
windowrulev2 = float,$scratch_ranger
windowrulev2 = $scratchpadsize,$scratch_ranger
windowrulev2 = workspace special:scratch_ranger silent,$scratch_ranger
windowrulev2 = center,$scratch_ranger
$scratch_numbat = class:^(scratch_numbat)$
windowrulev2 = float,$scratch_numbat
windowrulev2 = $scratchpadsize,$scratch_numbat
windowrulev2 = workspace special:scratch_numbat silent,$scratch_numbat
windowrulev2 = center,$scratch_numbat
$scratch_btm = class:^(scratch_btm)$
windowrulev2 = float,$scratch_btm
windowrulev2 = $scratchpadsize,$scratch_btm
windowrulev2 = workspace special:scratch_btm silent,$scratch_btm
windowrulev2 = center,$scratch_btm
windowrulev2 = float,class:^(Element)$
windowrulev2 = size 85% 90%,class:^(Element)$
windowrulev2 = workspace special:scratch_element silent,class:^(Element)$
windowrulev2 = center,class:^(Element)$
windowrulev2 = float,class:^(lollypop)$
windowrulev2 = size 85% 90%,class:^(lollypop)$
windowrulev2 = workspace special:scratch_music silent,class:^(lollypop)$
windowrulev2 = center,class:^(lollypop)$
$savetodisk = title:^(Save to Disk)$
windowrulev2 = float,$savetodisk
windowrulev2 = size 70% 75%,$savetodisk
windowrulev2 = center,$savetodisk
$pavucontrol = class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = float,$pavucontrol
windowrulev2 = size 86% 40%,$pavucontrol
windowrulev2 = move 50% 6%,$pavucontrol
windowrulev2 = workspace special silent,$pavucontrol
windowrulev2 = opacity 0.80,$pavucontrol
$miniframe = title:\*Minibuf.*
windowrulev2 = float,$miniframe
windowrulev2 = size 64% 50%,$miniframe
windowrulev2 = move 18% 25%,$miniframe
windowrulev2 = animation popin 1 20,$miniframe
windowrulev2 = float,class:^(pokefinder)$
windowrulev2 = float,class:^(Waydroid)$
windowrulev2 = float,title:^(Blender Render)$
windowrulev2 = size 86% 85%,title:^(Blender Render)$
windowrulev2 = center,title:^(Blender Render)$
windowrulev2 = float,class:^(org.inkscape.Inkscape)$
windowrulev2 = float,class:^(pinta)$
windowrulev2 = float,class:^(krita)$
windowrulev2 = float,class:^(Gimp)
windowrulev2 = float,class:^(Gimp)
windowrulev2 = float,class:^(libresprite)$
windowrulev2 = opacity 0.80,title:ORUI
windowrulev2 = opacity 1.0,class:^(org.qutebrowser.qutebrowser),fullscreen:1
windowrulev2 = opacity 0.85,class:^(Element)$
windowrulev2 = opacity 0.85,class:^(Logseq)$
windowrulev2 = opacity 0.85,class:^(lollypop)$
windowrulev2 = opacity 1.0,class:^(Brave-browser),fullscreen:1
windowrulev2 = opacity 1.0,class:^(librewolf),fullscreen:1
windowrulev2 = opacity 0.85,title:^(My Local Dashboard Awesome Homepage - qutebrowser)$
windowrulev2 = opacity 0.85,title:\[.*\] - My Local Dashboard Awesome Homepage
windowrulev2 = opacity 0.85,class:^(org.keepassxc.KeePassXC)$
windowrulev2 = opacity 0.85,class:^(org.gnome.Nautilus)$
windowrulev2 = opacity 0.85,class:^(org.gnome.Nautilus)$
windowrulev2 = opacity 0.85,initialTitle:^(Notes)$,initialClass:^(Brave-browser)$
layerrule = blur,waybar
layerrule = xray,waybar
blurls = waybar
layerrule = blur,launcher # fuzzel
blurls = launcher # fuzzel
layerrule = blur,gtk-layer-shell
layerrule = xray,gtk-layer-shell
blurls = gtk-layer-shell
layerrule = blur,~nwggrid
layerrule = xray 1,~nwggrid
layerrule = animation fade,~nwggrid
blurls = ~nwggrid
bind=SUPER,equal, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 + 0.5}')"
bind=SUPER,minus, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 - 0.5}')"
bind=SUPER,I,exec,networkmanager_dmenu
bind=SUPER,P,exec,keepmenu
bind=SUPERSHIFT,P,exec,hyprprofile-dmenu
bind=SUPERCTRL,R,exec,phoenix refresh
# 3 monitor setup
monitor=eDP-1,1920x1080@300,900x1080,1
monitor=HDMI-A-1,1920x1080,1920x0,1
monitor=DP-1,1920x1080,0x0,1
# hdmi tv
#monitor=eDP-1,1920x1080,1920x0,1
#monitor=HDMI-A-1,1920x1080,0x0,1
# hdmi work projector
#monitor=eDP-1,1920x1080,1920x0,1
#monitor=HDMI-A-1,1920x1200,0x0,1
xwayland {
force_zero_scaling = true
}
binds {
movefocus_cycles_fullscreen = false
}
input {
kb_layout = us
kb_options = caps:escape
repeat_delay = 350
repeat_rate = 50
accel_profile = adaptive
follow_mouse = 2
float_switch_override_focus = 0
}
misc {
disable_hyprland_logo = true
mouse_move_enables_dpms = true
enable_swallow = true
swallow_regex = (scratch_term)|(Alacritty)|(kitty)
font_family = '' + userSettings.font + ''
}
decoration {
rounding = 8
dim_special = 0.0
blur {
enabled = true
size = 5
passes = 2
ignore_opacity = true
contrast = 1.17
brightness = '' + (if (config.stylix.polarity == "dark") then "0.8" else "1.25") + ''
xray = true
special = true
popups = true
}
}
'';
xwayland = { enable = true; };
systemd.enable = true;
};
home.packages = (with pkgs; [
alacritty
kitty
feh
killall
polkit_gnome
nwg-launchers
papirus-icon-theme
(pkgs.writeScriptBin "nwggrid-wrapper" ''
#!/bin/sh
if pgrep -x "nwggrid-server" > /dev/null
then
nwggrid -client
else
GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache nwggrid-server -layer-shell-exclusive-zone -1 -g adw-gtk3 -o 0.55 -b ${config.lib.stylix.colors.base00}
fi
'')
libva-utils
libinput-gestures
gsettings-desktop-schemas
(pkgs.makeDesktopItem {
name = "nwggrid";
desktopName = "Application Launcher";
exec = "nwggrid-wrapper";
terminal = false;
type = "Application";
noDisplay = true;
icon = "/home/"+userSettings.username+"/.local/share/pixmaps/hyprland-logo-stylix.svg";
})
(hyprnome.override (oldAttrs: {
rustPlatform = oldAttrs.rustPlatform // {
buildRustPackage = args: oldAttrs.rustPlatform.buildRustPackage (args // {
pname = "hyprnome";
version = "unstable-2024-05-06";
src = fetchFromGitHub {
owner = "donovanglover";
repo = "hyprnome";
rev = "f185e6dbd7cfcb3ecc11471fab7d2be374bd5b28";
hash = "sha256-tmko/bnGdYOMTIGljJ6T8d76NPLkHAfae6P6G2Aa2Qo=";
};
cargoDeps = oldAttrs.cargoDeps.overrideAttrs (oldAttrs: rec {
name = "${pname}-vendor.tar.gz";
inherit src;
outputHash = "sha256-cQwAGNKTfJTnXDI3IMJQ2583NEIZE7GScW7TsgnKrKs=";
});
cargoHash = "sha256-cQwAGNKTfJTnXDI3IMJQ2583NEIZE7GScW7TsgnKrKs=";
});
};
})
)
gnome.zenity
wlr-randr
wtype
ydotool
wl-clipboard
hyprland-protocols
hyprpicker
inputs.hyprlock.packages.${pkgs.system}.default
hypridle
hyprpaper
fnott
keepmenu
pinentry-gnome3
wev
grim
slurp
libsForQt5.qt5.qtwayland
qt6.qtwayland
xdg-utils
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
wlsunset
pavucontrol
pamixer
tesseract4
(pkgs.writeScriptBin "screenshot-ocr" ''
#!/bin/sh
imgname="/tmp/screenshot-ocr-$(date +%Y%m%d%H%M%S).png"
txtname="/tmp/screenshot-ocr-$(date +%Y%m%d%H%M%S)"
txtfname=$txtname.txt
grim -g "$(slurp)" $imgname;
tesseract $imgname $txtname;
wl-copy -n < $txtfname
'')
(pkgs.writeScriptBin "nwg-dock-wrapper" ''
#!/bin/sh
if pgrep -x ".nwg-dock-hyprl" > /dev/null
then
nwg-dock-hyprland
else
nwg-dock-hyprland -f -x -i 64 -nolauncher -a start -ml 8 -mr 8 -mb 8
fi
'')
(pkgs.writeScriptBin "sct" ''
#!/bin/sh
killall wlsunset &> /dev/null;
if [ $# -eq 1 ]; then
temphigh=$(( $1 + 1 ))
templow=$1
wlsunset -t $templow -T $temphigh &> /dev/null &
else
killall wlsunset &> /dev/null;
fi
'')
(pkgs.writeScriptBin "obs-notification-mute-daemon" ''
#!/bin/sh
while true; do
if pgrep -x .obs-wrapped > /dev/null;
then
pkill -STOP fnott;
else
pkill -CONT fnott;
fi
sleep 10;
done
'')
(pkgs.writeScriptBin "suspend-unless-render" ''
#!/bin/sh
if pgrep -x nixos-rebuild > /dev/null || pgrep -x home-manager > /dev/null || pgrep -x kdenlive > /dev/null || pgrep -x FL64.exe > /dev/null || pgrep -x blender > /dev/null || pgrep -x flatpak > /dev/null;
then echo "Shouldn't suspend"; sleep 10; else echo "Should suspend"; systemctl suspend; fi
'')
])
++
(with pkgs-hyprland; [ ])
++ (with pkgs-nwg-dock-hyprland; [
(nwg-dock-hyprland.overrideAttrs (oldAttrs: {
patches = ./patches/noactiveclients.patch;
}))
]);
home.file.".local/share/pixmaps/hyprland-logo-stylix.svg".source =
config.lib.stylix.colors {
template = builtins.readFile ../../pkgs/hyprland-logo-stylix.svg.mustache;
extension = "svg";
};
home.file.".config/nwg-dock-hyprland/style.css".text = ''
window {
background: rgba(''+config.lib.stylix.colors.base00-rgb-r+'',''+config.lib.stylix.colors.base00-rgb-g+'',''+config.lib.stylix.colors.base00-rgb-b+'',0.0);
border-radius: 20px;
padding: 4px;
margin-left: 4px;
margin-right: 4px;
border-style: none;
}
#box {
/* Define attributes of the box surrounding icons here */
padding: 10px;
background: rgba(''+config.lib.stylix.colors.base00-rgb-r+'',''+config.lib.stylix.colors.base00-rgb-g+'',''+config.lib.stylix.colors.base00-rgb-b+'',0.55);
border-radius: 20px;
padding: 4px;
margin-left: 4px;
margin-right: 4px;
border-style: none;
}
button {
border-radius: 10px;
padding: 4px;
margin-left: 4px;
margin-right: 4px;
background: rgba(''+config.lib.stylix.colors.base03-rgb-r+'',''+config.lib.stylix.colors.base03-rgb-g+'',''+config.lib.stylix.colors.base03-rgb-b+'',0.55);
color: #''+config.lib.stylix.colors.base07+'';
font-size: 12px
}
button:hover {
background: rgba(''+config.lib.stylix.colors.base04-rgb-r+'',''+config.lib.stylix.colors.base04-rgb-g+'',''+config.lib.stylix.colors.base04-rgb-b+'',0.55);
}
'';
home.file.".config/nwg-dock-pinned".text = ''
nwggrid
Alacritty
neovide
qutebrowser
brave-browser
writer
impress
calc
draw
krita
xournalpp
obs
kdenlive
flstudio
blender
openscad
Cura
virt-manager
'';
home.file.".config/hypr/hypridle.conf".text = ''
general {
lock_cmd = pgrep hyprlock || hyprlock
before_sleep_cmd = loginctl lock-session
ignore_dbus_inhibit = false
}
# FIXME memory leak fries computer inbetween dpms off and suspend
#listener {
# timeout = 150 # in seconds
# on-timeout = hyprctl dispatch dpms off
# on-resume = hyprctl dispatch dpms on
#}
listener {
timeout = 165 # in seconds
on-timeout = loginctl lock-session
}
listener {
timeout = 180 # in seconds
#timeout = 5400 # in seconds
on-timeout = systemctl suspend
on-resume = hyprctl dispatch dpms on
}
'';
home.file.".config/hypr/hyprlock.conf".text = ''
background {
monitor =
path = screenshot
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = 4
blur_size = 5
noise = 0.0117
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
# doesn't work yet
image {
monitor =
path = /home/emmet/.dotfiles/user/wm/hyprland/nix-dark.png
size = 150 # lesser side if not 1:1 ratio
rounding = -1 # negative values mean circle
border_size = 0
rotate = 0 # degrees, counter-clockwise
position = 0, 200
halign = center
valign = center
}
input-field {
monitor =
size = 200, 50
outline_thickness = 3
dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = false
dots_rounding = -1 # -1 default circle, -2 follow input-field rounding
outer_color = rgb(''+config.lib.stylix.colors.base07-rgb-r+'',''+config.lib.stylix.colors.base07-rgb-g+'', ''+config.lib.stylix.colors.base07-rgb-b+'')
inner_color = rgb(''+config.lib.stylix.colors.base00-rgb-r+'',''+config.lib.stylix.colors.base00-rgb-g+'', ''+config.lib.stylix.colors.base00-rgb-b+'')
font_color = rgb(''+config.lib.stylix.colors.base07-rgb-r+'',''+config.lib.stylix.colors.base07-rgb-g+'', ''+config.lib.stylix.colors.base07-rgb-b+'')
fade_on_empty = true
fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered.
placeholder_text = <i>Input Password...</i> # Text rendered in the input box when it's empty.
hide_input = false
rounding = -1 # -1 means complete rounding (circle/oval)
check_color = rgb(''+config.lib.stylix.colors.base0A-rgb-r+'',''+config.lib.stylix.colors.base0A-rgb-g+'', ''+config.lib.stylix.colors.base0A-rgb-b+'')
fail_color = rgb(''+config.lib.stylix.colors.base08-rgb-r+'',''+config.lib.stylix.colors.base08-rgb-g+'', ''+config.lib.stylix.colors.base08-rgb-b+'')
fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i> # can be set to empty
fail_transition = 300 # transition time in ms between normal outer_color and fail_color
capslock_color = -1
numlock_color = -1
bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above)
invert_numlock = false # change color if numlock is off
swap_font_color = false # see below
position = 0, -20
halign = center
valign = center
}
label {
monitor =
text = Hello, Emmet
color = rgb(''+config.lib.stylix.colors.base07-rgb-r+'',''+config.lib.stylix.colors.base07-rgb-g+'', ''+config.lib.stylix.colors.base07-rgb-b+'')
font_size = 25
font_family = ''+userSettings.font+''
rotate = 0 # degrees, counter-clockwise
position = 0, 160
halign = center
valign = center
}
label {
monitor =
text = $TIME
color = rgb(''+config.lib.stylix.colors.base07-rgb-r+'',''+config.lib.stylix.colors.base07-rgb-g+'', ''+config.lib.stylix.colors.base07-rgb-b+'')
font_size = 20
font_family = Intel One Mono
rotate = 0 # degrees, counter-clockwise
position = 0, 80
halign = center
valign = center
}
'';
services.swayosd.enable = true;
services.swayosd.topMargin = 0.5;
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
postPatch = ''
# use hyprctl to switch workspaces
sed -i 's/zext_workspace_handle_v1_activate(workspace_handle_);/const std::string command = "hyprctl dispatch focusworkspaceoncurrentmonitor " + std::to_string(id());\n\tsystem(command.c_str());/g' src/modules/wlr/workspace_manager.cpp
sed -i 's/gIPC->getSocket1Reply("dispatch workspace " + std::to_string(id()));/gIPC->getSocket1Reply("dispatch focusworkspaceoncurrentmonitor " + std::to_string(id()));/g' src/modules/hyprland/workspaces.cpp
'';
patches = [./patches/waybarpaupdate.patch ./patches/waybarbatupdate.patch];
});
settings = {
mainBar = {
layer = "top";
position = "top";
height = 35;
margin = "7 7 3 7";
spacing = 2;
modules-left = [ "group/power" "group/battery" "group/backlight" "group/cpu" "group/memory" "group/pulseaudio" "keyboard-state" ];
modules-center = [ "custom/hyprprofile" "hyprland/workspaces" ];
modules-right = [ "group/time" "idle_inhibitor" "tray" ];
"custom/os" = {
"format" = " {} ";
"exec" = ''echo "" '';
"interval" = "once";
"on-click" = "nwggrid-wrapper";
"tooltip" = false;
};
"group/power" = {
"orientation" = "horizontal";
"drawer" = {
"transition-duration" = 500;
"children-class" = "not-power";
"transition-left-to-right" = true;
};
"modules" = [
"custom/os"
"custom/hyprprofileicon"
"custom/lock"
"custom/quit"
"custom/power"
"custom/reboot"
];
};
"custom/quit" = {
"format" = "";
"tooltip" = false;
"on-click" = "hyprctl dispatch exit";
};
"custom/lock" = {
"format" = "";
"tooltip" = false;
"on-click" = "hyprlock";
};
"custom/reboot" = {
"format" = "";
"tooltip" = false;
"on-click" = "reboot";
};
"custom/power" = {
"format" = "";
"tooltip" = false;
"on-click" = "shutdown now";
};
"custom/hyprprofileicon" = {
"format" = "";
"on-click" = "hyprprofile-dmenu";
"tooltip" = false;
};
"custom/hyprprofile" = {
"format" = " {}";
"exec" = ''cat ~/.hyprprofile'';
"interval" = 3;
"on-click" = "hyprprofile-dmenu";
};
"keyboard-state" = {
"numlock" = true;
"format" = "{icon}";
"format-icons" = {
"locked" = " ";
"unlocked" = " ";
};
};
"hyprland/workspaces" = {
"format" = "{icon}";
"format-icons" = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
"7" = "";
"8" = "";
"9" = "";
"scratch_term" = "_";
"scratch_ranger" = "_";
"scratch_music" = "_";
"scratch_btm" = "_";
"scratch_pavucontrol" = "_";
};
"on-click" = "activate";
"on-scroll-up" = "hyprnome";
"on-scroll-down" = "hyprnome --previous";
"all-outputs" = false;
"active-only" = false;
"ignore-workspaces" = ["scratch" "-"];
"show-special" = false;
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
};
tray = {
#"icon-size" = 21;
"spacing" = 10;
};
"clock#time" = {
"interval" = 1;
"format" = "{:%I:%M:%S %p}";
"timezone" = "America/Chicago";
"tooltip-format" = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
};
"clock#date" = {
"interval" = 1;
"format" = "{:%a %Y-%m-%d}";
"timezone" = "America/Chicago";
"tooltip-format" = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
};
"group/time" = {
"orientation" = "horizontal";
"drawer" = {
"transition-duration" = 500;
"transition-left-to-right" = false;
};
"modules" = [ "clock#time" "clock#date" ];
};
cpu = { "format" = ""; };
"cpu#text" = { "format" = "{usage}%"; };
"group/cpu" = {
"orientation" = "horizontal";
"drawer" = {
"transition-duration" = 500;
"transition-left-to-right" = true;
};
"modules" = [ "cpu" "cpu#text" ];
};
memory = { "format" = ""; };
"memory#text" = { "format" = "{}%"; };
"group/memory" = {
"orientation" = "horizontal";
"drawer" = {
"transition-duration" = 500;
"transition-left-to-right" = true;
};
"modules" = [ "memory" "memory#text" ];
};
backlight = {
"format" = "{icon}";
"format-icons" = [ "" "" "" "" "" "" "" "" "" ];
};
"backlight#text" = { "format" = "{percent}%"; };
"group/backlight" = {
"orientation" = "horizontal";
"drawer" = {
"transition-duration" = 500;
"transition-left-to-right" = true;
};
"modules" = [ "backlight" "backlight#text" ];
};
battery = {
"states" = {
"good" = 75;
"warning" = 30;
"critical" = 15;
};
"fullat" = 80;
"format" = "{icon}";
"format-charging" = "";
"format-plugged" = "";
"format-full" = "";
"format-icons" = [ "" "" "" "" "" "" "" "" "" "" ];
"interval" = 10;
};
"battery#text" = {
"states" = {
"good" = 75;
"warning" = 30;
"critical" = 15;
};
"fullat" = 80;
"format" = "{capacity}%";
};
"group/battery" = {
"orientation" = "horizontal";
"drawer" = {
"transition-duration" = 500;
"transition-left-to-right" = true;
};
"modules" = [ "battery" "battery#text" ];
};
pulseaudio = {
"scroll-step" = 1;
"format" = "{icon}";
"format-bluetooth" = "{icon}";
"format-bluetooth-muted" = "";
"format-muted" = "";
"format-source" = "";
"format-source-muted" = "";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = [ "" "" "" ];
};
"on-click" = "hyprctl dispatch togglespecialworkspace scratch_pavucontrol; if hyprctl clients | grep pavucontrol; then echo 'scratch_ranger respawn not needed'; else pavucontrol; fi";
};
"pulseaudio#text" = {
"scroll-step" = 1;
"format" = "{volume}%";
"format-bluetooth" = "{volume}%";
"format-bluetooth-muted" = "";
"format-muted" = "";
"format-source" = "{volume}%";
"format-source-muted" = "";
"on-click" = "hyprctl dispatch togglespecialworkspace scratch_pavucontrol; if hyprctl clients | grep pavucontrol; then echo 'scratch_ranger respawn not needed'; else pavucontrol; fi";
};
"group/pulseaudio" = {
"orientation" = "horizontal";
"drawer" = {
"transition-duration" = 500;
"transition-left-to-right" = true;
};
"modules" = [ "pulseaudio" "pulseaudio#text" ];
};
};
};
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: FontAwesome, ''+userSettings.font+'';
font-size: 20px;
}
window#waybar {
background-color: rgba('' + config.lib.stylix.colors.base00-rgb-r + "," + config.lib.stylix.colors.base00-rgb-g + "," + config.lib.stylix.colors.base00-rgb-b + "," + ''0.55);
border-radius: 8px;
color: #'' + config.lib.stylix.colors.base07 + '';
transition-property: background-color;
transition-duration: .2s;
}
tooltip {
color: #'' + config.lib.stylix.colors.base07 + '';
background-color: rgba('' + config.lib.stylix.colors.base00-rgb-r + "," + config.lib.stylix.colors.base00-rgb-g + "," + config.lib.stylix.colors.base00-rgb-b + "," + ''0.9);
border-style: solid;
border-width: 3px;
border-radius: 8px;
border-color: #'' + config.lib.stylix.colors.base08 + '';
}
tooltip * {
color: #'' + config.lib.stylix.colors.base07 + '';
background-color: rgba('' + config.lib.stylix.colors.base00-rgb-r + "," + config.lib.stylix.colors.base00-rgb-g + "," + config.lib.stylix.colors.base00-rgb-b + "," + ''0.0);
}
window > box {
border-radius: 8px;
opacity: 0.94;
}
window#waybar.hidden {
opacity: 0.2;
}
button {
border: none;
}
#custom-hyprprofile {
color: #'' + config.lib.stylix.colors.base0D + '';
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
background: inherit;
}
#workspaces button {
padding: 0px 6px;
background-color: transparent;