2024-05-04 16:37:52 +00:00
|
|
|
{ config, pkgs, ... }: {
|
2024-05-05 08:27:01 +00:00
|
|
|
|
|
|
|
imports = [
|
|
|
|
./mako.nix
|
|
|
|
./wofi.nix
|
|
|
|
];
|
|
|
|
|
2024-05-04 16:37:52 +00:00
|
|
|
hardware.opengl.enable = true;
|
|
|
|
|
|
|
|
programs.sway.enable = true;
|
|
|
|
programs.light.enable = true;
|
|
|
|
|
|
|
|
users.users.sammy.packages = with pkgs; [
|
|
|
|
qt5.qtwayland
|
|
|
|
wdisplays
|
|
|
|
waypipe
|
|
|
|
wl-clipboard
|
2024-05-22 11:02:07 +00:00
|
|
|
xfce.thunar
|
2024-05-04 16:37:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
environment.variables.SDL_VIDEODRIVER = "wayland";
|
|
|
|
environment.variables.QT_QPA_PLATFORM = "wayland";
|
|
|
|
environment.variables.QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
|
|
|
environment.variables._JAVA_AWT_WM_NONREPARENTING = "1";
|
|
|
|
environment.variables.NIXOS_OZONE_WL = "1";
|
|
|
|
|
|
|
|
xdg.portal.enable = true;
|
|
|
|
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
|
|
|
|
|
|
|
|
security.pam.services.swaylock.rules.auth.fprintd = {
|
|
|
|
order = config.security.pam.services.swaylock.rules.auth.unix.order + 10;
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.sammy = {
|
|
|
|
services.swayidle =
|
|
|
|
let
|
|
|
|
lockCommand = "${pkgs.writeShellScript "swaylock-command" ''
|
2024-05-05 08:56:59 +00:00
|
|
|
${pkgs.grim}/bin/grim -t png -l 1 /tmp/lock-screenshot.png
|
|
|
|
${pkgs.imagemagick}/bin/magick /tmp/lock-screenshot.png -blur 80x40 /tmp/lock-screenshot.png
|
|
|
|
${pkgs.swaylock}/bin/swaylock -i /tmp/lock-screenshot.png -efFl
|
2024-05-04 16:37:52 +00:00
|
|
|
''}";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
events = [
|
|
|
|
{ event = "before-sleep"; command = lockCommand; }
|
|
|
|
{ event = "lock"; command = lockCommand; }
|
|
|
|
];
|
|
|
|
timeouts = [
|
2024-06-17 07:39:15 +00:00
|
|
|
{ timeout = 900; command = lockCommand; }
|
2024-05-15 11:22:46 +00:00
|
|
|
{ timeout = 1800; command = "systemctl hybrid-sleep"; }
|
2024-05-04 16:37:52 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
wayland.windowManager.sway =
|
|
|
|
let
|
|
|
|
cfg = config.home-manager.users.sammy.wayland.windowManager.sway;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
wrapperFeatures.gtk = true;
|
|
|
|
|
|
|
|
config = {
|
|
|
|
fonts = {
|
|
|
|
names = [ "JetBrains Mono" ];
|
2024-05-05 08:56:59 +00:00
|
|
|
size = 9.0;
|
2024-05-04 16:37:52 +00:00
|
|
|
};
|
|
|
|
terminal = "foot";
|
|
|
|
menu = "wofi --show drun";
|
|
|
|
|
|
|
|
window = {
|
|
|
|
border = 0;
|
|
|
|
hideEdgeBorders = "both";
|
|
|
|
};
|
|
|
|
gaps.inner = 10;
|
2024-05-15 11:22:46 +00:00
|
|
|
gaps.smartGaps = true;
|
2024-05-04 16:37:52 +00:00
|
|
|
|
|
|
|
output = {
|
2024-05-15 11:22:46 +00:00
|
|
|
"eDP-1" = {
|
|
|
|
position = "0 1080";
|
|
|
|
};
|
|
|
|
"DP-6" = {
|
|
|
|
position = "0 0";
|
|
|
|
};
|
2024-05-04 16:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
input = {
|
|
|
|
"*" = {
|
2024-06-19 09:07:57 +00:00
|
|
|
xkb_layout = "us,de";
|
|
|
|
xkb_options = "caps:escape,grp:rctrl_toggle";
|
2024-05-04 16:37:52 +00:00
|
|
|
};
|
|
|
|
"type:touchpad" = {
|
|
|
|
tap = "enabled";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-05 08:27:01 +00:00
|
|
|
bars = [{
|
|
|
|
mode = "dock";
|
|
|
|
hiddenState = "hide";
|
|
|
|
position = "bottom";
|
|
|
|
workspaceButtons = true;
|
|
|
|
workspaceNumbers = true;
|
|
|
|
statusCommand = "${pkgs.i3status}/bin/i3status";
|
|
|
|
fonts = {
|
|
|
|
names = [ "JetBrains Mono" ];
|
|
|
|
size = 10.0;
|
|
|
|
};
|
|
|
|
trayOutput = "primary";
|
|
|
|
colors = {
|
|
|
|
background = "#000000";
|
|
|
|
statusline = "#ffffff";
|
|
|
|
separator = "#666666";
|
|
|
|
focusedWorkspace = {
|
|
|
|
border = "#4c7899";
|
|
|
|
background = "#285577";
|
|
|
|
text = "#ffffff";
|
|
|
|
};
|
|
|
|
activeWorkspace = {
|
|
|
|
border = "#333333";
|
|
|
|
background = "#5f676a";
|
|
|
|
text = "#ffffff";
|
|
|
|
};
|
|
|
|
inactiveWorkspace = {
|
|
|
|
border = "#333333";
|
|
|
|
background = "#222222";
|
|
|
|
text = "#888888";
|
|
|
|
};
|
|
|
|
urgentWorkspace = {
|
|
|
|
border = "#2f343a";
|
|
|
|
background = "#900000";
|
|
|
|
text = "#ffffff";
|
|
|
|
};
|
|
|
|
bindingMode = {
|
|
|
|
border = "#2f343a";
|
|
|
|
background = "#900000";
|
|
|
|
text = "#ffffff";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}];
|
|
|
|
|
2024-05-05 08:56:59 +00:00
|
|
|
modifier = "Mod4";
|
2024-05-04 16:37:52 +00:00
|
|
|
keybindings = {
|
2024-05-05 08:56:59 +00:00
|
|
|
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
|
|
|
|
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+l" = "exec loginctl lock-session";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+Shift+e" =
|
|
|
|
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
|
|
|
"${cfg.config.modifier}+Shift+q" = "kill";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+Shift+s" = "exec ${pkgs.grim}/bin/grim -t png -l 1 -g \"$(${pkgs.slurp}/bin/slurp)\" ~/Pictures/screenshot-$(date +%Y-%m-%d_%H-%m-%s).png";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+Left" = "focus left";
|
|
|
|
"${cfg.config.modifier}+Down" = "focus down";
|
|
|
|
"${cfg.config.modifier}+Up" = "focus up";
|
|
|
|
"${cfg.config.modifier}+Right" = "focus right";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+Shift+Left" = "move left";
|
|
|
|
"${cfg.config.modifier}+Shift+Down" = "move down";
|
|
|
|
"${cfg.config.modifier}+Shift+Up" = "move up";
|
|
|
|
"${cfg.config.modifier}+Shift+Right" = "move right";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+b" = "split h";
|
|
|
|
"${cfg.config.modifier}+v" = "split v";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+s" = "layout stacking";
|
|
|
|
"${cfg.config.modifier}+w" = "layout tabbed";
|
|
|
|
"${cfg.config.modifier}+e" = "layout toggle split";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+Shift+space" = "floating toggle";
|
|
|
|
"${cfg.config.modifier}+space" = "focus mode_toggle";
|
|
|
|
"${cfg.config.modifier}+a" = "focus parent";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+f" = "fullscreen toggle";
|
|
|
|
|
|
|
|
"${cfg.config.modifier}+1" = "workspace 1";
|
|
|
|
"${cfg.config.modifier}+2" = "workspace 2";
|
|
|
|
"${cfg.config.modifier}+3" = "workspace 3";
|
|
|
|
"${cfg.config.modifier}+4" = "workspace 4";
|
|
|
|
"${cfg.config.modifier}+5" = "workspace 5";
|
|
|
|
"${cfg.config.modifier}+6" = "workspace 6";
|
|
|
|
"${cfg.config.modifier}+7" = "workspace 7";
|
|
|
|
"${cfg.config.modifier}+8" = "workspace 8";
|
|
|
|
"${cfg.config.modifier}+9" = "workspace 9";
|
|
|
|
"${cfg.config.modifier}+0" = "workspace 10";
|
|
|
|
|
2024-05-15 11:22:46 +00:00
|
|
|
"${cfg.config.modifier}+Alt+Right" = "workspace next";
|
|
|
|
"${cfg.config.modifier}+Alt+Left" = "workspace prev";
|
|
|
|
"${cfg.config.modifier}+Alt+Up" = "move workspace to output up";
|
|
|
|
"${cfg.config.modifier}+Alt+Down" = "move workspace to output down";
|
|
|
|
|
2024-05-05 08:56:59 +00:00
|
|
|
"${cfg.config.modifier}+Shift+1" = "move container to workspace 1";
|
|
|
|
"${cfg.config.modifier}+Shift+2" = "move container to workspace 2";
|
|
|
|
"${cfg.config.modifier}+Shift+3" = "move container to workspace 3";
|
|
|
|
"${cfg.config.modifier}+Shift+4" = "move container to workspace 4";
|
|
|
|
"${cfg.config.modifier}+Shift+5" = "move container to workspace 5";
|
|
|
|
"${cfg.config.modifier}+Shift+6" = "move container to workspace 6";
|
|
|
|
"${cfg.config.modifier}+Shift+7" = "move container to workspace 7";
|
|
|
|
"${cfg.config.modifier}+Shift+8" = "move container to workspace 8";
|
|
|
|
"${cfg.config.modifier}+Shift+9" = "move container to workspace 9";
|
|
|
|
"${cfg.config.modifier}+Shift+0" = "move container to workspace 10";
|
2024-05-04 16:37:52 +00:00
|
|
|
|
2024-05-15 11:22:46 +00:00
|
|
|
"${cfg.config.modifier}+Alt+N" = "move container to workspace next";
|
|
|
|
"${cfg.config.modifier}+Alt+P" = "move container to workspace prev";
|
|
|
|
|
2024-05-04 16:37:52 +00:00
|
|
|
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5";
|
|
|
|
"XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5";
|
|
|
|
"XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t";
|
|
|
|
"XF86AudioMicMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer --default-source -t";
|
|
|
|
"XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
|
|
|
|
"XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
|
|
|
|
|
2024-05-05 08:56:59 +00:00
|
|
|
"${cfg.config.modifier}+r" = "mode resize";
|
2024-05-04 16:37:52 +00:00
|
|
|
};
|
2024-05-15 11:22:46 +00:00
|
|
|
|
|
|
|
startup = [{
|
|
|
|
command = "systemctl --user restart nextcloud-client";
|
|
|
|
always = true;
|
|
|
|
}];
|
|
|
|
|
2024-05-04 16:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
client.focused #00000000 #000000cc #FFFFFF
|
|
|
|
client.unfocused #00000000 #00000070 #FFFFFF
|
|
|
|
client.focused_inactive #00000000 #00000090 #FFFFFF
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|