blob: 551161ddc88b40a451e22514e2a0f3a71d3a2b4a [file] [log] [blame]
Skyler Grey2e6ff852022-08-26 06:49:18 +01001{
2 pkgs,
3 lib,
Skyler Greye27f9382022-09-01 23:33:04 +01004 home,
Skyler Grey2e6ff852022-08-26 06:49:18 +01005 ...
6}: {
7 home = {
8 wayland.windowManager.sway = {
9 enable = true;
10 wrapperFeatures.gtk = true;
Skyler Greye27f9382022-09-01 23:33:04 +010011 package = pkgs.sway-unwrapped;
Skyler Grey2e6ff852022-08-26 06:49:18 +010012
13 config = rec {
14 assigns = {};
15 bars = [];
16 colors = {};
17 defaultWorkspace = null;
18 down = "j";
19 floating = {};
20 focus = {};
21 fonts = {};
22 gaps = {
23 inner = 10;
24 top = -10;
25 outer = 0;
26 smartGaps = false;
27 };
28 input = {
29 "type:touchpad" = {
30 dwt = "enabled";
31 tap = "enabled";
32 natural_scroll = "enabled";
33 middle_emulation = "enabled";
34 events = "disabled_on_external_mouse";
35 };
36 "type:keyboard" = {
37 xkb_layout = "gb";
Skyler Grey7b265df2022-10-30 23:07:12 +000038 xkb_options = "caps:escape";
Skyler Grey2e6ff852022-08-26 06:49:18 +010039 };
40 "type:tablet_tool" = {
41 map_to_output = "eDP-1";
42 };
43 };
44 keybindings = lib.mkOptionDefault {
45 "${modifier}+g" = "sticky toggle";
46 "${modifier}+k" = "exec wl-copy -c";
47 "${modifier}+f" = "maximize toggle";
48 };
49 keycodebindings = {};
50 left = "h";
51 modes = {
52 resize = {
53 Down = "resize grow height 10 px";
54 Escape = "mode default";
55 Left = "resize shrink width 10 px";
56 Return = "mode default";
57 Right = "resize grow width 10 px";
58 Up = "resize shrink height 10 px";
59 h = "resize shrink width 10 px";
60 j = "resize grow height 10 px";
61 k = "resize shrink height 10 px";
62 l = "resize grow width 10 px";
63 };
64 };
65 modifier = "Mod4";
Skyler Grey2e4815e2022-09-05 08:08:10 +010066 output = rec {
Skyler Greye27f9382022-09-01 23:33:04 +010067 HDMI-A-1 = {
Skyler Grey2e6ff852022-08-26 06:49:18 +010068 resolution = "3840x2160";
69 bg = "#FFD0F9 solid_color";
70 position = "0,0";
71 };
Skyler Grey2e4815e2022-09-05 08:08:10 +010072 HDMI-A-2 = HDMI-A-1;
73 # For some reason my monitor sometimes gets one identifier and
74 # sometimes the other, despite being plugged into the same port
Skyler Grey2e6ff852022-08-26 06:49:18 +010075 eDP-1 = {
76 resolution = "1920x1080";
77 position = "0,2160";
78 };
79 "*" = {
80 };
81 };
82 right = "l";
83 seat = {
84 "*" = {
85 hide_cursor = "when-typing enable";
86 };
87 };
88 startup = [
89 {command = "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK";}
90 ];
91 terminal = "${pkgs.kitty}/bin/kitty";
92 up = "k";
93 window = {};
94 workspaceAutoBackAndForth = true;
95 workspaceLayout = "default";
96 workspaceOutputAssign = [];
97 };
98
99 extraSessionCommands = ''
100 export WLR_NO_HARDWARE_CURSORS=1
101 # TODO: Check if above is still needed w/ nvidia card enabled
102 export SDL_VIDEODRIVER=wayland
103 # needs qt5.qtwayland in systemPackages
104 export QT_QPA_PLATFORM=wayland
105 export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
106 # Fix for some Java AWT applications (e.g. Android Studio),
107 # use this if they aren't displayed properly:
108 export _JAVA_AWT_WM_NONREPARENTING=1
109 '';
110
111 swaynag = {
112 enable = false;
113 settings = {
114 "<config>" = {
115 background = "#ffffff99";
116 border-bottom = "#00000000";
117 button-background = "#ffffffcc";
118 button-padding = 10;
119 button-border-size = 0;
120 };
121
122 warning = {
123 background = "#ffffff99";
124 border-bottom = "#00000000";
125 button-background = "#ffff00";
126 };
127
128 error = {
129 background = "#ffffff99";
130 border-bottom = "#00000000";
131 button-background = "#ff0000";
132 };
133
134 green = {
135 background = "#ffffff99";
136 border-bottom = "#00000000";
137 button-background = "#00b300";
138 };
139
140 blue = {
141 background = "#ffffff99";
142 border-bottom = "#00000000";
143 button-background = "#0000ff";
144 };
145 };
146 };
147
148 systemdIntegration = true;
149 };
150
151 home.packages = with pkgs; [
152 wl-clipboard
153 ];
154
155 programs.zsh.profileExtra = ''
156 if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
157 exec systemd-cat -t sway sway --unsupported-gpu
158 fi
159 '';
160 };
161}