wip(home): refactor home modules *WILL NOT BUILD*

This commit is contained in:
ooks-io 2024-06-04 21:19:35 +12:00
parent 2033810429
commit 6a591ecbf7
115 changed files with 1028 additions and 791 deletions

View file

@ -0,0 +1,55 @@
{ config, lib, ... }:
let
wayland = config.ooknet.wayland;
pointer = config.home.pointerCursor;
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland = {
settings = {
cursor = {
inactive_timeout = 4;
};
general = {
gaps_in = 10;
gaps_out = 10;
border_size = 2;
"col.active_border" = "0xff${palette.base05}";
"col.inactive_border" = "0xff${palette.base02}";
};
exec-once = [
"hyprctl setcursor ${pointer.name} ${toString pointer.size}"
];
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;
fullscreen_opacity = 1.0;
rounding = 0;
blur = {
enabled = false;
ignore_opacity = true;
};
drop_shadow = true;
shadow_range = 12;
shadow_offset = "3 3";
"col.shadow" = "0x44000000";
"col.shadow_inactive" = "0x66000000";
};
animations = {
enabled = false;
};
};
};
};
}

View file

@ -0,0 +1,131 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
bind = let
terminal = config.home.sessionVariables.TERMINAL;
browser = config.home.sessionVariables.BROWSER;
editor = config.home.sessionVariables.EDITOR;
locker = config.home.sessionVariables.LOCKER;
spotifyctl = "${pkgs.spotify-player}/bin/spotify_player";
discord = "${pkgs.vesktop}/bin/vesktop";
explorer = "${pkgs.cinnamon.nemo-with-extensions}/bin/nemo";
password = "${pkgs._1password-gui}/bin/1password";
in [
# Program Launch
"SUPER, b, exec, ${browser}"
"SUPER, return, exec, ${terminal}"
"SUPER, e, exec, ${terminal} ${editor}"
"SUPERSHIFT, P, exec, ${password}"
"SUPER, d, exec, ${discord}"
"SUPERSHIFT, e, exec, ${explorer}"
"SUPERSHIFT, S, exec, steam"
"SUPER, escape, exec, ${terminal} --title=BTOP btop"
"SUPER CTRL, return, exec, zellijmenu -n"
"SUPER, delete, exec, powermenu -c dmenu"
# Spotify PLayer Controls
"SUPER, bracketright, exec, ${spotifyctl} playback next"
"SUPER, bracketleft, exec, ${spotifyctl} playback previous"
"SUPER, backslash, exec, ${spotifyctl} playback play-pause"
# Brightness
",XF86MonBrightnessUp, exec, hyprbrightness up"
",XF86MonBrightnessDown, exec, hyprbrightness down"
# Volume
",XF86AudioRaiseVolume, exec, hyprvolume up"
",XF86AudioLowerVolume, exec, hyprvolume down"
",XF86AudioMute, exec, hyprvolume mute"
# Window Management
"SUPER, Q, killactive"
"SUPER CTRL, backspace, killactive"
"SUPERSHIFT ALT, delete, exec, hyprkillsession"
"SUPER, F, fullscreen"
"SUPER CTRL, F, fakefullscreen"
"SUPER, Space, togglefloating"
"SUPER, P, pseudo" # dwindle
"SUPER, S, togglesplit" # dwindle
# Focus
"SUPER, left, movefocus,l"
"SUPER, right, movefocus,r"
"SUPER, up, movefocus,u"
"SUPER, down, movefocus,d"
# Move
"SUPERSHIFT, left, movewindow,l"
"SUPERSHIFT, right, movewindow,r"
"SUPERSHIFT, up, movewindow,u"
"SUPERSHIFT, down, movewindow,d"
#Resize
"SUPER CTRL, left, resizeactive,-20 0"
"SUPERCTRL, right, resizeactive,20 0"
"SUPER CTRL, up, resizeactive,0 -20"
"SUPERCTRL, down, resizeactive,0 20"
# Switch workspace
"SUPER, 1, workspace,1"
"SUPER, 2, workspace,2"
"SUPER, 3, workspace,3"
"SUPER, 4, workspace,4"
"SUPER, 5, workspace,5"
"SUPER, 6, workspace,6"
"SUPER, 7, workspace,7"
"SUPER, 8, workspace,8"
"SUPER, 9, workspace,9"
"SUPER, 0, workspace,10"
"SUPER, comma, workspace,e+1"
"SUPER, period, workspace,e-1"
"SUPER, tab, focusCurrentOrLast"
# Move workspace
"SUPERSHIFT, 1, movetoworkspace,1"
"SUPERSHIFT, 2, movetoworkspace,2"
"SUPERSHIFT, 3, movetoworkspace,3"
"SUPERSHIFT, 4, movetoworkspace,4"
"SUPERSHIFT, 5, movetoworkspace,5"
"SUPERSHIFT, 6, movetoworkspace,6"
"SUPERSHIFT, 7, movetoworkspace,7"
"SUPERSHIFT, 8, movetoworkspace,8"
"SUPERSHIFT, 9, movetoworkspace,9"
"SUPERSHIFT, 0, movetoworkspace,10"
# Lock Screen
"SUPER, Backspace, exec, ${locker}"
];
# Mouse
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
# bindr = [
# "SUPER, SUPER_L, exec, killall rofi || rofi -show drun"
# ];
};
};
}

View file

@ -0,0 +1,14 @@
{
imports = [
./appearance.nix
./binds.nix
./rules.nix
./exec.nix
./env.nix
./inputs.nix
./misc.nix
./monitor.nix
./gestures.nix
./hyprpaper.nix
];
}

View file

@ -0,0 +1,17 @@
{ lib, config, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.env = [
"XDG_SESSION_DESKTOP,hyprland"
"XDG_CURRENT_DESKTOP,hyprland"
];
};
}

View file

@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
exec = [
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
];
exec-once = [
"${pkgs._1password-gui}/bin/1password --silent"
# "${pkgs.live-buds-cli}/bin/earbuds -d"
# "waybar"
];
};
};
}

View file

@ -0,0 +1,15 @@
{ lib, config, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;
};
};
}

View file

@ -0,0 +1,21 @@
{ lib, config, inputs, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
wallpaperPath = config.ooknet.wallpaper.path;
in
{
config = mkIf (wayland.compositor == "hyprland") {
services.hyprpaper = {
enable = true;
};
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload = ${wallpaperPath}
wallpaper = , ${wallpaperPath}
splash = false
ipc = off
'';
};
}

View file

@ -0,0 +1,18 @@
{ lib, config, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.input = {
kb_layout = "us";
follow_mouse = 1;
touchpad.natural_scroll = "no";
mouse_refocus = false;
};
};
}

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.misc = {
mouse_move_enables_dpms = true;
key_press_enables_dpms = true;
disable_hyprland_logo = true;
disable_splash_rendering = true;
enable_swallow = true;
swallow_regex = "foot|nemo";
focus_on_activate = true;
};
};
}

View file

@ -0,0 +1,22 @@
{ lib, config, osConfig, ... }:
let
inherit (lib) mkIf concatMap;
wayland = config.ooknet.wayland;
monitors = osConfig.ooknet.host.hardware.monitors;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
monitor = concatMap (m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
basicConfig = "${m.name},${if m.enabled then "${resolution},${position},1" else "disable"}";
in
[ basicConfig ] ++ (if m.transform != 0 then ["${m.name},transform,${toString m.transform}"] else [])
) (monitors);
};
};
}

View file

@ -0,0 +1,31 @@
{ lib, config, ... }:
let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
windowrulev2 = [
"float,move 191 15,size 924 396,class:^(1Password)$"
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
"workspace 4, title:^(Vesktop)$"
# Floating BTOP
"float,title:^(BTOP)$"
"size 85%,title:^(BTOP)$"
"pin,title:^(BTOP)$"
"center,title:^(BTOP)$"
"stayfocused,title:^(BTOP)$"
# Tearing
"immediate, title:^(TEKKEN8)$"
];
};
};
}