Set up Sway
This commit is contained in:
parent
890ac1e91c
commit
2393e83d59
3 changed files with 109 additions and 0 deletions
|
@ -79,6 +79,13 @@ in
|
|||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
|
||||
security.polkit.enable = true;
|
||||
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
services.printing.enable = true;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
./nvim.nix
|
||||
./scripts.nix
|
||||
./ssh.nix
|
||||
./sway.nix
|
||||
./tmux.nix
|
||||
./utils.nix
|
||||
./vcs.nix
|
||||
|
|
101
home/common/sway.nix
Normal file
101
home/common/sway.nix
Normal file
|
@ -0,0 +1,101 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = lib.mkIf config.patagia.desktop.enable {
|
||||
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1"; # For electron apps
|
||||
|
||||
programs.wofi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
location = "top-center";
|
||||
allow_markup = true;
|
||||
width = 800;
|
||||
};
|
||||
|
||||
style = ''
|
||||
* {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
window {
|
||||
background-color: #7c818c;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
];
|
||||
|
||||
wayland.windowManager.sway =
|
||||
let
|
||||
gtk-launch = "${pkgs.gtk4.dev}/bin/gtk4-launch";
|
||||
light = "${pkgs.light}/bin/light";
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl --all-players";
|
||||
wofi = "${pkgs.wofi}/bin/wofi";
|
||||
wpctl = "${pkgs.wireplumber}/bin/wpctl";
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
|
||||
# SwayFX for fancy fancification
|
||||
package = pkgs.swayfx;
|
||||
checkConfig = false; # workaround for https://discourse.nixos.org/t/sway-fails-with-cannot-create-gles2-renderer-after-update/45703
|
||||
extraConfig = ''
|
||||
corner_radius 6
|
||||
shadows enable
|
||||
'';
|
||||
# default_dim_inactive 0.9
|
||||
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
terminal = "ghostty";
|
||||
menu = "${wofi} --show drun";
|
||||
|
||||
fonts.names = [ "Berkeley Mono Variable" ];
|
||||
|
||||
gaps = {
|
||||
smartGaps = true;
|
||||
smartBorders = "on";
|
||||
inner = 0;
|
||||
outer = 0;
|
||||
};
|
||||
|
||||
window = {
|
||||
border = 3;
|
||||
titlebar = false;
|
||||
};
|
||||
|
||||
keybindings =
|
||||
let
|
||||
inherit (config.wayland.windowManager.sway.config) modifier menu;
|
||||
in
|
||||
lib.mkAfter {
|
||||
"${modifier}+return" = "exec ${menu}";
|
||||
"${modifier}+f" = "floating toggle";
|
||||
"${modifier}+t" = "exec ghostty";
|
||||
"${modifier}+s" = "sticky toggle";
|
||||
"${modifier}+q" = "exit";
|
||||
"${modifier}+r" = "reload";
|
||||
"XF86MonBrightnessDown" = "exec '${light} -U 15'";
|
||||
"XF86MonBrightnessUp" = "exec '${light} -A 15'";
|
||||
"XF86AudioRaiseVolume" = "exec '${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0'";
|
||||
"XF86AudioLowerVolume" = "exec '${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0'";
|
||||
"XF86AudioMute" = "exec '${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle'";
|
||||
"XF86AudioPlay" = "exec '${playerctl} play-pause'";
|
||||
"XF86AudioNext" = "exec '${playerctl} next'";
|
||||
"XF86AudioPrev" = "exec '${playerctl} previous'";
|
||||
"Print" = "exec 'screenshot.sh clipboard'";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue