loqusion / hyprshade Goto Github PK
View Code? Open in Web Editor NEWHyprland shader configuration tool
License: MIT License
Hyprland shader configuration tool
License: MIT License
Is it possible to configure different shaders for different monitors?
systemd tend to excute on some random secs to avoid cpu request peak.But hyprshade need to run exactly at starttime.
In install.py,
[Timer]
AccuracySec=1ms
{timer_config}
I found hyprshade failed to run ,or maybe it run before some secs leads to shade change didnot apply.So I add the rule in hyprshade.timer, have not test it.
Would it be possible to have an invert color Shader?
Hey, just a minor issue/request.
I would like to be able to take screenshots (currently using grim
and slurp
) in such a a way that the shader isn't present.
I saw that at one point this was behavior and it was "fixed" so I can understand if my request seems backwards. It would be nice because if you send the screenshot to someone that also has a filter on then they'll see the images as extra yellow due to the stacked filters. Overall keeping the filter applied on the screenshots is just a destructive operation and removes the true colors from the underlying image.
I do have a simple workaround so it's not thaat big of an issue, so it's just a nice-to-have:
hyprshade off && grim -g "$(slurp)" - | xsel -b && hyprshade on blue-light-filter.glsl
Thanks for making hyprshade.
scandir_recursive
is used to find shader files in one's shader directory. It has various issues that will probably only occur for less than 0.1% of users:
max_depth
.hyprshade/src/hyprshade/utils.py
Lines 19 to 34 in b6de0db
Is there a way to reduce intensity on the "night-light-filter"?
If not I think its a must have!
This way it's easy for NixOS users to use this.
If any of the directories ls
searches has any subdirectories, they will be treated as regular files due to the implementation of ls_dirs
. This means any shader files within subdirectories will not be listed, and it also means that if you run the command with -l
, it will panic.
After copying the configuration file according to the document, directly running hyprshade install
will return an error:
Error: [Errno 2] No such file or directory: '/home/<username>/.config/systemd/user/hyprshade.service'
hyprshade install
can run successfully only after manually creating this systemd file.
OS: Arch Linux x86_64
Kernel: 6.5.1
hyprshade version: aur/hyprshade-git 0.10.0.r1.g7b78d98-1, however, this error has occurred in previous versions.
~/.config
❯ nix shell nixpkgs#hyprshade
~/.config
❯ mkdir -p hyprshade/shaders
~/.config
❯ cd hyprshade/
~/.config/hyprshade
❯ nvim shaders/blue-light.glsl
~/.config/hyprshade took 40s
❯ hyprshade on blue-light
Error: Shader 'blue-light' could not be found in any of the following directories:
[ble: exit 1]
~/.config/hyprshade
❯ hyprshade on ./shaders/blue-light.glsl
Error: Shader 'blue-light' could not be found in any of the following directories:
[ble: exit 1]
~/.config/hyprshade
❯ ls shaders
blue-light.glsl
~/.config/hyprshade
❯ hyprshade on /home/x/.config/hyprshade/shaders/hyblue-light.glsl
~/.config/hyprshade
❯ # success!
~/.config/hyprshade
❯ mkdir ~/.config/hypr/shaders
~/.config/hyprshade
❯ cp ./shaders/blue-light.glsl ../hypr/shaders/
~/.config/hyprshade
❯ hyprshade off
~/.config/hyprshade
❯ hyprshade on blue-light
~/.config/hyprshade
❯ # success!
The program does not print the directories it searched, but to my understanding it looks in some share folder and in in ~/.config/hypr/shaders
.
If the hyprshader config is allowed to live in ~/.config/hyprshader
, I want to also put my shaders in ~/.config/hyprshader/shaders
.
Share screenshots of your shaders here:
Installing hyprshade with yay
fails with:
(13/13) checking for file conflicts [#########################################] 100%
error: failed to commit transaction (conflicting files)
hyprland: /usr/bin/Hyprland exists in filesystem
hyprland: /usr/bin/hyprctl exists in filesystem
hyprland: /usr/lib/libwlroots.so.13032 exists in filesystem
hyprland: /usr/share/wayland-sessions exists in filesystem
I just reinstalled Hyprland but built it manually. Could that be linked?
Thanks! ❤️
As stated in the title, toggling a shader doesn't work and fails with a wall of text. Turning them off or on manually however, works perfectly fine (aka hyprshade on shader | hyprshade off).
Here's the output: https://pastebin.com/p66E7Uyq
I tried every possible way to build/install hyprshade so its not a version issue
Otherwise, if the user does something like hyprshade on vibrance
and there happens to be an unrelated file in the current directory named vibrance
, bad things will happen.
I create a new shade named 'blue-light-filter-gentle.glsl' in config/hypr/shaders, there already have a blue-light-filter.glsl in /usr/share/hyprshade/,but when blue-light-filter-gentle.glsl is applied when its blue-light-filter's turn, hyprshade auto can't switch to it.
I have to rename blue-light-filter-gentle.glsl to gentle-blue-light-filter.glsl, in that way hyprshade can tell them apart.
please check it ,I hope I am wrong.I just rename the file ,did not dig into the source file.
Please replace the code below with blue-light-shader.glsl. This one is properly formatted.
// from https://github.com/hyprwm/Hyprland/issues/1140#issuecomment-1335128437
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
const float temperatureStrength = 1.0;
const float temperature = 4800.0;
#define WithQuickAndDirtyLuminancePreservation
const float LuminancePreservationFactor = 1.0;
// function from https://www.shadertoy.com/view/4sc3D7
vec3 colorTemperatureToRGB(const in float temperature) {
// values from: http://blenderartists.org/forum/showthread.php?270332-OSL-Goodness&p=2268693&viewfull=1#post2268693
mat3 m = (temperature <= 6500.0) ?
mat3 (
vec3 (0.0, -2902.1955373783176 , -8257.7997278925690 ),
vec3 (0.0, 1669.5803561666639 , 2575.2827530017594 ),
vec3 (1.0, 1.3302673723350029, 1.8993753891711275)
) :
mat3 (
vec3 ( 1745.0425298314172 , 1216.6168361476490 , -8257.7997278925690 ),
vec3 (-2666.3474220535695 , -2173.1012343082230 , 2575.2827530017594 ),
vec3 ( 0.55995389139931482, 0.70381203140554553, 1.8993753891711275)
);
return mix (
clamp (
vec3 (
m[0] / (
vec3 (
clamp (
temperature,
1000.0,
40000.0
)
) + m[1]
) + m[2]
),
vec3(0.0),
vec3(1.0)
),
vec3(1.0),
smoothstep(
1000.0,
0.0,
temperature
)
);
}
void main() {
vec4 pixColor = texture2D (
tex,
v_texcoord
);
// RGB
vec3 color = vec3 (
pixColor[0],
pixColor[1],
pixColor[2]
);
#ifdef WithQuickAndDirtyLuminancePreservation
color *= mix (
1.0,
dot (
color,
vec3 (
0.2126,
0.7152,
0.0722
)
) / max (
dot (
color,
vec3 (
0.2126,
0.7152,
0.0722
)
),
1e-5
),
LuminancePreservationFactor
);
#endif
color = mix (
color,
color * colorTemperatureToRGB (
temperature
),
temperatureStrength
);
vec4 outCol = vec4 (
color,
pixColor[3]
);
gl_FragColor = outCol;
}
It would be nice if the README had screenshots of shaders for demonstration purposes. However, I (and others) have not been able to take proper screenshots (a screenshot is taken without the shader applied).
EDIT: Ok, screenshots with shaders are working again. I'll upload them soon.
The shaders apply to my whole screen except the cursor, I would attach a screenshot but not sure how to take one with a cursor in it.
Thanks for this awesome piece of software, would love if this issue could be resolved :)
Example:
bloom /home/loqusion/.config/hypr/shaders
- blue-light-filter /home/loqusion/.config/hypr/shaders
blue-light-filter /usr/share/hyprshade/shaders
* blue-light-filter /home/loqusion/.config/hypr/shaders
blur /home/loqusion/.config/hypr/shaders
crt /home/loqusion/.config/hypr/shaders
drugs /home/loqusion/.config/hypr/shaders
vibrance /usr/share/hyprshade/shaders
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.