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