diff --git a/images/make_250x250_thumbnails/go.sh b/images/make_250x250_thumbnails/go.sh old mode 100644 new mode 100755 index cb6b41f..4b69feb --- a/images/make_250x250_thumbnails/go.sh +++ b/images/make_250x250_thumbnails/go.sh @@ -8,13 +8,11 @@ if [ ! -d "$output_dir" ]; then mkdir -p "$output_dir" fi -for notpornimages in $input_dir/*.{$exts} ; do - +for notpornimages in $input_dir/*."{$exts}" ; do convert "$notpornimages" \ -thumbnail 250x250^ \ -gravity center \ -extent 250x250 \ -set filename:fname '%t_thumb' \ "$output_dir"/'%[filename:fname].jpg' - done diff --git a/system/macos/basic_IM_utilities_setup/lib/echos.sh b/system/macos/basic_IM_utilities_setup/lib/echos.sh index 403207c..bcf8503 100755 --- a/system/macos/basic_IM_utilities_setup/lib/echos.sh +++ b/system/macos/basic_IM_utilities_setup/lib/echos.sh @@ -1,28 +1,31 @@ #!//bin/bash -### -# some colorized echo helpers -# @author Adam Eivy -# https://raw.githubusercontent.com/atomantic/dotfiles/master/lib_sh/echos.sh -### +# ---------------------------------------------------------------------------- # +# Colorized echo helpers and functions +# Original work based on the echos.sh script by @author Adam Eivy: +# https://github.com/atomantic/dotfiles/blob/master/lib_sh/echos.sh +# ---------------------------------------------------------------------------- # # Colors +# ---------------------------------------------------------------- ESC_SEQ="\x1b[" -COL_RESET=$ESC_SEQ"39;49;00m" -COL_RED=$ESC_SEQ"31;01m" -COL_GREEN=$ESC_SEQ"32;01m" -COL_YELLOW=$ESC_SEQ"33;01m" -COL_BLUE=$ESC_SEQ"34;01m" -COL_MAGENTA=$ESC_SEQ"35;01m" -COL_CYAN=$ESC_SEQ"36;01m" -SEP_COLOR=$ESC_SEQ"36;01m" +COL_RESET=${ESC_SEQ}"39;49;00m" +COL_RED=${ESC_SEQ}"31;01m" +COL_GREEN=${ESC_SEQ}"32;01m" +COL_YELLOW=${ESC_SEQ}"33;01m" +COL_BLUE=${ESC_SEQ}"34;01m" +COL_MAGENTA=${ESC_SEQ}"35;01m" +COL_CYAN=${ESC_SEQ}"36;01m" +SEP_COLOR=${ESC_SEQ}"36;01m" -COL_DIM=$ESC_SEQ"2;49;90m" -SEP_COLOR_DIM=$ESC_SEQ"38;5;8m" -DIMDOTS=$ESC_SEQ"2;49;90m..."$COL_RESET +COL_DIM=${ESC_SEQ}"2;49;90m" +SEP_COLOR_DIM=${ESC_SEQ}"38;5;8m" +DIMDOTS=${ESC_SEQ}"2;49;90m..."${COL_RESET} -COL_PURPLE_BG=$ESC_SEQ"38;2;0;0;0m"$ESC_SEQ"48;2;110;0;255m" +COL_PURPLE_BG=${ESC_SEQ}"38;2;0;0;0m"${ESC_SEQ}"48;2;110;0;255m" +# Variables +# ---------------------------------------------------------------- columns="$(tput cols)" ov_sep="-------------------------------------------------" open_vers_1="MacOS install script - v0.0.1" diff --git a/system/macos/basic_IM_utilities_setup/lib/functions.sh b/system/macos/basic_IM_utilities_setup/lib/functions.sh index 9d319cf..9a931fe 100755 --- a/system/macos/basic_IM_utilities_setup/lib/functions.sh +++ b/system/macos/basic_IM_utilities_setup/lib/functions.sh @@ -1,6 +1,6 @@ #!/bin/bash -function install_homebrew() { +function check_homebrew() { brew_check=$(command -v brew) > /dev/null 2>&1 if [[ $? != 0 ]]; then @@ -26,8 +26,8 @@ function install_homebrew() { fi } -function install_brewcask() { - output=$(command -v brew cask --version) > /dev/null 2>&1 +function check_brewcask() { + cask_check=$(command -v brew cask --version) > /dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "brew-cask is not installed" else @@ -35,8 +35,35 @@ function install_brewcask() { fi } +function check_iterm2 () { + iterm_check=$(echo $TERM_PROGRAM) > /dev/null 2>&1 + if [[ $? != 0 ]]; then + echo -e "You don't have iterm2 installed. Installing..." + require_cask iterm2 + else + echo -e "iterm2 is already installed. Moving on." + fi +} +function check_atom () { + atom_check=$(command -v atom) > /dev/null 2>&1 + if [[ $? != 0 ]]; then + echo -e "You don't have Atom installed. Installing..." + require_cask atom + else + echo -e "Atom is already installed. Moving on." + fi +} +function check_im () { + im_check=$(command -v convert) > /dev/null 2>&1 + if [[ $? != 0 ]]; then + echo -e "You don't have ImageMagick installed. Installing..." + require_brew imagemagick + else + echo -e "ImageMagick is already installed. Moving on." + fi +} # source ./echos.sh diff --git a/system/macos/basic_IM_utilities_setup/setup.sh b/system/macos/basic_IM_utilities_setup/setup.sh index 2c6ff68..11e82ae 100755 --- a/system/macos/basic_IM_utilities_setup/setup.sh +++ b/system/macos/basic_IM_utilities_setup/setup.sh @@ -19,5 +19,24 @@ opening_title # Install Homebrew # ---------------------------------------------------------------- -running "Checking homebrew..." -install_homebrew +running "Checking on Homebrew..." +check_homebrew + +seperator + +# Install Homebrew Cask (for non-brew applications) +# ---------------------------------------------------------------- +running "Checking on Homebrew Casks..." +check_brewcask + +seperator + +check_iterm2 + +seperator + +check_atom + +seperator + +check_im