_inputs: { config, lib, pkgs, ... }: { reborn = { greetd.enable = true; swaylock.enable = true; swaync.enable = true; waybar.enable = true; wlsunset.enable = true; }; home-manager.users.minijackson = { config, osConfig, ... }: { wayland.windowManager.sway = { enable = true; extraSessionCommands = let schema = pkgs.gsettings-desktop-schemas; datadir = "${schema}/share/gsettings-schemas/${schema.name}"; in '' # https://github.com/emersion/xdg-desktop-portal-wlr/issues/20 export XDG_CURRENT_DESKTOP=sway # https://github.com/emersion/xdg-desktop-portal-wlr/pull/11 export XDG_SESSION_TYPE=wayland # Makes gsettings work export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS export SDL_VIDEODRIVER=wayland export QT_QPA_PLATFORM=wayland export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 ''; wrapperFeatures.gtk = true; config = { workspaceLayout = "tabbed"; # Using waybar bars = [ ]; colors = with osConfig.theme.colors; { focused = { border = lightBackground; background = lightBackground; text = foreground; indicator = dominant; childBorder = dominant; }; focusedInactive = { border = background; background = background; text = dimForeground; indicator = dominant; childBorder = background; }; unfocused = { border = background; background = background; text = dimForeground; indicator = dominant; childBorder = background; }; urgent = { border = brightRed; background = brightRed; text = foreground; indicator = brightRed; childBorder = brightRed; }; placeholder = { border = background0; background = background0; text = foreground; indicator = background0; childBorder = background0; }; }; floating.criteria = [ { title = "Steam - News"; } ]; input = { "*" = { xkb_options = "compose:caps"; }; "1:1:AT_Translated_Set_2_keyboard" = { xkb_layout = "fr"; xkb_variant = "oss"; xkb_options = "compose:caps"; xkb_numlock = "enabled"; }; "1452:514:Alps_Electric_M2452" = { xkb_layout = "fr"; xkb_variant = "oss"; xkb_options = "compose:caps,lv3:rwin_switch"; xkb_numlock = "enabled"; }; "7764:8240:TypeMatrix.com_USB_Keyboard" = { xkb_layout = "us"; xkb_variant = "dvorak"; xkb_options = "eurosign:e,compose:caps"; xkb_numlock = "enabled"; }; "1133:49948:Logitech_USB_Keyboard" = { xkb_layout = "fr"; xkb_variant = "oss"; xkb_options = "eurosign:e,compose:caps"; xkb_numlock = "enabled"; }; "1102:4639:DELL0817:00_044E:121F_Mouse" = { scroll_method = "on_button_down"; scroll_button = "button2"; }; }; keybindings = let modifier = config.wayland.windowManager.sway.config.modifier; inherit (lib) getExe; inherit (pkgs) brightnessctl grim pamixer slurp ; in lib.mkOptionDefault { "${modifier}+ampersand" = "workspace 1"; "${modifier}+eacute" = "workspace 2"; "${modifier}+quotedbl" = "workspace 3"; "${modifier}+apostrophe" = "workspace 4"; "${modifier}+parenleft" = "workspace 5"; "${modifier}+minus" = "workspace 6"; "${modifier}+egrave" = "workspace 7"; "${modifier}+underscore" = "workspace 8"; "${modifier}+ccedilla" = "workspace 9"; "${modifier}+agrave" = "workspace 10"; "${modifier}+Shift+ampersand" = "move container to workspace 1"; "${modifier}+Shift+eacute" = "move container to workspace 2"; "${modifier}+Shift+quotedbl" = "move container to workspace 3"; "${modifier}+Shift+apostrophe" = "move container to workspace 4"; "${modifier}+Shift+parenleft" = "move container to workspace 5"; "${modifier}+Shift+minus" = "move container to workspace 6"; "${modifier}+Shift+egrave" = "move container to workspace 7"; "${modifier}+Shift+underscore" = "move container to workspace 8"; "${modifier}+Shift+ccedilla" = "move container to workspace 9"; "${modifier}+Shift+agrave" = "move container to workspace 10"; "${modifier}+Ctrl+h" = "move workspace to output left"; "${modifier}+Ctrl+j" = "move workspace to output down"; "${modifier}+Ctrl+k" = "move workspace to output up"; "${modifier}+Ctrl+l" = "move workspace to output right"; "${modifier}+Ctrl+Left" = "move workspace to output left"; "${modifier}+Ctrl+Down" = "move workspace to output down"; "${modifier}+Ctrl+Up" = "move workspace to output up"; "${modifier}+Ctrl+Right" = "move workspace to output right"; "${modifier}+n" = "split none"; "${modifier}+comma" = "exec swaync-client --close-latest"; "${modifier}+Shift+comma" = "exec swaync-client --close-all"; "${modifier}+period" = "exec swaync-client --toggle-panel"; "${modifier}+m" = "exec ${pkgs.swaylock}/bin/swaylock"; "${modifier}+c" = "exec rofi -show calc -modi calc -no-sort -no-persist-history -calc-command 'echo -n {result} | wl-copy'"; "${modifier}+p" = "exec rofi-pass"; "XF86AudioRaiseVolume" = "exec ${getExe pamixer} -i 5"; "XF86AudioLowerVolume" = "exec ${getExe pamixer} -d 5"; "XF86AudioMute" = "exec ${getExe pamixer} -t"; "XF86MonBrightnessUp" = "exec ${getExe brightnessctl} set -- +10%"; "XF86MonBrightnessDown" = "exec ${getExe brightnessctl} set -- -10%"; "Print" = "exec ${getExe grim}"; "Shift+Print" = "exec ${getExe slurp} | ${getExe grim} -g -"; }; menu = '' rofi -show drun -terminal alacritty -modi "drun,run,emoji,keys" ''; modifier = "Mod4"; output."*".bg = "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill"; startup = [ { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } ]; terminal = "${pkgs.alacritty}/bin/alacritty"; window = { border = 2; hideEdgeBorders = "smart"; }; }; }; xsession.importedVariables = [ "DBUS_SESSION_BUS_ADDRESS" "DISPLAY" "SSH_AUTH_SOCK" "XAUTHORITY" "XDG_DATA_DIRS" "XDG_RUNTIME_DIR" "XDG_SESSION_ID" "WAYLAND_DISPLAY" "SWAYSOCK" "I3SOCK" "XDG_CURRENT_DESKTOP" "XDG_SESSION_TYPE" ]; }; # TODO: polkit gnome environment.systemPackages = with pkgs; [ grim qt5.qtwayland slurp wl-clipboard ]; programs.xwayland.enable = true; xdg.portal = { wlr = { enable = true; settings.screencast = let swaync-client = "${lib.getBin config.home-manager.users.minijackson.services.swaync.package}/bin/swaync-client"; in { exec_before = "${swaync-client} --inhibitor-add xdg-desktop-portal-wlr"; exec_after = "${swaync-client} --inhibitor-remove xdg-desktop-portal-wlr"; }; }; config.sway.default = [ "wlr" "gtk" ]; }; }