Skip to content

Commit

Permalink
split configuration by OSTYPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Terhar committed Feb 18, 2022
1 parent e4507da commit 404dd12
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 32 deletions.
50 changes: 18 additions & 32 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,41 @@
DOTFILES_DIR=$(pwd)
builddt=$(date +"%Y%m%d-%H%M%S")

case "$OSTYPE" in
solaris*) echo "SOLARIS" ;;
darwin*)
echo "MacOS"
. $DOTFILES_DIR/macos/configure.sh
;;
linux*)
echo "LINUX"
. $DOTFILES_DIR/linux/configure.sh
;;
bsd*) echo "BSD" ;;
msys*) echo "WINDOWS" ;;
cygwin*) echo "ALSO WINDOWS" ;;
*) echo "unknown: $OSTYPE" ;;
esac

if [ -f "~/.local/share/code-server/User/settings.json" ]
then
echo "VS Code settings are already present."
else
cp -rf ${DOTFILES_DIR}/.local ~/.local
fi

if [ -f "~/.fzf" ]
then
echo "fzf already present."
else
cp -rf ${DOTFILES_DIR}/.fzf ~/.fzf
~/.fzf/install --all
fi

cp -rf ${DOTFILES_DIR}/.fonts ~/.fonts
cp -f ${DOTFILES_DIR}/.vimrc ~/.vimrc
cp -f ${DOTFILES_DIR}/.gitconfig ~/.gitconfig

git config --file ~/.gitconfig.local user.name "Mike Terhar"
git config --file ~/.gitconfig.local user.email "mike@coder.com"

if [ -f /bin/zsh -o -f /usr/bin/zsh ]; then
cp -f ${DOTFILES_DIR}/.zshrc ~/.zshrc
if sudo -n true 2>/dev/null; then
sudo chsh -s $(which zsh) $(whoami)
else
echo "run chsh -s $(which zsh) to change your shell, I couldn't do it for you"
fi
else
echo "zsh not installed, not configured."
fi

mkdir -p ~/.vim_backup

if [ -z "$CODER_ASSETS_ROOT" ]; then
echo "no coder, no extensions"
else
echo "insalling gitlens"
${CODER_ASSETS_ROOT}/code-server/bin/code-server --install-extension ${DOTFILES_DIR}/extensions/eamodio.gitlens-11.7.0.vsix
fi

if [ "$CODER_RUNTIME" != "kubernetes/sysbox" ]; then
echo "no CVM tuntime: no GPG setup"
exit 0
fi

echo "CVM runtime detected: configuring GPG"
echo "need a new gpg key before re-enabling this."

exit 0
if hash gpg 2>/dev/null; then
mkdir -p ~/.gnupg
chmod 700 ~/.gnupg
Expand Down
17 changes: 17 additions & 0 deletions linux/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

if [ -f "~/.fzf" ]
then
echo "fzf already present."
else
cp -rf ${DOTFILES_DIR}/.fzf ~/.fzf
~/.fzf/install --all
fi

if [ -z "$CODER_ASSETS_ROOT" ]; then
echo "no coder, no extensions"
else
echo "insalling gitlens"
${CODER_ASSETS_ROOT}/code-server/bin/code-server --install-extension ${DOTFILES_DIR}/extensions/eamodio.gitlens-11.7.0.vsix
fi

30 changes: 30 additions & 0 deletions macos/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

echo "Disabling smart keyboard stuff"
# Disable smart quotes
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Enable tabs to hit all controls
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

echo "configuring finder"
## FINDER
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles YES
# Show all extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Show bars and paths
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable extension change warning
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
55 changes: 55 additions & 0 deletions macos/mjt.terminal
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Bell</key>
<false/>
<key>Font</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGkCwwVFlUkbnVsbNQNDg8QERIT
FFZOU1NpemVYTlNmRmxhZ3NWTlNOYW1lViRjbGFzcyNAKAAAAAAAABAQgAKAA15TRk1v
bm8tUmVndWxhctIXGBkaWiRjbGFzc25hbWVYJGNsYXNzZXNWTlNGb250ohkbWE5TT2Jq
ZWN0CBEaJCkyN0lMUVNYXmdud36FjpCSlKOos7zDxgAAAAAAAAEBAAAAAAAAABwAAAAA
AAAAAAAAAAAAAADP
</data>
<key>FontAntialias</key>
<true/>
<key>FontWidthSpacing</key>
<real>1.004032258064516</real>
<key>ProfileCurrentVersion</key>
<real>2.0699999999999998</real>
<key>TextColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGmCwwXHR4lVSRudWxs1Q0ODxAR
EhMUFRZcTlNDb21wb25lbnRzVU5TUkdCXE5TQ29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29s
b3JTcGFjZVYkY2xhc3NPECgwLjgyODkxMDI3NzEgMC44Mjg5MTAyNzcxIDAuODI4OTEw
Mjc3MSAxTxAnMC43ODk4NDMzMjA4IDAuNzg5ODQzMzIwOCAwLjc4OTg0MzMyMDgAEAG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</key>
<integer>150</integer>
<key>name</key>
<string>Basic</string>
<key>rowCount</key>
<integer>55</integer>
<key>type</key>
<string>Window Settings</string>
</dict>
</plist>

0 comments on commit 404dd12

Please sign in to comment.