From 858809054260ad958567faceab04def31c4baa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 5 Apr 2022 11:10:55 +0200 Subject: [PATCH] fixup! :rocket: add barebones sway config --- modules/desktop/sway/default.nix | 62 ++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/modules/desktop/sway/default.nix b/modules/desktop/sway/default.nix index 9d0b951..4a56df6 100644 --- a/modules/desktop/sway/default.nix +++ b/modules/desktop/sway/default.nix @@ -8,15 +8,65 @@ in { enable = true; driSupport = true; }; + environment.loginShellInit = '' + if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then + exec sway + fi + ''; home-manager.users.moritz = { + home.packages = with pkgs; [ wl-clipboard wofi waybar feh ]; + programs.waybar = { + enable = true; + systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 30; + output = [ "eDP-1" "HDMI-A-1" ]; + modules-left = [ "sway/workspaces" "sway/mode" "wlr/taskbar" ]; + modules-center = [ "sway/window" "custom/hello-from-waybar" ]; + modules-right = + [ "mpd" "custom/mymodule#with-css-id" "temperature" ]; + "sway/workspaces" = { all-outputs = true; }; + }; + }; + }; wayland.windowManager.sway = { enable = true; - terminal = "kitty"; - menu = "wofi --show run"; - bars = [{ - fonts.size = 15.0; - positiom = "bottom"; - }]; + config = { + input = { + "*" = { xkb_layout = "de"; }; + "type:touchpad" = { + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; + terminal = "kitty"; + menu = "wofi --show drun"; + modifier = "Mod4"; + gaps = { + inner = 5; + outer = 3; + smartBorders = "on"; + }; + bars = [ ]; + keybindings = let + modifier = + config.home-manager.users.moritz.wayland.windowManager.sway.config.modifier; + in lib.mkOptionDefault { + "${modifier}+f" = "firefox"; + "${modifier}+e" = "emacsclient -c -a emacs"; + }; + startup = [ + { + command = "systemctl --user restart waybar"; + always = true; + } + { command = "synology-drive"; } + { command = "randomWallpaper"; } + ]; + }; }; }; };