Skip to content

Commit 2f398db

Browse files
authored
Merge branch 'dev' into dropdown
2 parents 14e7b4c + cdb73c1 commit 2f398db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2365
-346
lines changed

Configs/.config/hyde/wallbash/always/discord.dcol

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,17 @@ ${XDG_CACHE_HOME}/hyde/wallbash/discord.css|${WALLBASH_SCRIPTS}/discord.sh
2222
--settingsicons: 0;
2323
}
2424

25+
::-webkit-scrollbar {
26+
width: 10px !important;
27+
}
28+
29+
::-webkit-scrollbar-thumb {
30+
/* On bigger screens, the scrollbar's border radius falls short,
31+
so we put an obscenely large value for the border radius */
32+
border-radius: 500px !important;
33+
background: rgba(var(--accentcolor), 0.7) !important;
34+
background-clip: content-box !important;
35+
border: 2px solid transparent !important; /* Margin for the scrollbar */
36+
}
37+
2538
/* Any custom CSS below here */

Configs/.config/hyde/wallbash/scripts/discord.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
#// source variables
5-
5+
cacheDir="${cacheDir:-$XDG_CACHE_HOME/hyde}"
66
discord_col="${cacheDir}/wallbash/discord.css"
77
declare -a client_list=()
88

Configs/.config/hypr/shaders.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
#! █▀ █░█ ▄▀█ █▀▄ █▀▀ █▀█ █▀
3+
#! ▄█ █▀█ █▀█ █▄▀ ██▄ █▀▄ ▄█
4+
5+
# *┌────────────────────────────────────────────────────────────────────────────┐
6+
# *│ |
7+
# *│ HyDE Controlled content DO NOT EDIT! |
8+
# *│ Edit or add shaders in the ./shaders/ directory |
9+
# *│ and run the 'shaders.sh --select' command to update this file |
10+
# *│ Modify ./shaders/user-defines.frag to add your own custom defines |
11+
# *│ The 'shader.sh' script will automatically copy this file to the cache |
12+
# *│ and the cache will be used in the shader |
13+
# *│ |
14+
# *└────────────────────────────────────────────────────────────────────────────┘
15+
16+
# name of the shader
17+
$SCREEN_SHADER = "disable"
18+
# path to the shader
19+
$SCREEN_SHADER_PATH = "$HOME/.config/hypr/shaders/disable.frag"
20+
# path to the compiled shader // override this in '../hyde/config.toml'
21+
$SCREEN_SHADER_COMPILED = ./shaders/.compiled.cache.glsl
22+
23+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
┌─────────────────────────────────────────────────────────────────────────┐
3+
│ This is a blank shader to disable hyprland shaders. │
4+
└─────────────────────────────────────────────────────────────────────────┘
5+
*/
6+
7+
precision mediump float;
8+
varying vec2 v_texcoord;
9+
uniform sampler2D tex;
10+
11+
void main() {
12+
gl_FragColor = texture2D(tex, v_texcoord);
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./*
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// from https://github.com/hyprwm/Hyprland/issues/1140#issuecomment-1335128437
2+
3+
4+
5+
/*
6+
To override this parameters create a file named './blue-light-filter.inc'
7+
We only need to match the file name and use 'inc' to incdicate that
8+
this is an "include" file
9+
Example:
10+
11+
┌────────────────────────────────────────────────────────────────────────────┐
12+
│ // file: ./blue-light-filter.inc │
13+
│ // float in Kelvin (lower = warmer) │
14+
│ #define BLUE_LIGHT_FILTER_TEMPERATURE 3000.0 │
15+
│ // float (0.0 = no effect, 1.0 = full effect) │
16+
│ #define BLUE_LIGHT_FILTER_INTENSITY 0.9 │
17+
│ │
18+
└────────────────────────────────────────────────────────────────────────────┘
19+
20+
21+
*/
22+
23+
24+
#ifndef BLUE_LIGHT_FILTER_TEMPERATURE
25+
#define BLUE_LIGHT_FILTER_TEMPERATURE 3000.0 // Default fallback value
26+
#endif
27+
#ifndef BLUE_LIGHT_FILTER_INTENSITY
28+
#define BLUE_LIGHT_FILTER_INTENSITY 0.9 // Default fallback value
29+
#endif
30+
31+
32+
precision highp float;
33+
varying vec2 v_texcoord;
34+
uniform sampler2D tex;
35+
36+
37+
const float TEMPERATURE = BLUE_LIGHT_FILTER_TEMPERATURE;
38+
const float INTENSITY = BLUE_LIGHT_FILTER_INTENSITY;
39+
40+
#define WithQuickAndDirtyLuminancePreservation
41+
const float LuminancePreservationFactor = 1.0;
42+
43+
// function from https://www.shadertoy.com/view/4sc3D7
44+
// valid from 1000 to 40000 K (and additionally 0 for pure full white)
45+
vec3 colorTemperatureToRGB(const in float TEMPERATURE) {
46+
// values from: http://blenderartists.org/forum/showthread.php?270332-OSL-Goodness&p=2268693&viewfull=1#post2268693
47+
mat3 m = (TEMPERATURE <= 6500.0) ? mat3(vec3(0.0, -2902.1955373783176, -8257.7997278925690),
48+
vec3(0.0, 1669.5803561666639, 2575.2827530017594),
49+
vec3(1.0, 1.3302673723350029, 1.8993753891711275))
50+
: mat3(vec3(1745.0425298314172, 1216.6168361476490, -8257.7997278925690),
51+
vec3(-2666.3474220535695, -2173.1012343082230, 2575.2827530017594),
52+
vec3(0.55995389139931482, 0.70381203140554553, 1.8993753891711275));
53+
return mix(clamp(vec3(m[0] / (vec3(clamp(TEMPERATURE, 1000.0, 40000.0)) + m[1]) + m[2]), vec3(0.0), vec3(1.0)),
54+
vec3(1.0), smoothstep(1000.0, 0.0, TEMPERATURE));
55+
}
56+
57+
void main() {
58+
vec4 pixColor = texture2D(tex, v_texcoord);
59+
60+
// RGB
61+
vec3 color = vec3(pixColor[0], pixColor[1], pixColor[2]);
62+
63+
#ifdef WithQuickAndDirtyLuminancePreservation
64+
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),
65+
LuminancePreservationFactor);
66+
#endif
67+
68+
color = mix(color, color * colorTemperatureToRGB(TEMPERATURE), INTENSITY);
69+
70+
vec4 outCol = vec4(color, pixColor[3]);
71+
72+
gl_FragColor = outCol;
73+
}
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
// Color Vision Shader for Hyprland - Simulates and compensates for color vision deficiency (CVD)
2+
// by: khing
3+
4+
/**********************************************************************************************
5+
* DEV NOTES: *
6+
* PLEASE NOTE THAT I DON'T HAVE ANY KNOWLEDGE OF GLSL, SO THIS SHADER MAY NOT BE OPTIMAL. *
7+
* I ONLY SEARCHED ONLINE FOR WAYS TO SIMULATE COLOR VISION DEFICIENCY AND DALTONIZATION. *
8+
* I ONLY TESTED THIS USING AN ANDROID APP CALLED "CVSIMULATOR". *
9+
* IF YOU HAVE ANY SUGGESTIONS FOR IMPROVEMENTS, PLEASE LET ME KNOW! *
10+
**********************************************************************************************/
11+
12+
13+
/*
14+
To override this parameters create a file named './color-vision.inc'
15+
We only need to match the file name and use 'inc' to incdicate that
16+
this is an "include" file
17+
Example:
18+
┌────────────────────────────────────────────────────────────────────────────┐
19+
│ //file: ./color-vision.inc │
20+
│ // integer: 0:Normal vision, 1:Protanopia, 2:Deuteranopia, 3:Tritanopia │
21+
│ #define COLOR_VISION_MODE 1 │
22+
│ // float: 0.0:No effect, -1.0 daltonization, 1.0: CVD simulation │
23+
│ #define COLOR_VISION_INTENSITY 0.5 │
24+
│ │
25+
└────────────────────────────────────────────────────────────────────────────┘
26+
*/
27+
28+
29+
#ifndef COLOR_VISION_MODE
30+
#define COLOR_VISION_MODE 0 // Default fallback value
31+
#endif
32+
#ifndef COLOR_VISION_INTENSITY
33+
#define COLOR_VISION_INTENSITY 0.0 // Default fallback value
34+
#endif
35+
36+
/*
37+
┌─────────────────────────────────────────────────────────────────────────┐
38+
!│ DO NOT EDIT THE FOLLOWING LINES │
39+
└─────────────────────────────────────────────────────────────────────────┘
40+
*/
41+
42+
precision highp float;
43+
varying vec2 v_texcoord;
44+
uniform sampler2D tex;
45+
46+
47+
const int MODE = COLOR_VISION_MODE;
48+
const float INTENSITY = COLOR_VISION_INTENSITY;
49+
50+
51+
52+
// Constants for color vision deficiency simulation
53+
const float protanopia_r = 2.02344;
54+
const float protanopia_g = -2.52581;
55+
56+
const float deuteranopia_r = 0.494207;
57+
const float deuteranopia_g = 1.24827;
58+
59+
const float tritanopia_r = -0.395913;
60+
const float tritanopia_g = 0.801109;
61+
62+
63+
64+
// RGB to LMS conversion matrix
65+
const mat3 RGB2LMS = mat3(
66+
17.8824, 43.5161, 4.11935,
67+
3.45565, 27.1554, 3.86714,
68+
0.0299566, 0.184309, 1.46709
69+
);
70+
71+
// LMS to RGB conversion matrix
72+
const mat3 LMS2RGB = mat3(
73+
0.0809444479, -0.130504409, 0.116721066,
74+
-0.0102485335, 0.0540193266, -0.113614708,
75+
-0.000365296938, -0.00412161469, 0.693511405
76+
);
77+
78+
// Simulate color vision deficiency based on LMS color space transformations
79+
vec3 simulateColorVisionDeficiency(vec3 color) {
80+
// Convert from RGB to LMS color space (Long, Medium, Short cone response)
81+
vec3 lms = RGB2LMS * color;
82+
83+
// Apply CVD transformation based on selected mode
84+
mat3 m;
85+
if(MODE == 0) { // Normal vision (no transformation)
86+
m = mat3(
87+
1.0, 0.0, 0.0,
88+
0.0, 1.0, 0.0,
89+
0.0, 0.0, 1.0
90+
);
91+
} else if(MODE == 1) { // Protanopia (red-deficient)
92+
m = mat3(
93+
0.0, protanopia_r, protanopia_g,
94+
0.0, 1.0, 0.0,
95+
0.0, 0.0, 1.0
96+
);
97+
} else if(MODE == 2) { // Deuteranopia (green-deficient)
98+
m = mat3(
99+
1.0, 0.0, 0.0,
100+
deuteranopia_r, 0.0, deuteranopia_g,
101+
0.0, 0.0, 1.0
102+
);
103+
} else { // Tritanopia (blue-deficient)
104+
m = mat3(
105+
1.0, 0.0, 0.0,
106+
0.0, 1.0, 0.0,
107+
tritanopia_r, tritanopia_g, 0.0
108+
);
109+
}
110+
111+
// Transform back to RGB color space
112+
return LMS2RGB * (m * lms);
113+
}
114+
115+
// Apply daltonization to enhance color differences for CVD viewers
116+
vec3 daltonize(vec3 color, vec3 simulation) {
117+
// Calculate the error between original and simulated colors
118+
vec3 error = color - simulation;
119+
120+
// Redistribute the error to enhance visibility
121+
vec3 correction;
122+
if (MODE == 0) { // Normal vision - no correction needed
123+
correction = vec3(0.0, 0.0, 0.0);
124+
} else if (MODE == 1) { // Protanopia - shift errors in red to blue and green
125+
correction = vec3(0.0, error.r * 0.7, error.r * 0.3);
126+
} else if (MODE == 2) { // Deuteranopia - shift errors in green to red and blue
127+
correction = vec3(error.g * 0.7, 0.0, error.g * 0.3);
128+
} else { // Tritanopia - shift errors in blue to red and green
129+
correction = vec3(error.b * 0.5, error.b * 0.5, 0.0);
130+
}
131+
132+
// Apply correction
133+
return color + correction;
134+
}
135+
136+
void main() {
137+
// Sample the texture at the current fragment's texture coordinates
138+
vec4 pixColor = texture2D(tex, v_texcoord);
139+
vec3 color = pixColor.rgb;
140+
141+
// No effect needed for normal vision with no intensity
142+
if (MODE == 0 && INTENSITY == 0.0) {
143+
gl_FragColor = pixColor;
144+
return;
145+
}
146+
147+
// Simulate color vision deficiency based on the selected mode
148+
vec3 simulated = simulateColorVisionDeficiency(color);
149+
150+
// Optional: Apply daltonization (color correction) if intensity is negative
151+
// This helps make colors more distinguishable for users with CVD
152+
vec3 corrected = daltonize(color, simulated);
153+
154+
vec3 result;
155+
156+
// Special handling for normal vision mode
157+
if (MODE == 0) {
158+
// For normal vision, positive intensity increases saturation
159+
// and negative intensity decreases saturation (towards grayscale)
160+
if (INTENSITY >= 0.0) {
161+
// Increase saturation
162+
vec3 luminance = vec3(dot(color, vec3(0.2126, 0.7152, 0.0722)));
163+
result = mix(color, mix(luminance, color * 1.5, 1.0), INTENSITY);
164+
} else {
165+
// Decrease saturation (towards grayscale)
166+
vec3 luminance = vec3(dot(color, vec3(0.2126, 0.7152, 0.0722)));
167+
result = mix(color, luminance, -INTENSITY);
168+
}
169+
}
170+
// For color vision deficiency modes
171+
else if (INTENSITY >= 0.0) {
172+
// Apply simulation with gradually increasing intensity
173+
result = mix(color, simulated, INTENSITY);
174+
} else {
175+
// Apply daltonization correction with gradually increasing intensity
176+
result = mix(color, corrected, -INTENSITY);
177+
}
178+
179+
// Output the final color with the original alpha value
180+
gl_FragColor = vec4(result, pixColor.a);
181+
}

0 commit comments

Comments
 (0)