gonewest818 / dimmer.el

Interactively highlight which buffer is active by dimming the others.
GNU General Public License v3.0
267 stars 14 forks source link

dimme background instead of foreground. #20

Closed 4goodapp closed 4 years ago

4goodapp commented 5 years ago

Is it possible to dimme the background (to be darker or lighter) instead of dimming the text/foreground?

There is this package auto-dim-other-buffers.el that does that but you have to chose one unique background color instead of a darker/lighter background of the current theme's. So when you change theme, things don't look good. and there is no way to change the dimme level with it.

gonewest818 commented 4 years ago

I seem to remember looking at this when I first wrote the package, and the challenge was exactly as you describe... what's the best way to mathematically compute a darker (or lighter) background color that is consistent with the rest of theme? At the time I wasn't able to come up with anything I liked.

gonewest818 commented 4 years ago

This is a new feature on the master branch, will be picked up in MELPA in the next few hours whenever the next auto-build runs. Give it a try and see what you think?

4goodapp commented 4 years ago

Will test it once available on MELPA. Thanks.

4goodapp commented 4 years ago

It's working perfectly as expected 👍

I however use (setq dimmer-fraction 0.08) instead of (setq dimmer-fraction 0.3) with dimmer-adjustment-mode set to :background.

(use-package dimmer
  :config
  (setq dimmer-adjustment-mode :background)
  (setq dimmer-exclusion-regexp "^\\*helm.*\\|^ \\*Minibuf-.*")
  (setq dimmer-fraction 0.08)
  (dimmer-mode)
  )
gonewest818 commented 4 years ago

Great! Yes, I agree, the background adjustment feels more aggressive than the foreground.

Note that the Minibuffer is now excluded by default and the dimmer-exclusion-regexp variable is now obsolete. In your case you can simplify your use-package setup like this:

(use-package dimmer
  :config
  (setq dimmer-adjustment-mode :background)
  (setq dimmer-fraction 0.08)
  (dimmer-configure-helm)
  (dimmer-mode t))
4goodapp commented 4 years ago

Yes, that, it's more aggressive. I replaced helm with Ivy/counsel. So I think I can just comment that line.

Now let's suppose I want exclude certain buffer like *imenu-list*, How can I set it with dimmer-exclusion-regexp-list?

gonewest818 commented 4 years ago

Try this:

(use-package dimmer
  :config
  (setq dimmer-adjustment-mode :background)
  (setq dimmer-fraction 0.08)
  (add-to-list 'dimmer-exclusion-regexp-list "^\\*imenu-list\\*$")
  (dimmer-mode t))
4goodapp commented 4 years ago

Perfect!

I think we need a dimmer-inclusion-regexp-listso that certain are always dimmed.

gonewest818 commented 4 years ago

If you can open another ticket for that? I would always want some way to "un-dim" a buffer by switching to it, but I suppose that’s why we have user preferences.

On Dec 6, 2019, at 2:56 PM, 4goodapp notifications@github.com wrote:

Perfect!

I think we need a dimmer-inclusion-regexp-listso that certain are always dimmed.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gonewest818/dimmer.el/issues/20?email_source=notifications&email_token=AASYZ5TBN2LJWJOU43IGSPTQXLKARA5CNFSM4G5MPFL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGFTHPQ#issuecomment-562770878, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASYZ5QSL5E7BK56O2G5EP3QXLKARANCNFSM4G5MPFLQ.

4goodapp commented 4 years ago

Done #27