Merge branch 'master' of ssh://git.lyte.dev:2222/lytedev/dotfiles

This commit is contained in:
Daniel Flanagan 2021-10-04 09:16:17 -05:00
commit e85ce990f5
Signed by: lytedev
GPG Key ID: 5B2020A0F9921EF4
21 changed files with 390 additions and 71 deletions

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -x -e
API="https://api.netlify.com/api/v1"
TOKEN="$(pass netlify | grep -i token | tr -d ' ' | cut -d ':' -f 2)"
URL="$API/dns_zones/lyte_dev/dns_records?access_token=$TOKEN"
curl -vvv -sL "$URL" > /tmp/zone.json

View File

@ -1,16 +1,22 @@
#!/usr/bin/env bash
hostname="${1}"; shift || {
echo "No hostname arg to delete provided."
exit 1
}
API="https://api.netlify.com/api/v1"
TOKEN="$(pass netlify | grep -i token | tr -d ' ' | cut -d ':' -f 2)"
counter=0
while read -r l; do
counter=$((counter+1))
ID="$(echo $l | awk '{print $2}')"
URL="$API/dns_zones/lyte_dev/dns_records/$ID?access_token=$TOKEN"
curl -vvv -X DELETE -sL "$URL" 2>&1 | grep 'ratelimit-remaining' &
echo "counter: $counter"
jq 'del(.[] | select(.id == "'$ID'"))' /tmp/zone.json > /tmp/zone2.json
mv /tmp/zone2.json /tmp/zone.json
[ $counter -gt 480 ] && break
done
curl -sL "$API/dns_zones/lyte_dev/dns_records?access_token=$TOKEN" | \
jq -r '.[] | select(.hostname=="'"$hostname"'") | .hostname+": "+.id' | \
while read -r l; do
counter=$((counter+1))
ID="$(echo $l | awk '{print $2}')"
URL="$API/dns_zones/lyte_dev/dns_records/$ID?access_token=$TOKEN"
curl -vvv -X DELETE -sL "$URL" 2>&1 | grep 'ratelimit-remaining' &
echo "counter: $counter"
jq 'del(.[] | select(.id == "'$ID'"))' /tmp/zone.json > /tmp/zone2.json
mv /tmp/zone2.json /tmp/zone.json
[ $counter -gt 450 ] && break
done
wait

0
common/bin/dns-deleter-matching Normal file → Executable file
View File

View File

@ -110,3 +110,4 @@ alias umount 'sudo -E umount'
alias pa pulsemixer
alias mail neomutt
alias wje work-journal-entry
alias miex 'iex -S mix'

View File

@ -0,0 +1,19 @@
complete --command nvm --exclusive --long version --description "Print version"
complete --command nvm --exclusive --long help --description "Print help"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
test -e $nvm_data && string split ' ' <$nvm_data/.index
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
_nvm_list | string split ' ' | string replace system ''
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "(
set --query nvm_default_version && echo default
)"

View File

@ -0,0 +1,28 @@
function _nvm_install --on-event nvm_install
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
set --universal nvm_data $XDG_DATA_HOME/nvm
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
test ! -d $nvm_data && command mkdir -p $nvm_data
echo "Downloading the Node distribution index for the first time..." 2>/dev/null
_nvm_index_update $nvm_mirror $nvm_data/.index
end
function _nvm_update --on-event nvm_update
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
set --universal nvm_data $XDG_DATA_HOME/nvm
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
end
function _nvm_uninstall --on-event nvm_uninstall
command rm -rf $nvm_data
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
set --names | string replace --filter --regex -- "^nvm" "set --erase nvm" | source
functions --erase (functions --all | string match --entire --regex -- "^_nvm_")
end
status is-interactive &&
set --query nvm_default_version && ! set --query nvm_current_version &&
nvm use $nvm_default_version >/dev/null

View File

@ -55,3 +55,5 @@ end
if test $PWD = $HOME; or test $PWD = $NICE_HOME;
cd $NICE_HOME || cd
end
# test -f '/home/daniel/.home/.config/netlify/helper/path.fish.inc' && source '/home/daniel/.home/.config/netlify/helper/path.fish.inc'

View File

@ -0,0 +1,12 @@
function _nvm_index_update --argument-names mirror index
command curl --location --silent $mirror/index.tab | command awk -v OFS=\t '
/v0.9.12/ { exit } # Unsupported
NR > 1 {
print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "")
}
' >$index.temp 2>/dev/null && command mv $index.temp $index && return
command rm -f $index.temp
echo "nvm: Invalid index or unavailable host: \"$mirror\"" >&2
return 1
end

View File

@ -0,0 +1,11 @@
function _nvm_list
set --local versions $nvm_data/*
set --query versions[1] &&
string match --entire --regex -- (string match --regex -- "v\d.+" $versions |
string escape --style=regex |
string join "|"
) <$nvm_data/.index
command --all node |
string match --quiet --invert --regex -- "^$nvm_data" && echo system
end

View File

@ -0,0 +1,4 @@
function _nvm_version_activate --argument-names v
set --global --export nvm_current_version $v
set --prepend PATH $nvm_data/$v/bin
end

View File

@ -0,0 +1,5 @@
function _nvm_version_deactivate --argument-names v
test "$nvm_current_version" = "$v" && set --erase nvm_current_version
set --local index (contains --index -- $nvm_data/$v/bin $PATH) &&
set --erase PATH[$index]
end

View File

@ -0,0 +1,206 @@
function nvm --argument-names cmd v --description "Node version manager"
if test -z "$v" && contains -- "$cmd" install use
for file in .nvmrc .node-version
set file (_nvm_find_up $PWD $file) && read v <$file && break
end
if test -z "$v"
echo "nvm: Invalid version or missing \".nvmrc\" file" >&2
return 1
end
end
switch "$cmd"
case -v --version
echo "nvm, version 2.2.5"
case "" -h --help
echo "Usage: nvm install <version> Download and activate the specified Node version"
echo " nvm install Install version from nearest .nvmrc file"
echo " nvm use <version> Activate a version in the current shell"
echo " nvm use Activate version from nearest .nvmrc file"
echo " nvm list List installed versions"
echo " nvm list-remote List versions available to install"
echo " nvm list-remote <regex> List versions matching a given regular expression"
echo " nvm current Print the currently-active version"
echo " nvm uninstall <version> Uninstall a version"
echo "Options:"
echo " -v or --version Print version"
echo " -h or --help Print this help message"
echo "Variables:"
echo " nvm_arch Override architecture, e.g. x64-musl"
echo " nvm_mirror Set the Node download mirror"
echo " nvm_default_version Set the default version for new shells"
case install
_nvm_index_update $nvm_mirror $nvm_data/.index || return
string match --entire --regex -- (_nvm_version_match $v) <$nvm_data/.index | read v alias
if ! set --query v[1]
echo "nvm: Invalid version number or alias: \"$argv[2..-1]\"" >&2
return 1
end
if test ! -e $nvm_data/$v
set --local os (command uname -s | string lower)
set --local ext tar.gz
set --local arch (command uname -m)
switch $os
case aix
set arch ppc64
case sunos
case linux
case darwin
case {MSYS_NT,MINGW\*_NT}\*
set os win
set ext zip
case \*
echo "nvm: Unsupported operating system: \"$os\"" >&2
return 1
end
switch $arch
case i\*86
set arch x86
case x86_64
set arch x64
case arm64
string match --regex --quiet "v(?<major>\d+)" $v
if test "$os" = darwin -a $major -lt 16
set arch x64
end
case armv6 armv6l
set arch armv6l
case armv7 armv7l
set arch armv7l
case armv8 armv8l aarch64
set arch arm64
end
set --query nvm_arch && set arch $nvm_arch
set --local dir "node-$v-$os-$arch"
set --local url $nvm_mirror/$v/$dir.$ext
command mkdir -p $nvm_data/$v
echo -e "Installing Node \x1b[1m$v\x1b[22m $alias"
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
if ! command curl --progress-bar --location $url \
| command tar --extract --gzip --directory $nvm_data/$v 2>/dev/null
command rm -rf $nvm_data/$v
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
return 1
end
echo -en "\033[F\33[2K\x1b[0m"
if test "$os" = win
command mv $nvm_data/$v/$dir $nvm_data/$v/bin
else
command mv $nvm_data/$v/$dir/* $nvm_data/$v
command rm -rf $nvm_data/$v/$dir
end
end
if test $v != "$nvm_current_version"
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
_nvm_version_activate $v
end
printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
case use
test $v = default && set v $nvm_default_version
_nvm_list | string match --entire --regex -- (_nvm_version_match $v) | read v __
if ! set --query v[1]
echo "nvm: Node version not installed or invalid: \"$argv[2..-1]\"" >&2
return 1
end
if test $v != "$nvm_current_version"
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
test $v != system && _nvm_version_activate $v
end
printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
case uninstall
if test -z "$v"
echo "nvm: Not enough arguments for command: \"$cmd\"" >&2
return 1
end
test $v = default && test ! -z "$nvm_default_version" && set v $nvm_default_version
_nvm_list | string match --entire --regex -- (_nvm_version_match $v) | read v __
if ! set -q v[1]
echo "nvm: Node version not installed or invalid: \"$argv[2..-1]\"" >&2
return 1
end
printf "Uninstalling Node %s %s\n" $v (string replace ~ \~ "$nvm_data/$v/bin/node")
_nvm_version_deactivate $v
command rm -rf $nvm_data/$v
case current
_nvm_current
case ls list
_nvm_list | _nvm_list_format (_nvm_current) $argv[2]
case lsr {ls,list}-remote
_nvm_index_update $nvm_mirror $nvm_data/.index || return
_nvm_list | command awk '
FILENAME == "-" && (is_local[$1] = FNR == NR) { next } {
print $0 (is_local[$1] ? " ✓" : "")
}
' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2]
case \*
echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h)" >&2
return 1
end
end
function _nvm_find_up --argument-names path file
test -e "$path/$file" && echo $path/$file || begin
test "$path" != / || return
_nvm_find_up (command dirname $path) $file
end
end
function _nvm_version_match --argument-names v
string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $v |
string replace --filter --regex -- '^v?(\d+)' 'v$1' |
string escape --style=regex ||
string lower '\b'$v'(?:/\w+)?$'
end
function _nvm_list_format --argument-names current regex
command awk -v current="$current" -v regex="$regex" '
$0 ~ regex {
aliases[versions[i++] = $1] = $2 " " $3
pad = (n = length($1)) > pad ? n : pad
}
END {
if (!i) exit 1
while (i--)
printf((current == versions[i] ? " ▶ " : " ") "%"pad"s %s\n",
versions[i], aliases[versions[i]])
}
'
end
function _nvm_current
command --search --quiet node || return
set --query nvm_current_version && echo $nvm_current_version || echo system
end
function _nvm_node_info
set --local npm_path (string replace bin/npm-cli.js "" (realpath (command --search npm)))
test -f $npm_path/package.json || set --local npm_version_default (command npm --version)
command node --eval "
console.log(process.version)
console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
console.log(process.execPath.replace(require('os').homedir(), '~'))
"
end

View File

@ -64,9 +64,6 @@
# -c 'silent execute \"normal gg2dd\"' \
# -c 'silent setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile'
[url "git@github.com:postmates"]
insteadOf = https://github.com/postmates
[commit]
gpgsign = true
@ -82,10 +79,11 @@
[color]
ui = auto
# This next lines include Netlify's Git Credential Helper configuration in your Git configuration.
[include]
path = /home/daniel/.home/.netlify/helper/git-config
[init]
defaultBranch = master
[branch]
autoSetupMerge = always
[http "https://git-p1ap1.divvy.co"]
proxy = socks://localhost:9982
[url "git@git-p1ap1.divvy.co"]
proxy = https://github.com/postmates
[push]
default = current

View File

@ -34,16 +34,22 @@ bind pager j half-down
bind pager J next-entry
bind pager K previous-entry
bind index \CR imap-fetch-mail
bind index \CR imap-fetch-mail
bind attach,index g first-entry
bind attach,index G last-entry
macro index,pager A s><return>y
macro index \' "<tag-pattern>~R !~D !~F<enter>\
<tag-prefix><save-message>+[Gmail]/All <enter>" \
"Archive"
set record = ""
set editor = "nvim"
set charset = "utf-8"
set header_cache = "~/.cache/mutt/headers"
set message_cachedir = "~/.cache/mutt/bodies"
set timeout = 60
set sort = reverse-date
set new_mail_command="notify-send 'New Email' '%n new messages, %u unread.' &"

View File

@ -1,5 +1,13 @@
{
"coc.preferences.formatOnSaveFiletypes": ["elixir", "ex", "exs", "typescript"],
"coc.preferences.formatOnSaveFiletypes": ["elixir", "ex", "exs", "typescript", "css", "markdown"],
"languageserver": {
"arduino": {
"command":"/home/daniel/.home/.go/bin/arduino-language-server",
"rootPatterns":["*.ino"],
"filetypes":["arduino"],
"args":["-cli", "/usr/bin/arduino-cli", "-clangd", "/usr/bin/clangd", "-cli-config", "/path/to/arduino-cli.yaml"]
}
},
"elixir.pathToElixirLS": "~/.elixir-ls/release/language_server.sh",
"diagnostic-languageserver.filetypes": {
"elixir": ["mix_credo", "mix_credo_compile"],

View File

@ -7,10 +7,19 @@ local globals = {
indent_blankline_filetype_exclude = {'help', 'packer'},
indent_blankline_buftype_exclude = {'terminal', 'nofile'},
indent_blankline_char_highlight = 'LineNr',
svelte_preprocessors = {'typescript', 'coffeescript', 'sass', 'pug'},
svelte_preprocessor_tags = {
{name = 'sass', tag = 'lang', as = 'sass'},
{name = 'coffeescript', tag = 'lang', as = 'coffeescript'},
{name = 'pug', tag = 'pug', as = 'pug'},
},
svelte_indent_script = 0,
svelte_indent_style = 0,
}
for k,v in pairs(globals) do vim.g[k] = v end
local options = {
clipboard = 'unnamedplus',
inccommand = 'nosplit',
tabstop = 2,
softtabstop = 2,

View File

@ -15,7 +15,6 @@ profile desktop-H-2x4kside2 {
profile desktop-H-2x4kside2 {
output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 0,1200 scale 1 transform normal
output "Dell Inc. DELL U2720Q CWTM623" enable mode 3840x2160@60Hz position 3440,0 scale 1 transform 90
exec "$DOTFILES_PATH/os/linux/kanshi/desktop-H-workspaces.sh"
}
profile desktop-H-2x4kside2 {
@ -36,7 +35,17 @@ profile tv4k {
profile desktop-ultrawide {
output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 1440,560 scale 1 transform normal
exec "$HOME/.config/lytedev-dotfiles/apps/de/kanshi/desktop-single-workspace.sh"
}
# profile laptop-with-display {
# output "Sharp Corporation 0x144A 0x00000000" enable mode 1920x1080@60Hz position 0,0 scale 1 transform normal
# output DP-1 enable mode 1920x1080@60Hz position 0,0 scale 1 transform normal
# exec "$HOME/.config/lytedev-dotfiles/apps/de/kanshi/laptop-single-workspace.bash"
# }
profile laptop-with-display {
output "Sharp Corporation 0x144A 0x00000000" enable mode 1920x1080@60Hz position 0,0 scale 1 transform normal
output DP-1 enable mode 1920x1080@60Hz position 0,0 scale 1 transform normal
}
profile laptop {

View File

@ -12,11 +12,8 @@ setup_output() { out="$1"; shift; while (($#)); do move_workspace "$1" "$out"; s
set -x
setup_output 'Dell Inc. DELL U2720Q CWTM623' 9 8
setup_output 'Dell Inc. DELL U2720Q D3TM623' 6 5
setup_output 'Samsung Electric Company CF791 HTRJ500315' 3 2
setup_output 'Dell Inc. DELL U2720Q CWTM623' 7
setup_output 'Dell Inc. DELL U2720Q D3TM623' 4
setup_output 'Samsung Electric Company CF791 HTRJ500315' 1
setup_output 'Dell Inc. DELL U2720Q CWTM623' 9
setup_output 'Dell Inc. DELL U2720Q D3TM623' 8
setup_output 'Samsung Electric Company CF791 HTRJ500315' 2 3 4 5 6 7 1
rm "$LOCKFILE"

View File

@ -161,6 +161,9 @@ mode "resize" {
for_window [app_id="floating_terminal"] floating enable
for_window [class="floating_terminal"] floating enable
for_window [app_id="zoom"] border none, floating enable
for_window [app_id="zoom" title="^zoom$"] border none, floating enable
bindsym $mod+shift+alt+f for_window [class=".*"] floating toggle
for_window [class=".*"] layout floating enable
for_window [class=".*"] layout splith

View File

@ -1,7 +1,7 @@
{
"layer": "top",
"position": "bottom",
"output": ["eDP-1", "DP-1"],
"output": ["eDP-1", "DP-3"],
"height": 32,
"modules-left": ["clock"],
"modules-center": ["sway/workspaces"],

View File

@ -10,16 +10,16 @@ like.
# Dependencies
+ `fish`
+ `bat`
+ `fd`
+ `sd`
+ `fzf`
+ `tmux`
+ `rsync`
+ `exa`
+ `nnn`
+ `nvim`
- `fish`
- `bat`
- `fd`
- `sd`
- `fzf`
- `tmux`
- `rsync`
- `exa`
- `nnn`
- `nvim`
# Setup
@ -35,33 +35,35 @@ dotfiles-setup
# Basic Usage
# To Do
+ Layered gitconfig?
+ Get out of Google!
+ `calcurse` for Calendar management?
+ `aerc` or `neomutt` for email?
+ My home-grown backup network for Drive?
+ Photos?
+ Hibernation and proper power management for laptop?
+ **Learn to use `journalctl`**
+ Fix sway workspaces on desktop?
+ Neovim LSP
+ Move to NixOS (WIP) or Guix? Declarative is the future!
+ Better/more secure remote management configuration in dotfiles? [1][1]
+ Setup network file share?
+ Home VPN
+ Add vim in the terminal as the handler for many MIME types (xdg-open and such)
for the rare time I'm in a file manager or for opening easily from
the browser.
+ This goes for navigating "into" a file in `nnn`
+ Unify all the common variables... somehow? (and use templates and `envsubst`?)
+ [Vimux](https://github.com/benmills/vimux)?
+ Investigate systemd services that may help with various tasks (homed, etc.)
+ Be more macOS friendly, since work may require that
- Wifi + Home DNS
- Rotate/switch gpg keys and password-store, setup properly on phone
- Maybe something age/sops-based?
- Layered gitconfig?
- Get out of Google!
- `calcurse` for Calendar management?
- `aerc` or `neomutt` for email?
- My home-grown backup network for Drive?
- Photos?
- Hibernation and proper power management for laptop?
- **Learn to use `journalctl`**
- Fix sway workspaces on desktop?
- Neovim LSP
- Move to NixOS (WIP) or Guix? Declarative is the future!
- Better/more secure remote management configuration in dotfiles? [1][1]
- Setup network file share?
- Home VPN
- Add vim in the terminal as the handler for many MIME types (xdg-open and such)
for the rare time I'm in a file manager or for opening easily from
the browser.
- This goes for navigating "into" a file in `nnn`
- Unify all the common variables... somehow? (and use templates and `envsubst`?)
- [Vimux](https://github.com/benmills/vimux)?
- Investigate systemd services that may help with various tasks (homed, etc.)
- Be more macOS friendly, since work may require that
[upstream]: https://git.faceless.lytedev.io/lytedev/dotfiles
[github]: https://github.com/lytedev/dotfiles