Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparent background turns opaque when focusing on second monitor #600

Open
Felipe-9 opened this issue Aug 18, 2024 · 2 comments
Open

Comments

@Felipe-9
Copy link

Felipe-9 commented Aug 18, 2024

I have set the bar background with a transparent alpha which works fine but whenever the monitor is not focussed it turns opaque, i tried taking a printscreen but for some reason it still shows transparent.

  • sketchybar-v2.21.0
  • macOS 14.6.1 (23G93)

colors.lua

local cat = require("catppuccin")
-- Catppuccin mocha palette

return {
  black   = cat.mocha.crust,
  white   = cat.mocha.text,
  red     = cat.mocha.red,
  green   = cat.mocha.green,
  blue    = cat.mocha.blue,
  teal    = cat.mocha.teal,
  yellow  = cat.mocha.yellow,
  orange  = cat.mocha.peach,
  magenta = cat.mocha.mauve,
  grey    = cat.mocha.overlay1,
  transparent = cat.invisible,

  bar = {
    bg = cat.with_alpha(cat.mocha.base,0.6),
    border = cat.mocha.overlay0
  },
  popup = {
    bg = cat.with_alpha(cat.mocha.base,0.9),
    border = cat.mocha.lavender,
  },
  bg1 = cat.with_alpha(cat.mocha.surface0,0.7),
  bg2 = cat.with_alpha(cat.mocha.surface1,0.9),

  with_alpha = cat.with_alpha
}
-- with_alpha = function(color, alpha)
--   if alpha > 1.0 or alpha < 0.0 then return color end
--   return (color & 0x00ffffff) | (math.floor(alpha * 255.0) << 24)
-- end

bar.lua

local colors = require("colors")

-- Equivalent to the --bar domain
sbar.bar({
  topmost = off,
  height = 25,
  border_width = 0,
  color = colors.bar.bg,
  boder_color = colors.bar.border,
  padding_right = 10,
  padding_left = 10,
  blur_radius = 5,
  corner_radius = 30,
  margin = 10,
  notch_width = 300,
  position = top,
  shadow = off,
  sticky = on,
  y_offset = 7,
})
@FelixKratz
Copy link
Owner

I can not reproduce this, which macOS version are you on?

@Felipe-9
Copy link
Author

Felipe-9 commented Aug 23, 2024

Im using macOS 14.6.1 (23G93)

Also for clarity (and i already edited on the question) it turns opaque when focusing on second monitor.
Would you need any more information to try to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants