nixos-config/modules/programs/sway/default.nix

63 lines
1.8 KiB
Nix
Raw Normal View History

{
config
2021-09-07 13:41:08 +00:00
, lib, writeScript
, stdenv
, sway, mako, bemenu
}:
2021-09-07 13:41:08 +00:00
let
passwordDmenu = writeShellScript "password_menu" ''
#!${stdenv.shell}
password=$(gopass list --flat | bmenu)
gopass show -c "$password
'';
in {
environment.systemPackages = [ sway ];
home-manager.users."${config.system.singleUser}" = {
wayland.windowManager.sway = {
enable = true;
config = rec {
startup = [
{ command = "${mako}/bin/mako --default-timeout=3000"; }
];
modifier = "Mod1";
gaps = {
inner = 5;
outer = 7;
};
input = {
* = { xkb_layout = "de"; };
"2:7:SynPS/2_Synaptics_TouchPad" = {
tap = "enabled";
natural_scroll = "disabled";
dwt = "enabled";
};
"2:10:TPPS/2_Elan_TrackPoint" = { dwt = "enabled"; };
};
output = {
* = { adaptive_sync = "on"; };;
};
keybindings = lib.mkOptionDefault let
speakers = "alsa_output.pci-0000_00_1f.3.analog-stereo";
in {
"${modifier}+Return" = "exec alacritty";
"${modifier}+e" = "exec emacs";
"${modifier}+Shift+q" = "kill";
"${modifer}+f" = "exec firefox";
2021-09-07 13:41:08 +00:00
"${modifier}+d" = "exec ${bemenu}/bin/bemenu-run";
"${modifier}+p" = "exec ${passwordDmenu}";
"Mod4+s" = "exec systemctl suspend";
# TODO: Screenlock
#"Mod4+l" = "exec ..."
"F1" = "exec pactl set-sink-volume ${speakers} toggle";
"F2" = "exec pactl set-sink-volume ${speakers} -10%";
"F3" = "exec pactl set-sink-volume ${speakers} +10%";
"F5" = "exec brightnessctl --device=intel_backlight set 10%-";
"F6" = "exec brightnessctl --device=intel_backlight set +10%";
};
};
};
};
}