Skyler Turner | 202e73d | 2022-03-09 00:23:39 +0000 | [diff] [blame] | 1 | { pkgs, lib, ... }: { |
Skyler Turner | db486c9 | 2022-03-06 10:48:24 +0000 | [diff] [blame] | 2 | wayland.windowManager.sway = { |
| 3 | enable = true; |
| 4 | wrapperFeatures.gtk = true; |
Skyler Turner | f2a8839 | 2022-03-06 21:08:15 +0000 | [diff] [blame] | 5 | |
Skyler Turner | bb530ed | 2022-03-15 14:04:39 +0000 | [diff] [blame^] | 6 | config = rec { |
Skyler Turner | f2a8839 | 2022-03-06 21:08:15 +0000 | [diff] [blame] | 7 | assigns = {}; |
| 8 | bars = []; |
| 9 | colors = {}; |
Skyler Turner | fe471d3 | 2022-03-07 13:16:17 +0000 | [diff] [blame] | 10 | defaultWorkspace = null; |
| 11 | down = "j"; |
| 12 | floating = {}; |
| 13 | focus = {}; |
| 14 | fonts = {}; |
| 15 | gaps = { |
Skyler Turner | 801a9a8 | 2022-03-07 13:40:41 +0000 | [diff] [blame] | 16 | inner = 10; |
Skyler Turner | 89be006 | 2022-03-07 21:37:09 +0000 | [diff] [blame] | 17 | top = -10; |
Skyler Turner | 1bd708a | 2022-03-07 13:44:27 +0000 | [diff] [blame] | 18 | outer = 0; |
Skyler Turner | a076a83 | 2022-03-09 09:42:54 +0000 | [diff] [blame] | 19 | smartGaps = false; |
Skyler Turner | fe471d3 | 2022-03-07 13:16:17 +0000 | [diff] [blame] | 20 | }; |
Skyler Turner | b1fef9e | 2022-03-07 13:39:14 +0000 | [diff] [blame] | 21 | input = { |
Skyler Turner | a9227fd | 2022-03-07 13:48:39 +0000 | [diff] [blame] | 22 | "type:touchpad" = { |
Skyler Turner | f277cf6 | 2022-03-07 13:49:14 +0000 | [diff] [blame] | 23 | dwt = "enabled"; |
| 24 | tap = "enabled"; |
| 25 | natural_scroll = "enabled"; |
Skyler Turner | 42bc366 | 2022-03-09 13:33:14 +0000 | [diff] [blame] | 26 | middle_emulation = "enabled"; |
Skyler Turner | a9227fd | 2022-03-07 13:48:39 +0000 | [diff] [blame] | 27 | events = "disabled_on_external_mouse"; |
| 28 | }; |
| 29 | "type:keyboard" = { |
| 30 | xkb_layout = "gb"; |
| 31 | }; |
Skyler Turner | b1fef9e | 2022-03-07 13:39:14 +0000 | [diff] [blame] | 32 | }; |
Skyler Turner | b8a6199 | 2022-03-15 10:32:51 +0000 | [diff] [blame] | 33 | keybindings = lib.mkOptionDefault { |
Skyler Turner | bb530ed | 2022-03-15 14:04:39 +0000 | [diff] [blame^] | 34 | "${modifier}+l" = "exec /usr/bin/env swaylock -c 000000"; |
| 35 | "XF86AudioRaiseVolume" = "exec volumectl -u up"; |
| 36 | "XF86AudioLowerVolume" = "exec volumectl -u down"; |
| 37 | "XF86AudioMute" = "exec volumectl toggle-mute"; |
| 38 | "XF86AudioMicMute" = "exec volumectl -m toggle-mute"; |
| 39 | "XF86MonBrightnessUp" = "exec lightctl up"; |
| 40 | "XF86MonBrightnessDown" = "exec lightctl down"; |
Skyler Turner | b8a6199 | 2022-03-15 10:32:51 +0000 | [diff] [blame] | 41 | }; |
Skyler Turner | b1fef9e | 2022-03-07 13:39:14 +0000 | [diff] [blame] | 42 | keycodebindings = {}; |
| 43 | left = "h"; |
| 44 | menu = "/usr/bin/env rofi -show combi"; |
| 45 | modes = { |
| 46 | resize = { |
| 47 | Down = "resize grow height 10 px"; |
| 48 | Escape = "mode default"; |
| 49 | Left = "resize shrink width 10 px"; |
| 50 | Return = "mode default"; |
| 51 | Right = "resize grow width 10 px"; |
| 52 | Up = "resize shrink height 10 px"; |
| 53 | h = "resize shrink width 10 px"; |
| 54 | j = "resize grow height 10 px"; |
| 55 | k = "resize shrink height 10 px"; |
| 56 | l = "resize grow width 10 px"; |
| 57 | }; |
| 58 | }; |
| 59 | modifier = "Mod4"; |
| 60 | output = { |
| 61 | HDMI-A-2 = { |
| 62 | resolution = "3840x2160"; |
| 63 | position = "1920,0"; |
| 64 | }; |
| 65 | eDP-1 = { |
| 66 | resolution = "1920x1080"; |
| 67 | position = "0,1522"; |
| 68 | }; |
Skyler Turner | c6af35b | 2022-03-09 00:16:45 +0000 | [diff] [blame] | 69 | "*" = { |
Skyler Turner | 202e73d | 2022-03-09 00:23:39 +0000 | [diff] [blame] | 70 | bg = "${./sway/background.png} fill"; |
Skyler Turner | c6af35b | 2022-03-09 00:16:45 +0000 | [diff] [blame] | 71 | }; |
Skyler Turner | b1fef9e | 2022-03-07 13:39:14 +0000 | [diff] [blame] | 72 | }; |
| 73 | right = "l"; |
| 74 | seat = { |
| 75 | "*" = { |
| 76 | hide_cursor = "when-typing enable"; |
| 77 | }; |
| 78 | }; |
| 79 | startup = []; |
| 80 | terminal = "alacritty"; |
| 81 | up = "k"; |
| 82 | window = {}; |
| 83 | workspaceAutoBackAndForth = true; |
| 84 | workspaceLayout = "default"; |
| 85 | workspaceOutputAssign = []; |
| 86 | }; |
| 87 | |
| 88 | extraSessionCommands = '' |
| 89 | export SDL_VIDEODRIVER=wayland |
| 90 | # needs qt5.qtwayland in systemPackages |
| 91 | export QT_QPA_PLATFORM=wayland |
| 92 | export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" |
| 93 | # Fix for some Java AWT applications (e.g. Android Studio), |
| 94 | # use this if they aren't displayed properly: |
| 95 | export _JAVA_AWT_WM_NONREPARENTING=1 |
| 96 | ''; |
| 97 | |
| 98 | swaynag = { |
Skyler Turner | 3651021 | 2022-03-07 23:13:14 +0000 | [diff] [blame] | 99 | enable = true; |
| 100 | settings = { |
Skyler Turner | d0a8f5c | 2022-03-07 23:16:01 +0000 | [diff] [blame] | 101 | "<config>" = { |
| 102 | background = "#ffffff99"; |
| 103 | border-bottom = "#00000000"; |
| 104 | button-background = "#ffffffcc"; |
Skyler Turner | 4ea6062 | 2022-03-07 23:24:22 +0000 | [diff] [blame] | 105 | button-padding = 10; |
Skyler Turner | d0a8f5c | 2022-03-07 23:16:01 +0000 | [diff] [blame] | 106 | button-border-size = 0; |
| 107 | }; |
Skyler Turner | 7b341db | 2022-03-07 23:17:23 +0000 | [diff] [blame] | 108 | |
| 109 | warning = { |
Skyler Turner | e957a37 | 2022-03-07 23:18:27 +0000 | [diff] [blame] | 110 | background = "#ffffff99"; |
Skyler Turner | 6222f75 | 2022-03-07 23:21:23 +0000 | [diff] [blame] | 111 | border-bottom = "#00000000"; |
Skyler Turner | f24ef5e | 2022-03-07 23:26:30 +0000 | [diff] [blame] | 112 | button-background = "#ffff00"; |
| 113 | }; |
| 114 | |
| 115 | error = { |
| 116 | background = "#ffffff99"; |
| 117 | border-bottom = "#00000000"; |
Skyler Turner | e609f0a | 2022-03-07 23:25:17 +0000 | [diff] [blame] | 118 | button-background = "#ff0000"; |
Skyler Turner | 7b341db | 2022-03-07 23:17:23 +0000 | [diff] [blame] | 119 | }; |
Skyler Turner | f24ef5e | 2022-03-07 23:26:30 +0000 | [diff] [blame] | 120 | |
| 121 | green = { |
| 122 | background = "#ffffff99"; |
| 123 | border-bottom = "#00000000"; |
Skyler Turner | c4d1c0b | 2022-03-07 23:28:58 +0000 | [diff] [blame] | 124 | button-background = "#00b300"; |
Skyler Turner | f24ef5e | 2022-03-07 23:26:30 +0000 | [diff] [blame] | 125 | }; |
| 126 | |
| 127 | blue = { |
| 128 | background = "#ffffff99"; |
| 129 | border-bottom = "#00000000"; |
Skyler Turner | c4d1c0b | 2022-03-07 23:28:58 +0000 | [diff] [blame] | 130 | button-background = "#0000ff"; |
Skyler Turner | f24ef5e | 2022-03-07 23:26:30 +0000 | [diff] [blame] | 131 | }; |
Skyler Turner | 3651021 | 2022-03-07 23:13:14 +0000 | [diff] [blame] | 132 | }; |
Skyler Turner | 07eb3d1 | 2022-03-06 21:08:29 +0000 | [diff] [blame] | 133 | }; |
Skyler Turner | eda726a | 2022-03-07 00:23:17 +0000 | [diff] [blame] | 134 | |
| 135 | systemdIntegration = true; |
Skyler Turner | db486c9 | 2022-03-06 10:48:24 +0000 | [diff] [blame] | 136 | }; |
| 137 | |
| 138 | home.packages = with pkgs; [ |
| 139 | swaylock |
| 140 | swayidle |
| 141 | wl-clipboard |
Skyler Turner | bb530ed | 2022-03-15 14:04:39 +0000 | [diff] [blame^] | 142 | avizo |
| 143 | pamixer |
| 144 | brightnessctl |
Skyler Turner | 9dfac61 | 2022-03-06 10:48:57 +0000 | [diff] [blame] | 145 | ]; |
Skyler Turner | db486c9 | 2022-03-06 10:48:24 +0000 | [diff] [blame] | 146 | |
Skyler Turner | d3b7068 | 2022-03-06 23:19:45 +0000 | [diff] [blame] | 147 | programs.zsh.profileExtra = '' |
| 148 | if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then |
| 149 | exec systemd-cat -t sway sway |
| 150 | fi |
| 151 | ''; |
Skyler Turner | bb530ed | 2022-03-15 14:04:39 +0000 | [diff] [blame^] | 152 | |
| 153 | systemd.user.services.avizo = { |
| 154 | Install.WantedBy = "graphical-session.target"; |
| 155 | Service = { |
| 156 | ExecReload = "kill -SIGUSR2 \$MAINPID"; |
| 157 | ExecStart = "${pkgs.avizo}/bin/avizo-service"; |
| 158 | KillMode = "mixed"; |
| 159 | Restart = "on-failure"; |
| 160 | }; |
| 161 | Unit = { |
| 162 | After = "graphical-session.target"; |
| 163 | Description = "Notification daemon to show volume & brightness changes"; |
| 164 | Documentation = "N/A (src/apps/personal/sway.nix)"; |
| 165 | PartOf= "graphical-session.target"; |
| 166 | }; |
| 167 | }; |
Skyler Turner | c6af35b | 2022-03-09 00:16:45 +0000 | [diff] [blame] | 168 | } |
Skyler Turner | bb530ed | 2022-03-15 14:04:39 +0000 | [diff] [blame^] | 169 | |