From 11969bf7919ff6bbbaa38a684a574168c30a9e81 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 30 Mar 2023 16:32:30 +0300 Subject: [PATCH] Fixes, configs and scripts --- base/angular-config.json | 6 ++++++ base/zshrc | 6 ++---- config/starship.toml | 3 +++ install | 2 +- scripts/install-composer.sh | 19 +++++++++++++++++++ scripts/install-nfty.sh | 11 +++++++++++ 6 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 base/angular-config.json create mode 100755 scripts/install-composer.sh create mode 100755 scripts/install-nfty.sh diff --git a/base/angular-config.json b/base/angular-config.json new file mode 100644 index 0000000..20d8187 --- /dev/null +++ b/base/angular-config.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "cli": { + "analytics": false + } +} \ No newline at end of file diff --git a/base/zshrc b/base/zshrc index 014a728..152711e 100644 --- a/base/zshrc +++ b/base/zshrc @@ -25,15 +25,12 @@ export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH" # brew, https://brew.sh if [ command -v brew &> /dev/null ]; then - BREW_BIN=$(brew --prefix)/bin - BREW_SBIN=$(brew --prefix)/sbin - BREW_PYTHON=$(brew --prefix python)/bin GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin BREW_RUBY=$(brew --prefix ruby)/bin BREW_GEMS=$(gem environment gemdir)/bin - export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$BREW_BIN:$BREW_SBIN:$PATH" + export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$PATH" fi # nvm, the node version manager @@ -69,6 +66,7 @@ fi if command -v gem &>/dev/null; then export GEM_HOME="$XDG_STATE_HOME/gem" export GEM_PATH="$XDG_STATE_HOME/gem" + export PATH="$GEM_HOME/bin:$PATH" fi diff --git a/config/starship.toml b/config/starship.toml index a9ebc24..a6727a5 100644 --- a/config/starship.toml +++ b/config/starship.toml @@ -4,6 +4,9 @@ # Inserts a blank line between shell prompts add_newline = true +# Timeout for commands executed by starship (in milliseconds). +command_timeout = 750 + # Replace the '❯' symbol in the prompt with '➜' [character] # The name of the module we are configuring is 'character' success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green' diff --git a/install b/install index ef8b03c..b498267 100755 --- a/install +++ b/install @@ -18,6 +18,6 @@ git submodule update --init --recursive --plugin-dir=dotbot-gh-extension \ --plugin-dir=dotbot-golang \ --plugin-dir=dotbot-if \ - --plugin-dir=dotbot-ifplatform \ + -p dotbot-if/if.py \ -c "${CONFIG}" \ "${@}" diff --git a/scripts/install-composer.sh b/scripts/install-composer.sh new file mode 100755 index 0000000..689babb --- /dev/null +++ b/scripts/install-composer.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" + +if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] +then + >&2 echo 'ERROR: Invalid installer checksum' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --quiet +RESULT=$? +rm composer-setup.php +mv composer.phar ~/.local/bin/composer +exit $RESULT + diff --git a/scripts/install-nfty.sh b/scripts/install-nfty.sh new file mode 100755 index 0000000..7f0f133 --- /dev/null +++ b/scripts/install-nfty.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +NFTY_VERSION=2.2.0 + +curl -L "https://github.com/binwiederhier/ntfy/releases/download/v${NFTY_VERSION}/ntfy_${NFTY_VERSION}_macOS_all.tar.gz" > "ntfy_${NFTY_VERSION}_macOS_all.tar.gz" +tar zxvf "ntfy_${NFTY_VERSION}_macOS_all.tar.gz" +cp -a "ntfy_${NFTY_VERSION}_macOS_all/ntfy" ~/.local/bin/ntfy +mkdir -p ~/.config/ntfy +cp "ntfy_${NFTY_VERSION}_macOS_all/client/client.yml" ~/.config/ntfy/client.yml +ntfy --help +rm -rf "ntfy_${NFTY_VERSION}_macOS_all" "ntfy_${NFTY_VERSION}_macOS_all.tar.gz"