2022-02-23 19:55:25 +00:00
|
|
|
{ pkgs, nixosConfig, lib, ... }:
|
2022-03-01 23:00:03 +00:00
|
|
|
let
|
2022-03-04 14:28:01 +00:00
|
|
|
lockCmd = "${pkgs.swaylock}/bin/swaylock -c 645394";
|
2022-03-01 23:00:03 +00:00
|
|
|
in
|
2022-02-07 00:09:06 +00:00
|
|
|
{
|
2022-02-23 22:42:42 +00:00
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
|
|
|
wrapperFeatures.gtk = true;
|
|
|
|
|
|
|
|
config = {
|
|
|
|
modifier = "Mod4";
|
|
|
|
focus.followMouse = false;
|
|
|
|
|
|
|
|
input = {
|
|
|
|
"type:keyboard" = { xkb_layout = "eu"; };
|
2022-03-21 16:46:45 +00:00
|
|
|
"type:mouse" = { pointer_accel = "-1"; };
|
2023-12-01 15:57:17 +00:00
|
|
|
"type:touchpad" = { tap = "enabled"; };
|
2022-03-02 14:28:37 +00:00
|
|
|
"1:1:AT_Translated_Set_2_keyboard" = {
|
2023-12-01 15:57:17 +00:00
|
|
|
# Remap borken ctrl key on internal keyboard for XPS
|
2022-03-02 14:28:37 +00:00
|
|
|
xkb_options = "caps:ctrl_modifier";
|
|
|
|
};
|
2022-02-23 22:42:42 +00:00
|
|
|
};
|
|
|
|
output = {
|
2023-12-01 15:57:17 +00:00
|
|
|
"*".bg = "/etc/nixos/wallpaper.jpg fill";
|
2022-03-01 20:13:08 +00:00
|
|
|
} // lib.optionalAttrs (nixosConfig.networking.hostName == "cray") {
|
2022-02-23 22:42:42 +00:00
|
|
|
"HDMI-A-1" = {
|
|
|
|
mode = "3840x2160";
|
|
|
|
scale = "1.3";
|
2022-04-19 19:44:46 +00:00
|
|
|
position = "0,0";
|
2022-02-07 00:09:06 +00:00
|
|
|
};
|
2022-07-13 21:28:48 +00:00
|
|
|
"DP-2" = {
|
2022-02-23 22:42:42 +00:00
|
|
|
mode = "3840x2160";
|
|
|
|
scale = "1.3";
|
2022-04-26 22:26:12 +00:00
|
|
|
position = "2953,0";
|
2022-02-07 00:09:06 +00:00
|
|
|
};
|
2022-02-23 22:42:42 +00:00
|
|
|
};
|
2022-02-23 19:55:25 +00:00
|
|
|
|
2022-02-23 22:42:42 +00:00
|
|
|
gaps = { inner = 8; };
|
|
|
|
window.border = 0;
|
|
|
|
workspaceAutoBackAndForth = true;
|
2023-01-20 10:47:20 +00:00
|
|
|
terminal = "foot";
|
2022-02-23 22:42:42 +00:00
|
|
|
|
|
|
|
bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
|
|
|
|
|
2022-03-02 14:28:37 +00:00
|
|
|
startup = [
|
|
|
|
{
|
|
|
|
command = ''${pkgs.swayidle}/bin/swayidle -w \
|
2022-03-04 14:28:01 +00:00
|
|
|
timeout 600 "${lockCmd}" \
|
|
|
|
timeout 900 "${pkgs.sway}/bin/swaymsg output * dpms off" \
|
2022-03-01 23:00:03 +00:00
|
|
|
resume "${pkgs.sway}/bin/swaymsg output * dpms on" \
|
2022-03-02 14:28:37 +00:00
|
|
|
before-sleep "${lockCmd}"'';
|
|
|
|
}
|
|
|
|
];
|
2022-03-01 23:00:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-23 22:42:42 +00:00
|
|
|
keybindings =
|
|
|
|
let
|
|
|
|
mod = "Mod4";
|
2022-06-15 13:18:16 +00:00
|
|
|
pactl = "${pkgs.pulseaudio}/bin/pactl";
|
2022-02-23 22:42:42 +00:00
|
|
|
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
|
|
|
in
|
|
|
|
{
|
2023-01-20 10:47:20 +00:00
|
|
|
"${mod}+Return" = "exec foot";
|
2023-07-19 20:40:24 +00:00
|
|
|
"${mod}+p" = "exec ${pkgs.wofi}/bin/wofi --show drun --gtk-dark";
|
2022-02-23 22:42:42 +00:00
|
|
|
|
|
|
|
"${mod}+Shift+c" = "reload";
|
|
|
|
"${mod}+Shift+q" = "kill";
|
|
|
|
"${mod}+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'";
|
|
|
|
"${mod}+x" = "move workspace to output right";
|
|
|
|
|
|
|
|
"${mod}+h" = "focus left";
|
|
|
|
"${mod}+j" = "focus down";
|
|
|
|
"${mod}+k" = "focus up";
|
|
|
|
"${mod}+l" = "focus right";
|
|
|
|
|
|
|
|
"${mod}+Shift+h" = "move left";
|
|
|
|
"${mod}+Shift+j" = "move down";
|
|
|
|
"${mod}+Shift+k" = "move up";
|
|
|
|
"${mod}+Shift+l" = "move right";
|
|
|
|
|
|
|
|
"${mod}+s" = "split v";
|
|
|
|
"${mod}+w" = "split h";
|
|
|
|
|
|
|
|
"${mod}+t" = "layout tabbed";
|
|
|
|
"${mod}+r" = "mode resize";
|
|
|
|
|
|
|
|
"${mod}+f" = "fullscreen toggle";
|
|
|
|
"${mod}+Shift+space" = "floating toggle";
|
|
|
|
|
|
|
|
"${mod}+1" = "workspace 1";
|
|
|
|
"${mod}+2" = "workspace 2";
|
|
|
|
"${mod}+3" = "workspace 3";
|
|
|
|
"${mod}+4" = "workspace 4";
|
|
|
|
"${mod}+5" = "workspace 5";
|
|
|
|
"${mod}+6" = "workspace 6";
|
|
|
|
"${mod}+7" = "workspace 7";
|
|
|
|
"${mod}+8" = "workspace 8";
|
|
|
|
"${mod}+9" = "workspace 9";
|
|
|
|
"${mod}+0" = "workspace 10";
|
|
|
|
|
|
|
|
"${mod}+Shift+1" = "move container to workspace 1";
|
|
|
|
"${mod}+Shift+2" = "move container to workspace 2";
|
|
|
|
"${mod}+Shift+3" = "move container to workspace 3";
|
|
|
|
"${mod}+Shift+4" = "move container to workspace 4";
|
|
|
|
"${mod}+Shift+5" = "move container to workspace 5";
|
|
|
|
"${mod}+Shift+6" = "move container to workspace 6";
|
|
|
|
"${mod}+Shift+7" = "move container to workspace 7";
|
|
|
|
"${mod}+Shift+8" = "move container to workspace 8";
|
|
|
|
"${mod}+Shift+9" = "move container to workspace 9";
|
|
|
|
"${mod}+Shift+0" = "move container to workspace 10";
|
|
|
|
|
|
|
|
## MacroPad
|
|
|
|
# Print, Pause, AudioRaiseVolume
|
|
|
|
"Print" = "exec grimshot save area";
|
|
|
|
"Pause" = "exec systemctl suspend";
|
|
|
|
"XF86AudioRaiseVolume" =
|
|
|
|
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
|
|
|
|
# Tools, AudioMute, AudioLowerVolume
|
2022-03-04 14:28:01 +00:00
|
|
|
"XF86Tools" = "exec ${lockCmd}";
|
2022-02-23 22:42:42 +00:00
|
|
|
"XF86AudioMute" =
|
|
|
|
"exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
|
|
|
|
"XF86AudioLowerVolume" =
|
|
|
|
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
|
|
|
|
|
|
|
|
# AudioPrev, AudioPlay, AudioNext
|
|
|
|
"XF86AudioNext" = "exec ${playerctl} next";
|
|
|
|
"XF86AudioPlay" = "exec ${playerctl} play-pause";
|
|
|
|
"XF86AudioPrev" = "exec ${playerctl} previous";
|
2022-03-01 23:00:53 +00:00
|
|
|
|
2022-09-13 09:17:43 +00:00
|
|
|
# Laptop Brightness controll
|
2022-03-01 23:00:53 +00:00
|
|
|
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +10%";
|
|
|
|
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 10%-";
|
2022-09-13 09:17:43 +00:00
|
|
|
|
|
|
|
# Lockscreen on laptop without macropad
|
|
|
|
"Control+Escape" = "exec ${lockCmd}";
|
|
|
|
|
2022-02-23 22:42:42 +00:00
|
|
|
};
|
2022-02-07 00:09:06 +00:00
|
|
|
|
|
|
|
};
|
2022-02-23 22:42:42 +00:00
|
|
|
};
|
2022-02-07 00:09:06 +00:00
|
|
|
|
2022-02-23 22:42:42 +00:00
|
|
|
}
|