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

Is it possible to write a rule to enable shadows for a particular application? #171

Closed
ghost opened this issue Jul 30, 2019 · 4 comments
Closed
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Jul 30, 2019

In a nutshell, I want to enable shadows only for System Preferences and Preview.

@ghost ghost changed the title Is it possible to turn borders off, and shadows on, only for a particular window such as Preview? Is it possible to write a rule to enable shadows for a particular application? Jul 30, 2019
@koekeishiya
Copy link
Owner

Added support on master for querying the value of a windows shadow and the ability to toggle shadow on or off. That should be enough for you to do what you want through the signal system.

@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released enhancement New feature or request labels Jul 30, 2019
@dominiklohmann
Copy link
Collaborator

dominiklohmann commented Jul 30, 2019

@koekeishiya you forgot the docs

@danteissaias this should do (edit: just filed #174, window_created has a bug that affects this)

# disable window shadows for all windows
yabai -m config window_shadow off

# toggle shadows when a window is created for system prefs or preview
yabai -m signal --add event=window_created  app='^(System Preferences|Preview)$' \
    action='yabai -m window "${YABAI_WINDOW_ID}" --toggle shadow'

# toggle shadows for all existing system prefs or preview windows when yabai launches
yabai -m query --windows \
    | jq '.[] | select(.shadow == 0 and (.app == "System Preferences" or .app == "Preview")).id' \
    | xargs -I{} yabai -m window {} --toggle shadow

koekeishiya added a commit that referenced this issue Jul 30, 2019
@ghost
Copy link
Author

ghost commented Jul 31, 2019

Is it possible to make these two work together, since toggling floating also re-disables shadows?

yabai -m signal --add event=window_created  app='^(System Preferences|Preview)$' \
    action='yabai -m window "${YABAI_WINDOW_ID}" --toggle shadow'
yabai -m signal --add event=window_created  app='^(System Preferences|Preview)$' \
    action='yabai -m window "${YABAI_WINDOW_ID}" --toggle floating'

Edit: This issue only affects System Preferences, and not Preview.
Edit 2: I now realize this is the #174 bug.

@koekeishiya
Copy link
Owner

I don't consider 174 to be a bug. You need to also subscribe to the application_launched signal.

@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants