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
{ config, pkgs, unstable, ... }:
{ config, pkgs, lib, unstable, ... }:
{
# Turn on GDM for login
services.xserver = {
@ -94,7 +94,11 @@
};
## Home manager stuff for sway
home-manager.users.nathan = {
home-manager.users.nathan =
let
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";
in
{
# Configure sway itself
wayland.windowManager.sway = {
enable = true;
@ -128,6 +132,22 @@
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
@ -152,5 +172,22 @@
# Bottom right corner
anchor = "bottom-right";
};
# Swayidle for automatic screen locking
services.swayidle = {
enable = true;
timeouts = [
# Lock the screen after 5 minutes of inactivity
{
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\"";
}
];
};
};
}