2023-10-10 07:25:31 +00:00
|
|
|
{
|
2024-07-21 06:49:16 +00:00
|
|
|
lib,
|
2023-11-04 10:14:42 +00:00
|
|
|
config,
|
2024-07-21 06:49:16 +00:00
|
|
|
inputs,
|
2023-11-04 10:14:42 +00:00
|
|
|
pkgs,
|
|
|
|
...
|
2024-08-25 15:02:35 +00:00
|
|
|
}:
|
|
|
|
{
|
2024-06-14 23:25:48 +00:00
|
|
|
# remove csd window buttons
|
|
|
|
# https://github.com/localsend/localsend/blob/2457acd8a7412723b174672d174e4853dccd7d99/app/linux/my_application.cc#L45
|
|
|
|
home.sessionVariables.GTK_CSD = 0;
|
2024-07-20 06:59:58 +00:00
|
|
|
dconf.settings."org/gnome/desktop/wm/preferences"."button-layout" = "appmenu:";
|
2024-06-14 23:25:48 +00:00
|
|
|
|
2023-10-10 07:25:31 +00:00
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
2024-04-23 08:08:11 +00:00
|
|
|
checkConfig = false; # wtf?
|
2023-10-10 07:25:31 +00:00
|
|
|
wrapperFeatures.gtk = true;
|
2023-12-08 15:44:35 +00:00
|
|
|
systemd.xdgAutostart = true;
|
2023-10-10 07:25:31 +00:00
|
|
|
config = {
|
|
|
|
### Visuals
|
2024-07-21 06:49:16 +00:00
|
|
|
output."*".bg = "${inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background} fill";
|
2024-08-29 18:17:30 +00:00
|
|
|
bars = lib.singleton {
|
|
|
|
statusCommand = "${lib.getExe pkgs.i3status-rust} $HOME/.config/i3status-rust/config-default.toml";
|
|
|
|
position = "top";
|
|
|
|
extraConfig = ''
|
|
|
|
icon_theme ${config.gtk.iconTheme.name}
|
|
|
|
'';
|
|
|
|
};
|
2023-10-10 07:25:31 +00:00
|
|
|
|
|
|
|
### Inputs
|
2024-03-06 08:48:01 +00:00
|
|
|
input = {
|
|
|
|
"*" = {
|
|
|
|
accel_profile = "flat";
|
|
|
|
natural_scroll = "enabled";
|
|
|
|
};
|
2023-10-10 07:25:31 +00:00
|
|
|
|
2024-03-06 08:48:01 +00:00
|
|
|
"type:touchpad" = {
|
|
|
|
tap = "enabled";
|
|
|
|
drag = "enabled";
|
|
|
|
dwt = "disabled";
|
|
|
|
};
|
|
|
|
|
|
|
|
"type:keyboard" = {
|
2024-04-01 20:09:59 +00:00
|
|
|
xkb_layout = "us";
|
2024-03-06 08:48:01 +00:00
|
|
|
xkb_options = "caps:escape";
|
2024-04-01 20:09:59 +00:00
|
|
|
xkb_variant = "dvorak";
|
2024-03-06 08:48:01 +00:00
|
|
|
};
|
2023-10-10 07:25:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
### Keybinds
|
|
|
|
modifier = "Mod4";
|
2024-08-25 15:02:35 +00:00
|
|
|
keybindings =
|
|
|
|
let
|
|
|
|
inherit (config.wayland.windowManager.sway.config) modifier;
|
2024-10-12 16:09:53 +00:00
|
|
|
inherit (lib) getExe getExe';
|
|
|
|
inherit (pkgs)
|
|
|
|
brightnessctl
|
|
|
|
cliphist
|
|
|
|
foot
|
|
|
|
pamixer
|
|
|
|
playerctl
|
|
|
|
sway-contrib
|
|
|
|
wireplumber
|
|
|
|
wl-clipboard
|
|
|
|
wmenu
|
|
|
|
xdg-utils
|
|
|
|
;
|
2024-08-25 15:02:35 +00:00
|
|
|
in
|
2023-12-30 15:42:09 +00:00
|
|
|
{
|
|
|
|
### Sway itself
|
|
|
|
# Window
|
|
|
|
"${modifier}+s" = "split toggle";
|
|
|
|
"${modifier}+v" = "floating toggle";
|
2023-12-30 16:18:02 +00:00
|
|
|
"${modifier}+f" = "fullscreen toggle";
|
2024-01-27 22:31:43 +00:00
|
|
|
"${modifier}+r" = "mode resize";
|
2023-12-30 15:42:09 +00:00
|
|
|
"${modifier}+q" = "kill";
|
2023-12-30 16:18:02 +00:00
|
|
|
"${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'";
|
2023-10-10 07:25:31 +00:00
|
|
|
|
2023-12-30 15:42:09 +00:00
|
|
|
# Move around
|
|
|
|
"${modifier}+h" = "focus left";
|
|
|
|
"${modifier}+j" = "focus down";
|
|
|
|
"${modifier}+k" = "focus up";
|
|
|
|
"${modifier}+l" = "focus right";
|
2024-01-27 22:31:43 +00:00
|
|
|
"${modifier}+Shift+h" = "move left";
|
|
|
|
"${modifier}+Shift+j" = "move down";
|
|
|
|
"${modifier}+Shift+k" = "move up";
|
|
|
|
"${modifier}+Shift+l" = "move right";
|
2023-10-10 07:25:31 +00:00
|
|
|
|
2023-12-30 15:42:09 +00:00
|
|
|
### Execute other stuff
|
|
|
|
# Launch applications
|
2024-10-12 16:09:53 +00:00
|
|
|
"${modifier}+Return" = "exec ${getExe foot}";
|
|
|
|
"${modifier}+w" = "exec ${xdg-utils}/bin/xdg-open http:";
|
|
|
|
"${modifier}+e" = "exec ${xdg-utils}/bin/xdg-open ~";
|
2023-10-10 07:25:31 +00:00
|
|
|
|
2024-07-07 17:06:26 +00:00
|
|
|
# Launcher
|
2024-10-12 16:09:53 +00:00
|
|
|
"${modifier}+d" = "exec ${getExe' wmenu "wmenu-run"}";
|
|
|
|
"${modifier}+Shift+d" = "exec ${getExe cliphist} list | ${getExe wmenu} -l 10 | ${getExe cliphist} decode | ${getExe' wl-clipboard "wl-copy"}";
|
2024-07-07 17:06:26 +00:00
|
|
|
"${modifier}+Shift+Semicolon" = "exec loginctl lock-session";
|
2023-10-10 07:25:31 +00:00
|
|
|
|
2023-12-30 15:42:09 +00:00
|
|
|
# Screenshot
|
2024-10-12 16:09:53 +00:00
|
|
|
"Print" = "exec env XDG_SCREENSHOTS_DIR=$HOME/Pictures/Screenshots ${getExe sway-contrib.grimshot} --notify savecopy anything";
|
2023-10-10 07:25:31 +00:00
|
|
|
|
2023-12-30 15:42:09 +00:00
|
|
|
# Fn keys
|
2024-10-12 16:09:53 +00:00
|
|
|
"XF86MonBrightnessUp" = "exec ${getExe brightnessctl} set 5%+";
|
|
|
|
"XF86MonBrightnessDown" = "exec ${getExe brightnessctl} set 5%-";
|
|
|
|
"XF86AudioRaiseVolume" = "exec ${getExe' wireplumber "wpctl"} set-volume @DEFAULT_SINK@ 5%+";
|
|
|
|
"XF86AudioLowerVolume" = "exec ${getExe' wireplumber "wpctl"} set-volume @DEFAULT_SINK@ 5%-";
|
|
|
|
"XF86AudioMute" = "exec ${getExe pamixer} -t";
|
|
|
|
"XF86AudioPlay" = "exec ${getExe playerctl} play-pause";
|
|
|
|
"XF86AudioPrev" = "exec ${getExe playerctl} previous";
|
|
|
|
"XF86AudioNext" = "exec ${getExe playerctl} next";
|
|
|
|
"XF86AudioStop" = "exec ${getExe playerctl} stop";
|
2023-12-30 15:42:09 +00:00
|
|
|
}
|
|
|
|
//
|
2024-08-25 15:02:35 +00:00
|
|
|
# workspace binds
|
|
|
|
lib.listToAttrs (
|
|
|
|
lib.concatMap (x: [
|
|
|
|
{
|
|
|
|
name = "${modifier}+${x}";
|
|
|
|
value = "workspace ${x}";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "${modifier}+Shift+${x}";
|
|
|
|
value = "move container to workspace ${x}";
|
|
|
|
}
|
|
|
|
]) (lib.genList (x: toString (x + 1)) 9)
|
|
|
|
);
|
2023-10-10 07:25:31 +00:00
|
|
|
};
|
|
|
|
};
|
2023-11-04 10:14:42 +00:00
|
|
|
}
|