blob: 7cced2d0bc651db8a4535d4da01204f01ea914b0 [file] [log] [blame]
Skyler Turner202e73d2022-03-09 00:23:39 +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 Turnera076a832022-03-09 09:42:54 +000019 smartGaps = false;
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 Turner42bc3662022-03-09 13:33:14 +000026 middle_emulation = "enabled";
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 };
Skyler Turnerc6af35b2022-03-09 00:16:45 +000061 "*" = {
Skyler Turner202e73d2022-03-09 00:23:39 +000062 bg = "${./sway/background.png} fill";
Skyler Turnerc6af35b2022-03-09 00:16:45 +000063 };
Skyler Turnerb1fef9e2022-03-07 13:39:14 +000064 };
65 right = "l";
66 seat = {
67 "*" = {
68 hide_cursor = "when-typing enable";
69 };
70 };
71 startup = [];
72 terminal = "alacritty";
73 up = "k";
74 window = {};
75 workspaceAutoBackAndForth = true;
76 workspaceLayout = "default";
77 workspaceOutputAssign = [];
78 };
79
80 extraSessionCommands = ''
81 export SDL_VIDEODRIVER=wayland
82 # needs qt5.qtwayland in systemPackages
83 export QT_QPA_PLATFORM=wayland
84 export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
85 # Fix for some Java AWT applications (e.g. Android Studio),
86 # use this if they aren't displayed properly:
87 export _JAVA_AWT_WM_NONREPARENTING=1
88 '';
89
90 swaynag = {
Skyler Turner36510212022-03-07 23:13:14 +000091 enable = true;
92 settings = {
Skyler Turnerd0a8f5c2022-03-07 23:16:01 +000093 "<config>" = {
94 background = "#ffffff99";
95 border-bottom = "#00000000";
96 button-background = "#ffffffcc";
Skyler Turner4ea60622022-03-07 23:24:22 +000097 button-padding = 10;
Skyler Turnerd0a8f5c2022-03-07 23:16:01 +000098 button-border-size = 0;
99 };
Skyler Turner7b341db2022-03-07 23:17:23 +0000100
101 warning = {
Skyler Turnere957a372022-03-07 23:18:27 +0000102 background = "#ffffff99";
Skyler Turner6222f752022-03-07 23:21:23 +0000103 border-bottom = "#00000000";
Skyler Turnerf24ef5e2022-03-07 23:26:30 +0000104 button-background = "#ffff00";
105 };
106
107 error = {
108 background = "#ffffff99";
109 border-bottom = "#00000000";
Skyler Turnere609f0a2022-03-07 23:25:17 +0000110 button-background = "#ff0000";
Skyler Turner7b341db2022-03-07 23:17:23 +0000111 };
Skyler Turnerf24ef5e2022-03-07 23:26:30 +0000112
113 green = {
114 background = "#ffffff99";
115 border-bottom = "#00000000";
Skyler Turnerc4d1c0b2022-03-07 23:28:58 +0000116 button-background = "#00b300";
Skyler Turnerf24ef5e2022-03-07 23:26:30 +0000117 };
118
119 blue = {
120 background = "#ffffff99";
121 border-bottom = "#00000000";
Skyler Turnerc4d1c0b2022-03-07 23:28:58 +0000122 button-background = "#0000ff";
Skyler Turnerf24ef5e2022-03-07 23:26:30 +0000123 };
Skyler Turner36510212022-03-07 23:13:14 +0000124 };
Skyler Turner07eb3d12022-03-06 21:08:29 +0000125 };
Skyler Turnereda726a2022-03-07 00:23:17 +0000126
127 systemdIntegration = true;
Skyler Turnerdb486c92022-03-06 10:48:24 +0000128 };
129
130 home.packages = with pkgs; [
131 swaylock
132 swayidle
133 wl-clipboard
Skyler Turner9dfac612022-03-06 10:48:57 +0000134 ];
Skyler Turnerdb486c92022-03-06 10:48:24 +0000135
Skyler Turnerd3b70682022-03-06 23:19:45 +0000136 programs.zsh.profileExtra = ''
137 if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
138 exec systemd-cat -t sway sway
139 fi
140 '';
Skyler Turnerc6af35b2022-03-09 00:16:45 +0000141}