Compare commits

...

11 Commits

23 changed files with 405 additions and 353 deletions

2
.gitignore vendored
View File

@@ -13,6 +13,6 @@ ssh/local.d/*
!ssh/local.d/.gitkeep
!.gitkeep
.env
local/share/fonts/NerdFonts
local/share/fonts/*
node_modules

3
.gitmodules vendored
View File

@@ -47,9 +47,6 @@
[submodule "tmux/tmux-window-name"]
path = config/tmux/plugins/tmux-window-name
url = https://github.com/ofirgall/tmux-window-name.git
[submodule "dotbot-crontab"]
path = tools/dotbot-crontab
url = https://github.com/codekansas/dotbot-crontab.git
[submodule "dotbot-snap"]
path = tools/dotbot-snap
url = https://github.com/DrDynamic/dotbot-snap.git

View File

@@ -4,34 +4,12 @@
# Defaults
export DOTFILES="$HOME/.dotfiles"
export DOTFILES_SHARED_LOADED=""
export DOTFILES_CURRENT_SHELL="bash"
# shellcheck source=scripts/shared.sh
source "$DOTFILES/scripts/shared.sh"
path_prepend "$DOTFILES/local/bin"
# Run x-load-configs in your terminal to reload the files.
function x-load-configs()
{
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
HOST="$(hostname -s)"
# global (exports|alias|functions) file for all hosts
# shellcheck source=../config/exports
[ -r "$file" ] && source "$file"
# global secret file, git ignored
# shellcheck source=../config/exports-secret
[ -r "$file-secret" ] && source "$file-secret"
# host specific (exports|alias|functions) file
# shellcheck source=../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# host specific (exports|alias|functions) file, git ignored
# shellcheck source=../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
x-load-configs
# Import ssh keys in keychain
ssh-add -A 2> /dev/null
# shellcheck source=../config/fzf/fzf.bash
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
&& source "${DOTFILES}/config/fzf/fzf.bash"
ssh-add -A 2>/dev/null

View File

@@ -3,32 +3,13 @@
# Defaults
export DOTFILES="$HOME/.dotfiles"
export DOTFILES_SHARED_LOADED=""
export DOTFILES_CURRENT_SHELL="zsh"
# shellcheck source=scripts/shared.sh
source "$DOTFILES/scripts/shared.sh"
path_prepend "$DOTFILES/local/bin"
export COMPLETION_WAITING_DOTS=true
# Run x-load-configs in your terminal to reload the files.
function x-load-configs()
{
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
HOST="$(hostname -s)"
# global (exports|alias|functions) file for all hosts
# shellcheck source=../config/exports
[ -r "$file" ] && source "$file"
# global secret file, git ignored
# shellcheck source=../config/exports-secret
[ -r "$file-secret" ] && source "$file-secret"
# host specific (exports|alias|functions) file
# shellcheck source=../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# host specific (exports|alias|functions) file, git ignored
# shellcheck source=../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
x-load-configs
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"

View File

@@ -4,7 +4,7 @@
export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
path_append "$DOTFILES/local/bin"
path_prepend "$DOTFILES/local/bin"
# Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
@@ -21,7 +21,7 @@ path_append "/opt/homebrew/bin"
have brew && eval "$(brew shellenv)"
path_append "/usr/local/bin"
path_append "$XDG_BIN_HOME"
path_prepend "$XDG_BIN_HOME"
source "$DOTFILES/config/exports-shell"
source "$DOTFILES/config/exports-apps"

View File

@@ -2,7 +2,7 @@
# shellcheck shell=bash
# shellcheck enable=external-sources
# shellcheck disable=1091,2139
# vim: filetype=zsh
# vim: filetype=bash
export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
@@ -23,6 +23,12 @@ x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
export ANDROID_HOME="$XDG_DATA_HOME/android"
# bob manages nvim versions
have bob && {
path_prepend "$XDG_DATA_HOME/bob/nvim-bin"
have nvim && export EDITOR="nvim"
}
export HOMEBREW_NO_ENV_HINTS=true
# composer, https://getcomposer.org/
@@ -68,8 +74,10 @@ have node && {
# op (1Password cli) is present
export OP_CACHE="$XDG_STATE_HOME/1password"
have op && {
eval "$(op completion zsh)"
compdef _op op
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && {
eval "$(op completion zsh)"
compdef _op op
}
}
# Python
@@ -93,7 +101,10 @@ export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
x-dc "$RBENV_ROOT"
have gem && path_append "${GEM_HOME}/bin"
have rbenv && eval "$(rbenv init - zsh)"
have rbenv && {
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && eval "$(rbenv init - zsh)"
[ "$DOTFILES_CURRENT_SHELL" = "bash" ] && eval "$(rbenv init - bash)"
}
# Rust / cargo
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"

View File

@@ -5,3 +5,16 @@ have luarocks && $(luarocks path --bin)
path_append "$HOME/.local/go/bin"
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
alias nano='nano -wS -$'
alias gpg=gpg2
ACME_PATH="$HOME/.acme.sh"
# shellcheck source=$HOME/.acme.sh/acme.sh.env
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
export RVM_PATH="$HOME/.rvm"
export PATH="$RVM_PATH/bin:$PATH"
# shellcheck source=$HOME/.rvm/scripts/rvm
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*

View File

@@ -44,16 +44,11 @@ export GREP_OPTIONS="--color=auto"
# update the values of LINES and COLUMNS.
hash shopt 2> /dev/null && shopt -s checkwinsize
# Load iterm2 shell integration
# https://iterm2.com/documentation-shell-integration.html
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
# Set dircolors based on the file, if it exists
have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
# If we are using zsh, color our dir lists and such
if [ "$SHELL" = "$(which zsh)" ]; then
if [ "$DOTFILES_CURRENT_SHELL" = "zsh" ]; then
autoload -U colors zsh/terminfo compinit
colors
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
@@ -67,10 +62,16 @@ if [ "$SHELL" = "$(which zsh)" ]; then
# fzf
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
# Load iterm2 shell integration
# https://iterm2.com/documentation-shell-integration.html
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
fi
# If we are using bash
if [ "$SHELL" = "$(which bash)" ]; then
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] \
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
if [ "$DOTFILES_CURRENT_SHELL" = "bash" ]; then
# shellcheck source=../config/fzf/fzf.bash
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
source "${DOTFILES}/config/fzf/fzf.bash"
fi

View File

@@ -1,25 +1,25 @@
{
"LazyVim": { "branch": "main", "commit": "50401d358b7be9b931b42fc3b537794920308bef" },
"LazyVim": { "branch": "main", "commit": "274649e92321d615888f889476c9329f8d831e8e" },
"LuaSnip": { "branch": "master", "commit": "480b032f6708573334f4437d3f83307d143f1a72" },
"SchemaStore.nvim": { "branch": "main", "commit": "917083c0ab4fc328628f0a55c72415e1bd72ab13" },
"SchemaStore.nvim": { "branch": "main", "commit": "c422bf8a6955028713692506e9119862370c529f" },
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
"animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" },
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
"catppuccin": { "branch": "main", "commit": "3d9a5ed556e289bce6c1fb0af89ec838360641b2" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
"edgy.nvim": { "branch": "main", "commit": "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4" },
"flash.nvim": { "branch": "main", "commit": "cc8c7e03987134997d74ee87e55a5717279f2d05" },
"flash.nvim": { "branch": "main", "commit": "0256d8ecab33a9aa69fdaaf885db22e1103e2a3a" },
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
"gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
"indent-blankline.nvim": { "branch": "master", "commit": "f5335ef7493bd6adf5f2ae21d67240709a514408" },
"lazy.nvim": { "branch": "main", "commit": "7ca3bdb566c3ba4492f2d22b37c2c9e26f09470f" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "2451adb9bdb0fd32140bf3aa8dbc17ff60050db3" },
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
@@ -32,19 +32,19 @@
"mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" },
"mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" },
"neoconf.nvim": { "branch": "main", "commit": "909179f44e94b4cb8331d46b31d3b77ca71127d5" },
"neodev.nvim": { "branch": "main", "commit": "67b7a5c9facd65077cc4486c73d1774d1a2ed582" },
"neoconf.nvim": { "branch": "main", "commit": "2b2af4c35b4f5e85e81a567412ba31e1643a2c02" },
"neodev.nvim": { "branch": "main", "commit": "f4abc72add7d2d986371c9d619f7b6f8297aa5ee" },
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
"noice.nvim": { "branch": "main", "commit": "396f9146529130904e07c45e90ecdbfa607534f3" },
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-lspconfig": { "branch": "master", "commit": "bfdf2e91e7297a54bcc09d3e092a12bff69a1cf4" },
"nvim-lspconfig": { "branch": "master", "commit": "68b23c06132cb1ef8d5690111c112388fbcf1c30" },
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" },
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
"nvim-treesitter": { "branch": "master", "commit": "d6c9c85e14e15bc59478a0d5d810e88dad0ac53f" },
"nvim-treesitter": { "branch": "master", "commit": "cc2f94ed1dfa008c23e16bbd17f56b967ceb6740" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
"nvim-ufo": { "branch": "main", "commit": "6f2ccdf2da390d62f8f9e15fc5ddbcbd312e1e66" },
@@ -53,11 +53,12 @@
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"stickybuf.nvim": { "branch": "master", "commit": "e3db41f2c1bb2df3ee6ff964ee74fe991f6f9566" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"tabnine": { "branch": "master", "commit": "2c06b4865415701dc638549032824664e114ee23" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
"telescope.nvim": { "branch": "master", "commit": "84d53dfdbefbdf84e861a288abc71ef8ccafd04e" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"tokyonight.nvim": { "branch": "main", "commit": "8e670218651eaf02bf61c68ecdfdaa572bc14b47" },
"transparent.nvim": { "branch": "main", "commit": "3af6232c8d39d51062702e875ff6407c1eeb0391" },
"tokyonight.nvim": { "branch": "main", "commit": "e89caa3ad6d8da9d0dd981ec74a82c55adc61ffd" },
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
"venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" },

View File

@@ -12,9 +12,6 @@ require("lazy").setup({
{
"LazyVim/LazyVim",
import = "lazyvim.plugins",
opts = {
colorscheme = "catppuccin",
},
},
-- import any extras modules here
{ import = "lazyvim.plugins.extras.formatting.prettier" },
@@ -41,7 +38,7 @@ require("lazy").setup({
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "catppuccin" } },
install = { colorscheme = { "tokyonight" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {

View File

@@ -65,17 +65,26 @@ return {
auto = true,
},
},
-- Clarify and beautify your comments using boxes and lines.
-- https://github.com/LudoPinelli/comment-box.nvim
{ "LudoPinelli/comment-box.nvim", opts = {} },
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
-- Tabnine Client for Neovim
-- https://github.com/codota/tabnine-nvim
{
"codota/tabnine-nvim",
name = "tabnine",
enabled = false,
-- enabled = false,
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User",
@@ -84,7 +93,6 @@ return {
dismiss_keymap = "<C-Esc>",
},
},
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
-- https://github.com/wakatime/vim-wakatime
{ "wakatime/vim-wakatime", lazy = false, enabled = true },

View File

@@ -0,0 +1,53 @@
return {
-- Use <tab> for completion and snippets (supertab)
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
{
"L3MON4D3/LuaSnip",
keys = function()
return {}
end,
},
-- then: setup supertab in cmp
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji",
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
local cmp = require("cmp")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- this way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
end,
},
}

View File

@@ -1,41 +1,13 @@
-- luacheck: globals vim
return {
-- The theme of choise, catppuccin
-- https://github.com/catppuccin/nvim
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
enabled = true,
config = function()
vim.cmd.colorscheme("catppuccin")
end,
"folke/tokyonight.nvim",
opts = {
flavour = "mocha",
},
},
-- Remove all background colors to make nvim transparent
-- https://github.com/xiyaowong/transparent.nvim
{
"xiyaowong/transparent.nvim",
lazy = false,
enabled = true,
config = function()
vim.g.transparent_groups = vim.list_extend(
vim.g.transparent_groups or {},
vim.tbl_map(function(v)
return v.hl_group
end, vim.tbl_values(require("bufferline.config").highlights))
)
end,
},
-- A fancy, configurable, notification manager for NeoVim
-- https://github.com/rcarriga/nvim-notify
{
"rcarriga/nvim-notify",
opts = {
-- Set background color to black so transparent doesn't mess stuff up
background_colour = "#000000",
transparent = true,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
},
-- Not UFO in the sky, but an ultra fold in Neovim.
@@ -71,7 +43,7 @@ return {
jumpBot = "]",
},
},
provider_selector = function(bufnr, filetype, buftype)
provider_selector = function(_, _, _) -- bufnr, filetype, buftype
return { "treesitter", "indent" }
end,
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
@@ -103,15 +75,18 @@ return {
end,
},
},
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
config = true,
},
-- Indent guides for Neovim
-- https://github.com/lukas-reineke/indent-blankline.nvim
{ "lukas-reineke/indent-blankline.nvim" },
-- Git integration for buffers
-- https://github.com/lewis6991/gitsigns.nvim
{ "lewis6991/gitsigns.nvim" },
-- Getting you where you want with the fewest keystrokes.
-- https://github.com/ThePrimeagen/harpoon
{ "ThePrimeagen/harpoon" },
-- Close buffer without messing up with the window.
-- https://github.com/famiu/bufdelete.nvim
{ "famiu/bufdelete.nvim" },

View File

@@ -1,59 +0,0 @@
# Lakka zsh configuration.
#
# shellcheck shell=bash
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
# Defaults
export DOTFILES="$HOME/.dotfiles"
# Run x-load-configs in your terminal to reload the files.
function x-load-configs()
{
HOST="$(hostname -s)"
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
# global (exports|alias|functions) file for all hosts
# shellcheck source=../../../config/exports
[ -r "$file" ] && source "$file"
# shellcheck source=../../../config/exports
[ -r "$file-secret" ] && source "$file-secret"
# shellcheck source=../../../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# shellcheck source=../../../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
x-load-configs
export PATH="$XDG_BIN_HOME:$PATH"
export LC_ALL=fi_FI.utf8
export RVM_PATH="$HOME/.rvm"
export PATH="$RVM_PATH/bin:$PATH"
# shellcheck source=$HOME/.rvm/scripts/rvm
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
# Try to load antigen, if present
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
# shellcheck source=$HOME/.local/bin/antigen.zsh
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
# If antigen was loaded
if command -v antigen &>/dev/null; then
antigen use oh-my-zsh
# config/functions
x-default-antigen-bundles
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen apply
fi
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
alias nano='nano -wS -$'
alias gpg=gpg2
ACME_PATH="$HOME/.acme.sh"
# shellcheck source=$HOME/.acme.sh/acme.sh.env
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"

View File

@@ -56,12 +56,3 @@
file: tools/requirements-pipx.txt
stdout: false
stderr: true
- crontab:
- time: 0 5 * * *
command: brew update && brew upgrade
platform: darwin # Optional
- time: 0 5 * * *
command: apt update && apt upgrade
platform: linux # Optional
- time: 0 5 * * *
command: task sync

View File

@@ -10,7 +10,6 @@
: "${VERBOSE:=0}"
: "${DOTFILES:=$HOME/.dotfiles}"
: "${SHARED_SCRIPT:=$DOTFILES/scripts/shared.sh}"
: "${INSTALL_SCRIPT:=$DOTFILES/scripts/install-dotfiles.sh}"
: "${BREWFILE:=$DOTFILES/config/homebrew/Brewfile}"
: "${HOSTFILES:=$DOTFILES/hosts}"
@@ -22,6 +21,9 @@ export DOTFILES_SHARED_LOADED=""
# shellcheck source=./../../scripts/shared.sh
source "$SHARED_SCRIPT"
# Loads configs for better installation experience
x-load-configs
function section_install
{
USAGE_PREFIX="$SCRIPT install <command>"
@@ -49,6 +51,8 @@ function section_install
case "$1" in
all)
msgr msg "Starting to install all and reloading configurations..."
x-load-configs
$0 install macos
$0 install fonts
$0 install antigen
@@ -67,6 +71,9 @@ function section_install
$0 install npm
$0 install ntfy
$0 install z
msgr msg "Reloading configurations again..."
x-load-configs
msgr yay "All done!"
;;
antigen)
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
@@ -141,10 +148,7 @@ function section_install
bash "$DOTFILES/scripts/install-ntfy.sh" \
&& msg_yay "ntfy installed!"
;;
pip)
bash "$DOTFILES/scripts/install-pip-packages.sh" \
&& msg_yay "pip/python packages installed!"
;;
pip) bash "$DOTFILES/scripts/install-pip-packages.sh" ;;
z)
bash "$DOTFILES/scripts/install-z.sh" \
&& msg_yay "z has been installed!"

222
local/bin/msgr Executable file
View File

@@ -0,0 +1,222 @@
#!/usr/bin/env bash
# msgr / Messanger helper
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
# MIT License, https://opensource.org/license/mit/
# Modified from https://stackoverflow.com/a/28776166
(
[[ -n $ZSH_VERSION && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|| [[ -n $BASH_VERSION ]] && (return 0 2> /dev/null)
) && sourced=1 || sourced=0
# ╭──────────────────────────────────────────────────────────╮
# │ Colors │
# ╰──────────────────────────────────────────────────────────╯
CLR_RED="\033[1;31m"
CLR_YELLOW="\033[1;33m"
CLR_GREEN="\033[1;32m"
CLR_BLUE="\033[1;34m"
CLR_RESET="\033[0m"
# ╭──────────────────────────────────────────────────────────╮
# │ Color functions │
# ╰──────────────────────────────────────────────────────────╯
function __color_red()
{
local MSG="$1"
echo -e "${CLR_RED}${MSG}${CLR_RESET}"
}
function __color_yellow()
{
local MSG="$1"
echo -e "${CLR_YELLOW}${MSG}${CLR_RESET}"
}
function __color_green()
{
local MSG="$1"
echo -e "${CLR_GREEN}${MSG}${CLR_RESET}"
}
function __color_blue()
{
local MSG="$1"
echo -e "${CLR_BLUE}${MSG}${CLR_RESET}"
}
# ╭──────────────────────────────────────────────────────────╮
# │ Helpers │
# ╰──────────────────────────────────────────────────────────╯
function __log_marker()
{
echo -e "${CLR_BLUE}➜${CLR_RESET}"
}
function __log_marker_ok()
{
echo -e "${CLR_GREEN}✔${CLR_RESET}"
}
function __log_marker_ok_blue()
{
echo -e "${CLR_BLUE}✔${CLR_RESET}"
}
function __log_marker_warn()
{
echo -e "${CLR_YELLOW}⁕${CLR_RESET}"
}
function __log_marker_question()
{
echo -e "${CLR_YELLOW}?${CLR_RESET}"
}
function __log_marker_err()
{
echo -e "${CLR_RED}⛌${CLR_RESET}"
}
function __log_indent()
{
echo " "
}
# ╭──────────────────────────────────────────────────────────╮
# │ Log functions │
# ╰──────────────────────────────────────────────────────────╯
function msg()
{
echo -e "$(__log_marker) $1"
}
function msg_yay()
{
echo -e "🎉 $1"
}
function msg_yay_done()
{
echo -e "🎉 $1 ...$(__log_marker_ok)"
}
function msg_done()
{
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)"
}
function msg_done_suffix()
{
echo -e "$(__log_marker) ...$(__log_marker_ok)"
}
function msg_prompt()
{
echo -e "$(__log_marker_question) $1"
}
function msg_prompt_done()
{
echo -e "$(__log_marker_question) $1 ...$(__log_marker_ok)"
}
function msg_nested()
{
echo -e "$(__log_indent)$(__log_marker) $1"
}
function msg_nested_done()
{
echo -e "$(__log_indent)$(__log_marker) $1 ...$(__log_marker_ok)"
}
function msg_run()
{
echo -e "${CLR_GREEN}➜ $1${CLR_RESET} $2"
}
function msg_run_done()
{
echo -e "${CLR_GREEN}➜ $1${CLR_RESET} $2 ...$(__log_marker_ok)"
}
function msg_ok()
{
echo -e "$(__log_marker_ok) $1"
}
function msg_warn()
{
echo -e "$(__log_marker_warn) $1"
}
function msg_err()
{
echo -e "$(__log_marker_err) $1"
}
# Create a prompt which you have to answer y/n to continue
ask()
{
while true; do
read -p "$1 ([y]/n) " -r
REPLY=${REPLY:-"y"}
if [[ $REPLY =~ ^[Yy]$ ]]; then
return 1
elif [[ $REPLY =~ ^[Nn]$ ]]; then
return 0
fi
done
}
# If this is being sourced, no need to run the next steps.
[ "$sourced" = 1 ] && return
function __tests()
{
msg "[ msg ]"
msg_done "[ done ]"
msg_done_suffix "[ done_suffix ]" && echo " ^-- (done_suffix)"
msg_err "[ err ]"
msg_nested "[ nested ]"
msg_nested_done "[ nested_done ]"
msg_ok "[ ok ]"
msg_prompt "[ prompt ]"
msg_prompt_done "[ prompt_done ]"
msg_run "[ run ]" "[ second_param ]"
msg_run_done "[ run_done ]" "[ second_param ]"
msg_warn "[ warn ]"
msg_yay "[ yay ]"
msg_yay_done "[ yay_done ]"
}
function usage()
{
echo "usage: msgr [type] [message] [optional second message]"
echo ""
echo "-- types and examples: --"
__tests
echo ""
}
# The main loop. first keyword after $0 triggers type, or help and usage examples.
case "$1" in
msg) msg "$2" ;;
done) msg_done "$2" ;;
done_suffix) msg_done_suffix "$2" ;;
err) msg_err "$2" ;;
nested) msg_nested "$2" ;;
nested_done) msg_nested_done "$2" ;;
ok) msg_ok "$2" ;;
prompt) msg_prompt "$2" ;;
prompt_done) msg_prompt_done "$2" ;;
run) msg_run "$2" ;;
run_done) msg_run_done "$2" "$3" ;;
warn) msg_warn "$2" ;;
yay) msg_yay "$2" ;;
yay_done) msg_yay_done "$2" ;;
tests) __tests "[first]" "[second]" ;;
*) usage && exit 0 ;;
esac

View File

@@ -2,15 +2,20 @@
# Install cargo/rust packages.
#
# shellcheck source=shared.sh
DOTFILES_SHARED_LOADED=""
source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install rust/cargo packages"
! have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path
}
source "$CARGO_HOME/env"
packages=(
# An incremental parsing system for programming tools
"tree-sitter-cli"
# a subprocess caching utility
"bkt"
# a structural diff that understands syntax

View File

@@ -4,6 +4,8 @@
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install npm packages"
! have npm && msg_err "npm could not be found." && exit 0
packages=(

View File

@@ -4,13 +4,16 @@
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
! have pip && {
msg_err "Could not find pip, something really terrible is going on." && exit 1
msg "Starting to install pip packages"
! have python3 && {
msg_err "Could not find python3, something really terrible is going on." && exit 1
}
packages=(
"pipx"
"libtmux"
"ensurepath"
)
for pkg in "${packages[@]}"; do
@@ -19,7 +22,10 @@ for pkg in "${packages[@]}"; do
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
msg_nested "Installing pip package: $pkg"
python3 -m pip install --user "$pkg"
echo ""
done
msg_yay "Run pip package installations"

View File

@@ -6,144 +6,27 @@
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
: "${VERBOSE:=0}"
# If this file has already been loaded, no need to reload it.
[ "$DOTFILES_SHARED_LOADED" = "yes" ] && return
export DOTFILES_SHARED_LOADED="yes"
source "$DOTFILES/local/bin/msgr"
# -- Colors -- #
CLR_RED="\033[1;31m"
CLR_YELLOW="\033[1;33m"
CLR_GREEN="\033[1;32m"
CLR_BLUE="\033[1;34m"
CLR_RESET="\033[0m"
# -- Color functions -- #
function __color_red()
# Run x-load-configs in your terminal to reload the files.
function x-load-configs()
{
local MSG="$1"
echo -e "${CLR_RED}${MSG}${CLR_RESET}"
}
function __color_yellow()
{
local MSG="$1"
echo -e "${CLR_YELLOW}${MSG}${CLR_RESET}"
}
function __color_green()
{
local MSG="$1"
echo -e "${CLR_GREEN}${MSG}${CLR_RESET}"
}
function __color_blue()
{
local MSG="$1"
echo -e "${CLR_BLUE}${MSG}${CLR_RESET}"
}
# -- Helpers -- #
function __log_marker()
{
echo -e "${CLR_BLUE}${CLR_RESET}"
}
function __log_marker_ok()
{
echo -e "${CLR_GREEN}${CLR_RESET}"
}
function __log_marker_ok_blue()
{
echo -e "${CLR_BLUE}${CLR_RESET}"
}
function __log_marker_warn()
{
echo -e "${CLR_YELLOW}${CLR_RESET}"
}
function __log_marker_question()
{
echo -e "${CLR_YELLOW}?${CLR_RESET}"
}
function __log_marker_err()
{
echo -e "${CLR_RED}${CLR_RESET}"
}
function __log_indent()
{
echo " "
}
# -- Log -- #
function msg()
{
echo -e "$(__log_marker) $1"
}
function msg_yay()
{
echo -e "🎉 $1"
}
function msg_yay_done()
{
echo -e "🎉 $1 ...$(__log_marker_ok)"
}
function msg_done()
{
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)"
}
function msg_done_suffix()
{
echo -e "$(__log_marker) ...$(__log_marker_ok)"
}
function msg_prompt()
{
echo -e "$(__log_marker_question) $1"
}
function msg_prompt_done()
{
echo -e "$(__log_marker_question) $1 ...$(__log_marker_ok)"
}
function msg_nested()
{
echo -e "$(__log_indent)$(__log_marker) $1"
}
function msg_nested_done()
{
echo -e "$(__log_indent)$(__log_marker) $1 ...$(__log_marker_ok)"
}
function msg_run()
{
echo -e "${CLR_GREEN}$1${CLR_RESET} $2"
}
function msg_run_done()
{
echo -e "${CLR_GREEN}$1${CLR_RESET} $2 ...$(__log_marker_ok)"
}
function msg_ok()
{
echo -e "$(__log_marker_ok) $1"
}
function msg_warn()
{
echo -e "$(__log_marker_warn) $1"
}
function msg_err()
{
echo -e "$(__log_marker_err) $1"
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
HOST="$(hostname -s)"
# global (exports|alias|functions) file for all hosts
# shellcheck source=../config/exports
[ -r "$file" ] && source "$file"
# global secret file, git ignored
# shellcheck source=../config/exports-secret
[ -r "$file-secret" ] && source "$file-secret"
# host specific (exports|alias|functions) file
# shellcheck source=../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# host specific (exports|alias|functions) file, git ignored
# shellcheck source=../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
# -- Menu builder -- #
@@ -230,7 +113,7 @@ function have_command
# usage: have php && php -v
function have
{
bkt -- command -v "$1" >&/dev/null
bkt -- which -s "$1" >&/dev/null
}
function brew_installed
@@ -357,20 +240,6 @@ silent()
"$@" >&/dev/null
}
# Create a prompt which you have to answer y/n to continue
ask()
{
while true; do
read -p "$1 ([y]/n) " -r
REPLY=${REPLY:-"y"}
if [[ $REPLY =~ ^[Yy]$ ]]; then
return 1
elif [[ $REPLY =~ ^[Nn]$ ]]; then
return 0
fi
done
}
# Check if a file contains non-ascii characters
nonascii()
{

View File

@@ -1,3 +1 @@
ensurepath
openapi-python-client
libtmux