blob: 8b40a0a1d9c5b51de85152b61b0e978bf755d1d0 [file] [log] [blame]
Skyler Turnerdb486c92022-03-06 10:48:24 +00001{ pkgs, ... }: {
2 wayland.windowManager.sway = {
3 enable = true;
4 wrapperFeatures.gtk = true;
Skyler Turnerf2a88392022-03-06 21:08:15 +00005
6 config = {
7 assigns = {};
8 bars = [];
9 colors = {};
Skyler Turnerfe471d32022-03-07 13:16:17 +000010 defaultWorkspace = null;
11 down = "j";
12 floating = {};
13 focus = {};
14 fonts = {};
15 gaps = {
Skyler Turnerff4b0bd2022-03-07 13:17:23 +000016 inner = 3;
17 outer = 6;
Skyler Turnerb1fef9e2022-03-07 13:39:14 +000018 smartGaps = true;
Skyler Turnerfe471d32022-03-07 13:16:17 +000019 };
Skyler Turnerb1fef9e2022-03-07 13:39:14 +000020 input = {
21 # TODO: Make my keyboard british
22 };
23 keybindings = lib.mkOptionDefault {};
24 keycodebindings = {};
25 left = "h";
26 menu = "/usr/bin/env rofi -show combi";
27 modes = {
28 resize = {
29 Down = "resize grow height 10 px";
30 Escape = "mode default";
31 Left = "resize shrink width 10 px";
32 Return = "mode default";
33 Right = "resize grow width 10 px";
34 Up = "resize shrink height 10 px";
35 h = "resize shrink width 10 px";
36 j = "resize grow height 10 px";
37 k = "resize shrink height 10 px";
38 l = "resize grow width 10 px";
39 };
40 };
41 modifier = "Mod4";
42 output = {
43 HDMI-A-2 = {
44 resolution = "3840x2160";
45 position = "1920,0";
46 };
47 eDP-1 = {
48 resolution = "1920x1080";
49 position = "0,1522";
50 };
51 };
52 right = "l";
53 seat = {
54 "*" = {
55 hide_cursor = "when-typing enable";
56 };
57 };
58 startup = [];
59 terminal = "alacritty";
60 up = "k";
61 window = {};
62 workspaceAutoBackAndForth = true;
63 workspaceLayout = "default";
64 workspaceOutputAssign = [];
65 };
66
67 extraSessionCommands = ''
68 export SDL_VIDEODRIVER=wayland
69 # needs qt5.qtwayland in systemPackages
70 export QT_QPA_PLATFORM=wayland
71 export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
72 # Fix for some Java AWT applications (e.g. Android Studio),
73 # use this if they aren't displayed properly:
74 export _JAVA_AWT_WM_NONREPARENTING=1
75 '';
76
77 swaynag = {
78 enable = false; # TODO: Configure swaynag to fit with waybar
79 settings = {};
Skyler Turner07eb3d12022-03-06 21:08:29 +000080 };
Skyler Turnereda726a2022-03-07 00:23:17 +000081
82 systemdIntegration = true;
Skyler Turnerdb486c92022-03-06 10:48:24 +000083 };
84
85 home.packages = with pkgs; [
86 swaylock
87 swayidle
88 wl-clipboard
Skyler Turner9dfac612022-03-06 10:48:57 +000089 ];
Skyler Turnerdb486c92022-03-06 10:48:24 +000090
Skyler Turnerd3b70682022-03-06 23:19:45 +000091 programs.zsh.profileExtra = ''
92 if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
93 exec systemd-cat -t sway sway
94 fi
95 '';
Skyler Turnerdb486c92022-03-06 10:48:24 +000096}