WillPower3309 / swayfx

SwayFX: Sway, but with eye candy!
MIT License
1.17k stars 48 forks source link

Add support for blur to swaybar. #309

Closed MubinMuhammad closed 1 month ago

MubinMuhammad commented 2 months ago

As swaybar is part of the sway ecosystem, as the blur effect doesn't work with swaybar, it's a part that should be fixed soon.

thnikk commented 2 months ago

This is already possible with layer_effects "panel" blur enable.

MubinMuhammad commented 2 months ago

Does that work in your system? Because it has no effect on my swaybar. Which I did set to transparent with:

bar {
  swaybar_command swaybar
  status_command /usr/bin/i3status-rs $HOME/.config/sway/i3status_config.toml
  position top
  gaps 8
  height 36
  font pango:CaskaydiaCove Nerd Font Bold 12
  colors {
    background #1d202160            # <----- here
    focused_workspace #ddb36e #d8a657 #1d2021
  }
}

After adding layer_shell effects that you mentioned it just doesn't have any effect.

scorpius2k1 commented 2 months ago

@MubinMuhammad background #RRGGBBAA - the higher the alpha 'AA' value is, RGB values will be more visible, but blur will become less visible. A good value to try for the alpha channel if used with color could be 66. So a "red" bar with blur could be background #FF000066. Try a few different wallpapers as well, brighter/dark/light contrasting, etc. help the blur effect to stand out more. You might also try adjusting blur_radius and blur_passes to your liking for more/less of a blur effect.

This works on my end with swayfx version 0.4.

Configure and reload your swayfx config:

blur_radius 3
blur_passes 4
layer_effects "panel" blur enable

bar {
    position top

    colors {
        # Text color of status bar
        statusline #ffffff
        # Background of status bar
        background #1d202166
    }
}

background #1d202166 2024-05-02_09-06-37 background #FF000066 2024-05-02_09-00-13 background #00000000 2024-05-02_08-53-01

MubinMuhammad commented 1 month ago

Thanks, I have updated swayfx, and blur is working as it should!