Refactor directory structure

This commit is contained in:
2024-06-20 13:41:57 +02:00
parent 4d2ee54904
commit b76932ead3
62 changed files with 92 additions and 205 deletions

View File

@@ -0,0 +1,199 @@
{ config, pkgs, lib, hostName, ... }:
{
imports = [
# ./hyprpaper.nix
./waybar.nix
./fixes.nix
./dunst.nix
./rofi.nix
];
home.packages = with pkgs; [
alacritty
wev
brightnessctl
playerctl
wl-clipboard
grimblast
nwg-bar
powertop
lxqt.lxqt-policykit
];
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = if hostName == "xv-laptop" then [
"eDP-1,preferred,3840x0,1.333"
"DP-10,preferred,0x0,1"
"DP-9,preferred,1920x0,1"
] else [
",preferred,auto,auto"
];
exec-once = [
"waybar"
"lxqt-policykit-agent"
];
"$mod" = "SUPER";
input = {
follow_mouse = 2;
touchpad = {
natural_scroll = true;
clickfinger_behavior = true;
};
};
general = {
gaps_in = "5";
gaps_out = "10";
border_size = "2";
"col.active_border" = "rgba(00bfffee) rgba(36b7e2ee) 45deg";
"col.inactive_border" = "rgba(0a3543aa)";
layout = "dwindle";
};
decoration = {
rounding = "5";
drop_shadow = "false";
blur.enabled = "false";
shadow_render_power = "3";
"col.shadow" = "rgba(1a1a1aee)";
};
gestures = {
workspace_swipe = "on";
workspace_swipe_distance = "200";
};
misc = {
vfr = "true";
vrr = 2;
force_default_wallpaper = "0";
};
xwayland = {
force_zero_scaling = true;
};
workspace = if hostName == "xv-desktop" then [
"1, monitor:DP-2"
"2, monitor:DP-2"
"3, monitor:DP-2"
"4, monitor:DP-2"
"5, monitor:DP-2"
"6, monitor:HDMI-A-1"
"7, monitor:HDMI-A-1"
"8, monitor:HDMI-A-1"
"9, monitor:HDMI-A-1"
"10, monitor:HDMI-A-1"
] else [
"1, monitor:DP-10"
"2, monitor:DP-10"
"3, monitor:DP-10"
"4, monitor:DP-10"
"5, monitor:DP-9"
"6, monitor:DP-9"
"7, monitor:DP-9"
"8, monitor:eDP-1"
"9, monitor:eDP-1"
"10, monitor:eDP-1"
];
bind = [
"$mod, Q, exec, alacritty"
"$mod, SPACE, exec, rofi -show drun"
",Print, exec, grimblast copy area"
"$mod,ESCAPE, exec, nwg-bar"
"$mod, P, exit"
"$mod, C, killactive"
"$mod SHIFT, C, exec, hyprctl kill"
"$mod, V, togglefloating"
"$mod, F, fullscreen, 0"
"$mod, M, fullscreen, 1"
"$mod SHIFT, L, exec, hyprlock"
"$mod, S, exec, systemctl suspend"
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, j, movewindow, d"
"$mod ALT, h, resizeactive, -20 0"
"$mod ALT, l, resizeactive, 20 0"
"$mod ALT, k, resizeactive, 0 -20"
"$mod ALT, j, resizeactive, 0 20"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod SHIFT, 1, movetoworkspace, 1"
"$mod SHIFT, 2, movetoworkspace, 2"
"$mod SHIFT, 3, movetoworkspace, 3"
"$mod SHIFT, 4, movetoworkspace, 4"
"$mod SHIFT, 5, movetoworkspace, 5"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, 10"
] ++ (if hostName == "xv-desktop" then [
",code:194,workspace, 6"
",code:195,workspace, 7"
",code:196,workspace, 8"
",code:197,workspace, 9"
",code:198,workspace, 10"
"SHIFT, code:194, movetoworkspace, 6"
"SHIFT, code:195, movetoworkspace, 7"
"SHIFT, code:196, movetoworkspace, 8"
"SHIFT, code:197, movetoworkspace, 9"
"SHIFT, code:198, movetoworkspace, 10"
] else [ ]);
bindle = [
# Volume control
",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
# Brightness control
",XF86MonBrightnessUp, exec, brightnessctl set 5%+"
",XF86MonBrightnessDown, exec, brightnessctl set 5%-"
];
bindl= [
# Toggle audio mute
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# Media control
",XF86AudioPlay, exec, playerctl play-pause"
",XF86AudioNext, exec, playerctl next"
",XF86AudioPrev, exec, playerctl previous"
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
};
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
services.dunst = {
enable = true;
};
}

View File

@@ -0,0 +1,15 @@
{ ... }:
{
home.file.".config/electron-flags.conf" = {
enable = true;
executable = false;
text =''
--enable-features=UseOzonePlatform --ozone-platform=wayland
'';
};
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
}

View File

@@ -0,0 +1,11 @@
{ ... }:
{
services.hyprpaper = {
enable = true;
settings = {
preload = [ "~/nix/assets/wallpaper.png"];
wallpaper = [ ",~/nix/assets/wallpaper.png"];
};
};
}

View File

@@ -0,0 +1,117 @@
{ config, pkgs, ... }:
{
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
theme = let
inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {
background-color = mkLiteral "#${config.colorScheme.palette.base00}";
foreground-color = mkLiteral "#${config.colorScheme.palette.base05}";
text-color = mkLiteral "#${config.colorScheme.palette.base07}";
border-color = mkLiteral "#${config.colorScheme.palette.base04}";
};
# Holds the entire window
"#window" = {
transparency = "real";
background-color = mkLiteral "#${config.colorScheme.palette.base00}";
text-color = mkLiteral "#${config.colorScheme.palette.base07}";
border = mkLiteral "0px";
border-color = mkLiteral "#${config.colorScheme.palette.base04}";
border-radius = mkLiteral "4px";
width = mkLiteral "850px";
padding = mkLiteral "8px";
};
# Wrapper around bar and results
"#mainbox" = {
background-color = mkLiteral "#${config.colorScheme.palette.base00}";
border = mkLiteral "0px";
border-radius = mkLiteral "0px";
border-color = mkLiteral "#${config.colorScheme.palette.base04}";
children = map mkLiteral [ "inputbar" "message" "listview" ];
spacing = mkLiteral "10px";
padding = mkLiteral "10px";
};
# Unknown
"#textbox-prompt-colon" = {
expand = false;
str = ":";
margin = mkLiteral "0px 0.3em 0em 0em";
text-color = mkLiteral "#${config.colorScheme.palette.base07}";
};
# Command prompt left of the input
"#prompt" = { enabled = false; };
# Actual text box
"#entry" = {
placeholder-color = mkLiteral "#${config.colorScheme.palette.base03}";
expand = true;
horizontal-align = "0";
placeholder = "";
padding = mkLiteral "0px 0px 0px 5px";
blink = true;
};
# Top bar
"#inputbar" = {
children = map mkLiteral [ "prompt" "entry" ];
border = mkLiteral "1px";
border-radius = mkLiteral "4px";
padding = mkLiteral "6px";
};
# Results
"#listview" = {
background-color = mkLiteral "#${config.colorScheme.palette.base00}";
padding = mkLiteral "0px";
columns = 1;
lines = 12;
spacing = "5px";
cycle = true;
dynamic = true;
layout = "vertical";
};
# Each result
"#element" = {
orientation = "vertical";
border-radius = mkLiteral "0px";
padding = mkLiteral "5px 0px 5px 5px";
};
"#element.selected" = {
border = mkLiteral "1px";
border-radius = mkLiteral "4px";
border-color = mkLiteral "#${config.colorScheme.palette.base07}";
background-color = mkLiteral "#${config.colorScheme.palette.base04}";
text-color = mkLiteral "#${config.colorScheme.palette.base00}";
};
"#element-text" = {
expand = true;
# horizontal-align = mkLiteral "0.5";
vertical-align = mkLiteral "0.5";
margin = mkLiteral "0px 2.5px 0px 2.5px";
};
"#element-text.selected" = {
background-color = mkLiteral "#${config.colorScheme.palette.base04}";
text-color = mkLiteral "#${config.colorScheme.palette.base00}";
};
# Not sure how to get icons
"#element-icon" = {
size = mkLiteral "18px";
border = mkLiteral "0px";
padding = mkLiteral "2px 5px 2px 2px";
background-color = mkLiteral "#${config.colorScheme.palette.base00}";
};
"#element-icon.selected" = {
background-color = mkLiteral "#${config.colorScheme.palette.base04}";
text-color = mkLiteral "#${config.colorScheme.palette.base00}";
};
};
};
}

View File

@@ -0,0 +1,153 @@
{ hostName, pkgs, ... }:
{
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 32;
modules-left = [
"hyprland/workspaces"
"hyprland/window"
];
modules-center = [
"clock"
];
modules-right = [
"tray"
"network"
"pulseaudio"
"battery"
];
# Modules left
"hyprland/workspaces" = {
"format" = "{icon}";
"on-scroll-up" = "hyprctl dispatch workspace e+1";
"on-scroll-down" = "hyprctl dispatch workspace e-1";
"on-click" = "activate";
"persistent-workspaces" = if hostName == "xv-laptop" then {
"DP-10" = [ 1 2 3 4 ];
"DP-9" = [ 5 6 7 ];
"eDP-1" = [ 8 9 10 ];
} else {
"DP-2" = [ 1 2 3 4 5 ];
"HDMI-A-1" = [ 6 7 8 9 10 ];
};
"format-icons" = {
"default" = "";
"empty" = "";
"active" = "";
};
};
"hyprland/window" = {
"max-length" = 200;
"seperate-outputs" = true;
};
# Modules middle
"clock" = {
"interval" = 1;
"format" = "{:%a %d %b | %H:%M:%S}";
};
# Modules right
"tray" = {
"spacing" = 10;
"icon-size" = 21;
};
"battery" = {
"bat" = "BAT1";
"interval" = 60;
"states" = {
"warning" = 30;
"critical" = 15;
};
"format" = "{icon} {capacity}%";
"format-icons" = [ "" "" "" "" "" ];
};
"pulseaudio" = {
"format" = "{icon} {volume}%";
"format-bluetooth" = "{volume}% {icon}";
"format-muted" = "󰝟";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = ["" ""];
};
"scroll-step" = 1;
"on-click" = "pavucontrol";
"ignored-sinks" = ["Easy Effects Sink"];
};
"network" = {
"interface" = "wlan0";
"format" = "{ifname}";
"format-wifi" = " {essid}";
"format-ethernet" = "󰊗 {ipaddr}/{cidr}";
"format-disconnected" = "";
"tooltip-format" = "{ifname} via {gwaddr}";
"tooltip-format-wifi" = "{essid} ({signalStrength}%)";
"tooltip-format-ethernet" = "{ifname}";
"tooltip-format-disconnected" = "Disconnected";
"max-length" = 50;
};
};
};
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: DejaVuSansM Nerd Font;
}
#workspaces,#window,#clock,#battery,#tray,#pulseaudio,#network {
background-color: @theme_bg_color;
border-radius: 50px;
padding: 0px 15px;
margin: 5px 3px 0px 3px;
}
#workspaces {
margin-left: 10px;
padding: 0px 5px;
font-size: 15px;
}
window#waybar.empty #window {
background-color: transparent;
}
window#waybar {
background-color: transparent;
font-size: 12px;
}
#workspaces button.active {
color: @theme_text_color;
}
#workspaces button {
color: shade(@theme_text_color, 0.5);
padding: 2px 5px;
}
#battery {
margin-right: 10px;
}
#battery.warning {
background-color: #ff8000;
}
#battery.critical {
background-color: #f00;
}
'';
};
}