big module system implementation

This commit is contained in:
cnst
2024-08-17 18:28:42 +02:00
parent 505afa84d0
commit 7525ab34c1
155 changed files with 2402 additions and 2029 deletions

View File

@@ -0,0 +1,48 @@
{
wayland.windowManager.hyprland.settings = {
general = {
gaps_in = 2;
gaps_out = 4;
border_size = 3;
#col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
#col.inactive_border = rgba(595959aa)
"col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg
"col.inactive_border" = "rgb(504945)";
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
decoration = {
rounding = 0;
blur = {
enabled = true;
size = 8;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = false;
shadow_range = 4;
shadow_render_power = 3;
# col.shadow = rgba(1a1a1aee)
};
animations = {
enabled = true;
bezier = [
"myBezier,0.05, 0.9, 0.1, 1.05"
];
animation = [
"windows, 1, 3, myBezier"
"windowsOut, 1, 3, default, popin 80%"
"border, 1, 3, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 3, default"
];
};
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
};
};
}

View File

@@ -0,0 +1,23 @@
{inputs, ...}: {
imports = [
inputs.hyprland.homeManagerModules.default
./appearance.nix
./inputs.nix
./keybinds.nix
./rules.nix
./startup.nix
];
config = {
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd = {
variables = ["--all"];
extraCommands = [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
};
};
}

View File

@@ -0,0 +1,75 @@
{
wayland.windowManager.hyprland.settings = {
monitor = [
"DP-3, 2560x1440@143.86, auto, auto"
"eDP-1,1920x1200@60.02,auto,1"
];
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
];
input = {
follow_mouse = 1;
accel_profile = "flat";
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = true;
disable_while_typing = true;
clickfinger_behavior = true;
scroll_factor = 0.5;
};
};
# Desktop keyboard
device = [
{
name = "pfu-limited-hhkb-hybrid";
kb_layout = "hhkbse";
kb_options = "lv3:rwin_switch";
}
{
name = "hhkb-hybrid_1-keyboard";
kb_layout = "hhkbse";
kb_options = "lv3:rwin_switch";
}
# Laptop keyboard
{
name = "at-translated-set-2-keyboard";
kb_layout = "se";
kb_options = "ctrl:swapcaps";
}
];
gestures = {
workspace_swipe = true;
workspace_swipe_distance = 400;
workspace_swipe_fingers = 3;
workspace_swipe_cancel_ratio = 0.2;
workspace_swipe_min_speed_to_force = 5;
workspace_swipe_direction_lock = true;
workspace_swipe_direction_lock_threshold = 10;
workspace_swipe_create_new = true;
};
misc = {
vrr = 2;
mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0;
force_default_wallpaper = 0;
disable_hyprland_logo = true;
disable_splash_rendering = true;
disable_autoreload = true;
};
xwayland = {
force_zero_scaling = false;
};
render = {
# explicit_sync = 2;
# explicit_sync_kms = 2;
# direct_scanout = false;
};
# cursor = {
# no_hardware_cursors = true;
# no_break_fs_vrr = true;
# min_refresh_rate = 24;
# };
};
}

View File

@@ -0,0 +1,101 @@
# KEYBINDS
{
wayland.windowManager.hyprland.settings = {
"$terminal" = "kitty";
"$fileManager" = "thunar";
"$passwordManager" = "keepassxc";
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$browser" = "firefox-nightly";
"$browserinc" = "firefox-nightly --private-window";
"$yazi" = "alacritty -e yazi";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mod" = "SUPER";
bind = [
# Custom binds
"$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
"$mod, A, exec, pkill -SIGUSR1 waybar"
"$mod, T, exec, $terminal"
"$mod, W, exec, $browser"
"$mod, K, exec, $passwordManager"
"$mod SHIFT, W, exec, $browserinc"
"$mod, Q, killactive,"
#bind = $mod, M, exec, hyprctl dispatch exit
#bind = $mod, E, exec, $fileManager
"$mod, E, exec, $fileManager"
"$mod SHIFT, E, exec, $yazi"
"$mod, F, fullscreen,"
"$mod SHIFT, F, togglefloating,"
"$mod, SPACE, exec, $menu"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
"$mod, C, exec, hyprctl dispatch exec copyq toggle"
"$mod, TAB, exec, $menuw"
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$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"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$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"
# Laptop controls
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioRaiseVolume, exec, pamixer -i 5"
",XF86AudioMute, exec, pamixer -m"
",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle"
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
",XF86MonBrightnessUp, exec, brightnessctl s +10%"
"$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on"
"$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off"
# Screenshot a window
"$mod, F10, exec, hyprshot -m window"
# Screenshot a monitor
", F10, exec, hyprshot -m output"
# Screenshot a region
"$mod SHIFT, F10, exec, hyprshot -m region"
# Example special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
# bind = $mod, mouse_down, workspace, e+1
# bind = $mod, mouse_up, workspace, e-1
];
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
}

View File

@@ -0,0 +1,44 @@
{
wayland.windowManager.hyprland.settings = {
# CALCURSE SETTINGS
windowrulev2 = [
"float,initialTitle:(floatcal)"
"size 843 650,initialTitle:(floatcal)"
"move 100%-w-20 40,initialTitle:(floatcal)"
#windowrulev2 = move 1708 32,class:(floatcal)
# RANGER/NNN SETTINGS
"float,class:(floatranger)"
"float,class:(floatnnn)"
#windowrulev2 = size 843 650,class:(floatranger)
#windowrulev2 = move 1708 32,class:(floatranger)
#windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
"suppressevent maximize, class:.* # You'll probably like this."
#windowrulev2 = noshadow, floating:0
"float,class:^(org.keepassxc.KeePassXC)$"
"center,class:^(org.keepassxc.KeePassXC)$"
"float,class:^(imv)$"
"float,class:^(com.github.hluk.copyq)$"
"float,class:^(blueman-manager)$"
"center,class:^(nwg-look)$"
"float,class:^(nwg-look)$"
"float,class:^(Lxappearance)$"
"float,class:(pavucontrol)$"
"move 100%-w-20 40,class:(pavucontrol)$"
"float,class:^(polkit-gnome-authentication-agent-1)$"
"float,class:^(org.gnome.Calculator)$"
"size 741 585,class:(pavucontrol)$"
"float,class:^(cnst.test)$"
"float,class:^(org.corectrl.CoreCtrl)$"
"float,class:^(feh)$"
"float,class:^(com.example.gtk-adieux)$"
];
windowrule = [
"center, ^(xarchiver)$"
"float, ^(xarchiver)$"
"float, ^(org.gnome.FileRoller)$"
"float, ^(org.freedesktop.impl.portal.desktop.kde)$"
];
};
}

View File

@@ -0,0 +1,20 @@
{
wayland.windowManager.hyprland.settings = {
exec-once = [
# STARTUP
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
"systemctl --user start polkit-gnome-authentication-agent-1"
# exec-once = lxqt-policykit-agent &
"waybar"
"pamixer --set-volume 50"
"blueman-applet & udiskie -Nt"
"nm-applet --indicator"
"mullvad-vpn"
# exec-once = swaybg -i ~/media/images/wallpaper.png
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
# exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server"
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
];
};
}

View File

@@ -0,0 +1,60 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.cnst.appearance;
in {
options = {
modules.wm.hyprland.cnst.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
general = {
gaps_in = 2;
gaps_out = 4;
border_size = 3;
#col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
#col.inactive_border = rgba(595959aa)
"col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg
"col.inactive_border" = "rgb(504945)";
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
decoration = {
rounding = 0;
blur = {
enabled = true;
size = 8;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = false;
shadow_range = 4;
shadow_render_power = 3;
# col.shadow = rgba(1a1a1aee)
};
animations = {
enabled = true;
bezier = [
"myBezier,0.05, 0.9, 0.1, 1.05"
];
animation = [
"windows, 1, 3, myBezier"
"windowsOut, 1, 3, default, popin 80%"
"border, 1, 3, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 3, default"
];
};
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
};
};
};
}

View File

@@ -0,0 +1,44 @@
{
inputs,
config,
lib,
pkgs,
userModules,
...
}: let
inherit (lib) mkIf mkEnableOption mkDefault;
cfg = config.modules.wm.hyprland.cnst;
in {
imports = [
"${userModules}/wm/hyprland/cnst/appearance.nix"
"${userModules}/wm/hyprland/cnst/inputs.nix"
"${userModules}/wm/hyprland/cnst/keybinds.nix"
"${userModules}/wm/hyprland/cnst/rules.nix"
"${userModules}/wm/hyprland/cnst/startup.nix"
];
options = {
modules.wm.hyprland.cnst.enable = mkEnableOption "Enable Hyprland";
};
config = mkIf cfg.enable {
modules.wm.hyprland.cnst = {
appearance.enable = mkDefault cfg.enable;
inputs.enable = mkDefault cfg.enable;
keybinds.enable = mkDefault cfg.enable;
rules.enable = mkDefault cfg.enable;
startup.enable = mkDefault cfg.enable;
};
wayland.windowManager.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.default;
systemd = {
variables = ["--all"];
extraCommands = [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
};
};
}

View File

@@ -0,0 +1,87 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.cnst.inputs;
in {
options = {
modules.wm.hyprland.cnst.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
monitor = [
"DP-3, 2560x1440@143.86, auto, auto"
"eDP-1,1920x1200@60.02,auto,1"
];
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
];
input = {
follow_mouse = 1;
accel_profile = "flat";
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = true;
disable_while_typing = true;
clickfinger_behavior = true;
scroll_factor = 0.5;
};
};
# Desktop keyboard
device = [
{
name = "pfu-limited-hhkb-hybrid";
kb_layout = "hhkbse";
kb_options = "lv3:rwin_switch";
}
{
name = "hhkb-hybrid_1-keyboard";
kb_layout = "hhkbse";
kb_options = "lv3:rwin_switch";
}
# Laptop keyboard
{
name = "at-translated-set-2-keyboard";
kb_layout = "se";
kb_options = "ctrl:swapcaps";
}
];
gestures = {
workspace_swipe = true;
workspace_swipe_distance = 400;
workspace_swipe_fingers = 3;
workspace_swipe_cancel_ratio = 0.2;
workspace_swipe_min_speed_to_force = 5;
workspace_swipe_direction_lock = true;
workspace_swipe_direction_lock_threshold = 10;
workspace_swipe_create_new = true;
};
misc = {
vrr = 2;
mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0;
force_default_wallpaper = 0;
disable_hyprland_logo = true;
disable_splash_rendering = true;
disable_autoreload = true;
};
xwayland = {
force_zero_scaling = false;
};
render = {
explicit_sync = 2;
explicit_sync_kms = 2;
direct_scanout = false;
};
# cursor = {
# no_hardware_cursors = true;
# no_break_fs_vrr = true;
# min_refresh_rate = 24;
# };
};
};
}

View File

@@ -0,0 +1,116 @@
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.cnst.keybinds;
in {
options = {
modules.wm.hyprland.cnst.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
"$terminal" = "kitty";
"$fileManager" = "thunar";
"$passwordManager" = "keepassxc";
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$browser" = "firefox";
"$browserinc" = "firefox --private-window";
"$yazi" = "alacritty -e yazi";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mod" = "SUPER";
bind = let
grimblast = lib.getExe pkgs.grimblast;
tesseract = lib.getExe pkgs.tesseract;
notify-send = lib.getExe' pkgs.libnotify "notify-send";
in [
# Custom binds
"$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
"$mod, A, exec, pkill -SIGUSR1 waybar"
"$mod, T, exec, $terminal"
"$mod, W, exec, $browser"
"$mod, K, exec, $passwordManager"
"$mod SHIFT, W, exec, $browserinc"
"$mod, Q, killactive,"
#bind = $mod, M, exec, hyprctl dispatch exit
#bind = $mod, E, exec, $fileManager
"$mod, E, exec, $fileManager"
"$mod SHIFT, E, exec, $yazi"
"$mod, F, fullscreen,"
"$mod SHIFT, F, togglefloating,"
"$mod, SPACE, exec, $menu"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
"$mod, C, exec, hyprctl dispatch exec copyq toggle"
"$mod, TAB, exec, $menuw"
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$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"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$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"
# Laptop controls
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioRaiseVolume, exec, pamixer -i 5"
",XF86AudioMute, exec, pamixer -m"
",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle"
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
",XF86MonBrightnessUp, exec, brightnessctl s +10%"
"$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on"
"$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off"
# Screenshotting
",Insert,exec,${grimblast} --notify --freeze copysave area"
"SHIFT,Insert,exec,${grimblast} --notify --freeze copysave output"
# To OCR
"ALT,Insert,exec,${grimblast} --freeze save area - | ${tesseract} - - | wl-copy && ${notify-send} -t 3000 'OCR result copied to buffer'"
# Example special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
# bind = $mod, mouse_down, workspace, e+1
# bind = $mod, mouse_up, workspace, e-1
];
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.cnst.rules;
in {
options = {
modules.wm.hyprland.cnst.rules.enable = mkEnableOption "Enables window rule settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
# CALCURSE SETTINGS
windowrulev2 = [
"float,initialTitle:(floatcal)"
"size 843 650,initialTitle:(floatcal)"
"move 100%-w-20 40,initialTitle:(floatcal)"
#windowrulev2 = move 1708 32,class:(floatcal)
# RANGER/NNN SETTINGS
"float,class:(floatranger)"
"float,class:(floatnnn)"
#windowrulev2 = size 843 650,class:(floatranger)
#windowrulev2 = move 1708 32,class:(floatranger)
#windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
"suppressevent maximize, class:.* # You'll probably like this."
#windowrulev2 = noshadow, floating:0
"float,class:^(org.keepassxc.KeePassXC)$"
"center,class:^(org.keepassxc.KeePassXC)$"
"float,class:^(imv)$"
"float,class:^(com.github.hluk.copyq)$"
"float,class:^(blueman-manager)$"
"center,class:^(nwg-look)$"
"float,class:^(nwg-look)$"
"float,class:^(Lxappearance)$"
"float,class:(pavucontrol)$"
"move 100%-w-20 40,class:(pavucontrol)$"
"float,class:^(polkit-gnome-authentication-agent-1)$"
"float,class:^(org.gnome.Calculator)$"
"size 741 585,class:(pavucontrol)$"
"float,class:^(cnst.test)$"
"float,class:^(org.corectrl.CoreCtrl)$"
"float,class:^(feh)$"
"float,class:^(com.example.gtk-adieux)$"
];
windowrule = [
"center, ^(xarchiver)$"
"float, ^(xarchiver)$"
"float, ^(org.gnome.FileRoller)$"
"float, ^(org.freedesktop.impl.portal.desktop.kde)$"
];
};
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.cnst.startup;
in {
options = {
modules.wm.hyprland.cnst.startup.enable = mkEnableOption "Enables startup settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
exec-once = [
# STARTUP
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
"systemctl --user start polkit-gnome-authentication-agent-1"
# exec-once = lxqt-policykit-agent &
"waybar"
"pamixer --set-volume 50"
"blueman-applet & udiskie -Nt"
"nm-applet --indicator"
"mullvad-vpn"
# exec-once = swaybg -i ~/media/images/wallpaper.png
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
# exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server"
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
];
};
};
}

View File

@@ -0,0 +1,7 @@
{userModules, ...}: {
imports = [
"${userModules}/wm/hyprland/cnst"
"${userModules}/wm/hyprland/toothpick"
# "${userModules}/wm/hyprland/adam"
];
}

View File

@@ -0,0 +1,60 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.toothpick.appearance;
in {
options = {
modules.wm.hyprland.toothpick.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
general = {
gaps_in = 2;
gaps_out = 4;
border_size = 3;
#col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
#col.inactive_border = rgba(595959aa)
"col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg
"col.inactive_border" = "rgb(504945)";
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
decoration = {
rounding = 0;
blur = {
enabled = true;
size = 8;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = false;
shadow_range = 4;
shadow_render_power = 3;
# col.shadow = rgba(1a1a1aee)
};
animations = {
enabled = true;
bezier = [
"myBezier,0.05, 0.9, 0.1, 1.05"
];
animation = [
"windows, 1, 3, myBezier"
"windowsOut, 1, 3, default, popin 80%"
"border, 1, 3, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 3, default"
];
};
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
};
};
};
}

View File

@@ -0,0 +1,44 @@
{
inputs,
config,
lib,
pkgs,
userModules,
...
}: let
inherit (lib) mkIf mkEnableOption mkDefault;
cfg = config.modules.wm.hyprland.toothpick;
in {
imports = [
"${userModules}/wm/hyprland/toothpick/appearance.nix"
"${userModules}/wm/hyprland/toothpick/inputs.nix"
"${userModules}/wm/hyprland/toothpick/keybinds.nix"
"${userModules}/wm/hyprland/toothpick/rules.nix"
"${userModules}/wm/hyprland/toothpick/startup.nix"
];
options = {
modules.wm.hyprland.toothpick.enable = mkEnableOption "Enable Hyprland";
};
config = mkIf cfg.enable {
modules.wm.hyprland.toothpick = {
appearance.enable = mkDefault cfg.enable;
inputs.enable = mkDefault cfg.enable;
keybinds.enable = mkDefault cfg.enable;
rules.enable = mkDefault cfg.enable;
startup.enable = mkDefault cfg.enable;
};
wayland.windowManager.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.default;
systemd = {
variables = ["--all"];
extraCommands = [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
};
};
}

View File

@@ -0,0 +1,73 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.toothpick.inputs;
in {
options = {
modules.wm.hyprland.toothpick.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
monitor = [
"monitor=DVI-D-1,1920x1080@144,auto,1"
];
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
];
input = {
follow_mouse = 1;
accel_profile = "flat";
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = true;
disable_while_typing = true;
clickfinger_behavior = true;
scroll_factor = 0.5;
};
};
# Desktop keyboard
device = [
{
name = "usb-hid-keyboard";
kb_layout = "se";
}
];
gestures = {
workspace_swipe = true;
workspace_swipe_distance = 400;
workspace_swipe_fingers = 3;
workspace_swipe_cancel_ratio = 0.2;
workspace_swipe_min_speed_to_force = 5;
workspace_swipe_direction_lock = true;
workspace_swipe_direction_lock_threshold = 10;
workspace_swipe_create_new = true;
};
misc = {
vrr = 2;
mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0;
force_default_wallpaper = 0;
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
xwayland = {
force_zero_scaling = false;
};
render = {
explicit_sync = 2;
explicit_sync_kms = 2;
direct_scanout = false;
};
cursor = {
no_hardware_cursors = true;
# no_break_fs_vrr = true;
# min_refresh_rate = 60;
};
};
};
}

View File

@@ -0,0 +1,116 @@
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.toothpick.keybinds;
in {
options = {
modules.wm.hyprland.toothpick.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
"$terminal" = "foot";
"$fileManager" = "thunar";
"$passwordManager" = "keepassxc";
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$browser" = "firefox";
"$browserinc" = "firefox --private-window";
"$ranger" = "rangerscript";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mod" = "ALT_L";
bind = let
grimblast = lib.getExe pkgs.grimblast;
tesseract = lib.getExe pkgs.tesseract;
notify-send = lib.getExe' pkgs.libnotify "notify-send";
in [
# Custom binds
"$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
"$mod, A, exec, pkill -SIGUSR1 waybar"
"$mod, T, exec, $terminal"
"$mod, W, exec, $browser"
"$mod, K, exec, $passwordManager"
"$mod SHIFT, W, exec, $browserinc"
"$mod, Q, killactive,"
#bind = $mod, M, exec, hyprctl dispatch exit
#bind = $mod, E, exec, $fileManager
"$mod, E, exec, $fileManager"
"$mod SHIFT, E, exec, $ranger"
"$mod, F, fullscreen,"
"$mod SHIFT, F, togglefloating,"
"$mod, SPACE, exec, $menu"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
"$mod, C, exec, hyprctl dispatch exec copyq toggle"
"$mod, TAB, exec, $menuw"
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$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"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$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"
# Laptop controls
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioRaiseVolume, exec, pamixer -i 5"
",XF86AudioMute, exec, pamixer -m"
",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle"
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
",XF86MonBrightnessUp, exec, brightnessctl s +10%"
"$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on"
"$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off"
# Screenshotting
",Print,exec,${grimblast} --notify --freeze copysave area"
"SHIFT,Print,exec,${grimblast} --notify --freeze copysave output"
# To OCR
"ALT,Print,exec,${grimblast} --freeze save area - | ${tesseract} - - | wl-copy && ${notify-send} -t 3000 'OCR result copied to buffer'"
# Example special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
# bind = $mod, mouse_down, workspace, e+1
# bind = $mod, mouse_up, workspace, e-1
];
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.toothpick.rules;
in {
options = {
modules.wm.hyprland.toothpick.rules.enable = mkEnableOption "Enables window rule settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
# CALCURSE SETTINGS
windowrulev2 = [
"float,initialTitle:(floatcal)"
"size 843 650,initialTitle:(floatcal)"
"move 100%-w-20 40,initialTitle:(floatcal)"
#windowrulev2 = move 1708 32,class:(floatcal)
# RANGER/NNN SETTINGS
"float,class:(floatranger)"
"float,class:(floatnnn)"
#windowrulev2 = size 843 650,class:(floatranger)
#windowrulev2 = move 1708 32,class:(floatranger)
#windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
"suppressevent maximize, class:.* # You'll probably like this."
#windowrulev2 = noshadow, floating:0
"float,class:^(org.keepassxc.KeePassXC)$"
"center,class:^(org.keepassxc.KeePassXC)$"
"float,class:^(imv)$"
"float,class:^(com.github.hluk.copyq)$"
"float,class:^(blueman-manager)$"
"center,class:^(nwg-look)$"
"float,class:^(nwg-look)$"
"float,class:^(Lxappearance)$"
"float,class:(pavucontrol)$"
"move 100%-w-20 40,class:(pavucontrol)$"
"float,class:^(polkit-gnome-authentication-agent-1)$"
"float,class:^(org.gnome.Calculator)$"
"size 741 585,class:(pavucontrol)$"
"float,class:^(org.corectrl.CoreCtrl)$"
"float,class:^(feh)$"
];
windowrule = [
"center, ^(xarchiver)$"
"float, ^(xarchiver)$"
"float, ^(org.gnome.FileRoller)$"
];
};
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.toothpick.startup;
in {
options = {
modules.wm.hyprland.toothpick.startup.enable = mkEnableOption "Enables startup settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
exec-once = [
# STARTUP
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
"systemctl --user start polkit-gnome-authentication-agent-1"
# exec-once = lxqt-policykit-agent &
"waybar"
"pamixer --set-volume 50"
"blueman-applet & udiskie -Nt"
"nm-applet --indicator"
"mullvad-vpn"
# exec-once = swaybg -i ~/media/images/wallpaper.png
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
# exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server"
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
];
};
};
}

View File

@@ -0,0 +1,36 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.utils.hypridle;
in {
options = {
modules.wm.utils.hypridle.enable = mkEnableOption "Enables hypridle";
};
config = mkIf cfg.enable {
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "hyprlock";
before_sleep_cmd = "$lock_cmd";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 900; # 15mins
on-timeout = "hyprlock";
}
{
timeout = 1200; # 20mins
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
};
}

View File

@@ -0,0 +1,90 @@
{
inputs,
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.utils.hyprlock;
in {
options = {
modules.wm.utils.hyprlock.enable = mkEnableOption "Enables hyprlock";
};
config = mkIf cfg.enable {
programs.hyprlock = {
enable = true;
package = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
settings = {
general = {
disable_loading_bar = true;
hide_cursor = true;
no_fade_in = true;
no_fade_out = true;
ignore_empty_input = true;
immediate_render = true;
};
background = [
{
monitor = "";
path = "~/media/images/dunes.png";
}
];
input-field = [
{
monitor = "";
size = "200, 50";
outline_thickness = 0;
dots_size = 0.1;
dots_spacing = 0.3;
dots_center = true;
dots_rounding = -1;
outer_color = "rgba(0,0,0,0)";
inner_color = "rgba(0,0,0,0)";
font_color = "rgba(FFFFFFFF)";
fade_on_empty = false;
fade_timeout = 0;
fail_text = "";
fail_transition = 0;
placeholder_text = "";
hide_input = false;
rounding = 0;
check_color = "rgba(0,0,0,0)";
fail_color = "rgba(0,0,0,0)";
position = "0, 20";
halign = "center";
valign = "center";
}
];
label = [
# date
{
monitor = "";
text = "cmd[update:3600000] date +'%A, %B %d'";
shadow_passes = 1;
shadow_boost = 0.5;
color = "rgba(FFFFFFFF)";
font_size = 25;
font_family = "Input Mono Compressed";
position = "0, 230";
halign = "center";
valign = "center";
}
# clock
{
monitor = "";
text = "cmd[update:1000] echo '$TIME'";
shadow_passes = 1;
shadow_boost = 0.5;
color = "rgba(FFFFFFFF)";
font_size = 85;
font_family = "Input Mono Compressed";
position = "0, 300";
halign = "center";
valign = "center";
}
];
};
};
};
}

View File

@@ -0,0 +1,45 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.utils.hyprpaper;
in {
options = {
modules.wm.utils.hyprpaper.enable = mkEnableOption "Enables hyprpaper";
};
config = mkIf cfg.enable {
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
splash_offset = 2.0;
preload = [
"~/media/images/nix.png"
"~/media/images/stacks.png"
"~/media/images/ship.png"
"~/media/images/cabin.png"
"~/media/images/dunes.png"
"~/media/images/globe.png"
"~/media/images/space.jpg"
"~/media/images/galaxy.png"
"~/media/images/deathstar.png"
"~/media/images/trollskog.png"
];
wallpaper = [
# cnix
"DP-3,~/media/images/dunes.png"
# adampad
"eDP-1,~/media/images/dunes.png"
# toothpc
"DVI-D-1,~/media/images/dunes.png"
# "DP-1,/share/wallpapers/cat_pacman.png"
];
};
};
};
}