blob: acd67f344d32af26c5898e2e2a7e04b565046a34 [file] [log] [blame]
Skyler Turner7a7eaf42022-03-07 13:39:48 +00001{ pkgs, lib, ... }: {
Skyler Turnerdb486c92022-03-06 10:48:24 +00002 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 Turner801a9a82022-03-07 13:40:41 +000016 inner = 10;
Skyler Turner89be0062022-03-07 21:37:09 +000017 top = -10;
Skyler Turner1bd708a2022-03-07 13:44:27 +000018 outer = 0;
Skyler Turnerb1fef9e2022-03-07 13:39:14 +000019 smartGaps = true;
Skyler Turnerfe471d32022-03-07 13:16:17 +000020 };
Skyler Turnerb1fef9e2022-03-07 13:39:14 +000021 input = {
Skyler Turnera9227fd2022-03-07 13:48:39 +000022 "type:touchpad" = {
Skyler Turnerf277cf62022-03-07 13:49:14 +000023 dwt = "enabled";
24 tap = "enabled";
25 natural_scroll = "enabled";
Skyler Turner0ac86a22022-03-07 20:58:14 +000026 middle_emulation = "enabledD";
Skyler Turnera9227fd2022-03-07 13:48:39 +000027 events = "disabled_on_external_mouse";
28 };
29 "type:keyboard" = {
30 xkb_layout = "gb";
31 };
Skyler Turnerb1fef9e2022-03-07 13:39:14 +000032 };
33 keybindings = lib.mkOptionDefault {};
34 keycodebindings = {};
35 left = "h";
36 menu = "/usr/bin/env rofi -show combi";
37 modes = {
38 resize = {
39 Down = "resize grow height 10 px";
40 Escape = "mode default";
41 Left = "resize shrink width 10 px";
42 Return = "mode default";
43 Right = "resize grow width 10 px";
44 Up = "resize shrink height 10 px";
45 h = "resize shrink width 10 px";
46 j = "resize grow height 10 px";
47 k = "resize shrink height 10 px";
48 l = "resize grow width 10 px";
49 };
50 };
51 modifier = "Mod4";
52 output = {
53 HDMI-A-2 = {
54 resolution = "3840x2160";
55 position = "1920,0";
56 };
57 eDP-1 = {
58 resolution = "1920x1080";
59 position = "0,1522";
60 };
61 };
62 right = "l";
63 seat = {
64 "*" = {
65 hide_cursor = "when-typing enable";
66 };
67 };
68 startup = [];
69 terminal = "alacritty";
70 up = "k";
71 window = {};
72 workspaceAutoBackAndForth = true;
73 workspaceLayout = "default";
74 workspaceOutputAssign = [];
75 };
76
77 extraSessionCommands = ''
78 export SDL_VIDEODRIVER=wayland
79 # needs qt5.qtwayland in systemPackages
80 export QT_QPA_PLATFORM=wayland
81 export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
82 # Fix for some Java AWT applications (e.g. Android Studio),
83 # use this if they aren't displayed properly:
84 export _JAVA_AWT_WM_NONREPARENTING=1
85 '';
86
87 swaynag = {
Skyler Turner36510212022-03-07 23:13:14 +000088 enable = true;
89 settings = {
Skyler Turnerd0a8f5c2022-03-07 23:16:01 +000090 "<config>" = {
91 background = "#ffffff99";
92 border-bottom = "#00000000";
93 button-background = "#ffffffcc";
94 button-border-size = 0;
95 };
Skyler Turner36510212022-03-07 23:13:14 +000096 };
Skyler Turner07eb3d12022-03-06 21:08:29 +000097 };
Skyler Turnereda726a2022-03-07 00:23:17 +000098
99 systemdIntegration = true;
Skyler Turnerdb486c92022-03-06 10:48:24 +0000100 };
101
102 home.packages = with pkgs; [
103 swaylock
104 swayidle
105 wl-clipboard
Skyler Turner9dfac612022-03-06 10:48:57 +0000106 ];
Skyler Turnerdb486c92022-03-06 10:48:24 +0000107
Skyler Turnerd3b70682022-03-06 23:19:45 +0000108 programs.zsh.profileExtra = ''
109 if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
110 exec systemd-cat -t sway sway
111 fi
112 '';
Skyler Turnerdb486c92022-03-06 10:48:24 +0000113}