Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #26 from omares/improvements
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
omares committed Jul 23, 2018
2 parents df89e4d + 192a8c6 commit 5fb961e
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .dotfiles/base/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ echo "------------------------------"
# get the absolute path of the .dotfiles directory
# this is only for aesthetic reasons to have an absolute symlink path instead of a relative one
# <path-to-smu>/.dotfiles/somedotfile vs <path-to-smu>/.dotfiles/base/../somedotfile
readonly dotfiles="$(dirname -- "$(dirname -- "$(readlink -f -- "$0")")")"
readonly dotfiles="$(dirname -- "$(dirname -- "$(greadlink -f -- "$0")")")"

export RCRC="../rcrc"
rcup -v -d "${dotfiles}"
1 change: 1 addition & 0 deletions .dotfiles/base/brewfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tap "thoughtbot/formulae"

brew "coreutils"
brew "rcm"
67 changes: 38 additions & 29 deletions .dotfiles/tag-smu/SpaceVim.d/init.toml
Original file line number Diff line number Diff line change
@@ -1,60 +1,69 @@
[options]
colorscheme = "one"
colorscheme_bg = "dark"
statusline_separator = "arrow"
statusline_inactive_separator = "arrow"
buffer_index_type = 4
filetype_icon = true
default_indent = 4
relativenumber = false
enable_statusline_display_mode = true

# Enable autocomplete layer
[[layers]]
name = 'autocomplete'
[[layers]]
auto-completion-return-key-behavior = "complete"
auto-completion-tab-key-behavior = "smart"
name = "autocomplete"

[[layers]]
name = 'shell'
default_position = 'top'
default_height = 30
default_position = "top"
name = "shell"

[[layers]]
enable = false
name = "core#statusline"

[[layers]]
name = 'checkers'
enable = false
name = "core#tabline"

[[layers]]
name = 'colorscheme'
name = "VersionControl"

[[layers]]
name = 'VersionControl'
name = "checkers"

[[layers]]
name = 'fzf'
name = "colorscheme"

[[layers]]
name = 'lang#html'
name = "fzf"

[[layers]]
name = 'lang#javascript'
name = "lang#html"

[[layers]]
name = 'lang#json'
name = "lang#javascript"

[[layers]]
name = 'lang#markdown'
name = "lang#json"

[[layers]]
name = 'lang#php'
name = "lang#markdown"

[[layers]]
name = 'lang#sh'
name = "lang#php"

[[layers]]
name = 'lang#toml'
name = "lang#sh"

[[layers]]
name = 'lang#typescript'
name = "lang#toml"

[[layers]]
name = 'lang#xml'
name = "lang#typescript"

[[layers]]
name = "lang#xml"

[options]
buffer_index_type = 4
colorscheme = "$BASE16_THEME"
colorscheme_bg = "dark"
custom_plugins = [["chriskempson/base16-vim"]]
default_indent = 4
enable_statusline_display_mode = true
filetype_icon = true
guifont = "FuraCodeNerdFontComplete-Light 12"
relativenumber = false
statusline_inactive_separator = "arrow"
statusline_separator = "arrow"
2 changes: 2 additions & 0 deletions .dotfiles/tag-smu/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
pager = diff-so-fancy | less --tabs=4 -RFX
editor = vim

[color]
# Use colors in Git commands that are capable of colored output when
Expand Down
2 changes: 1 addition & 1 deletion .dotfiles/tag-smu/modules/editor/brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ cask "macdown"
cask "oni"

# diff
cask "p4merge"
cask "p4v"
brew "diff-so-fancy"
1 change: 1 addition & 0 deletions .dotfiles/tag-smu/modules/editor/editor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ if [[ ! -e "${sublime_package_control}" ]]; then
echo "------------------------------"
echo "Installing Sublime3 package control"

mkdir -p $(dirname "${sublime_package_control}")
curl -fsSL "https://packagecontrol.io/Package%20Control.sublime-package" > "${sublime_package_control}"
fi

Expand Down
12 changes: 6 additions & 6 deletions .dotfiles/tag-smu/modules/macos/macos.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/bin/bash

if [[ "${EUID}" -ne 0 ]]; then
echo "This module requires sudo rights."
echo "You should run this module using the smu script."
exit 1
fi

# Run the osx.sh Script
# I strongly suggest you read through the commented osx.sh
# source file and tweak any settings based on your personal
Expand All @@ -24,6 +18,12 @@ echo ""
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'

# Ask for the administrator password upfront
sudo -v

# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &

###############################################################################
# General UI/UX #
###############################################################################
Expand Down
12 changes: 6 additions & 6 deletions .dotfiles/tag-smu/modules/macosupdate/macosupdate.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash

if [[ "${EUID}" -ne 0 ]]; then
echo "This module requires sudo rights."
echo "You should run this module using the smuu script."
exit 1
fi

echo "------------------------------"
echo "Updating macOS. If this requires a restart, run the script again."
echo "------------------------------"
echo ""

# Ask for the administrator password upfront
sudo -v

# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &

# Install all available updates
sudo softwareupdate -i -a

Expand Down
1 change: 1 addition & 0 deletions .dotfiles/tag-smu/modules/php/brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ brew "rabbitmq-c"
brew "php@7.2"
brew "php@5.6"
brew "composer"
brew "libmemcached"
37 changes: 6 additions & 31 deletions smu
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,6 @@ provision_enabled() {
export _arg_provision
export -f provision_enabled

start_sudo() {
sudo -v
( while true; do sudo -v; sleep 60; done; ) &
SUDO_PID="$!"
trap stop_sudo SIGINT SIGTERM
}

stop_sudo() {
kill "$SUDO_PID"
trap - SIGINT SIGTERM
sudo -k
}

provision_module() {
# source base from installation directory
# this enables smu to work on first time installations
Expand All @@ -153,7 +140,6 @@ provision_module() {
fi

local -r script="${1}.sh"
local -r requires_sudo=("macos" "macosupdate")

if [[ ! -e "${path}/${script}" ]]; then
echo "${path}/${script} does not seem to exist, skipping."
Expand All @@ -163,23 +149,12 @@ provision_module() {

echo "Running ${path}/${script} module"

if [[ " ${requires_sudo[@]} " =~ " ${1}" ]]; then
(
cd "${path}/" &&
start_sudo &&
[[ -s ./before.sh ]] && source ./before.sh
source "./${script}" &&
[[ -s ./after.sh ]] && source ./after.sh
stop_sudo
)
else
(
cd "${path}/" &&
[[ -s ./before.sh ]] && source ./before.sh
source "./${script}" &&
[[ -s ./after.sh ]] && source ./after.sh
)
fi
(
cd "${path}/" &&
[[ -s ./before.sh ]] && source ./before.sh
source "./${script}" &&
[[ -s ./after.sh ]] && source ./after.sh
)
}

if [[ ${_arg_lsrc} == "on" ]]; then
Expand Down

0 comments on commit 5fb961e

Please sign in to comment.