Last active
May 16, 2019 11:36
-
-
Save arall/80e076124646671c7772393b672028c3 to your computer and use it in GitHub Desktop.
BashBunny - OSX Wallpaper Change (Mojave & Sierra)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LED SETUP | |
DRIVER_LABEL='BashBunny' | |
GET SWITCH_POSITION | |
MAC_HAPPY ATTACKMODE HID STORAGE | |
LED ATTACK | |
Q DELAY 1000 | |
RUN OSX Terminal | |
Q DELAY 3000 | |
# Type | |
Q STRING bash "/Volumes/${DRIVER_LABEL}/payloads/${SWITCH_POSITION}/script.sh" "${DRIVER_LABEL}" "${SWITCH_POSITION}" | |
Q DELAY 100 | |
Q ENTER | |
Q DELAY 1000 | |
LED FINISH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
version=$(defaults read loginwindow SystemVersionStampAsString) | |
# Mojave | |
if [[ $version == "10.14"* ]]; then | |
# Unfortunately, the app privacy dialogue will pop up | |
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Volumes/'${1}'/payloads/'${2}'/wallpaper.jpg"' | |
# High Sierra | |
else | |
sqlite3 ~/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '/Volumes/$1/payloads/$2/wallpaper.jpg'"; | |
killall Dock; | |
fi | |
killall Terminal; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment