nixos-configuration/modules/window-managers/hyprland/plugins.nix
2025-03-21 02:00:29 +01:00

241 lines
8 KiB
Nix

{
pkgs,
inputs,
...
}: {
plugins = with pkgs.hyprlandPlugins; [
hyprfocus
# inputs.hypr-dynamic-cursors.packages.${pkgs.system}.hypr-dynamic-cursors
];
pluginConfig = ''
hyprfocus {
enabled = yes
animate_floating = yes
animate_workspacechange = yes
focus_animation = shrink
# Beziers for focus animations
bezier = bezIn, 0.5,0.0,1.0,0.5
bezier = bezOut, 0.0,0.5,0.5,1.0
bezier = overshot, 0.05, 0.9, 0.1, 1.05
bezier = smoothOut, 0.36, 0, 0.66, -0.56
bezier = smoothIn, 0.25, 1, 0.5, 1
bezier = realsmooth, 0.28,0.29,.69,1.08
# Flash settings
flash {
flash_opacity = 0.95
in_bezier = realsmooth
in_speed = 0.5
out_bezier = realsmooth
out_speed = 3
}
# Shrink settings
shrink {
shrink_percentage = 0.95
in_bezier = realsmooth
in_speed = 1
out_bezier = realsmooth
out_speed = 2
}
}
plugin:dynamic-cursors {
# enables the plugin
enabled = true
# sets the cursor behaviour, supports these values:
# tilt - tilt the cursor based on x-velocity
# rotate - rotate the cursor based on movement direction
# stretch - stretch the cursor shape based on direction and velocity
# none - do not change the cursors behaviour
mode = tilt
# minimum angle difference in degrees after which the shape is changed
# smaller values are smoother, but more expensive for hw cursors
threshold = 2
# override the mode behaviour per shape
# this is a keyword and can be repeated many times
# by default, there are no rules added
# see the dedicated `shape rules` section below!
# shaperule = <shape-name>, <mode> (optional), <property>: <value>, ...
# shaperule = <shape-name>, <mode> (optional), <property>: <value>, ...
# ...
# for mode = rotate
rotate {
# length in px of the simulated stick used to rotate the cursor
# most realistic if this is your actual cursor size
length = 20
# clockwise offset applied to the angle in degrees
# this will apply to ALL shapes
offset = 0.0
}
# for mode = tilt
tilt {
# controls how powerful the tilt is, the lower, the more power
# this value controls at which speed (px/s) the full tilt is reached
limit = 5000
# relationship between speed and tilt, supports these values:
# linear - a linear function is used
# quadratic - a quadratic function is used (most realistic to actual air drag)
# negative_quadratic - negative version of the quadratic one, feels more aggressive
function = negative_quadratic
}
# for mode = stretch
stretch {
# controls how much the cursor is stretched
# this value controls at which speed (px/s) the full stretch is reached
limit = 3000
# relationship between speed and stretch amount, supports these values:
# linear - a linear function is used
# quadratic - a quadratic function is used
# negative_quadratic - negative version of the quadratic one, feels more aggressive
function = quadratic
}
# configure shake to find
# magnifies the cursor if its is being shaken
shake {
# enables shake to find
enabled = true
# use nearest-neighbour (pixelated) scaling when shaking
# may look weird when effects are enabled
nearest = true
# controls how soon a shake is detected
# lower values mean sooner
threshold = 6.0
# magnification level immediately after shake start
base = 4.0
# magnification increase per second when continuing to shake
speed = 4.0
# how much the speed is influenced by the current shake intensitiy
influence = 0.0
# maximal magnification the cursor can reach
# values below 1 disable the limit (e.g. 0)
limit = 0.0
# time in millseconds the cursor will stay magnified after a shake has ended
timeout = 2000
# show cursor behaviour `tilt`, `rotate`, etc. while shaking
effects = false
# enable ipc events for shake
# see the `ipc` section below
ipc = false
}
# use hyprcursor to get a higher resolution texture when the cursor is magnified
# see the `hyprcursor` section below
hyprcursor {
# use nearest-neighbour (pixelated) scaling when magnifing beyond texture size
# this will also have effect without hyprcursor support being enabled
# 0 / false - never use pixelated scaling
# 1 / true - use pixelated when no highres image
# 2 - always use pixleated scaling
nearest = true
# enable dedicated hyprcursor support
enabled = true
# resolution in pixels to load the magnified shapes at
# be warned that loading a very high-resolution image will take a long time and might impact memory consumption
# -1 means we use [normal cursor size] * [shake:base option]
resolution = -1
# shape to use when clientside cursors are being magnified
# see the shape-name property of shape rules for possible names
# specifying clientside will use the actual shape, but will be pixelated
fallback = clientside
}
}
'';
# wayland.windowManager.hyprland.hyprfocus = {
# enabled = true;
# animate_floating = false;
# animate_workspacechange = false;
#
# # Possible values:
# # - shrink
# # - flash
# focus_animation = "shrink";
#
# bezier = [
# "bezIn, 0.5,0.0,1.0,0.5"
# "bezOut, 0.0,0.5,0.5,1.0"
# "overshot, 0.05, 0.9, 0.1, 1.05"
# "smoothOut, 0.36, 0, 0.66, -0.56"
# "smoothIn, 0.25, 1, 0.5, 1"
# "realsmooth, 0.28,0.29,.69,1.08"
# ];
#
# # Flash animation settings
# flash = {
# flash_opacity = 0.95;
# in_bezier = "realsmooth";
# in_speed = 0.5;
# out_bezier = "realsmooth";
# out_speed = 3;
# };
#
# # Shrink animation settings
# shrink = {
# shrink_percentage = 0.95;
# in_bezier = "realsmooth";
# in_speed = 1;
# out_bezier = "realsmooth";
# out_speed = 2;
# };
# };
#
# wayland.windowManager.hyprland.plugin."dynamic-cursor" = {
# enabled = true;
#
# # Possible values:
# # - rotate
# # - tilt
# # - stretch
# # - none
# mode = "tilt";
#
# # minimum angle difference in degrees after which the shape is changed
# # smaller values are smoother, but more expensive for hw cursors
# threshold = 2;
#
# # override the mode behaviour per shape
# # this is a keyword and can be repeated many times
# # by default, there are no rules added
# # shaperule = <shape-name>, <mode> (optional), <property>: <value>, ...
# shaperule = [];
#
# tilt = {
# # controls how powerful the tilt is, the lower, the more power
# # this value controls at which speed (px/s) the full tilt is reached
# limit = 5000;
#
# # relationship between speed and tilt, supports these values:
# # linear - a linear function is used
# # quadratic - a quadratic function is used (most realistic to actual air drag)
# # negative_quadratic - negative version of the quadratic one, feels more aggressive
# function = "negative_quadratic";
# };
# };
}