diff --git a/.gitignore b/.gitignore index d36977d..3340df8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .tmp +.timestamp.txt diff --git a/.hide/app/images/install.png b/.hide/app/images/install.png deleted file mode 100644 index 570d2e4..0000000 Binary files a/.hide/app/images/install.png and /dev/null differ diff --git a/.hide/app/images/uninstall.png b/.hide/app/images/uninstall.png deleted file mode 100644 index 41aab13..0000000 Binary files a/.hide/app/images/uninstall.png and /dev/null differ diff --git a/.hide/app/install/1_check_resource.sh b/.hide/app/install/1_check_resource.sh new file mode 100755 index 0000000..6b5b353 --- /dev/null +++ b/.hide/app/install/1_check_resource.sh @@ -0,0 +1,15 @@ +# !/bin/bash +screensaver=$1 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# run aerial application + if [ -d ~/Library/Screen\ Savers/$screensaver ] + then + open ~/Library/Screen\ Savers/$screensaver + elif [ -d /Library/Screen\ Savers/$screensaver ] + then + open /Library/Screen\ Savers/$screensaver + else + svn checkout https://github.com/MichaelDimmitt/sc/trunk/$screensaver; + open $screensaver + fi diff --git a/.hide/app/install/1_download_aerial.sh b/.hide/app/install/1_download_aerial.sh deleted file mode 100755 index f6e1d60..0000000 --- a/.hide/app/install/1_download_aerial.sh +++ /dev/null @@ -1,10 +0,0 @@ -# !/bin/bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# run aerial application - if [ -d ~/Library/Screen\ Savers/Aerial.saver ] || [ -d /Library/Screen\ Savers/Aerial.saver ] ; then - echo "File exists." - else - open $DIR/../../bin/Aerial.saver/ - fi diff --git a/.hide/app/install/4_desktop_background_changer.sh b/.hide/app/install/4_desktop_background_changer.sh new file mode 100755 index 0000000..0abfdce --- /dev/null +++ b/.hide/app/install/4_desktop_background_changer.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# gather information to be able to run scripts from this file location. +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# say $DIR +# end gather information. + +# test_date() uninstall launch_agent if computer has slept twice quickly... +# handling potential high sierra catestrophy +check_launch_agent () { + if [ "$(launchctl list | grep aerial)" -ge 1 ]; + then + osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'; + $DIR/./../../uninstall/1_unstage_dyna_desktop.sh + else + $DIR/./../../uninstall/1_unstage_dyna_desktop.sh; + fi +} + +test_date() { + num_lines=$(cat $DIR/.timestamp.txt | wc -l) + case $(echo $num_lines) in + [0-1]) + date +%s >> $DIR/.timestamp.txt + if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop; + then + sleep 3; + `/System/Library/Frameworks/ScreenSaver.framework/Resources/./ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background`;# echo Internet status: OK; + else + check_launch_agent + fi | tail -n 1 + ;; + 2) + old_time=`cat $DIR/.timestamp.txt`; + count=`expr $(date +%s) - $(sed -n '2p' $DIR/.timestamp.txt)`; + if [ "$count" -le 100 ]; then + osascript -e 'display notification "Uninstalled because you put your computer to sleep twice really quickly.😍✌️" with title "Uninstalled due rapid sleep, please reinstall."' + ./$DIR/../uninstall/2_unstage_launch_agent.sh + else + sed -i '' '1d' $DIR/.timestamp.txt; + date +%s >> $DIR/.timestamp.txt; + if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop; + then + sleep 3; + `/System/Library/Frameworks/ScreenSaver.framework/Resources/./ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background`; + # echo Internet status: OK; + else + check_launch_agent + # echo Internet status: ERROR; + fi | tail -n 1 + fi + ;; + *) + say "should never be reached" + esac +} +test_date; diff --git a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Info.plist b/.hide/app/install/DesktopBackgroundChanger.app/Contents/Info.plist deleted file mode 100644 index e0fb26f..0000000 --- a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - DesktopBackgroundChanger - CFBundleIdentifier - org.zen1.DesktopBackgroundChanger - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - DesktopBackgroundChanger - CFBundlePackageType - APPL - CFBundleShortVersionString - 9.0 - CFBundleSignature - ???? - CFBundleVersion - 9.0 - LSMinimumSystemVersion - 10.7.0 - LSUIElement - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - NSHumanReadableCopyright - © 2017 Michael Dimmitt - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/.hide/app/install/DesktopBackgroundChanger.app/Contents/MacOS/DesktopBackgroundChanger b/.hide/app/install/DesktopBackgroundChanger.app/Contents/MacOS/DesktopBackgroundChanger deleted file mode 100755 index d4f4459..0000000 Binary files a/.hide/app/install/DesktopBackgroundChanger.app/Contents/MacOS/DesktopBackgroundChanger and /dev/null differ diff --git a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/AppSettings.plist b/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/AppSettings.plist deleted file mode 100644 index 398e175..0000000 --- a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/AppSettings.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - AcceptsFiles - - AcceptsText - - Authentication - - Creator - Platypus-5.2 - Droppable - - InterfaceType - None - InterpreterArgs - - InterpreterPath - /usr/bin/ruby - PromptForFileOnLaunch - - RemainRunning - - ScriptArgs - - Suffixes - - TextBackground - #ffffff - TextFont - Monaco - TextForeground - #000000 - TextSize - 13 - URISchemes - - UniformTypes - - public.item - public.folder - - - diff --git a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/MainMenu.nib b/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/MainMenu.nib deleted file mode 100644 index 8d20692..0000000 Binary files a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/MainMenu.nib and /dev/null differ diff --git a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/script b/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/script deleted file mode 100755 index 6892e8e..0000000 --- a/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/script +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -# gather information to be able to run scripts from this file location. -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# say $DIR -# end gather information. - -# test_date() uninstall launch_agent if computer has slept twice quickly... -# handling potential high sierra catestrophy -test_date() { - num_lines=$(cat $DIR/.timestamp.txt | wc -l) - case $(echo $num_lines) in - [0-1]) - date +%s >> $DIR/.timestamp.txt - if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop; - then `/System/Library/Frameworks/ScreenSaver.framework/Resources/./ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background`;# echo Internet status: OK; - else osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'# echo Internet status: ERROR; - fi | tail -n 1 - ;; - [2]) - old_time=`cat $DIR/.timestamp.txt`; - count=`expr $(date +%s) - $(sed -n '2p' $DIR/.timestamp.txt)`; - if [ "$count" -le 100 ]; then - osascript -e 'display notification "Uninstalled because you put your computer to sleep twice really quickly.😍✌️" with title "Uninstalled due rapid sleep, please reinstall."' - say "uninstalled due to $count seconds between repeated sleeping" - rm $DIR/.timestamp.txt - launchctl unload ~/Library/LaunchAgents/com.monitor.charge.plist && launchctl unload ~/Library/LaunchAgents/com.aerial.desktop.plist - else - sed -i '' '1d' $DIR/.timestamp.txt; - date +%s >> $DIR/.timestamp.txt; - if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop; - then `/System/Library/Frameworks/ScreenSaver.framework/Resources/./ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background`;# echo Internet status: OK; - else osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'# echo Internet status: ERROR; - fi | tail -n 1 - fi - ;; - *) say "should never happen let me reset!"; - rm $DIR/.timestamp.txt; - if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop; - then `/System/Library/Frameworks/ScreenSaver.framework/Resources/./ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background`;# echo Internet status: OK; - else osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'# echo Internet status: ERROR; - fi | tail -n 1 - ;; - esac -} -test_date; diff --git a/.hide/app/install/3_install_launch_agent.sh b/.hide/app/install/launch_agent/3_install_launch_agent.sh similarity index 57% rename from .hide/app/install/3_install_launch_agent.sh rename to .hide/app/install/launch_agent/3_install_launch_agent.sh index 540c18e..29e63be 100755 --- a/.hide/app/install/3_install_launch_agent.sh +++ b/.hide/app/install/launch_agent/3_install_launch_agent.sh @@ -1,4 +1,6 @@ # !/bin/bash +screen=$1 +saver='.saver' # write out path needed DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -6,24 +8,24 @@ echo $DIR #create .tmp file mkdir $DIR/.tmp -cp $DIR/com.aerial.desktop.plist $DIR/.tmp/com.aerial.desktop.plist +cp $DIR/com.desktop.$screen.plist $DIR/.tmp/com.desktop.$screen.plist cp $DIR/com.monitor.charge.plist $DIR/.tmp/com.monitor.charge.plist # create the string needed. -pwd2=" $DIR/./DesktopBackgroundChanger.app/Contents/Resources/script" +pwd2=" $DIR/./../4_desktop_background_changer.sh" pwd3=" $DIR/./battery_check.sh" echo $pwd2 # insert path needed into correct file. -# line 9 in com.aerial.desktop.plist -sed -i '' '9s?.*?'"$pwd2"'?' $DIR/.tmp/com.aerial.desktop.plist +# line 9 in com.$screen.desktop.plist +sed -i '' '9s?.*?'"$pwd2"'?' $DIR/.tmp/com.desktop.$screen.plist sed -i '' '9s?.*?'"$pwd3"'?' $DIR/.tmp/com.monitor.charge.plist # change environment appropriately -chmod 644 $DIR/.tmp/com.aerial.desktop.plist +chmod 644 $DIR/.tmp/com.desktop.$screen.plist chmod 645 $DIR/.tmp/com.monitor.charge.plist -cp $DIR/.tmp/com.aerial.desktop.plist ~/Library/LaunchAgents/ +cp $DIR/.tmp/com.desktop.$screen.plist ~/Library/LaunchAgents/ cp $DIR/.tmp/com.monitor.charge.plist ~/Library/LaunchAgents/ -launchctl load ~/Library/LaunchAgents/com.aerial.desktop.plist +launchctl load ~/Library/LaunchAgents/com.desktop.$screen.plist launchctl load ~/Library/LaunchAgents/com.monitor.charge.plist diff --git a/.hide/app/install/battery_check.sh b/.hide/app/install/launch_agent/battery_check.sh similarity index 69% rename from .hide/app/install/battery_check.sh rename to .hide/app/install/launch_agent/battery_check.sh index 3bec330..7a550df 100755 --- a/.hide/app/install/battery_check.sh +++ b/.hide/app/install/launch_agent/battery_check.sh @@ -18,6 +18,26 @@ get_percentage(){ numerator=$(ioreg -n AppleSmartBattery | grep CurrentCapacity percentage="$(get_percentage)"; battery_threshold=.20; +battery_actions () { + if [ "$(launchctl list | grep -c aerial)" -ge 1 ]; + then + osascript -e 'display notification "Computer not charging and low battery \nprogram disabled." with title "Aerial Desktop"'; + $DIR/./../../uninstall/1_unstage_dyna_desktop.sh; + else + $DIR/./../../uninstall/1_unstage_dyna_desktop.sh; + fi +} + +check_wifi () { + if [ "$(launchctl list | grep -c aerial)" -ge 1 ]; + then + osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'; + $DIR/./../../uninstall/1_unstage_dyna_desktop.sh + else + $DIR/./../../uninstall/1_unstage_dyna_desktop.sh; + fi +} + if (( $(echo "$percentage > $battery_threshold" | bc -l) )) ; then echo "$percentage greater than $battery_threshold" elif (( $(echo "$percentage < $battery_threshold" | bc -l) )) ; then @@ -31,8 +51,11 @@ fi if [ "$result" == "Yes" ] ; then # echo Charging; if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop; - then $DIR/./3_install_launch_agent.sh# echo Internet status: OK; - else osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'# echo Internet status: ERROR; + then + sleep 3; + $DIR/./3_install_launch_agent.sh dyna; + else + check_wifi fi | tail -n 1 # osascript -e 'display notification "Since Computer is Charging, program ok." with title "Aerial Desktop"' @@ -40,15 +63,16 @@ if [ "$result" == "Yes" ] ; then elif [ "$result" == "No" ] ; then echo Not Charging; if (( $(echo "$percentage < $battery_threshold" | bc -l) )) ; then - # echo not charging and battery unacceptable level. - # osascript -e 'display notification "Computer not charging and low battery program disabled." with title "Aerial Desktop"' - $DIR/./../uninstall/unstage_aerial_desktop.sh + battery_actions else # echo but at an acceptable battery level. # osascript -e 'display notification "Computer not charging and but at an acceptable battery level, program ok." with title "Aerial Desktop"' if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop; - then $DIR/./3_install_launch_agent.sh# echo Internet status: OK; - else osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'# echo Internet status: ERROR; + then + sleep 3; + $DIR/./3_install_launch_agent.sh dyna; + else + check_wifi fi | tail -n 1 fi else @@ -56,9 +80,12 @@ else then osascript -e 'display notification " something went wrong, contact michael; did some bad programming." with title "Aerial Desktop"' else osascript -e 'display notification " Desktop Computer not needing battery consideration." with title "Aerial Desktop activating program."'; if curl --silent --head https://github.com/michaeldimmitt/aerial_desktop;-- - then $DIR/./3_install_launch_agent.sh# echo Internet status: OK;- - else osascript -e 'display notification "Please connect your computer to internet." with title "Aerial Desktop"'# echo Internet status: ERROR;- + then + sleep 3; + $DIR/./3_install_launch_agent.sh dyna; + else + check_wifi fi | tail -n 1 fi - fi +sleep 10 diff --git a/.hide/app/install/com.aerial.desktop.plist b/.hide/app/install/launch_agent/com.aerial.desktop.plist similarity index 100% rename from .hide/app/install/com.aerial.desktop.plist rename to .hide/app/install/launch_agent/com.aerial.desktop.plist diff --git a/.hide/app/install/launch_agent/com.desktop.dyna.plist b/.hide/app/install/launch_agent/com.desktop.dyna.plist new file mode 100644 index 0000000..c65a126 --- /dev/null +++ b/.hide/app/install/launch_agent/com.desktop.dyna.plist @@ -0,0 +1,18 @@ + + + + + Label + com.aerial.desktop + ProgramArguments + + This is a test. Check if the file has been exists or has been modified in /.tmp/com.example.plist. If not, navigate to repo and run ./install_launch_agent. + + RunAtLoad + + SuccessfulExit + + StartInterval + 1 + + diff --git a/.hide/app/install/com.monitor.charge.plist b/.hide/app/install/launch_agent/com.monitor.charge.plist similarity index 100% rename from .hide/app/install/com.monitor.charge.plist rename to .hide/app/install/launch_agent/com.monitor.charge.plist diff --git a/.hide/app/install/2_local_install_workaround.sh b/.hide/app/install/notify_and_defaults/2_local_install_workaround.sh similarity index 71% rename from .hide/app/install/2_local_install_workaround.sh rename to .hide/app/install/notify_and_defaults/2_local_install_workaround.sh index 5856ef0..fd58b7a 100755 --- a/.hide/app/install/2_local_install_workaround.sh +++ b/.hide/app/install/notify_and_defaults/2_local_install_workaround.sh @@ -1,11 +1,13 @@ # !/bin/bash -if [ -d ~/Library/Screen\ Savers/Aerial.saver ] ; then +screensaver=$1 +if [ -d ~/Library/Screen\ Savers/$screensaver ] ; then + defaults -currentHost write com.JohnCoates.Aerial shouldShowNameLabel 1 defaults -currentHost write com.apple.screensaver modulePath -string "/System/Library/Screen Savers/Shell.saver"; defaults -currentHost write com.apple.screensaver moduleName -string "Shell"; defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName Shell path /System/Library/Screen\ Savers/Shell.saver/ type 0; - defaults -currentHost write com.apple.screensaver modulePath -string "~/Library/Screen\ Savers/Aerial.saver"; defaults -currentHost write com.apple.screensaver moduleName -string "Aerial";defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName Aerial path ~/Library/Screen\ Savers/Aerial.saver type 0; + defaults -currentHost write com.apple.screensaver modulePath -string "~/Library/Screen\ Savers/$screensaver"; defaults -currentHost write com.apple.screensaver moduleName -string "Aerial";defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName Aerial path ~/Library/Screen\ Savers/$screensaver type 0; osascript -e 'display notification "Installed for this user only, enjoy." with title "Success, Aerial Desktop"' -elif [ -d /Library/Screen\ Savers/Aerial.saver ] ; then - defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName Aerial path /Library/Screen\ Savers/Aerial.saver type 0 +elif [ -d /Library/Screen\ Savers/$screensaver ] ; then + defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName Aerial path /Library/Screen\ Savers/$screensaver type 0 osascript -e 'display notification "Installed for all users, enjoy." with title "Success, Aerial Desktop"' -else +else osascript -e 'display notification "Did you put your credentials? Uninstall and reinstall, thanks." with title "error 333 Aerial Desktop"' fi diff --git a/.hide/app/uninstall/unstage_aerial_desktop.sh b/.hide/app/uninstall/1_unstage_dyna_desktop.sh similarity index 63% rename from .hide/app/uninstall/unstage_aerial_desktop.sh rename to .hide/app/uninstall/1_unstage_dyna_desktop.sh index 71537ea..2bd24d9 100755 --- a/.hide/app/uninstall/unstage_aerial_desktop.sh +++ b/.hide/app/uninstall/1_unstage_dyna_desktop.sh @@ -1,17 +1,25 @@ # !/bin/bash - -if [ -f ~/Library/LaunchAgents/com.example.hello.plist ] ; then +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +screen=$1 +saver='.saver' +if [ -f ~/Library/LaunchAgents/com.desktop.$screen.plist ] ; then osascript -e 'display notification "Plug your computer into a charger Otherwise, run whengreater than 20 percent.😍✌️" with title "Aerial Desktop Disabled Due to Battery Level"' -elif [ -f ~/Library/LaunchAgents/com.aerial.desktop.plist ] ; then +elif [ -f ~/Library/LaunchAgents/com.desktop.$screen.plist ] ; then osascript -e 'display notification "Plug your computer into a charger Otherwise, run whengreater than 20 percent.😍✌️" with title "Aerial Desktop Disabled Due to Battery Level"' fi + + launchctl unload ~/Library/LaunchAgents/com.desktop.dyna.plist; + rm ~/Library/LaunchAgents/com.desktop.dyna.plist + # in case people have the old launch agents 😐 launchctl unload ~/Library/LaunchAgents/com.example.hello.plist; rm ~/Library/LaunchAgents/com.example.hello.plist launchctl unload ~/Library/LaunchAgents/com.aerial.desktop.plist; rm ~/Library/LaunchAgents/com.aerial.desktop.plist - + + rm $DIR/../install/.timestamp.txt + # mv ~/Library/LaunchAgents/com.aerial.desktop.plist com.aerial.desktop.plist; diff --git a/.hide/app/uninstall/unstage_launch_agent.sh b/.hide/app/uninstall/2_unstage_launch_agent.sh similarity index 62% rename from .hide/app/uninstall/unstage_launch_agent.sh rename to .hide/app/uninstall/2_unstage_launch_agent.sh index 8e40103..db33f48 100755 --- a/.hide/app/uninstall/unstage_launch_agent.sh +++ b/.hide/app/uninstall/2_unstage_launch_agent.sh @@ -1,10 +1,13 @@ # !/bin/bash osascript -e 'quit app "System Preferences"' + launchctl unload ~/Library/LaunchAgents/com.monitor.charge.plist; + rm ~/Library/LaunchAgents/com.monitor.charge.plist + launchctl unload ~/Library/LaunchAgents/com.desktop.dyna.plist; + rm ~/Library/LaunchAgents/com.desktop.dyna.plist + + # in case people have the old launch agents 😐 launchctl unload ~/Library/LaunchAgents/com.example.hello.plist; rm ~/Library/LaunchAgents/com.example.hello.plist launchctl unload ~/Library/LaunchAgents/com.aerial.desktop.plist; rm ~/Library/LaunchAgents/com.aerial.desktop.plist - launchctl unload ~/Library/LaunchAgents/com.monitor.charge.plist; - rm ~/Library/LaunchAgents/com.monitor.charge.plist - # mv ~/Library/LaunchAgents/com.aerial.desktop.plist com.aerial.desktop.plist; diff --git a/.hide/app/uninstall/remove_aerial.sh b/.hide/app/uninstall/remove_aerial.sh deleted file mode 100755 index 991bb66..0000000 --- a/.hide/app/uninstall/remove_aerial.sh +++ /dev/null @@ -1,12 +0,0 @@ -if [ -d ~/Library/Screen\ Savers/Aerial.saver ] ; then - rm -rf ~/Library/Screen\ Savers/Aerial.saver/ - osascript -e 'display notification "Aerial Screensaver has been removed." with title "Aerial Desktop Uninstal Successful"' -elif [ -d /Library/Screen\ Savers/Aerial.saver ] ; then - #build notes: will need to open a popup window and gather input - #then put it as the pasword information for sudo -osascript -e 'display notification "Did not Uninstall currently in dev,\nReason: installed across all Users; need sudo"' - sudo rm -rf /Library/Screen\ Savers/Aerial.saver/ -else - osascript -e 'display notification "File does not exist." with title "Notification: Aerial Desktop"' -fi - defaults -currentHost write com.apple.screensaver modulePath -string "/System/Library/Screen Savers/Random.saver"; defaults -currentHost write com.apple.screensaver moduleName -string "Random"; defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName Random path /System/Library/Screen\ Savers/Random.saver/ type 0; diff --git a/.hide/bin/Start.app/Contents/Info.plist b/.hide/bin/Installer.app/Contents/Info.plist similarity index 100% rename from .hide/bin/Start.app/Contents/Info.plist rename to .hide/bin/Installer.app/Contents/Info.plist diff --git a/.hide/bin/Start.app/Contents/MacOS/Installer b/.hide/bin/Installer.app/Contents/MacOS/Installer similarity index 100% rename from .hide/bin/Start.app/Contents/MacOS/Installer rename to .hide/bin/Installer.app/Contents/MacOS/Installer diff --git a/.hide/bin/Start.app/Contents/Resources/AppSettings.plist b/.hide/bin/Installer.app/Contents/Resources/AppSettings.plist similarity index 100% rename from .hide/bin/Start.app/Contents/Resources/AppSettings.plist rename to .hide/bin/Installer.app/Contents/Resources/AppSettings.plist diff --git a/.hide/bin/Start.app/Contents/Resources/MainMenu.nib/designable.nib b/.hide/bin/Installer.app/Contents/Resources/MainMenu.nib/designable.nib similarity index 100% rename from .hide/bin/Start.app/Contents/Resources/MainMenu.nib/designable.nib rename to .hide/bin/Installer.app/Contents/Resources/MainMenu.nib/designable.nib diff --git a/.hide/bin/Start.app/Contents/Resources/MainMenu.nib/keyedobjects.nib b/.hide/bin/Installer.app/Contents/Resources/MainMenu.nib/keyedobjects.nib similarity index 100% rename from .hide/bin/Start.app/Contents/Resources/MainMenu.nib/keyedobjects.nib rename to .hide/bin/Installer.app/Contents/Resources/MainMenu.nib/keyedobjects.nib diff --git a/Installer.app/Contents/Resources/appIcon.icns b/.hide/bin/Installer.app/Contents/Resources/appIcon.icns similarity index 100% rename from Installer.app/Contents/Resources/appIcon.icns rename to .hide/bin/Installer.app/Contents/Resources/appIcon.icns diff --git a/.hide/bin/Installer.app/Contents/Resources/script b/.hide/bin/Installer.app/Contents/Resources/script new file mode 100755 index 0000000..87e789f --- /dev/null +++ b/.hide/bin/Installer.app/Contents/Resources/script @@ -0,0 +1,24 @@ +osascript -e 'quit app "System Preferences"' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +screen=$1 +saver='.saver' +adaptive_wait () { +TIMEOUT=25 + until [ -d ~/Library/Screen\ Savers/$screen$saver ] || [ -d /Library/Screen\ Savers/$screen$saver ] || [ $TIMEOUT -eq 0 ] ; do + if ! ((TIMEOUT % 5)); then + osascript -e 'display notification "To allow for Decision/User Credentials" with title "Application Waiting"' + fi + sleep 1 + TIMEOUT=$[$TIMEOUT-1] + done +} +shrink="$DIR/../../../../app" + +$shrink/uninstall/./2_unstage_launch_agent.sh +rm $shrink/install/.timestamp.txt +$shrink/install/./1_check_resource.sh $screen$saver +adaptive_wait +osascript -e 'quit app "System Preferences"' +$shrink/install/./notify_and_defaults/2_local_install_workaround.sh $screen".saver" +$shrink/install/./launch_agent/3_install_launch_agent.sh dyna +rm -rf $screen".saver" diff --git a/.hide/bin/Start.app/Contents/Resources/Start.png b/.hide/bin/Start.app/Contents/Resources/Start.png deleted file mode 100644 index 1563e97..0000000 Binary files a/.hide/bin/Start.app/Contents/Resources/Start.png and /dev/null differ diff --git a/.hide/bin/Start.app/Contents/Resources/appIcon.icns b/.hide/bin/Start.app/Contents/Resources/appIcon.icns deleted file mode 100644 index 9294c3c..0000000 Binary files a/.hide/bin/Start.app/Contents/Resources/appIcon.icns and /dev/null differ diff --git a/.hide/bin/Start.app/Contents/Resources/script b/.hide/bin/Start.app/Contents/Resources/script deleted file mode 100755 index b78b34a..0000000 --- a/.hide/bin/Start.app/Contents/Resources/script +++ /dev/null @@ -1,3 +0,0 @@ -shrink=../../.. -./$shrink/.hide/app/install/2_local_install_workaround.sh -./$shrink/.hide/app/install/3_install_launch_agent.sh diff --git a/.hide/bin/Stop.app/Contents/Resources/script b/.hide/bin/Stop.app/Contents/Resources/script index b157b65..f693e03 100755 --- a/.hide/bin/Stop.app/Contents/Resources/script +++ b/.hide/bin/Stop.app/Contents/Resources/script @@ -1,2 +1,2 @@ -shrink=../../.. -./$shrink/.hide/app/uninstall/unstage_launch_agent.sh +shrink=../../../.. +./$shrink/app/uninstall/2_unstage_launch_agent.sh diff --git a/.hide/bin/Uninstall.app/Contents/Info.plist b/.hide/bin/Uninstall.app/Contents/Info.plist deleted file mode 100644 index dcbf797..0000000 Binary files a/.hide/bin/Uninstall.app/Contents/Info.plist and /dev/null differ diff --git a/.hide/bin/Uninstall.app/Contents/MacOS/Uninstall b/.hide/bin/Uninstall.app/Contents/MacOS/Uninstall deleted file mode 100755 index d4f4459..0000000 Binary files a/.hide/bin/Uninstall.app/Contents/MacOS/Uninstall and /dev/null differ diff --git a/.hide/bin/Uninstall.app/Contents/Resources/AppSettings.plist b/.hide/bin/Uninstall.app/Contents/Resources/AppSettings.plist deleted file mode 100644 index fa18b5d..0000000 Binary files a/.hide/bin/Uninstall.app/Contents/Resources/AppSettings.plist and /dev/null differ diff --git a/.hide/bin/Uninstall.app/Contents/Resources/MainMenu.nib/designable.nib b/.hide/bin/Uninstall.app/Contents/Resources/MainMenu.nib/designable.nib deleted file mode 100644 index 014a9a7..0000000 --- a/.hide/bin/Uninstall.app/Contents/Resources/MainMenu.nib/designable.nib +++ /dev/null @@ -1,569 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.hide/bin/Uninstall.app/Contents/Resources/MainMenu.nib/keyedobjects.nib b/.hide/bin/Uninstall.app/Contents/Resources/MainMenu.nib/keyedobjects.nib deleted file mode 100644 index 8d20692..0000000 Binary files a/.hide/bin/Uninstall.app/Contents/Resources/MainMenu.nib/keyedobjects.nib and /dev/null differ diff --git a/.hide/bin/Uninstall.app/Contents/Resources/Uninstall.png b/.hide/bin/Uninstall.app/Contents/Resources/Uninstall.png deleted file mode 100644 index 70e7955..0000000 Binary files a/.hide/bin/Uninstall.app/Contents/Resources/Uninstall.png and /dev/null differ diff --git a/.hide/bin/Uninstall.app/Contents/Resources/appIcon.icns b/.hide/bin/Uninstall.app/Contents/Resources/appIcon.icns deleted file mode 100644 index 3bd8454..0000000 Binary files a/.hide/bin/Uninstall.app/Contents/Resources/appIcon.icns and /dev/null differ diff --git a/.hide/bin/Uninstall.app/Contents/Resources/script b/.hide/bin/Uninstall.app/Contents/Resources/script deleted file mode 100755 index 2f45cb9..0000000 --- a/.hide/bin/Uninstall.app/Contents/Resources/script +++ /dev/null @@ -1,9 +0,0 @@ -shrink=../../.. -rm $shrink/.hide/app/install/DesktopBackgroundChanger.app/Contents/Resources/.timestamp.txt -./$shrink/.hide/app/uninstall/unstage_launch_agent.sh -./$shrink/.hide/app/uninstall/remove_aerial.sh -mv $shrink/Start.app/ ../../../.hide/bin -mv $shrink/Stop.app/ ../../../.hide/bin -mv $shrink/Uninstall.app ../../../.hide/bin -mv ../$shrink/bin/Installer.app ../../../../../ - diff --git a/Installer.app/Contents/Info.plist b/Installer.app/Contents/Info.plist deleted file mode 100644 index fd1d804..0000000 Binary files a/Installer.app/Contents/Info.plist and /dev/null differ diff --git a/Installer.app/Contents/MacOS/Installer b/Installer.app/Contents/MacOS/Installer deleted file mode 100755 index d4f4459..0000000 Binary files a/Installer.app/Contents/MacOS/Installer and /dev/null differ diff --git a/Installer.app/Contents/Resources/AppSettings.plist b/Installer.app/Contents/Resources/AppSettings.plist deleted file mode 100644 index fa18b5d..0000000 Binary files a/Installer.app/Contents/Resources/AppSettings.plist and /dev/null differ diff --git a/Installer.app/Contents/Resources/Install.png b/Installer.app/Contents/Resources/Install.png deleted file mode 100644 index a7182e4..0000000 Binary files a/Installer.app/Contents/Resources/Install.png and /dev/null differ diff --git a/Installer.app/Contents/Resources/MainMenu.nib/designable.nib b/Installer.app/Contents/Resources/MainMenu.nib/designable.nib deleted file mode 100644 index 014a9a7..0000000 --- a/Installer.app/Contents/Resources/MainMenu.nib/designable.nib +++ /dev/null @@ -1,569 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Installer.app/Contents/Resources/MainMenu.nib/keyedobjects.nib b/Installer.app/Contents/Resources/MainMenu.nib/keyedobjects.nib deleted file mode 100644 index 8d20692..0000000 Binary files a/Installer.app/Contents/Resources/MainMenu.nib/keyedobjects.nib and /dev/null differ diff --git a/Installer.app/Contents/Resources/script b/Installer.app/Contents/Resources/script deleted file mode 100755 index 796b08a..0000000 --- a/Installer.app/Contents/Resources/script +++ /dev/null @@ -1,22 +0,0 @@ -osascript -e 'quit app "System Preferences"' - -adaptive_wait () { -TIMEOUT=25 - until [ -d ~/Library/Screen\ Savers/Aerial.saver ] || [ -d /Library/Screen\ Savers/Aerial.saver ] || [ $TIMEOUT -eq 0 ] ; do - if ! ((TIMEOUT % 5)); then - osascript -e 'display notification "To allow for Decision/User Credentials" with title "Application Waiting"' - fi - sleep 1 - TIMEOUT=$[$TIMEOUT-1] - done -} -shrink=../../.. -./$shrink/.hide/app/install/1_download_aerial.sh -adaptive_wait -osascript -e 'quit app "System Preferences"' -./$shrink/.hide/app/install/2_local_install_workaround.sh -./$shrink/.hide/app/install/3_install_launch_agent.sh -mv $shrink/.hide/bin/Start.app/ ../../../ -mv $shrink/.hide/bin/Stop.app/ ../../../ -mv $shrink/.hide/bin/Uninstall.app ../../../ -mv $shrink/Installer.app ../../../.hide/bin diff --git a/test_scenetios.md b/test_scenetios.md new file mode 100644 index 0000000..0d8239e --- /dev/null +++ b/test_scenetios.md @@ -0,0 +1,15 @@ +## it would be beneficial to write all expected outputs. +1) `open .hide/bin/Installer.app/ --args Aerial` +
"opens the application" +
... allowing install if needed. +
now user is gaurenteed to have saver. and expect it is showing on desktop. +
closes out of system preferences. +
notifies the user with a notification ... of success or failure. +
now for the fun part! +2) checks to see if user is connected to the internet. +
does not show screensaver until connected to the internet. +3) checks to see if users battery is below 20 percent uncharged or 40 percent charged. +4) correctly identifies if user is on desktop mac computer or macbook laptop computer. +
battery check does not take effect if user is on a desktop computer as it is not needed. +5) disables completely if user (sleeps computer/closes laptop) multiple times. within 60 seconds. +6) application stops when script `open .hide/bin/Stop.app/` is executed.