Closed ThomasF34 closed 4 years ago
Went through this because I'm super interested myself, it looks like you require jq
to pass-through the parsed JSON data.
Install Homebrew if you haven't and brew install jq
, after that you'd probably want to remove spaces-secondary.jsx from the active folder if you aren't using a secondary monitor, and give spaces-primary.jsx a refreshFrequency relative towards what won't drain your battery.
Primary printed a correct result but secondary did not, saying it could not locate the given display.
The "spaces-secondary" widget prints out workspaces from a secondary connected monitor. If you don't have one, it will print out an error, so you should just disabled it from the uebersicht menu.
and give spaces-primary.jsx a refreshFrequency relative towards what won't drain your battery.
Alternatively, use yabai's signals to trigger refreshing specific uebersicht widgets. I've just added more info on that in the README: https://github.com/kkga/nibar#usage
and give spaces-primary.jsx a refreshFrequency relative towards what won't drain your battery.
Alternatively, use yabai's signals to trigger refreshing specific uebersicht widgets. I've just added more info on that in the README: https://github.com/kkga/nibar#usage
This no longer works for whatever reason. I got the bar working with spaces by changing the refreshrate but adding the yabai spaces-changed signal isn't working.
See my comments in https://github.com/koekeishiya/yabai/issues/381
None of these work:
# ubersicht="$(ps ax | grep sicht | awk '{print $5}' | head -1 | cut -d/ -f3 | cut -d. -f1)"
# echo $ubersicht
# refresh primary display workspaces
# yabai -m signal --add event='space_changed' action="ru"
# refresh my Übersicht bar when the space changes
# yabai -m signal --add event='space_changed' \
# action="osascript -e 'tell application \"'$(ps ax | grep sicht | awk '{print $5}' | head -1 | cut -d/ -f3 | cut -d. -f1)'\" to refresh'"
# yabai -m signal --add event=space_changed action="osascript -e 'display notification \"active space changed.\" with title \"yabai\" subtitle \"signal\"'"
# yabai -m signal --add event=space_changed action="osascript -e 'tell application $(ps ax | grep sicht | awk '{print $5}' | head -1 | cut -d/ -f3 | cut -d. -f1) to refresh'"
# refresh primary display workspaces
# yabai -m signal --add event=space_changed \
# action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-primary-jsx\"'"
# yabai -m notification trigger=space-changed \
# action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"yabai-space-widget\"'"
# yabai -m signal --add event=space_changed action="osascript -e 'display notification \"active space changed.\" with title \"yabai\" subtitle \"signal\"'"
here's what I have in .yabairc
:
yabai -m signal --add event=space_changed \
action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-primary-jsx\"'"
yabai -m signal --add event=window_focused \
action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-primary-jsx\"'"
yabai -m signal --add event=space_changed \
action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-secondary-jsx\"'"
yabai -m signal --add event=window_focused \
action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-secondary-jsx\"'"
It works perfectly in my case.
What do you see when running 👇 this command directly in a terminal?
osascript -e 'tell application "Übersicht" to refresh widget id "nibar-spaces-primary-jsx"'
here's what I have in
.yabairc
:yabai -m signal --add event=space_changed \ action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-primary-jsx\"'" yabai -m signal --add event=window_focused \ action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-primary-jsx\"'" yabai -m signal --add event=space_changed \ action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-secondary-jsx\"'" yabai -m signal --add event=window_focused \ action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-secondary-jsx\"'"
It works perfectly in my case.
* yabai-v2.2.2 * Übersicht 1.4 (61)
What do you see when running 👇 this command directly in a terminal?
osascript -e 'tell application "Übersicht" to refresh widget id "nibar-spaces-primary-jsx"'
Hey thanks for the quick reply! I get:
$ osascript -e 'tell application "Übersicht" to refresh widget id "nibar-spaces-primary-jsx"'
32:46: syntax error: A identifier can’t go after this identifier. (-2740)
$ osascript -e 'tell application \"Übersicht\" to refresh widget id "nibar-spaces-primary-jsx"'
17:18: syntax error: Expected expression, property or key form, etc. but found unknown token. (-2741)
rublev@andreis-MacBook-Pro ~ %
I tried the commands you listed as well and changed refreshRate to false in the JSX file but it didn't work.
Hi,
I just installed your widget and in the desktop infos (on the left) i have an error :
Error : unknown script output
I looked at both primary and secondary spaces scripts and ran them manually. Primary printed a correct result but secondary did not, saying it could not locate the given display.
In
spaces-secondary.sh
I replaced this line by :But i still have the same error. Do you know what's causing this ?
Thanks