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