update niri; random tweaks
This commit is contained in:
parent
99ccea27eb
commit
402d9f4957
10 changed files with 171 additions and 130 deletions
|
@ -55,17 +55,22 @@ in {
|
|||
size = config.modules.desktop.themes.cursorTheme.size;
|
||||
};
|
||||
|
||||
prefer-no-csd = true;
|
||||
|
||||
# xwayland stuff
|
||||
xwayland-satellite.enable = true;
|
||||
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite-unstable;
|
||||
environment = {
|
||||
DISPLAY = ":0";
|
||||
};
|
||||
|
||||
prefer-no-csd = true;
|
||||
|
||||
layout = {
|
||||
gaps = 6;
|
||||
|
||||
center-focused-column = "on-overflow";
|
||||
|
||||
background-color = config.modules.desktop.themes.niri.background;
|
||||
|
||||
focus-ring = {
|
||||
enable = false;
|
||||
width = 1;
|
||||
|
@ -80,33 +85,69 @@ in {
|
|||
inactive.color = config.modules.desktop.themes.niri.inactive;
|
||||
};
|
||||
|
||||
insert-hint = {
|
||||
enable = true;
|
||||
display.color = config.modules.desktop.themes.niri.accent;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enable = true;
|
||||
# TODO: remove this?
|
||||
# this is a way to make the shadow appear on rounded corners
|
||||
# see: https://github.com/YaLTeR/niri/blob/e251ca7340bc71870c3a81a7ffc3d9bde58e685a/resources/default-config.kdl#L201
|
||||
draw-behind-window = true;
|
||||
draw-behind-window = false;
|
||||
offset.x = 0;
|
||||
offset.y = 0;
|
||||
softness = 30;
|
||||
spread = 2;
|
||||
color = config.modules.desktop.themes.niri.shadow;
|
||||
};
|
||||
|
||||
insert-hint.enable = false;
|
||||
};
|
||||
|
||||
overview = {
|
||||
backdrop-color = config.modules.desktop.themes.niri.background;
|
||||
workspace-shadow = {
|
||||
enable = true;
|
||||
offset.x = 0;
|
||||
offset.y = 0;
|
||||
softness = 30;
|
||||
spread = 2;
|
||||
color = config.modules.desktop.themes.niri.shadow;
|
||||
};
|
||||
};
|
||||
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
|
||||
screenshot-path = null;
|
||||
screenshot-path = "${replaceString "$HOME" "~" config.hm.xdg.userDirs.extraConfig.screenshots}/%Y-%m-%d %H-%M-%S.png";
|
||||
|
||||
animations = {
|
||||
shaders.window-resize = ''
|
||||
vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) {
|
||||
window-open = {
|
||||
kind.spring = {
|
||||
damping-ratio = 0.8;
|
||||
stiffness = 300;
|
||||
epsilon = 0.001;
|
||||
};
|
||||
custom-shader = ''
|
||||
vec4 default_open(vec3 coords_curr_geo, vec3 size_curr_geo) {
|
||||
// Scale up the window.
|
||||
float scale = max(0.0, (niri_progress / 2.0 + 0.5));
|
||||
coords_curr_geo = vec3((coords_curr_geo.xy - vec2(0.5)) / scale + vec2(0.5), 1.0);
|
||||
|
||||
// Get color from the window texture.
|
||||
vec3 coords_tex = niri_geo_to_tex * coords_curr_geo;
|
||||
vec4 color = texture2D(niri_tex, coords_tex.st);
|
||||
|
||||
// Make the window opaque.
|
||||
color *= niri_clamped_progress;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
vec4 open_color(vec3 coords_curr_geo, vec3 size_curr_geo) {
|
||||
return default_open(coords_curr_geo, size_curr_geo);
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
window-resize.custom-shader = ''
|
||||
vec4 stretch_or_crop_next(vec3 coords_curr_geo, vec3 size_curr_geo) {
|
||||
vec3 coords_next_geo = niri_curr_geo_to_next_geo * coords_curr_geo;
|
||||
|
||||
vec3 coords_stretch = niri_geo_to_tex_next * coords_curr_geo;
|
||||
|
@ -141,36 +182,40 @@ in {
|
|||
|
||||
return color;
|
||||
}
|
||||
|
||||
vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) {
|
||||
return stretch_or_crop_next(coords_curr_geo, size_curr_geo);
|
||||
}
|
||||
'';
|
||||
|
||||
window-close = {
|
||||
easing = {
|
||||
kind.easing = {
|
||||
curve = "linear";
|
||||
duration-ms = 600;
|
||||
};
|
||||
custom-shader = ''
|
||||
vec4 fall_and_rotate(vec3 coords_geo, vec3 size_geo) {
|
||||
float progress = niri_clamped_progress * niri_clamped_progress;
|
||||
vec2 coords = (coords_geo.xy - vec2(0.5, 1.0)) * size_geo.xy;
|
||||
coords.y -= progress * 1440.0;
|
||||
float random = (niri_random_seed - 0.5) / 2.0;
|
||||
random = sign(random) - random;
|
||||
float max_angle = 0.5 * random;
|
||||
float angle = progress * max_angle;
|
||||
mat2 rotate = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));
|
||||
coords = rotate * coords;
|
||||
coords_geo = vec3(coords / size_geo.xy + vec2(0.5, 1.0), 1.0);
|
||||
vec3 coords_tex = niri_geo_to_tex * coords_geo;
|
||||
vec4 color = texture2D(niri_tex, coords_tex.st);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
vec4 close_color(vec3 coords_geo, vec3 size_geo) {
|
||||
return fall_and_rotate(coords_geo, size_geo);
|
||||
}
|
||||
'';
|
||||
};
|
||||
shaders.window-close = ''
|
||||
vec4 fall_and_rotate(vec3 coords_geo, vec3 size_geo) {
|
||||
float progress = niri_clamped_progress * niri_clamped_progress;
|
||||
vec2 coords = (coords_geo.xy - vec2(0.5, 1.0)) * size_geo.xy;
|
||||
coords.y -= progress * 1440.0;
|
||||
float random = (niri_random_seed - 0.5) / 2.0;
|
||||
random = sign(random) - random;
|
||||
float max_angle = 0.5 * random;
|
||||
float angle = progress * max_angle;
|
||||
mat2 rotate = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));
|
||||
coords = rotate * coords;
|
||||
coords_geo = vec3(coords / size_geo.xy + vec2(0.5, 1.0), 1.0);
|
||||
vec3 coords_tex = niri_geo_to_tex * coords_geo;
|
||||
vec4 color = texture2D(niri_tex, coords_tex.st);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
vec4 close_color(vec3 coords_geo, vec3 size_geo) {
|
||||
return fall_and_rotate(coords_geo, size_geo);
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
|
@ -269,13 +314,24 @@ in {
|
|||
enable = true;
|
||||
};
|
||||
}
|
||||
# special rounded corner cases. gah!!
|
||||
# also for some reason int literals aren't accepted
|
||||
# so multiply by 1.0 to make it a float
|
||||
{
|
||||
matches = [
|
||||
{ namespace = "^launcher$"; }
|
||||
{ namespace = "^wob$"; }
|
||||
];
|
||||
# see earlier shadow config; this is here because it's a transparent window, special case
|
||||
shadow.draw-behind-window = false;
|
||||
matches = [ { namespace = "^rofi$"; } ];
|
||||
geometry-corner-radius = allCorners (config.modules.desktop.fonts.fonts.monospace.size * 1.0); # its 1em, so
|
||||
}
|
||||
{
|
||||
matches = [ { namespace = "^launcher$"; } ];
|
||||
geometry-corner-radius = allCorners (config.hm.programs.fuzzel.settings.border.radius * 1.0);
|
||||
}
|
||||
{
|
||||
matches = [ { namespace = "^notifications$"; } ];
|
||||
geometry-corner-radius = allCorners (config.hm.services.dunst.settings.global.corner_radius * 1.0);
|
||||
}
|
||||
{
|
||||
matches = [ { namespace = "^waybar$"; } ];
|
||||
geometry-corner-radius = allCorners (config.modules.desktop.fonts.fonts.monospace.size * 1.0); # its 1em, so
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -330,17 +386,16 @@ in {
|
|||
"Mod+8".action = focus-workspace 8;
|
||||
"Mod+9".action = focus-workspace 9;
|
||||
"Mod+0".action = focus-workspace 10;
|
||||
# no clue why, this got removed!! TODO: find an alternative
|
||||
# "Mod+Shift+1".action = move-column-to-workspace 1;
|
||||
# "Mod+Shift+2".action = move-column-to-workspace 2;
|
||||
# "Mod+Shift+3".action = move-column-to-workspace 3;
|
||||
# "Mod+Shift+4".action = move-column-to-workspace 4;
|
||||
# "Mod+Shift+5".action = move-column-to-workspace 5;
|
||||
# "Mod+Shift+6".action = move-column-to-workspace 6;
|
||||
# "Mod+Shift+7".action = move-column-to-workspace 7;
|
||||
# "Mod+Shift+8".action = move-column-to-workspace 8;
|
||||
# "Mod+Shift+9".action = move-column-to-workspace 9;
|
||||
# "Mod+Shift+0".action = move-column-to-workspace 10;
|
||||
"Mod+Shift+1".action.move-column-to-workspace = 1;
|
||||
"Mod+Shift+2".action.move-column-to-workspace = 2;
|
||||
"Mod+Shift+3".action.move-column-to-workspace = 3;
|
||||
"Mod+Shift+4".action.move-column-to-workspace = 4;
|
||||
"Mod+Shift+5".action.move-column-to-workspace = 5;
|
||||
"Mod+Shift+6".action.move-column-to-workspace = 6;
|
||||
"Mod+Shift+7".action.move-column-to-workspace = 7;
|
||||
"Mod+Shift+8".action.move-column-to-workspace = 8;
|
||||
"Mod+Shift+9".action.move-column-to-workspace = 9;
|
||||
"Mod+Shift+0".action.move-column-to-workspace = 10;
|
||||
|
||||
"Mod+Comma".action = consume-window-into-column;
|
||||
"Mod+Period".action = expel-window-from-column;
|
||||
|
@ -361,7 +416,7 @@ in {
|
|||
"Mod+Shift+Minus".action = set-window-height "-10%";
|
||||
"Mod+Shift+Equal".action = set-window-height "+10%";
|
||||
|
||||
"Print".action = screenshot;
|
||||
"Print".action = screenshot { show-pointer = false; };
|
||||
|
||||
"Mod+Grave".action = toggle-overview;
|
||||
|
||||
|
@ -370,12 +425,12 @@ in {
|
|||
"XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
|
||||
"XF86AudioMicMute".allow-when-locked = true;
|
||||
|
||||
"XF86LaunchA".action = screenshot;
|
||||
"XF86LaunchA".action = screenshot { show-pointer = false; };
|
||||
"XF86LaunchB".action = sh "${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20";
|
||||
"XF86ScreenSaver".action = sh "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
|
||||
# substitutions for when not on laptop
|
||||
"Mod+Shift+S".action = screenshot;
|
||||
"Mod+Shift+S".action = screenshot { show-pointer = false; };
|
||||
"Mod+Shift+P".action = sh "${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20";
|
||||
"Mod+L".action = sh "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue