System/home-manager/programs/sway.nix

183 lines
5.4 KiB
Nix
Raw Normal View History

2022-06-23 02:57:41 -04:00
{ config, lib, pkgs, inputs, ... }:
let
nathan = config.nathan;
in
with lib;
2021-12-20 13:37:26 -05:00
{
2022-06-23 02:57:41 -04:00
config = mkIf nathan.programs.swaywm.enable (
2022-04-19 18:01:39 -04:00
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
{
2022-06-23 02:57:41 -04:00
#########################
## Sway
#########################
2022-04-19 18:01:39 -04:00
wayland.windowManager.sway = {
enable = true;
systemdIntegration = true;
wrapperFeatures = {
base = true;
gtk = true;
};
2022-05-02 21:47:42 -04:00
extraSessionCommands = ''
# Make qt theming work
export QT_QPA_PLATFORMTHEME="qt5ct"
'';
2022-04-19 18:01:39 -04:00
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";
2022-05-02 21:47:42 -04:00
# Use waybar, but through systemd
2022-05-16 00:54:46 -04:00
bars = [
{
command = "waybar";
}
];
2022-04-19 18:01:39 -04:00
# 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";
};
2022-04-19 19:00:41 -04:00
# Startup applications
startup = [
# Albert, the launcher
{ command = "albert"; }
# Mako, the notification daemon
{ command = "mako"; }
];
2022-05-15 22:39:20 -04:00
# Other stuff
};
2022-05-15 22:39:20 -04:00
# disable transparency for minecraft
extraConfig = ''
for_window [title=".*Minecraft.*"] opacity 1
'';
2022-04-19 18:01:39 -04:00
};
2022-06-23 02:57:41 -04:00
#########################
## Mako (notifications)
#########################
2022-04-19 18:01:39 -04:00
programs.mako = {
enable = true;
# Selenized color scheme
borderColor = "#f275be";
backgroundColor = "#184956";
textColor = "#adbcbc";
# Border configuration
borderSize = 3;
# Use Fira Code for font
font = "Fira Code Nerd Font 10";
# Group by application
groupBy = "app-name";
# Bottom right corner
anchor = "bottom-right";
2022-06-17 18:38:11 -04:00
# Maximum visible notifications
maxVisible = 10;
# Sort by time in descending order (newest first)
sort = "-time";
2022-04-19 18:01:39 -04:00
};
2022-06-23 02:57:41 -04:00
#########################
## Swayidle
#########################
2022-04-19 18:01:39 -04:00
services.swayidle = {
enable = true;
timeouts = [
# Lock the screen after 5 minutes of inactivity
{
timeout = 300;
2022-04-19 19:14:58 -04:00
command = builtins.replaceStrings [ "%" ] [ "%%" ] swaylock-command;
2022-04-19 18:01:39 -04:00
}
# Turn off the displays after 10 minutes of inactivity
{
timeout = 600;
command = "swaymsg \"output * dpms off\"";
resumeCommand = "swaymsg \"output * dpms on\"";
}
];
};
2022-06-23 02:57:41 -04:00
#########################
## Waybar
#########################
2022-05-02 21:47:42 -04:00
programs.waybar = {
enable = true;
2022-06-23 02:57:41 -04:00
package = inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".waybar;
};
#########################
## Alacritty
#########################
programs.alacritty = {
enable = true;
settings = {
env = {
TERM = "xterm-256color";
ALACRITTY = "1";
};
font = {
normal.family = "FiraCode Nerd Font";
bold.family = "FiraCode Nerd Font";
italic.family = "FiraCode Nerd Font";
bold_italic.family = "FiraCode Nerd Font";
size = 9.0;
};
colors = {
primary = {
background = "0x103c48";
foreground = "0xadbcbc";
};
normal = {
black = "0x184956";
red = "0xfa5750";
green = "0x75b938";
yellow = "0xdbb32d";
blue = "0x4695f7";
magenta = "0xf275be";
cyan = "0x41c7b9";
white = "0x72898f";
};
bright = {
black = "0x2d5b69";
red = "0xff665c";
green = "0x84c747";
yellow = "0xebc13d";
blue = "0x58a3ff";
magenta = "0xff84cd";
cyan = "0x53d6c7";
white = "0xcad8d9";
};
};
};
2022-05-02 21:47:42 -04:00
};
2022-06-23 02:57:41 -04:00
#########################
## EasyEffects
#########################
services.easyeffects.enable = true;
}
);
2021-12-20 13:37:26 -05:00
}