nixos-config/config/programs/sway.nix

72 lines
2.3 KiB
Nix
Raw Normal View History

2022-01-18 14:29:13 +00:00
{ config, pkgs, lib, ... }: {
2022-01-18 13:12:43 +00:00
wayland.windowManager.sway = {
2022-01-18 13:16:40 +00:00
enable = true;
2022-01-18 13:12:43 +00:00
config = {
modifier = "Mod4";
2022-01-18 13:12:43 +00:00
input = {
2022-01-18 13:14:12 +00:00
"*" = {
2022-01-18 13:12:43 +00:00
xkb_layout = "de,de";
xkb_variant = "neo_qwertz,neo";
xkb_options = "grp:ctrls_toggle";
2022-01-18 13:12:43 +00:00
};
};
2022-01-18 14:12:38 +00:00
output = {
2022-01-18 14:02:20 +00:00
"DP-1" = {
mode = "2560x1440@74.971Hz";
position = "0 0";
subpixel = "rgb";
adaptive_sync = "on";
};
"HDMI-A-1" = {
mode = "1920x1080@60Hz";
position = "2560 0";
subpixel = "rgb";
};
};
2022-01-19 08:28:39 +00:00
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
in
lib.mkOptionDefault {
"${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty";
"${modifier}+d" = "exec ${pkgs.wofi}/bin/wofi --show drun";
2022-01-19 09:12:58 +00:00
"Print" = "mode screenshot";
2022-01-19 08:28:39 +00:00
};
2022-01-18 15:57:45 +00:00
bars = [
{
command = "${pkgs.waybar}/bin/waybar";
}
];
2022-01-19 09:12:58 +00:00
modes = {
screenshot = {
2022-01-19 09:44:59 +00:00
Print = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp -d)" - | ${pkgs.wl-clipboard}/bin/wl-copy'';
w = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.sway}/bin/swaymsg -t get_tree | ${pkgs.jq}/bin/jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"')" - | ${pkgs.wl-clipboard}/bin/wl-copy'';
2022-01-19 09:26:27 +00:00
f = ''exec ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy'';
Escape = ''mode "default"'';
Return = ''mode "default"'';
2022-01-19 09:12:58 +00:00
};
};
2022-01-19 09:23:52 +00:00
startup = [
{
2022-01-19 09:26:27 +00:00
command = "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.clipman}/bin/clipman store --no-persist";
2022-01-19 09:23:52 +00:00
}
2022-01-19 14:00:24 +00:00
{
2022-01-19 14:00:58 +00:00
command = "${pkgs.mako}/bin/mako";
2022-01-19 14:00:24 +00:00
}
{
2022-03-05 13:38:20 +00:00
command = "${pkgs.swayidle}/bin/swayidle -w timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' timeout 305 '${pkgs.sway}/bin/swaymsg \"output * dpms off\"' resume '${pkgs.sway}/bin/swaymsg \"output * dpms on\"' lock '${pkgs.swaylock}/bin/swaylock -f -c 000000' unlock '${pkgs.procps}/bin/pkill swaylock'";
}
{
command = "${pkgs.plover.dev}/bin/plover";
}
2022-01-19 09:23:52 +00:00
];
2022-01-18 14:21:38 +00:00
};
2022-01-18 15:55:32 +00:00
wrapperFeatures.gtk = true;
2022-01-18 13:12:43 +00:00
};
2022-01-19 10:16:54 +00:00
2022-02-02 19:12:21 +00:00
home.file.".XCompose ".source = ../../extra/.XCompose;
2022-01-18 14:02:20 +00:00
}
2022-01-19 09:12:58 +00:00
2022-02-02 19:12:21 +00:00