nix/common/home-manager/wayland.nix

89 lines
4.2 KiB
Nix
Raw Normal View History

{ pkgs, lib, ... }:
{
wayland.windowManager.sway = {
enable = true;
config = let
scintillaDellOutput = { pos = "0 0"; };
scintillaHpOutput = { pos = "0 120"; };
in rec {
modifier = "Mod4";
terminal = "foot";
fonts = {
names = [ "Ubuntu" ];
style = "Regular";
size = 11.0;
};
input = {
"type:touchpad" = {
natural_scroll = "enabled";
dwt = "disabled";
click_method = "clickfinger";
scroll_factor = "0.25";
};
"type:keyboard" = {
xkb_layout = "us,kr";
xkb_options = "grp:alt_caps_toggle";
};
"type:mouse" = {
accel_profile = "flat";
};
};
output = {
"*" = {
bg = "~/Pictures/berg.jpg fill";
subpixel = "none";
};
"BOE 0x095F Unknown" = { pos = "92 1200"; scale = "1.3"; }; # framework
"Dell Inc. DELL U2410 F525M13318GL" = scintillaDellOutput; # bibi
"Dell Inc. DELL U2410 F525M12P08RL" = scintillaDellOutput; # fabienne
"Hewlett Packard HP E222 CNK6110ZM2" = scintillaHpOutput; # floortje
"Hewlett Packard HP E222 CNK6110ZM7" = scintillaHpOutput;
"Hewlett Packard HP E222 CNK6110ZMF" = scintillaHpOutput; # tamara
"Hewlett Packard HP E222 CNK6110ZMQ" = scintillaHpOutput; # patricia
"Hewlett Packard HP E222 CNK6110ZR8" = scintillaHpOutput; # megan
"Hewlett Packard HP E222 CNK611103Z" = scintillaHpOutput; # katy
"Hewlett Packard HP E222 CNK611104P" = scintillaHpOutput; # charissa
"Hewlett Packard HP E222 CNK611104X" = scintillaHpOutput;
"Hewlett Packard HP E222 CNK6111051" = scintillaHpOutput; # kim
"Hewlett Packard HP E222 CNK6111052" = scintillaHpOutput; # ilona
"Goldstar Company Ltd LG Ultra HD 0x00008520" = { mode = "2560x1440@60Hz"; }; # thuis rechts
"Dell Inc. DELL S2722DGM 3P84Z83" = { pos = "-228 -240"; mode = "2560x1440@144Hz"; }; # thuis links (hdmi)
};
keybindings = lib.mkOptionDefault {
XF86MonBrightnessDown = "exec ${pkgs.light}/bin/light -U 5";
XF86MonBrightnessUp = "exec ${pkgs.light}/bin/light -A 5";
"shift+XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 1";
"shift+XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 1";
XF86AudioRaiseVolume = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%'";
XF86AudioLowerVolume = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%'";
XF86AudioMute = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle'";
Print = "exec '${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | wl-copy -t image/png'";
"shift+Print" = "exec '${pkgs.grim}/bin/grim - | wl-copy -t image/png'";
"${modifier}+d" = "exec '${pkgs.rofi-wayland}/bin/rofi -show drun'";
"${modifier}+shift+b" = "exec '/etc/nixos/framework/dmenu-bluetooth --connected-icon'";
"${modifier}+alt+l" = "exec '${pkgs.swaylock}/bin/swaylock -c 000000 -i eDP-1:Pictures/vista32.jpg'";
"${modifier}+ctrl+Return" = "exec '${pkgs.gnome.nautilus}/bin/nautilus'";
"${modifier}+ctrl+Down" = "move workspace to down";
"${modifier}+ctrl+Up" = "move workspace to up";
"${modifier}+ctrl+Left" = "move workspace to left";
"${modifier}+ctrl+Right" = "move workspace to right";
"${modifier}+ctrl+j" = "move workspace to down";
"${modifier}+ctrl+k" = "move workspace to up";
"${modifier}+ctrl+h" = "move workspace to left";
"${modifier}+ctrl+l" = "move workspace to right";
"${modifier}+ctrl+f" = "exec '${pkgs.python3}/bin/python /etc/nixos/common/sway/next_free.py | xargs swaymsg -- workspace number'";
"${modifier}+comma" = "workspace prev_on_output";
"${modifier}+period" = "workspace next_on_output";
};
startup = [
{ command = "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"; }
];
};
};
}