mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-02 18:48:04 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cab855380f | |||
| e7578e4905 | |||
| 3fce0ac4dc |
Submodule config/nvim updated: d50611058c...b17ca3c324
@@ -13,11 +13,13 @@ if [ -z "${FILENAME}" ]; then
|
|||||||
FILENAME=$DIRECTORY
|
FILENAME=$DIRECTORY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILENAME=${FILENAME} \
|
FILENAME=$(
|
||||||
| tr '/' _ \
|
${FILENAME} \
|
||||||
| iconv -t ascii//TRANSLIT \
|
| tr '/' _ \
|
||||||
| sed -r s/[^a-zA-Z0-9]+/_/g \
|
| iconv -t ascii//TRANSLIT \
|
||||||
| sed -r s/^_+\|-+$//g
|
| sed -r s/[^a-zA-Z0-9]+/_/g \
|
||||||
|
| sed -r s/^_+\|-+$//g
|
||||||
|
)
|
||||||
|
|
||||||
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
||||||
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ $fsCharLenght = 0;
|
|||||||
|
|
||||||
$quota = shell_exec("quota -w");
|
$quota = shell_exec("quota -w");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pad string
|
||||||
|
*
|
||||||
|
* @param string $i Input string
|
||||||
|
* @param int $n Length
|
||||||
|
* @param string $p Padding string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function pad($i, $n = 3, $p = ' ')
|
function pad($i, $n = 3, $p = ' ')
|
||||||
{
|
{
|
||||||
return str_pad($i, $n, $p, STR_PAD_LEFT);
|
return str_pad($i, $n, $p, STR_PAD_LEFT);
|
||||||
|
|||||||
@@ -4,20 +4,21 @@
|
|||||||
# shellcheck source="shared.sh"
|
# shellcheck source="shared.sh"
|
||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
have php && {
|
! have php && msg_err "PHP Not Available, cannot install composer" && exit 0;
|
||||||
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
|
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
||||||
echo >&2 'ERROR: Invalid installer checksum'
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
rm composer-setup.php
|
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
php composer-setup.php --quiet
|
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
|
||||||
RESULT=$?
|
echo >&2 'ERROR: Invalid installer checksum'
|
||||||
rm composer-setup.php
|
rm composer-setup.php
|
||||||
mv composer.phar ~/.local/bin/composer
|
exit 1
|
||||||
exit $RESULT
|
fi
|
||||||
} || msg_err "PHP Not Available, cannot install composer"
|
|
||||||
|
php composer-setup.php --quiet
|
||||||
|
RESULT=$?
|
||||||
|
rm composer-setup.php
|
||||||
|
mv composer.phar ~/.local/bin/composer
|
||||||
|
exit $RESULT
|
||||||
|
|
||||||
|
|||||||
@@ -4,42 +4,42 @@
|
|||||||
# shellcheck source="shared.sh"
|
# shellcheck source="shared.sh"
|
||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
have gh && {
|
|
||||||
extensions=(
|
|
||||||
# GitHub CLI extension for generating a report on repository dependencies.
|
|
||||||
andyfeller/gh-dependency-report
|
|
||||||
# GitHub CLI extension to generate montage from GitHub user avatars
|
|
||||||
andyfeller/gh-montage
|
|
||||||
# An opinionated GitHub Cli extension for creating
|
|
||||||
# changelogs that adhere to the keep a changelog specification.
|
|
||||||
chelnak/gh-changelog
|
|
||||||
# Safely deletes local branches with no upstream and no un-pushed commits
|
|
||||||
davidraviv/gh-clean-branches
|
|
||||||
# A beautiful CLI dashboard for GitHub 🚀
|
|
||||||
dlvhdr/gh-dash
|
|
||||||
# A github-cli extension script to clone all repositories
|
|
||||||
# in an organization, optionally filtering by topic.
|
|
||||||
matt-bartel/gh-clone-org
|
|
||||||
# being an extension to view the overall health of
|
|
||||||
# an organization's use of actions
|
|
||||||
rsese/gh-actions-status
|
|
||||||
)
|
|
||||||
|
|
||||||
msg "Starting to install GitHub CLI extensions..."
|
|
||||||
|
|
||||||
for ext in "${extensions[@]}"; do
|
|
||||||
# Trim spaces
|
|
||||||
ext=${ext// /}
|
|
||||||
# Skip comments
|
|
||||||
if [[ ${ext:0:1} == "#" ]]; then continue; fi
|
|
||||||
|
|
||||||
msg_run "Installing $ext"
|
|
||||||
gh extensions install "$ext"
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
|
|
||||||
msg_ok "Done"
|
|
||||||
}
|
|
||||||
|
|
||||||
! have gh \
|
! have gh \
|
||||||
&& msg_err "gh (GitHub Client) could not be found, please install it first"
|
&& msg_err "gh (GitHub Client) could not be found, please install it first" \
|
||||||
|
&& exit 0;
|
||||||
|
|
||||||
|
extensions=(
|
||||||
|
# GitHub CLI extension for generating a report on repository dependencies.
|
||||||
|
andyfeller/gh-dependency-report
|
||||||
|
# GitHub CLI extension to generate montage from GitHub user avatars
|
||||||
|
andyfeller/gh-montage
|
||||||
|
# An opinionated GitHub Cli extension for creating
|
||||||
|
# changelogs that adhere to the keep a changelog specification.
|
||||||
|
chelnak/gh-changelog
|
||||||
|
# Safely deletes local branches with no upstream and no un-pushed commits
|
||||||
|
davidraviv/gh-clean-branches
|
||||||
|
# A beautiful CLI dashboard for GitHub 🚀
|
||||||
|
dlvhdr/gh-dash
|
||||||
|
# A github-cli extension script to clone all repositories
|
||||||
|
# in an organization, optionally filtering by topic.
|
||||||
|
matt-bartel/gh-clone-org
|
||||||
|
# being an extension to view the overall health of
|
||||||
|
# an organization's use of actions
|
||||||
|
rsese/gh-actions-status
|
||||||
|
)
|
||||||
|
|
||||||
|
msg "Starting to install GitHub CLI extensions..."
|
||||||
|
|
||||||
|
for ext in "${extensions[@]}"; do
|
||||||
|
# Trim spaces
|
||||||
|
ext=${ext// /}
|
||||||
|
# Skip comments
|
||||||
|
if [[ ${ext:0:1} == "#" ]]; then continue; fi
|
||||||
|
|
||||||
|
msg_run "Installing $ext"
|
||||||
|
gh extensions install "$ext"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
msg_ok "Done"
|
||||||
|
|
||||||
|
|||||||
@@ -4,38 +4,37 @@
|
|||||||
# shellcheck source=shared.sh
|
# shellcheck source=shared.sh
|
||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
have go && {
|
! have go && msg "go hasn't been installed yet." && exit 0;
|
||||||
packages=(
|
|
||||||
# sysadmin/scripting utilities, distributed as a single binary
|
|
||||||
github.com/skx/sysbox@latest
|
|
||||||
# Git Profile allows you to switch between user profiles in git repos
|
|
||||||
github.com/dotzero/git-profile@latest
|
|
||||||
# An extensible command line tool or library to format yaml files.
|
|
||||||
github.com/google/yamlfmt/cmd/yamlfmt@latest
|
|
||||||
# Parsing HTML at the command line
|
|
||||||
github.com/ericchiang/pup@latest
|
|
||||||
# HTML to Markdown converter
|
|
||||||
github.com/suntong/html2md@latest
|
|
||||||
# cheat allows you to create and view interactive cheatsheets on the cli.
|
|
||||||
github.com/cheat/cheat/cmd/cheat@latest
|
|
||||||
# Render markdown on the CLI, with pizzazz! 💅
|
|
||||||
github.com/charmbracelet/glow@latest
|
|
||||||
# Static checker for GitHub Actions workflow files
|
|
||||||
github.com/rhysd/actionlint/cmd/actionlint@latest
|
|
||||||
)
|
|
||||||
|
|
||||||
for pkg in "${packages[@]}"; do
|
packages=(
|
||||||
# Trim spaces
|
# sysadmin/scripting utilities, distributed as a single binary
|
||||||
pkg=${pkg// /}
|
github.com/skx/sysbox@latest
|
||||||
# Skip comments
|
# Git Profile allows you to switch between user profiles in git repos
|
||||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
github.com/dotzero/git-profile@latest
|
||||||
|
# An extensible command line tool or library to format yaml files.
|
||||||
|
github.com/google/yamlfmt/cmd/yamlfmt@latest
|
||||||
|
# Parsing HTML at the command line
|
||||||
|
github.com/ericchiang/pup@latest
|
||||||
|
# HTML to Markdown converter
|
||||||
|
github.com/suntong/html2md@latest
|
||||||
|
# cheat allows you to create and view interactive cheatsheets on the cli.
|
||||||
|
github.com/cheat/cheat/cmd/cheat@latest
|
||||||
|
# Render markdown on the CLI, with pizzazz! 💅
|
||||||
|
github.com/charmbracelet/glow@latest
|
||||||
|
# Static checker for GitHub Actions workflow files
|
||||||
|
github.com/rhysd/actionlint/cmd/actionlint@latest
|
||||||
|
)
|
||||||
|
|
||||||
msg_run "Installing go package:" "$pkg"
|
for pkg in "${packages[@]}"; do
|
||||||
go install "$pkg"
|
# Trim spaces
|
||||||
echo ""
|
pkg=${pkg// /}
|
||||||
done
|
# Skip comments
|
||||||
|
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||||
|
|
||||||
msg_ok "Done"
|
msg_run "Installing go package:" "$pkg"
|
||||||
}
|
go install "$pkg"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
msg_ok "Done"
|
||||||
|
|
||||||
! have go && msg "go hasn't been installed yet."
|
|
||||||
|
|||||||
@@ -4,42 +4,41 @@
|
|||||||
# shellcheck source=shared.sh
|
# shellcheck source=shared.sh
|
||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
have npm && {
|
! have npm && msg_err "npm could not be found." && exit 0;
|
||||||
packages=(
|
|
||||||
# This is a tool to check if your files consider your .editorconfig rules.
|
|
||||||
"editorconfig-checker"
|
|
||||||
# Node module to create a release or a changelog from
|
|
||||||
# a tag and uses issues or commits to creating the release notes.
|
|
||||||
"github-release-notes"
|
|
||||||
"neovim"
|
|
||||||
"prettier"
|
|
||||||
"corepack"
|
|
||||||
"standardjs"
|
|
||||||
# CLI and local web plain text note‑taking, bookmarking, and archiving
|
|
||||||
# with linking, tagging, filtering, search, Git versioning & syncing,
|
|
||||||
# Pandoc conversion, + more, in a single portable script.
|
|
||||||
"nb.sh"
|
|
||||||
)
|
|
||||||
|
|
||||||
for pkg in "${packages[@]}"; do
|
packages=(
|
||||||
# Trim spaces
|
# This is a tool to check if your files consider your .editorconfig rules.
|
||||||
pkg=${pkg// /}
|
"editorconfig-checker"
|
||||||
# Skip comments
|
# Node module to create a release or a changelog from
|
||||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
# a tag and uses issues or commits to creating the release notes.
|
||||||
|
"github-release-notes"
|
||||||
|
"neovim"
|
||||||
|
"prettier"
|
||||||
|
"corepack"
|
||||||
|
"standardjs"
|
||||||
|
# CLI and local web plain text note‑taking, bookmarking, and archiving
|
||||||
|
# with linking, tagging, filtering, search, Git versioning & syncing,
|
||||||
|
# Pandoc conversion, + more, in a single portable script.
|
||||||
|
"nb.sh"
|
||||||
|
)
|
||||||
|
|
||||||
if [[ $(npm ls -g -p "$pkg") != "" ]]; then
|
for pkg in "${packages[@]}"; do
|
||||||
msg_run_done "$pkg" "already installed"
|
# Trim spaces
|
||||||
else
|
pkg=${pkg// /}
|
||||||
msg_run "Installing npm package:" "$pkg"
|
# Skip comments
|
||||||
npm install -g --no-fund --no-progress --no-timing "$pkg"
|
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
if [[ $(npm ls -g -p "$pkg") != "" ]]; then
|
||||||
done
|
msg_run_done "$pkg" "already installed"
|
||||||
|
else
|
||||||
|
msg_run "Installing npm package:" "$pkg"
|
||||||
|
npm install -g --no-fund --no-progress --no-timing "$pkg"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_run "Upgrading all global packages"
|
echo ""
|
||||||
npm -g --no-progress --no-timing --no-fund outdated
|
done
|
||||||
npm -g --no-timing --no-fund upgrade
|
|
||||||
}
|
msg_run "Upgrading all global packages"
|
||||||
|
npm -g --no-progress --no-timing --no-fund outdated
|
||||||
|
npm -g --no-timing --no-fund upgrade
|
||||||
|
|
||||||
! have npm && msg_err "npm could not be found."
|
|
||||||
|
|||||||
@@ -6,32 +6,31 @@
|
|||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
have ntfy && msg "ntfy already installed"
|
have ntfy && msg "ntfy already installed" && exit 0;
|
||||||
|
|
||||||
! have ntfy && {
|
case $(dfm check arch) in
|
||||||
case $(dfm check arch) in
|
Linux)
|
||||||
Linux)
|
NTFY_ARCH="linux_$(arch)"
|
||||||
NTFY_ARCH="linux_$(arch)"
|
;;
|
||||||
;;
|
Darwin)
|
||||||
Darwin)
|
NTFY_ARCH="macOS_all"
|
||||||
NTFY_ARCH="macOS_all"
|
;;
|
||||||
;;
|
esac
|
||||||
esac
|
|
||||||
|
|
||||||
NTFY_VERSION=2.2.0
|
NTFY_VERSION=2.2.0
|
||||||
NTFY_URL="https://github.com/binwiederhier/ntfy"
|
NTFY_URL="https://github.com/binwiederhier/ntfy"
|
||||||
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
|
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
|
||||||
|
|
||||||
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
|
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
|
||||||
> "${NTFY_DEST}.tar.gz"
|
> "${NTFY_DEST}.tar.gz"
|
||||||
tar zxvf "${NTFY_DEST}.tar.gz"
|
tar zxvf "${NTFY_DEST}.tar.gz"
|
||||||
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
|
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
|
||||||
mkdir -p ~/.config/ntfy
|
mkdir -p ~/.config/ntfy
|
||||||
|
|
||||||
# copy config only if it does not exist
|
# copy config only if it does not exist
|
||||||
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
|
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
|
||||||
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
|
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
||||||
|
|
||||||
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user