spectre_nixcfg/sway/sway.nix

120 lines
2.7 KiB
Nix
Raw Normal View History

2025-06-17 03:42:31 -04:00
{ lib, pkgs, config, ... }:
let
mod = "Mod4";
chvol = pkgs.writeShellScript "chvol"
(builtins.readFile ./chvol.sh);
2025-06-23 02:28:32 -04:00
chbright = pkgs.writeShellScript "chbrights"
(builtins.readFile ./chbright.sh);
2025-11-21 03:25:16 -05:00
multiTouchGesturesConfig = ''
bindgesture swipe:4:up focus parent
bindgesture swipe:4:left workspace prev
bindgesture swipe:4:right workspace next
bindgesture swipe:3:up focus up
bindgesture swipe:3:down focus down
bindgesture swipe:3:left focus left
bindgesture swipe:3:right focus right
'';
2025-06-17 03:42:31 -04:00
in {
2025-09-07 20:28:12 -04:00
home.packages = with pkgs;
[ grim slurp wl-clipboard brightnessctl ];
2025-11-21 03:25:16 -05:00
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
2025-06-17 03:42:31 -04:00
wayland.windowManager.sway = {
enable = true;
config = {
modifier = mod;
2025-06-23 00:44:31 -04:00
terminal = "alacritty";
2025-06-17 03:42:31 -04:00
# Waybar
bars = [{
command = "${pkgs.lib.getExe config.programs.waybar.package}";
position = "top";
fonts = config.wayland.windowManager.sway.config.fonts;
}];
menu = "${pkgs.lib.getExe config.programs.rofi.package} -modes \"drun,run\" -show-icons -show drun";
2025-09-07 20:28:12 -04:00
keybindings = let
screenshotPath ="pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png";
in lib.mkOptionDefault ({
2025-06-17 03:42:31 -04:00
# volume
XF86AudioRaiseVolume = "exec bash ${chvol} sink 5";
XF86AudioLowerVolume = "exec bash ${chvol} sink -5";
XF86AudioMute = "exec bash ${chvol} sink mute";
XF86AudioMicMute = "exec bash ${chvol} source mute";
# brightness
2025-06-23 02:28:32 -04:00
XF86MonBrightnessUp = "exec bash ${chbright} 1";
XF86MonBrightnessDown = "exec bash ${chbright} -1";
2025-06-17 03:42:31 -04:00
# media
XF86AudioPlay = "exec playerctl play-pause";
XF86AudioPrev = "exec playerctl previous";
XF86AudioNext = "exec playerctl next";
2025-06-28 19:43:19 -04:00
# Lock
"${mod}+Shift+l" = "exec swaylock -f";
2025-09-07 20:28:12 -04:00
# Screenshots
"${mod}+Shift+s" = "exec grim -g \"`slurp`\" - | wl-copy && wl-paste > ${screenshotPath}";
2025-06-17 03:42:31 -04:00
});
};
2025-09-07 20:28:12 -04:00
# GODOT IS A PAIN
2025-11-21 03:25:16 -05:00
extraConfig = "
for_window [class=\"^.*Godot.*$\"] floating enable
for_window [class=\"^.*Unity.*$\"] floating enable
" +
multiTouchGesturesConfig
+
''output 'eDP-1' scale 1''
;
2025-06-17 03:42:31 -04:00
};
# Waybar
programs.waybar = {
enable = true;
};
2025-06-28 19:43:19 -04:00
# App menu
2025-06-17 03:42:31 -04:00
programs.rofi = {
enable = true;
};
2025-06-28 19:43:19 -04:00
# Lock screen
programs.swaylock = {
enable = true;
settings = {
font-size = 14;
};
};
# Autolock
services.swayidle = {
enable = true;
events = [{
event = "before-sleep";
command = "${pkgs.lib.getExe pkgs.swaylock} -f";
}];
};
2025-06-17 03:42:31 -04:00
qt = {
enable = true;
# style = {};
};
gtk = {
enable = true;
# theme = {};
};
}