Skip to content

Commit

Permalink
hyprland: extraConfig -> settings
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Dec 14, 2023
1 parent bed0454 commit 90087bf
Show file tree
Hide file tree
Showing 8 changed files with 310 additions and 291 deletions.
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions home/profiles/io/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,20 @@
home.sessionVariables = {
GDK_SCALE = "2";
};

wayland.windowManager.hyprland.settings = let
accelpoints = "0.21 0.000 0.040 0.080 0.140 0.200 0.261 0.326 0.418 0.509 0.601 0.692 0.784 0.875 0.966 1.058 1.149 1.241 1.332 1.424 1.613";
in {
monitor = [
"DP-1, preferred, -1920x0, auto"
"DP-2, preferred, -1920x0, auto"
"eDP-1, preferred, auto, auto"
];

"device:elan2841:00-04f3:31eb-touchpad" = {
accel_profile = "custom ${accelpoints}";
scroll_points = accelpoints;
natural_scroll = true;
};
};
}
3 changes: 2 additions & 1 deletion home/shell/cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ in {
unrar

# utils
file
du-dust
duf
fd
file
jaq
ripgrep

# file managers
Expand Down
113 changes: 113 additions & 0 deletions home/wayland/hyprland/binds.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{default, ...}: let
screenshotarea = "hyprctl keyword animation 'fadeOut,0,0,default'; grimblast --notify copysave area; hyprctl keyword animation 'fadeOut,1,4,default'";

# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
workspaces = builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
]
)
10);
in {
wayland.windowManager.hyprland.settings = {
# mouse movements
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];

# binds
bind = let
monocle = "dwindle:no_gaps_when_only";
in
[
# compositor commands
"$mod SHIFT, E, exec, pkill Hyprland"
"$mod, Q, killactive,"
"$mod, F, fullscreen,"
"$mod, G, togglegroup,"
"$mod SHIFT, N, changegroupactive, f"
"$mod SHIFT, P, changegroupactive, b"
"$mod, R, togglesplit,"
"$mod, T, togglefloating,"
"$mod, P, pseudo,"
"$mod ALT, ,resizeactive,"

# toggle "monocle" (no_gaps_when_only)
"$mod, M, exec, hyprctl keyword ${monocle} $(($(hyprctl getoption ${monocle} -j | jaq -r '.int') ^ 1))"

# utility
# terminal
"$mod, Return, exec, run-as-service ${default.terminal.name}"
# logout menu
"$mod, Escape, exec, wlogout -p layer-shell"
# lock screen
"$mod, L, exec, loginctl lock-session"
# select area to perform OCR on
"$mod, O, exec, run-as-service wl-ocr"

# move focus
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"

# screenshot
# stop animations while screenshotting; makes black border go away
", Print, exec, ${screenshotarea}"
"$mod SHIFT, R, exec, ${screenshotarea}"

"CTRL, Print, exec, grimblast --notify --cursor copysave output"
"$mod SHIFT CTRL, R, exec, grimblast --notify --cursor copysave output"

"ALT, Print, exec, grimblast --notify --cursor copysave screen"
"$mod SHIFT ALT, R, exec, grimblast --notify --cursor copysave screen"

# special workspace
"$mod SHIFT, grave, movetoworkspace, special"
"$mod, grave, togglespecialworkspace, eDP-1"

# cycle workspaces
"$mod, bracketleft, workspace, m-1"
"$mod, bracketright, workspace, m+1"

# cycle monitors
"$mod SHIFT, bracketleft, focusmonitor, l"
"$mod SHIFT, bracketright, focusmonitor, r"
]
++ workspaces;

bindr = [
# launcher
"$mod, SUPER_L, exec, pkill .${default.launcher}-wrapped || run-as-service ${default.launcher}"
];

bindl = [
# media controls
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
", XF86AudioNext, exec, playerctl next"

# volume
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
];

bindle = [
# volume
", XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+"
", XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-"

# backlight
", XF86MonBrightnessUp, exec, brillo -q -u 300000 -A 5"
", XF86MonBrightnessDown, exec, brillo -q -u 300000 -U 5"
];
};
}
Loading

0 comments on commit 90087bf

Please sign in to comment.