blob: da837c98c38845d82343d58418448aca6bfdc7e4 [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";
38 };
39 "type:tablet_tool" = {
40 map_to_output = "eDP-1";
41 };
42 };
43 keybindings = lib.mkOptionDefault {
44 "${modifier}+g" = "sticky toggle";
45 "${modifier}+k" = "exec wl-copy -c";
46 "${modifier}+f" = "maximize toggle";
47 };
48 keycodebindings = {};
49 left = "h";
50 modes = {
51 resize = {
52 Down = "resize grow height 10 px";
53 Escape = "mode default";
54 Left = "resize shrink width 10 px";
55 Return = "mode default";
56 Right = "resize grow width 10 px";
57 Up = "resize shrink height 10 px";
58 h = "resize shrink width 10 px";
59 j = "resize grow height 10 px";
60 k = "resize shrink height 10 px";
61 l = "resize grow width 10 px";
62 };
63 };
64 modifier = "Mod4";
65 output = {
Skyler Greye27f9382022-09-01 23:33:04 +010066 HDMI-A-1 = {
Skyler Grey2e6ff852022-08-26 06:49:18 +010067 resolution = "3840x2160";
68 bg = "#FFD0F9 solid_color";
69 position = "0,0";
70 };
71 eDP-1 = {
72 resolution = "1920x1080";
73 position = "0,2160";
74 };
75 "*" = {
76 };
77 };
78 right = "l";
79 seat = {
80 "*" = {
81 hide_cursor = "when-typing enable";
82 };
83 };
84 startup = [
85 {command = "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK";}
86 ];
87 terminal = "${pkgs.kitty}/bin/kitty";
88 up = "k";
89 window = {};
90 workspaceAutoBackAndForth = true;
91 workspaceLayout = "default";
92 workspaceOutputAssign = [];
93 };
94
95 extraSessionCommands = ''
96 export WLR_NO_HARDWARE_CURSORS=1
97 # TODO: Check if above is still needed w/ nvidia card enabled
98 export SDL_VIDEODRIVER=wayland
99 # needs qt5.qtwayland in systemPackages
100 export QT_QPA_PLATFORM=wayland
101 export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
102 # Fix for some Java AWT applications (e.g. Android Studio),
103 # use this if they aren't displayed properly:
104 export _JAVA_AWT_WM_NONREPARENTING=1
105 '';
106
107 swaynag = {
108 enable = false;
109 settings = {
110 "<config>" = {
111 background = "#ffffff99";
112 border-bottom = "#00000000";
113 button-background = "#ffffffcc";
114 button-padding = 10;
115 button-border-size = 0;
116 };
117
118 warning = {
119 background = "#ffffff99";
120 border-bottom = "#00000000";
121 button-background = "#ffff00";
122 };
123
124 error = {
125 background = "#ffffff99";
126 border-bottom = "#00000000";
127 button-background = "#ff0000";
128 };
129
130 green = {
131 background = "#ffffff99";
132 border-bottom = "#00000000";
133 button-background = "#00b300";
134 };
135
136 blue = {
137 background = "#ffffff99";
138 border-bottom = "#00000000";
139 button-background = "#0000ff";
140 };
141 };
142 };
143
144 systemdIntegration = true;
145 };
146
147 home.packages = with pkgs; [
148 wl-clipboard
149 ];
150
151 programs.zsh.profileExtra = ''
152 if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
153 exec systemd-cat -t sway sway --unsupported-gpu
154 fi
155 '';
156 };
157}