Add more sway configuration
This commit is contained in:
parent
761e06e0a8
commit
3cd4701bdb
|
@ -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,7 +94,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
## Home manager stuff for sway
|
## 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
|
# Configure sway itself
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -128,6 +132,22 @@
|
||||||
names = [ "Fira Code Nerd Font" ];
|
names = [ "Fira Code Nerd Font" ];
|
||||||
size = 10.0;
|
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 = ''
|
extraConfig = ''
|
||||||
exec albert
|
exec albert
|
||||||
|
@ -152,5 +172,22 @@
|
||||||
# Bottom right corner
|
# Bottom right corner
|
||||||
anchor = "bottom-right";
|
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\"";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue