-
|
hello there, Im new to Void linux (from fedora linux) and would really appreciate your help in getting my scripts working properly in Void. the main one being this script that toggles all colors on the screen to grayscale. Currently using qtile so this is in my # compositor
picom --config ~/.config/picom/picom-grayscale.conf -b &that is supposed to start the window manager in grayscale mode by default, but it doesnt. then I should be able to toggle between the two different modes by pressing keys = [
# toggle grayscale mode!! shiny lights bad...
Key(
[mod],
"g",
lazy.spawn(os.path.expanduser("~/.local/scripts/toggle_grayscale")),
desc="toggle [g]rayscale mode systemwide",
),
]Currenlty, hitting the keybind only displays a notification from dunst, nothing occurs in terms of color changes, the default colors are preserved. the keybind is supposed to run this script for toggling colors: #!/usr/bin/env bash
# strict mode
CONFIG_PATH="$HOME/.config/picom/picom.conf"
GRAY_CONFIG_PATH="$HOME/.config/picom/picom-grayscale.conf"
# Identify the active monitor
MONITOR=$(xrandr | grep " connected" | cut -d' ' -f1 | head -n 1)
# clean up stuck gamma/brightness
reset_colors() {
xrandr --output "$MONITOR" --gamma 1:1:1 --brightness 1
}
if pgrep -a picom | grep -q "picom-grayscale.conf"; then
# EXITING GRAYSCALE: Turn Redshift back on
killall picom
# Wait until the old picom process is completely dead
while pgrep -x picom >/dev/null; do sleep 0.05; done
reset_colors
dunstify -a picom -t 3000 -u low "let there be colours :)"
picom --config ${CONFIG_PATH} -b &
else
# ENTERING GRAYSCALE: Kill Redshift to prevent color conflicts
killall picom
# Wait until the old picom process is completely dead
while pgrep -x picom >/dev/null; do sleep 0.05; done
reset_colors
dunstify -a picom -t 3000 -u low "turning on grayscale"
picom --config ${GRAY_CONFIG_PATH} -b &
fi
which inturn uses the following picom configuration to set the grayscale: and the glsl shader settings are in the below file: #version 330
in vec2 texcoord;
uniform sampler2D tex;
uniform float opacity;
vec4 default_post_processing(vec4 c);
vec4 window_shader() {
vec2 texsize = textureSize(tex, 0);
vec4 color = texture2D(tex, texcoord / texsize, 0);
// 1. Standard Grayscale conversion
float gray = (color.r * 0.299) + (color.g * 0.587) + (color.b * 0.114);
vec3 grayscale = vec3(gray);
return vec4(grayscale * opacity, color.a * opacity);
}I realised that Void does not have the ' <user> 3784 1.4 0.9 448576 78020 ? Ssl 16:34 0:06 picom --config /home/<user>/.config/picom/picom-grayscale.conf -b
<user> 7805 0.0 0.0 6704 2484 pts/1 S+ 16:42 0:00 grep --color=auto picomCould Void linux have something that prevents the colors from switiching? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
cc @0x5c |
Beta Was this translation helpful? Give feedback.
-
|
Your shader works perfectly well for me, when passing it to picom with the I diffed the config you provided vs the one I have, and the structure is very different. Are you using a Fedora version that ships a picom version lower than 12? That version moved all the rule systems into one more capable and less clunky rules system, along with other important configuration file changes; picom might be rejecting your config and reverting to defaults or crashing. Here's upstream's info about that change and about the new format (including the section on migrating old rules). I'm about to tackle the v13 update, and I'll test the shader there too. |
Beta Was this translation helpful? Give feedback.
Your shader works perfectly well for me, when passing it to picom with the
--window-shader-fg <path-to-shader-file>argument. I recommend trying to run picom directly from the terminal with that argument plus--log-level info. I'm curious what the log output is like if that doesn't apply the shader.I diffed the config you provided vs the one I have, and the structure is very different. Are you using a Fedora version that ships a picom version lower than 12? That version moved all the rule systems into one more capable and less clunky rules system, along with other important configuration file changes; picom might be rejecting your config and reverting to defaults or crashing. Here's upst…