setup includes media sync and defaults editor; moved almost all prompts to the start of the setup
This commit is contained in:
parent
72d6e76602
commit
e04a16bbcd
19
bin/aws/configure
vendored
Executable file
19
bin/aws/configure
vendored
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/zsh
|
||||
source "$HOME/.config/wryn/env/env.zsh"
|
||||
source $ZSH_COLOR_UTIL
|
||||
|
||||
#####################################################################
|
||||
|
||||
CONFIGURE() {
|
||||
CHECK "checking for '$DOTWRYN_AWS_PROFILE' aws credentials"
|
||||
grep -q "^\\[$DOTWRYN_AWS_PROFILE\\]$" "$HOME/.aws/credentials" \
|
||||
&& { OK; return 0 } || WARN
|
||||
|
||||
USER_PROMPT "set up credentials now? [Y/n]"
|
||||
READ_K yn
|
||||
[[ $yn =~ ^[nN] ]] && return 1
|
||||
|
||||
aws --profile $DOTWRYN_AWS_PROFILE configure
|
||||
}
|
||||
|
||||
CONFIGURE
|
6
env/env.zsh
vendored
6
env/env.zsh
vendored
@ -23,7 +23,11 @@ WEBBROWSER='google-chrome-stable'
|
||||
#I3__DMENU_FONT_SIZE=
|
||||
#I3__BORDER_PIXEL_SIZE=
|
||||
|
||||
S3_SYNC_AWS_PROFILE='yage'
|
||||
DOTWRYN_AWS_PROFILE='yage'
|
||||
DOTWRYN_AWS_REGION='us-east-2'
|
||||
DOTWRYN_AWS_OUTPUT='json'
|
||||
|
||||
S3_SYNC_AWS_PROFILE=$DOTWRYN_AWS_PROFILE
|
||||
S3_SYNC_BUCKET='yage'
|
||||
S3_SYNC_MEDIA=(
|
||||
"Games/roms"
|
||||
|
7
setup/aws/setup.zsh
Normal file
7
setup/aws/setup.zsh
Normal file
@ -0,0 +1,7 @@
|
||||
AWS__SETUP() {
|
||||
STATUS 'starting aws setup'
|
||||
"$DOTWRYN_PATH/bin/aws/configure"
|
||||
|
||||
STATUS 'getting media from s3'
|
||||
"$DOTWRYN_PATH/bin/aws/s3/sync-media" pull
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
DOTCONFIG__SETUP() {
|
||||
CONFIG__SETUP() {
|
||||
############################################################################################
|
||||
# Friendly Name ~/.config/THE_REST .wryn/config/THE_REST (if different)
|
||||
CONFIG__SYMLINK 'compton' 'compton/compton.conf'
|
||||
@ -19,6 +19,9 @@ DOTCONFIG__SETUP() {
|
||||
############################################################################################
|
||||
|
||||
CONFIG__TERMINFO
|
||||
|
||||
CONFIG__RC 'zsh'
|
||||
CONFIG__RC 'vim'
|
||||
}
|
||||
|
||||
function CONFIG__SYMLINK() {
|
||||
@ -40,8 +43,46 @@ function CONFIG__SYMLINK() {
|
||||
|
||||
function CONFIG__TERMINFO() {
|
||||
for file in $(find "$DOTWRYN_PATH/config/terminfo" -type f); do
|
||||
CHECK "adding '$(basename $file)'"
|
||||
CHECK "adding $(basename $file)"
|
||||
tic -x $file >>$LOG 2>&1 \
|
||||
&& OK || WARN
|
||||
done
|
||||
}
|
||||
|
||||
function CONFIG__RC() {
|
||||
local DEFAULT_CONFIG="$DOTWRYN_PATH/env/env.$1"
|
||||
local LOCAL_CONFIG="$HOME/.config/wryn/env/env.$1"
|
||||
|
||||
[ -f $LOCAL_CONFIG ] && {
|
||||
WARNING "local $1 configuration exists ($LOCAL_CONFIG)"
|
||||
USER_PROMPT 'overwrite? [y/N]'
|
||||
READ_K yn
|
||||
[[ $yn =~ ^[yY] ]] && {
|
||||
CHECK "backing up local copy ($LOCAL_CONFIG.bak)"
|
||||
mv "$LOCAL_CONFIG" "$LOCAL_CONFIG.bak" && OK || WARN
|
||||
} || {
|
||||
STATUS 'skipping'
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
CHECK "setting up $1 configuration ($LOCAL_CONFIG)"
|
||||
|
||||
case $1 in
|
||||
vim ) COMMENT='"' ;;
|
||||
zsh ) COMMENT='#' ;;
|
||||
esac
|
||||
|
||||
{
|
||||
echo "source $DEFAULT_CONFIG"
|
||||
echo -e "\\n$COMMENT\n$COMMENT .wryn configuration overrides\n$COMMENT\n"
|
||||
sed "s/^[^$COMMENT].*/$COMMENT&/" $DEFAULT_CONFIG
|
||||
} > $LOCAL_CONFIG && OK || WARN
|
||||
|
||||
USER_PROMPT 'change local configuration options? [y/N]'
|
||||
READ_K yn
|
||||
|
||||
[[ $yn =~ ^[yY] ]] && {
|
||||
$EDITOR "$HOME/.config/wryn/env/env.$1"
|
||||
}
|
||||
}
|
11
setup/linux
11
setup/linux
@ -118,7 +118,8 @@ MAKE_REQUIRED_DIRECTORY_STRUCTURE() {
|
||||
source "$DOTWRYN_PATH/setup/os-dependencies/setup.zsh"
|
||||
source "$DOTWRYN_PATH/setup/zsh/setup.zsh"
|
||||
source "$DOTWRYN_PATH/setup/vim/setup.zsh"
|
||||
source "$DOTWRYN_PATH/setup/dotconfig/setup.zsh"
|
||||
source "$DOTWRYN_PATH/setup/config/setup.zsh"
|
||||
source "$DOTWRYN_PATH/setup/aws/setup.zsh"
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -132,9 +133,11 @@ GET_SUDO_PASSWORD
|
||||
OS_DEPENDENCY__SETUP || FATAL 'user abort'
|
||||
MAKE_REQUIRED_DIRECTORY_STRUCTURE
|
||||
|
||||
ZSH__SETUP || ERROR=1
|
||||
VIM__SETUP || ERROR=2
|
||||
DOTCONFIG__SETUP || ERROR=3
|
||||
CONFIG__SETUP || ERROR=1
|
||||
|
||||
ZSH__SETUP || ERROR=2
|
||||
VIM__SETUP || ERROR=3
|
||||
AWS__SETUP || ERROR=4
|
||||
|
||||
CLEANUP $ERROR
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
base-devel
|
||||
aws-cli-v2
|
||||
cmake
|
||||
cowsay
|
||||
figlet
|
||||
|
@ -1,3 +1,4 @@
|
||||
awscli
|
||||
build-essential
|
||||
cmake
|
||||
cowsay
|
||||
|
@ -1,3 +1,4 @@
|
||||
aws
|
||||
build-essential
|
||||
cmake
|
||||
cowsay
|
||||
|
@ -21,6 +21,7 @@ function OS_DEPENDENCY__SETUP() {
|
||||
case $OS_NAME in
|
||||
arch )
|
||||
OS_INSTALL() { OS_INSTALL__ARCH $@; }
|
||||
WARNING 'base-devel is required; make sure it is installed'
|
||||
YAY__INSTALL_FROM_SOURCE
|
||||
;;
|
||||
debian | ubuntu )
|
||||
@ -60,10 +61,6 @@ function OS_DEPENDENCY__SETUP() {
|
||||
|
||||
function OS_INSTALL__ARCH() {
|
||||
local TARGET="$1"
|
||||
[[ $TARGET =~ ^base-devel$ ]] && {
|
||||
WARNING 'base-devel is required; make sure it is installed'
|
||||
return 0
|
||||
}
|
||||
CHECK "checking for $TARGET"
|
||||
pacman -Qq | grep -q "^$TARGET$\|^$TARGET-git$" && OK || {
|
||||
WARN "$TARGET not found"
|
||||
|
@ -6,7 +6,6 @@ function VIM__SETUP() {
|
||||
STATUS 'starting vim setup'
|
||||
VIM__COMPILE_FROM_SOURCE
|
||||
VIM__SOURCE_RC
|
||||
VIM__SET_LOCAL_CONFIG
|
||||
VIM__UPDATE_COLORSCHEMES
|
||||
VIM__INSTALL_VUNDLE_PLUGINS
|
||||
VIM__CREATE_PANE_DEFAULT_APP
|
||||
@ -31,31 +30,6 @@ function VIM__SOURCE_RC() {
|
||||
}
|
||||
}
|
||||
|
||||
function VIM__SET_LOCAL_CONFIG() {
|
||||
local DEFAULT_CONFIG="$DOTWRYN_PATH/env/env.vim"
|
||||
local LOCAL_CONFIG="$HOME/.config/wryn/env/env.vim"
|
||||
|
||||
[ -f $LOCAL_CONFIG ] && {
|
||||
WARNING "local vim env configuration ($LOCAL_CONFIG)"
|
||||
USER_PROMPT 'overwrite? [y/N]'
|
||||
READ_K yn
|
||||
[[ $yn =~ ^[yY] ]] && {
|
||||
CHECK "backing up local copy ($LOCAL_CONFIG.bak)"
|
||||
mv "$LOCAL_CONFIG" "$LOCAL_CONFIG.bak" && OK || WARN
|
||||
} || {
|
||||
STATUS 'skipping'
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
CHECK "setting vim configuration file ($LOCAL_CONFIG)"
|
||||
{
|
||||
echo "source $DEFAULT_CONFIG"
|
||||
echo -e '\n"\n" .wryn configuration overrides\n"\n'
|
||||
sed 's/["]*\(.*\)/"\1/' $DEFAULT_CONFIG
|
||||
} > $LOCAL_CONFIG && OK || WARN
|
||||
}
|
||||
|
||||
function VIM__UPDATE_COLORSCHEMES() {
|
||||
CHECK 'updating colorschemes'
|
||||
$DOTWRYN_PATH/bin/vim/update_colorschemes >>$LOG 2>&1\
|
||||
|
@ -3,7 +3,6 @@
|
||||
function ZSH__SETUP() {
|
||||
ZSH__SET_DEFAULT_SHELL
|
||||
ZSH__SOURCE_RC
|
||||
ZSH__SET_LOCAL_CONFIG
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
@ -27,28 +26,3 @@ function ZSH__SOURCE_RC() {
|
||||
&& OK || WARN
|
||||
}
|
||||
}
|
||||
|
||||
function ZSH__SET_LOCAL_CONFIG() {
|
||||
local DEFAULT_CONFIG="$DOTWRYN_PATH/env/env.zsh"
|
||||
local LOCAL_CONFIG="$HOME/.config/wryn/env/env.zsh"
|
||||
|
||||
[ -f $LOCAL_CONFIG ] && {
|
||||
WARNING "local zsh env configuration ($LOCAL_CONFIG)"
|
||||
USER_PROMPT 'overwrite? [y/N]'
|
||||
READ_K yn
|
||||
[[ $yn =~ ^[yY] ]] && {
|
||||
CHECK "backing up local copy ($LOCAL_CONFIG.bak)"
|
||||
mv "$LOCAL_CONFIG" "$LOCAL_CONFIG.bak" && OK || WARN
|
||||
} || {
|
||||
STATUS 'skipping'
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
CHECK "setting zsh configuration file ($LOCAL_CONFIG)"
|
||||
{
|
||||
echo "source $DEFAULT_CONFIG"
|
||||
echo -e '\n#\n# .wryn configuration overrides\n#\n'
|
||||
sed 's/^[^#].*/#&/' $DEFAULT_CONFIG
|
||||
} > $LOCAL_CONFIG && OK || WARN
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user