Skip to main content

Morning script (for MacOS)

Hereby I publish part of my morning script, which perform needed actions. The nature of this script, that it is all-time adjustable.

#!/bin/sh

#
# this is a morning script of Anton to launch morning environment on mac
#
# 2023-11-26  * migrated from start_general_env_on_mac.sh for general usage /A
# 2024-02-15  * small optimizations /A
#             + workspace within MS Code /A
#             + sync (mirror) Cloud KP DB to local storage /A
# 2024-02-17  + seasonal links /A
# 2024-02-22  + import media from pCloud/Automatic /A
# 2024-03-02  + profile backup to external drive /A
# 2024-04-04  + location section /A
# 2024-05-06  + pull_repos.sh /A
# 2024-10-29  * sync with -w profile /A
# 2024-11-30  - cleaning
# 2024-12-02  + Yubico Auth /A
# 2025-09-04  + Yandex Disk /A
# 2025-12-12  - trimmed before publishing /A
#
#


echo "Fix permissions on /Users/Shared, provide sudo pass"
sudo /Users/Shared/tech/scripts/fixperm.sh

echo "Connecting to Cloud Drives."
open -a Nextcloud
open -a "pCloud Drive"
open -a "Yandex.Disk.2.app"
read


# open token and password manager
open -a "Yubico Authenticator"
open -a KeePassXC "/Users/(path to kp)/pvt.kdbx"
echo "Open pCloud Crypto and open ALL password databases, which required. Press any key to continue ..."
read


# launch mail client
# open -a Mail
open -a Thunderbird

# open libraries
open -a Kindle
open -a Firefox https://mybook.ru
open -a Firefox https://books.yandex.ru/books


# other utilities
open -a Calendar
open -a BusyCal
# open -a Spotify
open -a "Яндекс Музыка"
open -a "Double Commander"
open -a "Visual Studio Code" "/Users/anton-pvt/dox-pvt/tech/workspaces/anton-pvt.code-workspace"

# Start messengers
open -a Telegram
open -a Signal
open -a Slack

# repositories
# open -a GitAhead
# open -a sourcetree


# other seasonal links
open -a Firefox https://lcwo.net/callsigns/





# mirror KPxc DB from cloud to local storage
open -a FreeFileSync "/Users/(path to sync)/pCloud--ant1mbp3---kp-pvt.ffs_gui"



# import media from pCloud/Automatic and hub/pix2import
echo "\n\nImporting media from automatic uploades"
/Users/anton-pvt/dox-pvt/tech/scripts/import_media_from_pCloud_Automatic_Upload.sh
/Users/anton-pvt/dox-pvt/tech/scripts/import_media_from_hub.2dz.fi_pix-uploaded.sh


# pulling repos
echo "\n\nPulling repos"
/Users/anton-pvt/dox-pvt/tech/scripts/pull_repos.sh


# other tools


echo "----------------------------------------[Location]-------------"
echo "External IP and location are:"
curl myip.2dz.fi
curl ifconfig.co
curl ifconfig.co/country
curl ifconfig.co/city
echo "----------------------------------------[Timezone]-------------"
sudo systemsetup -gettimezone
echo "---------------------------------------------------------------"


echo "Restoring permissions on backup drive before sync ..."
sudo /Volumes/00067-1T/fixperm.sh

echo "Backing up private profile to 000067-1T ..."
open -a FreeFileSync "/Volumes/00067-1T/ant1mbp3-anton-pvt--00067.ffs_gui"

echo "\n\nHave an excellent day!"
~