Some zed fixes

This commit is contained in:
Emmet 2025-10-25 15:03:45 -05:00
parent 8770c61d40
commit 68e2da66c8
2 changed files with 16 additions and 12 deletions

View file

@ -38,8 +38,9 @@ in {
(lib.mkIf (editor == "emacs") "emacsclient -c") (lib.mkIf (editor == "emacs") "emacsclient -c")
(lib.mkIf (editor == "neovide") "neovide -- --listen /tmp/nvimsocket") (lib.mkIf (editor == "neovide") "neovide -- --listen /tmp/nvimsocket")
(lib.mkIf (editor == "vscodium") "codium -n") (lib.mkIf (editor == "vscodium") "codium -n")
(lib.mkIf (editor == "zed") "zeditor --wait")
(lib.mkIf (builtins.elem editor [ "vim" "nvim" "nano" "micro" ]) ("exec " + term + " -e " + editor)) (lib.mkIf (builtins.elem editor [ "vim" "nvim" "nano" "micro" ]) ("exec " + term + " -e " + editor))
(lib.mkIf (!(builtins.elem editor [ "emacs" "vim" "nvim" "neovide" "nano" "micro" "vscodium" ])) editor) (lib.mkIf (!(builtins.elem editor [ "emacs" "vim" "nvim" "neovide" "nano" "micro" "vscodium" "zed" ])) editor)
]; ];
}; };
}; };

View file

@ -61,7 +61,7 @@ in
xdg-desktop-portal-termfilechooser xdg-desktop-portal-termfilechooser
]; ];
}; };
xdg.portal.config.common = { xdg.portal.config.common = {
default = [ "hyprland" ]; default = [ "hyprland" ];
"org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; "org.freedesktop.impl.portal.FileChooser" = "termfilechooser";
@ -70,9 +70,9 @@ in
default = [ "hyprland" ]; default = [ "hyprland" ];
"org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; "org.freedesktop.impl.portal.FileChooser" = "termfilechooser";
}; };
home.sessionVariables.TERMCMD = "kitty --class=filechoose_yazi"; home.sessionVariables.TERMCMD = "kitty --class=filechoose_yazi";
xdg.configFile."xdg-desktop-portal-termfilechooser/config" = xdg.configFile."xdg-desktop-portal-termfilechooser/config" =
{ {
force = true; force = true;
@ -373,6 +373,9 @@ in
"center,title:(Resource)" "center,title:(Resource)"
"tile,title:(Godot)" "tile,title:(Godot)"
"suppressevent maximize,class:^(steam)$" "suppressevent maximize,class:^(steam)$"
"float,title:^(Unlock Database - KeePassXC)$"
"size 80% 85%,title:^(Unlock Database - KeePassXC)$"
"center,title:^(Unlock Database - KeepassXC)$"
] ++ lib.optionals (!performance) [ ] ++ lib.optionals (!performance) [
"opacity 0.80,class:^(dev.zed.Zed)$" "opacity 0.80,class:^(dev.zed.Zed)$"
"opacity 0.80,class:^(org.pulseaudio.pavucontrol)$" "opacity 0.80,class:^(org.pulseaudio.pavucontrol)$"
@ -582,36 +585,36 @@ in
* Grayscale * Grayscale
*/ */
#version 300 es #version 300 es
precision highp float; precision highp float;
in vec2 v_texcoord; in vec2 v_texcoord;
uniform sampler2D tex; uniform sampler2D tex;
out vec4 fragColor; out vec4 fragColor;
// Enum for type of grayscale conversion // Enum for type of grayscale conversion
const int LUMINOSITY = 0; const int LUMINOSITY = 0;
const int LIGHTNESS = 1; const int LIGHTNESS = 1;
const int AVERAGE = 2; const int AVERAGE = 2;
/** /**
* Type of grayscale conversion. * Type of grayscale conversion.
*/ */
const int Type = LUMINOSITY; const int Type = LUMINOSITY;
// Enum for selecting luma coefficients // Enum for selecting luma coefficients
const int PAL = 0; const int PAL = 0;
const int HDTV = 1; const int HDTV = 1;
const int HDR = 2; const int HDR = 2;
/** /**
* Formula used to calculate relative luminance. * Formula used to calculate relative luminance.
* (Only applies to type = "luminosity".) * (Only applies to type = "luminosity".)
*/ */
const int LuminosityType = HDR; const int LuminosityType = HDR;
void main() { void main() {
vec4 pixColor = texture2D(tex, v_texcoord); vec4 pixColor = texture2D(tex, v_texcoord);
float gray; float gray;
if (Type == LUMINOSITY) { if (Type == LUMINOSITY) {
// https://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems // https://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems
@ -630,7 +633,7 @@ in
gray = (pixColor.r + pixColor.g + pixColor.b) / 3.0; gray = (pixColor.r + pixColor.g + pixColor.b) / 3.0;
} }
vec3 grayscale = vec3(gray); vec3 grayscale = vec3(gray);
fragColor = vec4(grayscale, pixColor.a); fragColor = vec4(grayscale, pixColor.a);
} }
''; '';