Add more sway configuration

This commit is contained in:
Nathan McCarty 2022-04-19 18:01:39 -04:00
parent 761e06e0a8
commit 3cd4701bdb
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
1 changed files with 94 additions and 57 deletions

View File

@ -1,5 +1,5 @@
## Enable and setup SwayWM ## Enable and setup SwayWM
{ config, pkgs, unstable, ... }: { config, pkgs, lib, unstable, ... }:
{ {
# Turn on GDM for login # Turn on GDM for login
services.xserver = { services.xserver = {
@ -94,63 +94,100 @@
}; };
## Home manager stuff for sway ## Home manager stuff for sway
home-manager.users.nathan = { home-manager.users.nathan =
# Configure sway itself let
wayland.windowManager.sway = { swaylock-command = "${pkgs.swaylock-effects}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr \"%-I:%M:%S %p\" --datestr \"%A %Y-%M-%d\" --effect-blur 20x3";
enable = true; in
systemdIntegration = true; {
wrapperFeatures = { # Configure sway itself
base = true; wayland.windowManager.sway = {
gtk = true; enable = true;
systemdIntegration = true;
wrapperFeatures = {
base = true;
gtk = true;
};
config = {
# Setup gaps
gaps = {
smartGaps = true;
inner = 9;
};
# disable borders
window = {
border = 0;
};
# Use windows key as modifier
modifier = "Mod4";
# Alacritty as default terminal
terminal = "alacritty";
# Use krunner (from kde) as our launcher
menu = "albert show";
# Use waybar
bars = [{
command = "${unstable.waybar}/bin/waybar";
}];
# Use fira code
fonts = {
names = [ "Fira Code Nerd Font" ];
size = 10.0;
};
# Setup keybindings
keybindings =
let
modifer = "Mod4";
in
lib.mkOptionDefault {
"${modifer}+q" = "kill";
"${modifer}+z" = "exec ${swaylock-command}";
## Sreenshot keybinds
# Copy area to clipboard
"${modifer}+x" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
# Copy window to clipboard
"${modifer}+Ctrl+x" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy window";
# Clpy entire output to clipboard
"${modifer}+Alt+x" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output";
};
};
extraConfig = ''
exec albert
exec mako
'';
}; };
config = { # Mako for notifications
# Setup gaps programs.mako = {
gaps = { enable = true;
smartGaps = true; # Selenized color scheme
inner = 9; borderColor = "#f275be";
}; backgroundColor = "#184956";
# disable borders textColor = "#adbcbc";
window = { # Border configuration
border = 0; borderSize = 3;
}; # Timeout to 5 seconds
# Use windows key as modifier defaultTimeout = 5000;
modifier = "Mod4"; # Use Fira Code for font
# Alacritty as default terminal font = "Fira Code Nerd Font 10";
terminal = "alacritty"; # Group by application
# Use krunner (from kde) as our launcher groupBy = "app-name";
menu = "albert show"; # Bottom right corner
# Use waybar anchor = "bottom-right";
bars = [{ };
command = "${unstable.waybar}/bin/waybar"; # Swayidle for automatic screen locking
}]; services.swayidle = {
# Use fira code enable = true;
fonts = { timeouts = [
names = [ "Fira Code Nerd Font" ]; # Lock the screen after 5 minutes of inactivity
size = 10.0; {
}; timeout = 300;
command = swaylock-command;
}
# Turn off the displays after 10 minutes of inactivity
{
timeout = 600;
command = "swaymsg \"output * dpms off\"";
resumeCommand = "swaymsg \"output * dpms on\"";
}
];
}; };
extraConfig = ''
exec albert
exec mako
'';
}; };
# Mako for notifications
programs.mako = {
enable = true;
# Selenized color scheme
borderColor = "#f275be";
backgroundColor = "#184956";
textColor = "#adbcbc";
# Border configuration
borderSize = 3;
# Timeout to 5 seconds
defaultTimeout = 5000;
# Use Fira Code for font
font = "Fira Code Nerd Font 10";
# Group by application
groupBy = "app-name";
# Bottom right corner
anchor = "bottom-right";
};
};
} }