move overrides to overlay.nix

This commit is contained in:
Kopatz
2024-05-20 12:27:28 +02:00
parent effdbf8ac5
commit e9c3f0871c
8 changed files with 350 additions and 368 deletions

View File

@@ -1,9 +1,7 @@
{ config, osConfig, pkgs, inputs, lib, ... }:
with lib;
let
cfg = osConfig.custom.graphical.hyprland;
in
{
let cfg = osConfig.custom.graphical.hyprland;
in {
config = lib.mkIf cfg.enable {
programs.swaylock.enable = true;
wayland.windowManager.hyprland = {
@@ -16,144 +14,141 @@ in
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor = if osConfig.networking.hostName == "kop-pc" then [
monitor = if osConfig.networking.hostName == "kop-pc" then [
# PC
"HDMI-A-1,1920x1080@60,0x0,1"
"DP-1,2560x1440@165,1920x0,1"
"Unknown-1,disable"
] else if osConfig.networking.hostName == "nix-laptop" then [
] else if osConfig.networking.hostName == "nix-laptop" then [
# laptop
"eDP-1,3840x2160@60,0x0,2"
"DP-3,1920x1080@60,1920x0,1"
] else [
# Default
",preferred,auto,auto"
];
] else
[
# Default
",preferred,auto,auto"
];
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Some default env vars.
env = [ "XCURSOR_SIZE,24" "NIXOS_OZONE_WL,1" ];
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input = {
kb_layout = osConfig.mainUser.layout;
kb_variant = osConfig.mainUser.variant;
kb_model = "";
kb_options = "";
kb_rules = "";
follow_mouse = 1;
touchpad = {
natural_scroll = true;
};
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
kb_layout = osConfig.mainUser.layout;
kb_variant = osConfig.mainUser.variant;
kb_model = "";
kb_options = "";
kb_rules = "";
follow_mouse = 1;
touchpad = { natural_scroll = true; };
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
};
general = {
# See https://wiki.hyprland.org/Configuring/Variables
gaps_in = 5;
gaps_out = 5;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
#allow_tearing = true;
# See https://wiki.hyprland.org/Configuring/Variables
gaps_in = 5;
gaps_out = 5;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
#allow_tearing = true;
};
decoration = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10;
#blur = yes
#blur_size = 3
#blur_passes = 1
#blur_new_optimizations = on
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10;
#blur = yes
#blur_size = 3
#blur_passes = 1
#blur_new_optimizations = on
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
};
animations = {
enabled = true;
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
#bezier = myBezier, 0.05, 0.9, 0.1, 1.05
#animation = windows, 1, 7, myBezier
#animation = windowsOut, 1, 7, default, popin 80%
#animation = border, 1, 10, default
#animation = borderangle, 1, 8, default
#animation = fade, 1, 7, default
animation = [
"workspaces, 0"
];
enabled = true;
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
#bezier = myBezier, 0.05, 0.9, 0.1, 1.05
#animation = windows, 1, 7, myBezier
#animation = windowsOut, 1, 7, default, popin 80%
#animation = border, 1, 10, default
#animation = borderangle, 1, 8, default
#animation = fade, 1, 7, default
animation = [ "workspaces, 0" ];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile =
true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
};
master = {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true;
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true;
};
gestures = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = true;
gestures = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = true;
};
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
#"device:epic-mouse-v1" = {
# sensitivity = -0.5;
#};
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mainMod" = "SUPER";
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = let
rofi = "${pkgs.rofi-wayland}/bin/rofi";
kitty = "${pkgs.kitty}/bin/kitty";
#dolphin = "${pkgs.dolphin}/bin/dolphin";
thunar = "${pkgs.xfce.thunar}/bin/thunar";
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
grim = "${pkgs.grim}/bin/grim";
slurp = "${pkgs.slurp}/bin/slurp";
rofi = "${pkgs.rofi-wayland}/bin/rofi";
kitty = "${pkgs.kitty}/bin/kitty";
#dolphin = "${pkgs.dolphin}/bin/dolphin";
thunar = "${pkgs.xfce.thunar}/bin/thunar";
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
grim = "${pkgs.grim}/bin/grim";
slurp = "${pkgs.slurp}/bin/slurp";
swww = "${pkgs.swww}/bin/swww";
pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep";
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
swaylock = "${pkgs.swaylock}/bin/swaylock";
playerctl = "${pkgs.playerctl}/bin/playerctl";
in [
"$mainMod, Q, exec, ${kitty}"
in [
"$mainMod, Q, exec, ${kitty}"
"$mainMod, C, killactive"
"$mainMod, L, exec, ${swaylock} -f -c 000000"
"$mainMod, M, exit,"
@@ -161,7 +156,8 @@ in
"$mainMod, F, fullscreen"
"$mainMod, V, togglefloating"
"$mainMod, I, exec, ${rofi} -show drun -show-icons"
"$mainMod, S, exec, cat ~/songs | shuf -n 1 | sed \"s/^/b\.p /g\" | ${wl-copy}"
''
$mainMod, S, exec, cat ~/songs | shuf -n 1 | sed "s/^/b.p /g" | ${wl-copy}''
"$mainMod, R, exec, ${swww} img $(ls -d /synced/default/dinge/Bg/* | shuf -n 1)"
" , Print, exec, ${grim} -g \"$(${slurp} -d)\" - | ${wl-copy}"
"ALT, SPACE, exec, ${rofi} -show combi"
@@ -177,7 +173,7 @@ in
"$mainMod, right, movefocus, r"
"$mainMod, up, movefocus, u"
"$mainMod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
@@ -189,7 +185,7 @@ in
"$mainMod, 8, workspace, 8"
"$mainMod, 9, workspace, 9"
"$mainMod, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$mainMod SHIFT, 1, movetoworkspace, 1"
"$mainMod SHIFT, 2, movetoworkspace, 2"
@@ -201,20 +197,20 @@ in
"$mainMod SHIFT, 8, movetoworkspace, 8"
"$mainMod SHIFT, 9, movetoworkspace, 9"
"$mainMod SHIFT, 0, movetoworkspace, 10"
# Scroll through existing workspaces with mainMod + scroll
"$mainMod, mouse_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1"
# "ALT, Tab, cyclenext,"
# "ALT, Tab, bringactivetotop,"
];
];
bindm = [
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
];
windowrulev2 = [
# -- Fix odd behaviors in IntelliJ IDEs --
@@ -224,7 +220,7 @@ in
"center,class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
"nofocus,class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
"noborder,class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
#! Center popups/find windows
"center,class:^(jetbrains-.*)$,title:^( )$,floating:1"
"stayfocused,class:^(jetbrains-.*)$,title:^( )$,floating:1"
@@ -233,14 +229,13 @@ in
"nofocus,class:^(jetbrains-.*)$,title:^(win.*)$,floating:1"
#"immediate, class:^(Risk.*)$"
];
exec-once = [
exec-once = [
"${pkgs.swww}/bin/swww init; sleep 1;"
"${pkgs.swww} img $(ls -d /synced/default/dinge/Bg/* | shuf -n 1)"
"${pkgs.networkmanagerapplet}/bin/nm-applet --indicator &"
"${pkgs.waybar}/bin/waybar &"
#"${pkgs.dunst}/bin/dunst &"
"${pkgs.networkmanagerapplet}/bin/nm-applet --indicator &"
"${pkgs.waybar}/bin/waybar &"
#"${pkgs.dunst}/bin/dunst &"
];
};
extraConfig = let
@@ -284,16 +279,16 @@ in
enable = true;
settings = {
global = {
width = "(0,1000)";
height = "1000";
offset = "0x0";
origin = "bottom-center";
transparency = -1;
frame_color = "#1a1c1b";
font = "Monospace 8";
width = "(0,1000)";
height = "1000";
offset = "0x0";
origin = "bottom-center";
transparency = -1;
frame_color = "#1a1c1b";
font = "Monospace 8";
};
urgency_normal = {
urgency_normal = {
background = "#1a1c1b";
foreground = "#eceff1";
timeout = 10;

View File

@@ -1,9 +1,7 @@
{ config, osConfig, pkgs, inputs, lib, ... }:
with lib;
let
cfg = osConfig.custom.graphical.hyprland;
in
{
let cfg = osConfig.custom.graphical.hyprland;
in {
config = let
# styles from https://github.com/khaneliman/khanelinix/blob/8375f8cfbe5bfd87565b4dc34c9d30630c17336d/modules/home/desktop/addons/waybar/default.nix
theme = builtins.readFile ./styles/catppuccin.css;
@@ -18,189 +16,171 @@ in
#systemd.enable = true;
#systemd.target = "sway-session.target";
settings.main = {
layer = "top";
position = "top";
#output = lib.mapAttrsToList (n: v: v.monitor) outputs;
height = 25;
spacing = 4;
modules-left = [
"hyprland/workspaces"
#"hyprland/window"
];
modules-center = [];
modules-right = [
"group/stats"
"group/other"
];
"cpu" = {
"format" = " {usage}%";
"tooltip" = true;
};
"disk" = {
"format" = " {percentage_used}%";
};
"memory" = {
"format" = "󰍛 {}%";
};
layer = "top";
position = "top";
#output = lib.mapAttrsToList (n: v: v.monitor) outputs;
height = 25;
spacing = 4;
modules-left = [
"hyprland/workspaces"
#"hyprland/window"
];
modules-center = [ ];
modules-right = [ "group/stats" "group/other" ];
"cpu" = {
"format" = " {usage}%";
"tooltip" = true;
};
"disk" = { "format" = " {percentage_used}%"; };
"memory" = { "format" = "󰍛 {}%"; };
"idle_inhibitor" = {
"format" = "{icon} ";
"format-icons" = {
"activated" = "";
"deactivated" = "";
};
};
"idle_inhibitor" = {
"format" = "{icon} ";
"format-icons" = {
"activated" = "";
"deactivated" = "";
};
};
"keyboard-state" = {
"numlock" = true;
"capslock" = true;
"format" = "{icon} {name}";
"format-icons" = {
"locked" = "";
"unlocked" = "";
};
};
"keyboard-state" = {
"numlock" = true;
"capslock" = true;
"format" = "{icon} {name}";
"format-icons" = {
"locked" = "";
"unlocked" = "";
};
};
"network" = {
"interval" = 2;
"format-wifi" = " 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}";
"format-ethernet" = "󰈀 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}";
"tooltip-format" = " {ifname} via {gwaddr}";
"format-linked" = "󰈁 {ifname} (No IP)";
"format-disconnected" = " Disconnected";
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
};
"pulseaudio" = {
"format" = "{volume}% {icon}";
"format-bluetooth" = "{volume}% {icon}";
"format-muted" = "🚫";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = [
""
""
];
};
"scroll-step" = 1;
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
"ignored-sinks" = [ "Easy Effects Sink" ];
};
"network" = {
"interval" = 2;
"format-wifi" = " 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}";
"format-ethernet" = "󰈀 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}";
"tooltip-format" = " {ifname} via {gwaddr}";
"format-linked" = "󰈁 {ifname} (No IP)";
"format-disconnected" = " Disconnected";
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
};
"pulseaudio" = {
"format" = "{volume}% {icon}";
"format-bluetooth" = "{volume}% {icon}";
"format-muted" = "🚫";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = [ "" "" ];
};
"scroll-step" = 1;
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
"ignored-sinks" = [ "Easy Effects Sink" ];
};
"pulseaudio/slider" = {
"min" = 0;
"max" = 100;
"orientation" = "horizontal";
};
"temperature".critical-threshold = 80;
"temperature".format = "{temperatureC}°C ";
"temperature".interval = 5;
"temperature".hwmon-path = lib.mkIf (osConfig.networking.hostName == "nix-laptop") "/sys/class/hwmon/hwmon6/temp1_input";
"backlight".format = "{percent}% {icon}";
"backlight".states = [0 50];
"backlight".format-icons = ["" ""];
"battery".states.good = 95;
"battery".states.warning = 30;
"battery".states.critical = 15;
"battery".format = "{capacity}% / {power:.2}W {icon}";
"battery".format-icons = ["" "" "" "" ""];
"clock".format = "{:%F %H:%M}";
"clock".tooltip-format = "<tt><small>{calendar}</small></tt>";
"tray".icon-size = 21;
"tray".spacing = 10;
"pulseaudio/slider" = {
"min" = 0;
"max" = 100;
"orientation" = "horizontal";
};
"temperature".critical-threshold = 80;
"temperature".format = "{temperatureC}°C ";
"temperature".interval = 5;
"temperature".hwmon-path =
lib.mkIf (osConfig.networking.hostName == "nix-laptop")
"/sys/class/hwmon/hwmon6/temp1_input";
"backlight".format = "{percent}% {icon}";
"backlight".states = [ 0 50 ];
"backlight".format-icons = [ "" "" ];
"battery".states.good = 95;
"battery".states.warning = 30;
"battery".states.critical = 15;
"battery".format = "{capacity}% / {power:.2}W {icon}";
"battery".format-icons = [ "" "" "" "" "" ];
"clock".format = "{:%F %H:%M}";
"clock".tooltip-format = "<tt><small>{calendar}</small></tt>";
"tray".icon-size = 21;
"tray".spacing = 10;
"group/stats" = {
"orientation" = "horizontal";
"modules" = [
"network"
"cpu"
"memory"
"disk"
"temperature"
];
"modules" = [ "network" "cpu" "memory" "disk" "temperature" ];
};
"group/other" = {
"orientation" = "horizontal";
"modules" = [
"tray"
"backlight"
"pulseaudio"
"battery"
"clock"
];
"modules" = [ "tray" "backlight" "pulseaudio" "battery" "clock" ];
};
"hyprland/window" = {
"format" = "{}";
"separate-outputs" = true;
};
"hyprland/window" = {
"format" = "{}";
"separate-outputs" = true;
};
"hyprland/workspaces" = {
"hyprland/workspaces" = {
"disable-scroll" = true;
"all-outputs" = true;
"active-only" = false;
"all-outputs" = true;
"active-only" = false;
"on-click" = "activate";
"format" = "{icon} {windows}";
"format-icons" = {
"1" = "󰎤";
"2" = "󰎧";
"3" = "󰎪";
"4" = "󰎭";
"5" = "󰎱";
"6" = "󰎳";
"7" = "󰎶";
"8" = "󰎹";
"9" = "󰎼";
"10" = "󰽽";
"urgent" = "󱨇";
"default" = "";
"empty" = "󱓼";
};
# "format-window-separator" = "->";
"window-rewrite-default" = "";
"window-rewrite" = {
"class<org.keepassxc.KeePassXC>" = "󰢁";
"class<Caprine>" = "󰈎";
"class<Github Desktop>" = "󰊤";
"class<Godot>" = "";
"class<Mysql-workbench-bin>" = "";
"class<Slack>" = "󰒱";
"class<code>" = "󰨞";
"code-url-handler" = "󰨞";
"class<discord>" = "󰙯";
"class<firefox>" = "";
"class<firefox-beta>" = "";
"class<firefox-developer-edition>" = "";
"class<firefox> title<.*github.*>" = "";
"class<firefox> title<.*twitch|youtube|plex|tntdrama|bally sports.*>" = "";
"class<kitty>" = "";
"class<org.wezfurlong.wezterm>" = "";
"class<mediainfo-gui>" = "󱂷";
"class<org.kde.digikam>" = "󰄄";
"class<org.telegram.desktop>" = "";
"class<.pitivi-wrapped>" = "󱄢";
"class<steam>" = "";
"class<thunderbird>" = "";
"class<virt-manager>" = "󰢹";
"class<vlc>" = "󰕼";
"class<thunar>" = "󰉋";
"class<org.gnome.Nautilus>" = "󰉋";
"class<Spotify>" = "";
"title<Spotify Free>" = "";
"class<libreoffice-draw>" = "󰽉";
"class<libreoffice-writer>" = "";
"class<libreoffice-calc>" = "󱎏";
"class<libreoffice-impress>" = "󱎐";
"class<teams-for-linux>" = "󰊻";
"class<org.prismlauncher.PrismLauncher>" = "󰍳";
"class<minecraft-launcher>" = "󰍳";
"class<Postman>" = "󰛮";
};
};
"format" = "{icon} {windows}";
"format-icons" = {
"1" = "󰎤";
"2" = "󰎧";
"3" = "󰎪";
"4" = "󰎭";
"5" = "󰎱";
"6" = "󰎳";
"7" = "󰎶";
"8" = "󰎹";
"9" = "󰎼";
"10" = "󰽽";
"urgent" = "󱨇";
"default" = "";
"empty" = "󱓼";
};
# "format-window-separator" = "->";
"window-rewrite-default" = "";
"window-rewrite" = {
"class<org.keepassxc.KeePassXC>" = "󰢁";
"class<Caprine>" = "󰈎";
"class<Github Desktop>" = "󰊤";
"class<Godot>" = "";
"class<Mysql-workbench-bin>" = "";
"class<Slack>" = "󰒱";
"class<code>" = "󰨞";
"code-url-handler" = "󰨞";
"class<discord>" = "󰙯";
"class<firefox>" = "";
"class<firefox-beta>" = "";
"class<firefox-developer-edition>" = "";
"class<firefox> title<.*github.*>" = "";
"class<firefox> title<.*twitch|youtube|plex|tntdrama|bally sports.*>" =
"";
"class<kitty>" = "";
"class<org.wezfurlong.wezterm>" = "";
"class<mediainfo-gui>" = "󱂷";
"class<org.kde.digikam>" = "󰄄";
"class<org.telegram.desktop>" = "";
"class<.pitivi-wrapped>" = "󱄢";
"class<steam>" = "";
"class<thunderbird>" = "";
"class<virt-manager>" = "󰢹";
"class<vlc>" = "󰕼";
"class<thunar>" = "󰉋";
"class<org.gnome.Nautilus>" = "󰉋";
"class<Spotify>" = "";
"title<Spotify Free>" = "";
"class<libreoffice-draw>" = "󰽉";
"class<libreoffice-writer>" = "";
"class<libreoffice-calc>" = "󱎏";
"class<libreoffice-impress>" = "󱎐";
"class<teams-for-linux>" = "󰊻";
"class<org.prismlauncher.PrismLauncher>" = "󰍳";
"class<minecraft-launcher>" = "󰍳";
"class<Postman>" = "󰛮";
};
};
};
style = "${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}";
style =
"${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}";
};
};
}