Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/tests/black-24.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejusk committed Jun 27, 2024
2 parents b538c4d + d10dc2b commit 3061335
Show file tree
Hide file tree
Showing 16 changed files with 316 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: Run test suite
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].6

# Run the tests
- name: 'Run tests'
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ A local repository can be installed by running:

./script/install

Once installed, updates can be applied by running:

dots

A specific script can be installed by running:

dots script1 script2 ...

### Automated setup

This repository can be installed without a local copy
Expand Down
11 changes: 11 additions & 0 deletions files/home/.aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# dotfiles
alias dots=$DOTFILES/install

# jump around
alias j="z"

# zip
alias tarz="tar -czvf"
# unzip
alias tarx="tar -xzvf"
alias taru="tarx"
7 changes: 5 additions & 2 deletions files/home/.profile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then
. $HOME/.nix-profile/etc/profile.d/nix.sh
fi


# _ _ _ ____
# U /"\ u |"| ___ U /"\ u / __"| u
# \/ _ \/ U | | u |_"_| \/ _ \/ <\___ \/
Expand All @@ -93,5 +94,7 @@ fi
# \\ >> // \\.-,_|___|_,-.\\ >> )( (__)
# (__) (__)(_")("_)\_)-' '-(_/(__) (__)(__)
#
alias j="z"
alias fd=`command -v fdfind`

if [ -f ~/.aliases ]; then
source ~/.aliases
fi
3 changes: 1 addition & 2 deletions files/home/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ source $HOME/.profile
export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
ZSH_THEME="powerlevel10k/powerlevel10k"

export DISABLE_AUTO_UPDATE="true"
export ZSH="$HOME/.oh-my-zsh"

zstyle ':omz:update' frequency 13

# https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
plugins=(
aliases
Expand Down
24 changes: 20 additions & 4 deletions script/install
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -eo pipefail
# Script to run all install scripts contained in install.d
#

printf "\n\t <<< dots installer >>>\n"
printf "\t========================\n\n\n"
printf "\n\t <<< dots >>>\n"
printf "\t==============\n\n\n"

# Prevent running as root
if [[ $EUID -eq 0 && -z "$SKIP_SUDO_CHECK" ]]; then
Expand Down Expand Up @@ -49,12 +49,28 @@ if [[ ! -f "$log_target" ]]; then
fi
log_abs_target=$(readlink -f "$log_target")

# Set up targets
targets=($@)

# Run install scripts
install() {
run() {
echo "Running \"$(basename "$0")\" at \"$(date)\""
echo "Running as \"$(whoami)\" on \"$(hostname)\""
if [[ -n "$targets" ]]; then
echo "Running ${#targets[@]} install target(s): ${targets[@]}"
else
echo "Running all install targets"
fi

for script in $install_dir/*.sh; do
if [[ -n "$targets" ]]; then
script_name=$(basename $script .sh)
script_name=${script_name#*-}
if [[ ! " ${targets[*]} " =~ " $script_name " ]]; then
continue
fi
fi

script_name=$(basename $script)
printf "\n\n<<< $script_name:\n"
source $script
Expand All @@ -63,7 +79,7 @@ install() {
done
}
echo "install: Logging to \"$log_abs_target\""
install 2>&1 | tee "$log_abs_target"
run 2>&1 | tee "$log_abs_target"

# Clean up
unset uuid dir install_dir log_dir log_abs_target log_target
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions script/install.d/01-ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# Print SSH key.
#

# skip if CODESPACES is set
if [ -n "$CODESPACES" ]; then
export SKIP_SSH_CONFIG=1
fi

# skip if SKIP_SSH_CONFIG is set
if [ -z "$SKIP_SSH_CONFIG" ]; then
ssh_method="ed25519"
Expand Down
3 changes: 3 additions & 0 deletions script/install.d/02-brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
if [[ "$OSTYPE" == "darwin"* ]]; then
export NONINTERACTIVE=1
if ! command -v brew &> /dev/null; then
echo "Installing Homebrew..."
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
else
echo "Homebrew is already installed."
fi

brew update
Expand Down
2 changes: 2 additions & 0 deletions script/install.d/21-gh_cli.sh → script/install.d/21-gh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ if ! command -v gh &>/dev/null; then
brew install gh
fi
fi

gh --version
17 changes: 17 additions & 0 deletions script/install.d/22-azure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# -----------------------------------------------------------------------------
# Description:
# Install Azure CLI.
#

if ! command -v az &>/dev/null; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install azure-cli
fi
fi

az --version
14 changes: 14 additions & 0 deletions script/install.d/72-meetingbar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# -----------------------------------------------------------------------------
# Description:
# (macOS only) Install MeetingBar.
#

if [[ "$OSTYPE" == "darwin"* ]]; then
if ! brew list --cask meetingbar &> /dev/null; then
brew install --cask meetingbar
else
echo "MeetingBar is already installed."
fi
fi
14 changes: 14 additions & 0 deletions script/install.d/73-betterdisplay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# -----------------------------------------------------------------------------
# Description:
# (macOS only) Install BetterDisplay.
#

if [[ "$OSTYPE" == "darwin"* ]]; then
if ! brew list --cask betterdisplay &> /dev/null; then
brew install --cask betterdisplay
else
echo "BetterDisplay is already installed."
fi
fi
14 changes: 14 additions & 0 deletions script/install.d/74-dockutil.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# -----------------------------------------------------------------------------
# Description:
# (macOS only) Install dockutil.
#

if [[ "$OSTYPE" == "darwin"* ]]; then
if ! brew list dockutil &> /dev/null; then
brew install dockutil
else
echo "dockutil is already installed."
fi
fi
14 changes: 14 additions & 0 deletions script/install.d/81-cmatrix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# -----------------------------------------------------------------------------
# Description:
# Install cmatrix.
#

if ! command -v "cmatrix" &>/dev/null; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt-get install -qq cmatrix &>/dev/null
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install cmatrix
fi
fi
Loading

0 comments on commit 3061335

Please sign in to comment.