-
Notifications
You must be signed in to change notification settings - Fork 1
/
.wakeup##os.Darwin,class.Work
executable file
·34 lines (23 loc) · 1.24 KB
/
.wakeup##os.Darwin,class.Work
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
#osascript -e 'tell application id "com.runningwithcrayons.Alfred" to run trigger "resume" in workflow "com.pedropombeiro.resumetimeout"'
osascript -e 'tell application "Stay.app" to restore all windows'
open -a Busylight_HTTP_Mac.app # Reopen Busylight_HTTP_Mac at wake
~/.config/yadm/scripts/remap-mac-keys.sh
if pgrep 'Elgato Control Center' >/dev/null 2>&1; then
# Restart Control Center, since it regularly loses connection with the Key Lights and gets confused
killall 'Elgato Control Center'
fi
# open -g -a 'Elgato Control Center.app'
if uhubctl >/dev/null 2>&1; then
# Restart Stream Deck on hub, since half of the times it only shows wallpaper after resuming
if ! uhubctl --action cycle --location 2-1 --port 5 --wait 4000 | grep 'Elgato Stream Deck'; then
terminal-notifier -title 'uhubctl' -message 'Failed to cycle power to Elgato Stream Deck' -sound boop -ignoreDnD
fi
# Turn off Elgato Wave mic
uhubctl --action off --location 2-1.1.2 --port 1
sleep 5
sudo killall coreaudiod # Restart CoreAudio service to make sure eqMac can work correctly
SwitchAudioSource -t output -s 'MacBook Pro Speakers'
SwitchAudioSource -t output -s 'CalDigit TS4 Audio - Rear'
fi
~/.config/yadm/scripts/run-checks.zsh