Skip to content

Instantly share code, notes, and snippets.

Assuming the script is located in ~/crontabs/, this needs an edit in the crontab file:

HOUSE_POWER_CHECK_DEPLOYMENT_ID="<INSERT HERE THE DEPLOYMENT ID FROM GOOGLE APP SCRIPTS>"
*/10 * * * * ~/crontabs/house-power-check-heartbeat.sh

It's also helpful to have in the /etc/logrotate.conf the following:

/home//crontabs/house-power-check-heartbeat.log {
# Uses yabai to create a 3x3 matrix of spaces on MacOs with wrap-around through skhd mappings
cmd + lctrl - up : yabai -m space --focus `yabai -m query --spaces --display | jq 'nth(index(map(select(."has-focus" == true))) - 3).index'`
cmd + lctrl - down : yabai -m space --focus `yabai -m query --spaces --display | jq 'nth((index(map(select(."has-focus" == true))) + 3) % 9).index'`
cmd + lctrl - right : yabai -m space --focus `yabai -m query --spaces --display | jq '((nth((index(map(select(."has-focus" == true))))).index / 3 | ceil - 1)*3)+(nth((index(map(select(."has-focus" == true))))).index%3)+1'`
cmd + lctrl - left : yabai -m space --focus `yabai -m query --spaces --display | jq '((nth((index(map(select(."has-focus" == true))))).index / 3 | ceil - 1)*3)+((nth((index(map(select(."has-focus" == true))))).index%3)+1)%3+1'`
lshift + cmd + lctrl - up : yabai -m window --space `yabai -m query --spaces --display | jq 'nth(index(map(select(."has-focus" == true))) - 3).index'` && yabai -m space --focus `yabai -m qu