nixos-config/home/wayland/default.nix

192 lines
4.4 KiB
Nix

{ config, pkgs, lib, ghostty, ... }:
{
home.packages = with pkgs; [
brightnessctl
flameshot
ghostty.packages.x86_64-linux.default
pulseaudio
swaybg
swaylock
];
programs.rofi = {
enable = true;
font = "Roboto Mono Nerd Font 10";
theme = "Arc-Dark";
};
programs.waybar = {
enable = true;
settings = {
mainBar = {
position = "bottom";
height = 24;
modules-left = [
"sway/workspaces"
"sway/mode"
];
modules-right = [
"network"
"cpu"
"memory"
"battery"
"tray"
"clock"
];
"network" = {
format-wifi = " {essid} {ipaddr} ({signalStrength}%)";
format-ethernet = "{ipaddr}";
};
"clock" = {
format = "{:%a, %d.%m.%Y CW%V %H:%M}";
};
"cpu" = {
interval = 30;
format = "󰗉 {load}";
};
"memory" = {
interval = 30;
format = " {percentage}%";
};
"battery" = {
interval = 10;
format = "󰁹 {capacity}% ({time})";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-full = " {capacity}%";
states = {
"warning" = 30;
"critical" = 15;
};
};
};
};
style = ./waybar.css;
};
# Automatic display output management
services.kanshi = {
enable = true;
settings = [
{ profile.name = "undocked";
profile.outputs = [
{
criteria = "eDP-1";
status = "enable";
}
];
}
{ profile.name = "home_office";
profile.outputs = [
{
criteria = "eDP-1";
status = "disable";
}
{
criteria = "HDMI-A-2";
status = "enable";
}
];
}
{ profile.name = "office";
profile.outputs = [
{
criteria = "eDP-1";
status = "disable";
}
{
criteria = "DP-1";
status = "enable";
}
];
}
];
};
services.swayidle = {
enable = true;
timeouts = [
{ timeout = 1800; command = "${pkgs.swaylock}/bin/swaylock -f -c 000000"; }
{
timeout = 3600;
command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'";
}
];
events = [
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -f -c 000000"; }
];
};
services.gammastep = {
enable = true;
latitude = 50.81;
longitude = 6.37;
};
services.mako = {
enable = true;
defaultTimeout = 5000;
};
wayland.windowManager.sway = {
enable = true;
checkConfig = false;
package = pkgs.sway;
wrapperFeatures.gtk = true;
config = let
wallpaper = "~/.wallpapers/voxel-city-by-huntingfluff.jpg";
in {
modifier = "Mod4";
focus.followMouse = false;
bars = [{
command = "waybar";
}];
output = {
"*" = {
bg = "${wallpaper} fill";
};
};
input = {
"*" = {
xkb_layout = "de";
};
};
menu = "rofi -show drun";
startup = [
{ command = "logseq"; }
];
window = {
hideEdgeBorders = "smart";
titlebar = false;
commands = [
{
command = "move scratchpad, resize set 1280 800";
criteria = {
title = "Logseq";
};
}
];
};
keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault {
"--release Print" = "exec flameshot gui";
"Mod1+l" = "exec swaylock -f -i ${wallpaper} -s fill";
"${modifier}+m" = "scratchpad show";
"${modifier}+Return" = "exec ghostty";
"XF86MonBrightnessDown" = "exec light -U 10";
"XF86MonBrightnessUp" = "exec light -A 10";
"XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%'";
"XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%'";
"XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'";
};
};
};
home.file = {
".wallpapers".source = ./wallpapers;
};
}