refactor(hypr): move more config into nix files
All checks were successful
Discord / discord commits (push) Has been skipped

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

@ -1,41 +1,10 @@
# Autostart programs # Autostart programs
exec-once = ags
exec-once = sleep 6; nextcloud --background
exec-once = sleep 10; tmux new-session -s gsr -d 'bash -c $HOME/.config/gsr.sh' exec-once = sleep 10; tmux new-session -s gsr -d 'bash -c $HOME/.config/gsr.sh'
# TODO: add gpu-save-replay bind # TODO: add gpu-save-replay bind
## fix fullscreen game resolution ## fix fullscreen game resolution
exec-once = xrandr --output DP-5 --primary exec-once = xrandr --output DP-5 --primary
## Special window apps
exec-once = [workspace special:thunder silent] thunderbird
windowrule = workspace special:thunder silent,^(thunderbird)$
bind = $mainMod, T, togglespecialworkspace, thunder
exec-once = [workspace special:spot silent] spotify
windowrule = workspace special:spot silent,^(Spotify)$
bind = $mainMod, S, togglespecialworkspace, spot
# Input settings
device:razer-razer-naga-pro {
sensitivity = -0.5
accel_profile = "flat"
}
# Binds
bind = Alt Shift, Tab, cyclenext
## Ags & co
bindn = , Escape, exec, ags run-js 'closeAll()'
bind = $mainMod SHIFT, E , exec, ags -t powermenu
bind = $mainMod , D , exec, ags -t applauncher
# Rules
windowrule = tile,^(firefox)$
# Cosmetic # Cosmetic
general { general {

View file

@ -1,39 +1,3 @@
# Autostart programs
exec-once = sleep 3; nextcloud --background
exec-once = squeekboard
exec-once = ags
exec-once = sleep 3; ags -t applauncher
## Special window apps
exec-once = [workspace special:thunder silent] thunderbird
windowrule = workspace special:thunder silent,^(thunderbird)$
bind = $mainMod, T, togglespecialworkspace, thunder
exec-once = [workspace special:spot silent] spotify
windowrule = workspace special:spot silent,^(Spotify)$
bind = $mainMod, S, togglespecialworkspace, spot
# Input settings
device:razer-razer-naga-pro-1 {
sensitivity = -0.5
accel_profile = "flat"
}
# Binds
## Brightness control
binde =, XF86MonBrightnessUp, exec, ags -r 'Brightness.screen += 0.05'
binde =, XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'
bindr = CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'
## Ags & co
bindn = , Escape, exec, ags run-js 'closeAll()'
bind = $mainMod SHIFT, E , exec, ags -t powermenu
bind = $mainMod , D , exec, ags -t applauncher
# Cosmetic # Cosmetic
general { general {
gaps_in = 5 gaps_in = 5
@ -79,23 +43,3 @@ animations {
animation = border, 1, 10, default animation = border, 1, 10, default
animation = borderangle, 1, 8, default animation = borderangle, 1, 8, default
} }
# For GParted auth
windowrule = size 741 288,^(org.kde.ksshaskpass)$
windowrule = move cursor -370 -144,^(org.kde.ksshaskpass)$
windowrule = float,^(org.gnome.Calculator)$
windowrule = size 1231 950,title:^(Open Folder)$
windowrule = float,title:^(Open Folder)$
windowrule = size 1231 950,title:^(Open File)$
windowrule = float,title:^(Open File)$
windowrule = float,^(com.nextcloud.desktopclient.nextcloud)$
windowrule = move cursor -15 -10,^(com.nextcloud.desktopclient.nextcloud)$
windowrule = size 400 581,^(com.nextcloud.desktopclient.nextcloud)$
windowrule = tile,^(photoshop.exe)$
windowrule = tile,^(libreoffice)$

View file

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

View file

@ -5,6 +5,7 @@
... ...
}: let }: let
inherit (config.vars) mainUser hostName; inherit (config.vars) mainUser hostName;
isTouchscreen = config.hardware.sensor.iio.enable; isTouchscreen = config.hardware.sensor.iio.enable;
in { in {
services.upower.enable = true; services.upower.enable = true;
@ -18,7 +19,9 @@ in {
... ...
}: let }: let
symlink = config.lib.file.mkOutOfStoreSymlink; symlink = config.lib.file.mkOutOfStoreSymlink;
inherit (lib) optionals; inherit (lib) optionalAttrs optionals;
cfgHypr = config.wayland.windowManager.hyprland;
in { in {
programs.ags.enable = true; programs.ags.enable = true;
@ -53,6 +56,27 @@ in {
ydotool 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 }: let
inherit (lib) concatStringsSep optionals; inherit (lib) concatStringsSep optionals;
inherit (config.vars) configDir mainUser mainMonitor; inherit (config.vars) mainUser mainMonitor;
isNvidia = config.hardware.nvidia.modesetting.enable; isNvidia = config.hardware.nvidia.modesetting.enable;
in { in {
@ -34,10 +34,10 @@ in {
# HOME-MANAGER CONFIG # HOME-MANAGER CONFIG
home-manager.users.${mainUser} = { home-manager.users.${mainUser} = {
imports = [ imports = [
../../home/theme.nix
./hycov.nix ./hycov.nix
./hyprgrass.nix ./hyprgrass.nix
./inputs.nix
./style.nix
]; ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
@ -49,8 +49,7 @@ in {
gset = pkgs.gsettings-desktop-schemas; gset = pkgs.gsettings-desktop-schemas;
in in
[ [
"XCURSOR_SIZE, 24" "XDG_DATA_DIRS, ${concatStringsSep ":" [
"XDG_DATA_DIRS, ${builtins.concatStringsSep ":" [
"${gset}/share/gsettings-schemas/${gset.name}" "${gset}/share/gsettings-schemas/${gset.name}"
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}" "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
"$XDG_DATA_DIRS" "$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"; "$mainMod" = "SUPER";
bind = [ bind = [
@ -173,8 +151,6 @@ in {
smart_split = true; smart_split = true;
special_scale_factor = 0.8; special_scale_factor = 0.8;
}; };
source = ["${configDir}/hypr/main.conf"];
}; };
}; };
@ -187,8 +163,6 @@ in {
alsa-utils alsa-utils
p7zip # for reshade p7zip # for reshade
swww
qt5.qtwayland qt5.qtwayland
qt6.qtwayland qt6.qtwayland
libayatana-appindicator 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 { in {
imports = [../dolphin.nix]; imports = [../dolphin.nix];
programs = { programs.kdeconnect.enable = true;
kdeconnect.enable = true;
};
home-manager.users.${mainUser} = { home-manager.users.${mainUser} = {
imports = [ imports = [
@ -62,10 +60,24 @@ in {
"kdeconnect-indicator" "kdeconnect-indicator"
"wl-paste --watch cliphist store" "wl-paste --watch cliphist store"
"sleep 3; nextcloud --background"
"[workspace special:thunder silent] thunderbird"
"[workspace special:spot silent] spotify"
]; ];
windowrule = [ windowrule = [
"noborder,^(wofi)$" "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 = [ bind = [
@ -76,6 +88,9 @@ in {
",Print, exec, grim -g \"$(slurp)\" - | swappy -f -" ",Print, exec, grim -g \"$(slurp)\" - | swappy -f -"
"$mainMod SHIFT, C, exec, wl-color-picker" "$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)$" "float,^(org.kde.polkit-kde-authentication-agent-1)$"
"size 741 288,^(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)$" "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 = [ 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"];
};
};
}