migrate hyprland to nix
This commit is contained in:
parent
62ed20d1f5
commit
5db1a379e4
15 changed files with 250 additions and 283 deletions
22
home-manager/hyprland/config/input.nix
Normal file
22
home-manager/hyprland/config/input.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
input = {
|
||||
kb_layout = "us";
|
||||
kb_variant = "";
|
||||
kb_model = "";
|
||||
kb_options = "";
|
||||
kb_rules = "";
|
||||
|
||||
follow_mouse = 1;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = "no";
|
||||
};
|
||||
|
||||
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
|
||||
};
|
||||
|
||||
device = {
|
||||
name = "epic-mouse-v1";
|
||||
sensitivity = -0.5;
|
||||
};
|
||||
}
|
||||
81
home-manager/hyprland/config/keybinds.nix
Normal file
81
home-manager/hyprland/config/keybinds.nix
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
bind =
|
||||
[
|
||||
"$mainMod, T, exec, $terminal"
|
||||
"$mainMod, X, killactive,"
|
||||
"$mainMod, ESCAPE, exit,"
|
||||
"$mainMod, E, exec, $fileManager"
|
||||
"$mainMod, F, togglefloating,"
|
||||
"$mainMod, R, exec, $menu"
|
||||
"$mainMod, P, pseudo," # dwindle
|
||||
"$mainMod, V, togglesplit," # dwindle
|
||||
"$mainMod, L, exec, $lockScreen" # hyprlock
|
||||
"$mainMod, period, exec, emote"
|
||||
"$mainMod, B, exec, firefox"
|
||||
"$mainMod CTRL, F, fullscreen"
|
||||
", PRINT, exec, grim -g \"$(slurp)\" - | swappy -f -"
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
"$mainMod, left, movefocus, l"
|
||||
"$mainMod, right, movefocus, r"
|
||||
"$mainMod, up, movefocus, u"
|
||||
"$mainMod, down, movefocus, d"
|
||||
|
||||
###############################################################################
|
||||
# Special workspaces
|
||||
###############################################################################
|
||||
# Scratchpad
|
||||
"CTRL SHIFT, S, togglespecialworkspace, magic"
|
||||
"CTRL $mainMod, S, movetoworkspace, special:magic"
|
||||
# Terminal
|
||||
"CTRL SHIFT, T, togglespecialworkspace, terminal"
|
||||
"CTRL $mainMod, T, movetoworkspace, special:terminal"
|
||||
# Music
|
||||
"CTRL SHIFT, M, togglespecialworkspace, music"
|
||||
"CTRL $mainMod, M, movetoworkspace, special:music"
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
"$mainMod, mouse_down, workspace, e+1"
|
||||
"$mainMod, mouse_up, workspace, e-1"
|
||||
|
||||
# Switch workspaces
|
||||
"CTRL ALT, right, workspace, e+1"
|
||||
"CTRL ALT, left, workspace, e-1"
|
||||
|
||||
# Audio keybinds
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-"
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
", XF86AudioStop, exec,"
|
||||
", XF86AudioPrev, exec, playerctl previous"
|
||||
", XF86AudioNext, exec, playerctl next"
|
||||
]
|
||||
++ (
|
||||
# workspaces
|
||||
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
||||
builtins.concatLists (
|
||||
builtins.genList (
|
||||
x:
|
||||
let
|
||||
ws =
|
||||
let
|
||||
c = (x + 1) / 10;
|
||||
in
|
||||
builtins.toString (x + 1 - (c * 10));
|
||||
in
|
||||
[
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
"$mainMod, ${ws}, workspace, ${toString (x + 1)}"
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
"$mainMod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
|
||||
]
|
||||
) 10
|
||||
)
|
||||
);
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = [
|
||||
"$mainMod, mouse:272, movewindow"
|
||||
"$mainMod, mouse:273, resizewindow"
|
||||
];
|
||||
}
|
||||
71
home-manager/hyprland/config/look.nix
Normal file
71
home-manager/hyprland/config/look.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
general = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
gaps_in = 10;
|
||||
gaps_out = 20;
|
||||
border_size = 3;
|
||||
"col.active_border" = "$color4 $color13 45deg";
|
||||
"col.inactive_border" = "$color0";
|
||||
|
||||
layout = "dwindle";
|
||||
|
||||
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
|
||||
allow_tearing = true;
|
||||
};
|
||||
|
||||
decoration = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
rounding = 10;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 3;
|
||||
passes = 1;
|
||||
ignore_opacity = true;
|
||||
};
|
||||
|
||||
drop_shadow = "yes";
|
||||
shadow_range = 4;
|
||||
shadow_render_power = 3;
|
||||
"col.shadow" = "rgba(1a1a1aee)";
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = "yes";
|
||||
|
||||
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||
|
||||
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
|
||||
|
||||
animation = [
|
||||
"windows, 1, 7, myBezier"
|
||||
"windowsOut, 1, 7, default, popin 80%"
|
||||
"border, 1, 10, default"
|
||||
"borderangle, 1, 8, default"
|
||||
"fade, 1, 7, default"
|
||||
"workspaces, 1, 6, default"
|
||||
];
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
pseudotile = "yes"; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
preserve_split = "yes"; # you probably want this
|
||||
};
|
||||
|
||||
master = {
|
||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
};
|
||||
|
||||
gestures = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
workspace_swipe = "off";
|
||||
};
|
||||
|
||||
misc = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
force_default_wallpaper = 0; # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
};
|
||||
}
|
||||
12
home-manager/hyprland/config/nvidia.nix
Normal file
12
home-manager/hyprland/config/nvidia.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
env = [
|
||||
"XCURSOR_SIZE,24"
|
||||
"QT_QPA_PLATFORM,wayland"
|
||||
"WLR_NO_HARDWARE_CURSORS,1"
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"XDG_SESSION_TYPE,wayland"
|
||||
"GBM_BACKEND,nvidia-drm"
|
||||
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
|
||||
|
||||
];
|
||||
}
|
||||
19
home-manager/hyprland/config/rules.nix
Normal file
19
home-manager/hyprland/config/rules.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
windowrule = [
|
||||
"float, title:rofi"
|
||||
"workspace special:terminal, kitty"
|
||||
"workspace special:music, title:^Spotify Premium$"
|
||||
"workspace 1, discord"
|
||||
"opacity 0.999, discord"
|
||||
"workspace 1, Caprine"
|
||||
"opacity 0.999, Caprine"
|
||||
"workspace 2, firefox"
|
||||
"opacity 0.999, firefox"
|
||||
"workspace 3, class:^(steam_app_553850)$"
|
||||
"float, title:Friends List"
|
||||
];
|
||||
windowrulev2 = [
|
||||
"nomaxsize, class:.*"
|
||||
"opacity 0.85 0.8, initialTitle:^Spotify Premium$"
|
||||
];
|
||||
}
|
||||
11
home-manager/hyprland/config/scripts/start-swaync.sh
Normal file
11
home-manager/hyprland/config/scripts/start-swaync.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
CONFIG_FILES="$HOME/.config/swaync/ $HOME/.cache/wal/"
|
||||
|
||||
trap "killall swaync" EXIT
|
||||
swaync &
|
||||
|
||||
while true; do
|
||||
inotifywait -e create,modify -r $CONFIG_FILES
|
||||
swaync-client -R & swaync-client -rs
|
||||
done
|
||||
12
home-manager/hyprland/config/scripts/start-waybar.sh
Normal file
12
home-manager/hyprland/config/scripts/start-waybar.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
CONFIG_FILES="$HOME/.config/waybar/ $HOME/.cache/wal/"
|
||||
|
||||
trap "killall waybar" EXIT
|
||||
|
||||
while true; do
|
||||
sleep 1.6
|
||||
waybar &
|
||||
inotifywait -e create,modify -r $CONFIG_FILES
|
||||
killall waybar
|
||||
done
|
||||
13
home-manager/hyprland/config/startup.nix
Normal file
13
home-manager/hyprland/config/startup.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
exec-once = [
|
||||
''
|
||||
bash ${builtins.getEnv "PWD"}/dotfiles/home-manager/hyprland/config/scripts/start-swaync.sh
|
||||
''
|
||||
"hypridle"
|
||||
"swww-daemon"
|
||||
''
|
||||
bash ${builtins.getEnv "PWD"}/dotfiles/home-manager/hyprland/config/scripts/start-waybar.sh
|
||||
''
|
||||
"emote"
|
||||
];
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
imports = [
|
||||
./gtk.nix
|
||||
./hypridle.nix
|
||||
./hyprland.nix
|
||||
./hyprlock.nix
|
||||
];
|
||||
|
||||
|
|
@ -14,15 +15,7 @@
|
|||
size = 24;
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
hypr = {
|
||||
source = ../../hypr;
|
||||
recursive = true;
|
||||
};
|
||||
rofi = {
|
||||
source = ../../rofi;
|
||||
recursive = true;
|
||||
|
|
|
|||
31
home-manager/hyprland/hyprland.nix
Normal file
31
home-manager/hyprland/hyprland.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
configs = [
|
||||
./config/input.nix
|
||||
./config/keybinds.nix
|
||||
./config/look.nix
|
||||
./config/nvidia.nix
|
||||
./config/rules.nix
|
||||
./config/startup.nix
|
||||
];
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
extraConfig = builtins.readFile /home/benjamin/.cache/wal/colors-hyprland.conf;
|
||||
settings = lib.mkMerge (
|
||||
[
|
||||
{
|
||||
monitor = "DP-1,preferred,auto,auto";
|
||||
"$terminal" = "kitty";
|
||||
"$fileManager" = "Thunar";
|
||||
"$menu" = "rofi -show drun";
|
||||
"$lockScreen" = "hyprlock";
|
||||
|
||||
"$mainMod" = "SUPER";
|
||||
}
|
||||
]
|
||||
++ (lib.forEach configs (config: import config))
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue