_inputs: { lib, pkgs, ... }: { services.greetd = { enable = true; settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway"; }; 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}+comma" = "exec makoctl dismiss"; "${modifier}+Shift+comma" = "exec makoctl dismiss --all"; "${modifier}+period" = "exec makoctl menu rofi -dmenu -no-custom"; "${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 = [ # TODO: use systemd user service { command = "mako"; always = true; } {command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";} ]; terminal = "${pkgs.alacritty}/bin/alacritty"; window = { border = 2; hideEdgeBorders = "smart"; }; }; }; services.mako = with osConfig.theme.colors; { enable = true; backgroundColor = background0; borderColor = dimDominant; borderSize = 2; progressColor = neutralBlue; textColor = foreground; margin = "15"; padding = "7"; groupBy = "app-name"; extraConfig = '' [mode=do-not-disturb] invisible=1 ''; }; services.wlsunset = { enable = true; latitude = "48.864716"; longitude = "2.349014"; # Reduce blue light anyways temperature = { day = 4000; night = 2500; }; }; programs.swaylock = { enable = true; settings = with osConfig.theme.colors; { ignore-empty-password = true; show-failed-attempts = true; image = "${../../../res/wallpapers/wallpaper-1920x1080-install-gentoo.png}"; font = "monospace"; inside-color = "${lib.removePrefix "#" dominant}dd"; inside-clear-color = "${lib.removePrefix "#" neutralOrange}dd"; inside-ver-color = "${lib.removePrefix "#" neutralOrange}dd"; inside-wrong-color = "${lib.removePrefix "#" neutralRed}dd"; key-hl-color = "${lib.removePrefix "#" brightGreen}ee"; bs-hl-color = "${lib.removePrefix "#" neutralRed}ee"; line-color = "${lib.removePrefix "#" background}ee"; line-clear-color = "${lib.removePrefix "#" background}ee"; line-ver-color = "${lib.removePrefix "#" background}ee"; line-wrong-color = "${lib.removePrefix "#" background}ee"; ring-color = "${lib.removePrefix "#" dominant}ee"; ring-clear-color = "${lib.removePrefix "#" brightOrange}ee"; ring-ver-color = "${lib.removePrefix "#" brightOrange}ee"; ring-wrong-color = "${lib.removePrefix "#" brightRed}ee"; separator-color = "${lib.removePrefix "#" background}ee"; text-color = "${lib.removePrefix "#" background}ff"; text-clear-color = "${lib.removePrefix "#" background}ff"; text-ver-color = "${lib.removePrefix "#" background}ff"; text-wrong-color = "${lib.removePrefix "#" background}ff"; indicator-radius = 75; indicator-thickness = 10; }; }; 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; security.pam.services.swaylock = {}; xdg.portal = { wlr.enable = true; config.sway.default = ["wlr" "gtk"]; }; }