diff --git a/README.md b/README.md index 12b6944..354b935 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,13 @@ mar does dotfiles # post install +## Casks + +```fish +open /usr/local/Caskroom/windscribe/[#.#.#]/windscribeInstaller.app + +``` + ## iTerm2 Set iTerm2 to use the preferences folder ~/dotfiles/os/. diff --git a/os/apt_utils.fish b/os/apt_utils.fish new file mode 100644 index 0000000..6fb0b76 --- /dev/null +++ b/os/apt_utils.fish @@ -0,0 +1,53 @@ +#!/usr/bin/env fish + +source "$DOT/script/utils.fish" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +function package_is_installed -a pkg + dpkg -s "$pkg" &>/dev/null +end + +function install_package -a pkg_readable_name pkg args + if ! package_is_installed "$pkg" + execute \ + "sudo apt-get install --allow-authenticated -qqy $args $pkg" "$pkg_readable_name" + # suppress output ─┘│ + # assume "yes" as the answer to all prompts ──┘ + else + print_success "$pkg_readable_name" + end +end + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +function add_key -a key + wget -q0 - "$key" | sudo apt-key add - &> /dev/null + # │└─ write output to file + # └─ don't show output +end + +function add_ppa -a ppa + sudo add-apt-repository -y ppa:"$ppa" &>/dev/null +end + +function add_to_source_list -a source list + sudo sh -c "printf 'deb $source' >> '/etc/apt/sources.list.d/$list'" +end + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +function apt_update + execute "sudo apt-get update -qqy" "APT (update)" +end + +function apt_upgrade + execute \ + "export DEBIAN_FRONTEND=\"noninteractive\" \ + && sudo apt-get -o Dpkg::Options::=\"--force-confnew\" upgrade -qqy" \ + "APT (upgrade)" +end + +function apt_autoremove + execute "sudo apt-get autoremove -qqy" "APT (autoremove)" +end diff --git a/os/install.fish b/os/install.fish new file mode 100644 index 0000000..b4da2f4 --- /dev/null +++ b/os/install.fish @@ -0,0 +1,31 @@ +#!/usr/bin/env fish + +source "$DOT/script/utils.fish" +source "$DOT/homebrew/brew_utils.fish" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +print_subtitle "OS" + +if [ "$(uname)" = "Darwin" ] + brew_install "mas-cli" "mas" + + brew_install "Rectangle" "rectangle" "--cask" + execute "mas install 1563735522" "Charmstone" + + brew_install "Windscribe" "windscribe" "--cask" + brew_install "Firefox" "firefox" "--cask" + brew_install "qBittorrent" "qbittorrent" "--cask" + + brew_install "Discord" "discord" "--cask" + brew_install "BetterDiscord" "betterdiscord-installer" "--cask" + + brew_install "Obsidian" "obsidian" "--cask" + brew_install "Fantastical" "fantastical" "--cask" + + brew_install "iTerm2" "iterm2" "--cask" + brew_install "Laravel Herd" "herd" "--cask" + brew_install "DBngin" "dbngin" "--cask" + brew_install "PhpStorm" "phpstorm" "--cask" + brew_install "WebStorm" "webstorm" "--cask" +end diff --git a/os/pref.sh b/os/macos.fish similarity index 100% rename from os/pref.sh rename to os/macos.fish diff --git a/php/install.fish b/php/install.fish new file mode 100644 index 0000000..b50106b --- /dev/null +++ b/php/install.fish @@ -0,0 +1,11 @@ +#!/usr/bin/env fish + +source "$DOT/script/utils.fish" +source "$DOT/homebrew/brew_utils.fish" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +if [ "$(uname)" = "Darwin" ] + brew_install "Laravel Herd" "herd" "--cask" + brew_install "PhpStorm" "phpstorm" "--cask" +end diff --git a/script/dot.fish b/script/dot.fish index 4b3d01f..92cd6c7 100755 --- a/script/dot.fish +++ b/script/dot.fish @@ -1,8 +1,9 @@ #!/usr/bin/env fish -# vim:set ft=fish : set -q DOT || set -gx DOT "$HOME/dotfiles" +set -g yes_to_all false + source "$DOT/script/utils.fish" ################################################################################ @@ -106,9 +107,23 @@ end function install_dotfiles print_title "Installing Dotfiles" + set -g skip_all false set -g overwrite_all false set -g backup_all false - set -g skip_all false + + if set -q yes_to_all && $yes_to_all + set skip_all true + else if set -q _flag_s + set skip_all true + end + + if set -q _flag_o + set overwrite_all true + end + + if set -q _flag_b + set backup_all true + end set -l path (string replace -a '/' '\/' "$DOT") set -l regex (string join '' '^' "$path" '\/[a-zA-Z]+\/(.+)\.(sym|hard)link$') @@ -119,9 +134,17 @@ function install_dotfiles end ################################################################################ -# Main # +# Main # ################################################################################ +argparse "y/yes-to-all" "s/skip" "o/overwrite" "b/backup" -- $argv + +if set -q _flag_y + set yes_to_all true +end + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # Ensure npm is available. "$DOT/node/volta.fish"