refactor(hypr): move more config into nix files

This commit is contained in:
matt1432 2024-02-05 09:56:42 -05:00
parent 1b235a4b7e
commit efa318d4d1
9 changed files with 121 additions and 121 deletions

View file

@ -50,6 +50,7 @@ class Tablet extends Service {
constructor() {
super();
this.#listenOskState();
execAsync('squeekboard').catch(print);
}
#blockInputs() {

View file

@ -5,6 +5,7 @@
...
}: let
inherit (config.vars) mainUser hostName;
isTouchscreen = config.hardware.sensor.iio.enable;
in {
services.upower.enable = true;
@ -18,7 +19,9 @@ in {
...
}: let
symlink = config.lib.file.mkOutOfStoreSymlink;
inherit (lib) optionals;
inherit (lib) optionalAttrs optionals;
cfgHypr = config.wayland.windowManager.hyprland;
in {
programs.ags.enable = true;
@ -53,6 +56,27 @@ in {
ydotool
]));
};
wayland.windowManager.hyprland = {
settings = {
exec-once = [
"ags"
"sleep 3; ags -r 'App.openWindow(\"applauncher\")'"
];
bindn = [",Escape, exec, ags run-js 'closeAll()'"];
bind = [
"$mainMod SHIFT, E , exec, ags -t powermenu"
"$mainMod , D , exec, ags -t applauncher"
];
binde = [
## Brightness control
", XF86MonBrightnessUp, exec, ags -r 'Brightness.screen += 0.05'"
", XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'"
];
bindr = ["CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'"];
};
};
})
];
}

View file

@ -6,7 +6,7 @@
...
}: let
inherit (lib) concatStringsSep optionals;
inherit (config.vars) configDir mainUser mainMonitor;
inherit (config.vars) mainUser mainMonitor;
isNvidia = config.hardware.nvidia.modesetting.enable;
in {
@ -34,10 +34,10 @@ in {
# HOME-MANAGER CONFIG
home-manager.users.${mainUser} = {
imports = [
../../home/theme.nix
./hycov.nix
./hyprgrass.nix
./inputs.nix
./style.nix
];
wayland.windowManager.hyprland = {
@ -49,8 +49,7 @@ in {
gset = pkgs.gsettings-desktop-schemas;
in
[
"XCURSOR_SIZE, 24"
"XDG_DATA_DIRS, ${builtins.concatStringsSep ":" [
"XDG_DATA_DIRS, ${concatStringsSep ":" [
"${gset}/share/gsettings-schemas/${gset.name}"
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
"$XDG_DATA_DIRS"
@ -88,27 +87,6 @@ in {
])
];
input = let
inherit (config.services.xserver) xkb;
in {
kb_layout = xkb.layout;
kb_variant = xkb.variant;
follow_mouse = true;
touchpad = {
natural_scroll = true;
disable_while_typing = false;
};
};
exec-once =
[
"hyprctl setcursor Dracula-cursors 24"
"swww init --no-cache && swww img -t none ${pkgs.dracula-theme}/wallpapers/waves.png"
]
++ optionals (! isNull mainMonitor)
["hyprctl dispatch focusmonitor ${mainMonitor}"];
"$mainMod" = "SUPER";
bind = [
@ -173,8 +151,6 @@ in {
smart_split = true;
special_scale_factor = 0.8;
};
source = ["${configDir}/hypr/main.conf"];
};
};
@ -187,8 +163,6 @@ in {
alsa-utils
p7zip # for reshade
swww
qt5.qtwayland
qt6.qtwayland
libayatana-appindicator

View file

@ -0,0 +1,36 @@
{
lib,
osConfig,
...
}: let
inherit (lib) optionals;
inherit (osConfig.services.xserver) xkb;
inherit (osConfig.vars) mainMonitor;
razerConf = {
sensitivity = -0.5;
accel_profile = "flat";
};
in {
wayland.windowManager.hyprland = {
settings = {
input = {
kb_layout = xkb.layout;
kb_variant = xkb.variant;
follow_mouse = true;
touchpad = {
natural_scroll = true;
disable_while_typing = false;
};
};
"device:razer-razer-naga-pro" = razerConf;
"device:razer-razer-naga-pro-1" = razerConf;
exec-once =
optionals (! isNull mainMonitor)
["hyprctl dispatch focusmonitor ${mainMonitor}"];
};
};
}

View file

@ -7,9 +7,7 @@
in {
imports = [../dolphin.nix];
programs = {
kdeconnect.enable = true;
};
programs.kdeconnect.enable = true;
home-manager.users.${mainUser} = {
imports = [
@ -62,10 +60,24 @@ in {
"kdeconnect-indicator"
"wl-paste --watch cliphist store"
"sleep 3; nextcloud --background"
"[workspace special:thunder silent] thunderbird"
"[workspace special:spot silent] spotify"
];
windowrule = [
"noborder,^(wofi)$"
"tile,^(libreoffice)$"
"float,^(org.gnome.Calculator)$"
"float,^(com.nextcloud.desktopclient.nextcloud)$"
"move cursor -15 -10,^(com.nextcloud.desktopclient.nextcloud)$"
"size 400 581,^(com.nextcloud.desktopclient.nextcloud)$"
"workspace special:thunder silent,^(thunderbird)$"
"workspace special:spot silent,^(Spotify)$"
];
bind = [
@ -76,6 +88,9 @@ in {
",Print, exec, grim -g \"$(slurp)\" - | swappy -f -"
"$mainMod SHIFT, C, exec, wl-color-picker"
"$mainMod, T, togglespecialworkspace, thunder"
"$mainMod, S, togglespecialworkspace, spot"
];
};
};

View file

@ -41,6 +41,10 @@ in {
"float,^(org.kde.polkit-kde-authentication-agent-1)$"
"size 741 288,^(org.kde.polkit-kde-authentication-agent-1)$"
"center,^(org.kde.polkit-kde-authentication-agent-1)$"
# For GParted auth
"size 741 288,^(org.kde.ksshaskpass)$"
"move cursor -370 -144,^(org.kde.ksshaskpass)$"
];
bind = [

View file

@ -0,0 +1,33 @@
{
config,
pkgs,
...
}: let
inherit (config.vars) configDir;
in {
imports = [../../home/theme.nix];
home.packages = with pkgs; [swww];
wayland.windowManager.hyprland = {
settings = {
env = ["XCURSOR_SIZE, 24"];
exec-once = [
"hyprctl setcursor Dracula-cursors 24"
"swww init --no-cache && swww img -t none ${pkgs.dracula-theme}/wallpapers/waves.png"
];
windowrule = [
"size 1231 950,title:^(Open Folder)$"
"float,title:^(Open Folder)$"
"size 1231 950,title:^(Open File)$"
"float,title:^(Open File)$"
];
# This file should only be used for theming
source = ["${configDir}/hypr/main.conf"];
};
};
}