1{
2 pkgs,
3 config,
4 lib,
5 ...
6}:
7let
8 term = config.wayland.windowManager.sway.config.terminal;
9 homeDir = config.home.homeDirectory;
10 cfg = config.py.profiles.gui;
11in
12{
13 config = lib.mkIf cfg.enable {
14 catppuccin = {
15 sway.enable = true;
16 };
17 home.sessionVariables = {
18 XDG_CURRENT_DESKTOP = "sway";
19 };
20 wayland.windowManager.sway = {
21 enable = lib.mkDefault true;
22 package = null;
23 # nix-community/home-manager/issues/5311
24 checkConfig = false;
25 wrapperFeatures.base = true;
26 wrapperFeatures.gtk = true;
27 extraConfig = ''
28 default_border pixel
29 focus_on_window_activation smart
30 '';
31 systemd = {
32 enable = true;
33 xdgAutostart = true;
34 };
35 config = {
36 terminal = lib.getExe pkgs.ghostty;
37 menu = "exec ${lib.getExe pkgs.onagre}";
38 modifier = "Mod4";
39 bars = [ { command = "true"; } ];
40 focus = {
41 followMouse = true;
42 mouseWarping = true;
43 newWindow = "smart";
44 };
45 fonts = {
46 names = [ "Inter" ];
47 style = "Regular";
48 size = 12.0;
49 };
50 gaps = {
51 inner = 1;
52 outer = 1;
53 smartBorders = "on";
54 smartGaps = false;
55 };
56 input = {
57 "type:keyboard" = {
58 xkb_options = "caps:escape";
59 };
60 "type:mouse" = {
61 accel_profile = "flat";
62 };
63 "type:touchpad" = {
64 accel_profile = "adaptive";
65 scroll_factor = "1.5";
66 tap = "enabled";
67 };
68 };
69 modes = {
70 resize = {
71 Escape = "mode default";
72 Return = "mode default";
73 Up = "resize shrink height 10 px";
74 Down = "resize grow height 10 px";
75 Left = "resize shrink width 10 px";
76 Right = "resize grow width 10 px";
77 h = "resize shrink width 10 px";
78 j = "resize grow height 10 px";
79 k = "resize shrink height 10 px";
80 l = "resize grow width 10 px";
81 };
82 };
83 output = {
84 eDP-1 = {
85 scale = "1.2";
86 };
87 };
88 startup = [
89 { command = "${pkgs.dex}/bin/dex -a"; }
90 { command = "${homeDir}/scripts/unfuck-xdg-portals.fish"; }
91 { command = "wl-paste -t text --watch clipman store --no-persist"; }
92 ];
93 window = {
94 commands = [
95 {
96 command = "inhibit_idle fullscreen";
97 criteria = {
98 class = "Chromium|zoom|Firefox";
99 };
100 }
101 {
102 command = "floating enable, sticky enable, resize set 20 ppt 40 ppt, border pixel 4";
103 criteria = {
104 app_id = "^py.floating$";
105 };
106 }
107 {
108 command = "resize set 20 ppt";
109 criteria = {
110 title = "Mumble PTT";
111 };
112 }
113 ];
114 };
115 colors = {
116 background = "$base";
117 focused = {
118 border = "$pink";
119 background = "$base";
120 text = "$text";
121 indicator = "$rosewater";
122 childBorder = "$pink";
123 };
124 focusedInactive = {
125 border = "$mauve";
126 background = "$base";
127 text = "$text";
128 indicator = "$rosewater";
129 childBorder = "$mauve";
130 };
131 unfocused = {
132 border = "$mauve";
133 background = "$base";
134 text = "$text";
135 indicator = "$rosewater";
136 childBorder = "$mauve";
137 };
138 urgent = {
139 border = "$peach";
140 background = "$base";
141 text = "$peach";
142 indicator = "$overlay0";
143 childBorder = "$peach";
144 };
145 placeholder = {
146 border = "$overlay0";
147 background = "$base";
148 text = "$text";
149 indicator = "$overlay0";
150 childBorder = "$overlay0";
151 };
152 };
153 };
154 };
155 };
156}