Compare commits

..

No commits in common. "3249cf65677a7a250b530e60ce0e15a511616437" and "1a1c71e51c0694edad2d55c3a571efcf5303e4c6" have entirely different histories.

8 changed files with 45 additions and 65 deletions

View file

@ -1,13 +1 @@
sourceDir = "~/.dotfiles" sourceDir = "~/.dotfiles"
[diff]
command = 'delta'
{{ $email := promptString "git email" -}}
{{ $name := promptString "git name" -}}
{{ $gui := promptBool "use gui configs?" -}}
[data]
email = {{ $email | quote }}
name = {{ $name | quote }}
gui = {{ $gui }}

View file

@ -1,4 +1,4 @@
{{- if (not .gui) }} {{- if ne .chezmoi.hostname "thinkpad" }}
bin/get-updates bin/get-updates
bin/lock bin/lock
.xinitrc .xinitrc

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# run this from within WSL
files=(alacritty.yml dracula.yml dracula-pro.yml)
for file in "${files[@]}"; do
cp -v $DOTFILES_DIR/config/alacritty/$file /mnt/c/Users/daylin/AppData/Roaming/alacritty/$file
done

View file

@ -1,10 +1,10 @@
[credential] [credential]
helper = cache helper = cache
[core] [core]
excludesfile = /home/{{- .chezmoi.username -}}/.config/git/ignore excludesfile = /home/daylin/.config/git/ignore
[user] [user]
name = {{ .name }} name = Daylin Morgan
email = {{ .email }} email = daylinmorgan@gmail.com
[submodule] [submodule]
recurse = true recurse = true
[pull] [pull]

View file

@ -1,6 +1,6 @@
#compdef pdm #compdef pdm
PDM_PYTHON="$HOME/.local/pipx/venvs/pdm/bin/python" PDM_PYTHON="/home/daylin/projects/github/forks/pdm/venv/bin/python"
PDM_PIP_INDEXES=($(command ${PDM_PYTHON} -m pdm config pypi.url)) PDM_PIP_INDEXES=($(command ${PDM_PYTHON} -m pdm config pypi.url))
_pdm() { _pdm() {
@ -28,7 +28,6 @@ _pdm() {
'list:List packages installed in the current working set' 'list:List packages installed in the current working set'
'lock:Resolve and lock dependencies' 'lock:Resolve and lock dependencies'
'plugin:Manage the PDM plugins' 'plugin:Manage the PDM plugins'
'publish:Build and publish the project to PyPI'
'remove:Remove packages from pyproject.toml' 'remove:Remove packages from pyproject.toml'
'run:Run commands or scripts with local packages loaded' 'run:Run commands or scripts with local packages loaded'
'search:Search for PyPI packages' 'search:Search for PyPI packages'
@ -42,8 +41,8 @@ _pdm() {
$arguments \ $arguments \
{-c,--config}'[Specify another config file path(env var: PDM_CONFIG_FILE)]' \ {-c,--config}'[Specify another config file path(env var: PDM_CONFIG_FILE)]' \
{-V,--version}'[Show the version and exit]' \ {-V,--version}'[Show the version and exit]' \
{-I,--ignore-python}'[Ignore the Python path saved in the .pdm.toml config]' \ {-I,--ignore-python}'[Ignore the Python path saved in the pdm.toml config]' \
'--pep582:Print the command line to be eval by the shell:shell:(zsh bash fish tcsh csh)' \ '--pep582=[Print the command line to be eval by the shell]:shell:(zsh bash fish tcsh csh)' \
'*:: :->_subcmds' \ '*:: :->_subcmds' \
&& return 0 && return 0
@ -68,10 +67,8 @@ _pdm() {
'--save-minimum[Save minimum version specifiers]' '--save-minimum[Save minimum version specifiers]'
'--update-reuse[Reuse pinned versions already present in lock file if possible]' '--update-reuse[Reuse pinned versions already present in lock file if possible]'
'--update-eager[Try to update the packages and their dependencies recursively]' '--update-eager[Try to update the packages and their dependencies recursively]'
'--update-all[Update all dependencies and sub-dependencies]'
'--no-editable[Install non-editable versions for all packages]' '--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]" "--no-self[Don't install the project itself]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-u,--unconstrained}'[Ignore the version constraint of packages]' {-u,--unconstrained}'[Ignore the version constraint of packages]'
{--pre,--prerelease}'[Allow prereleases to be pinned]' {--pre,--prerelease}'[Allow prereleases to be pinned]'
{-e+,--editable+}'[Specify editable packages]:packages' {-e+,--editable+}'[Specify editable packages]:packages'
@ -85,7 +82,6 @@ _pdm() {
"--no-sdist[Don't build source tarballs]" "--no-sdist[Don't build source tarballs]"
"--no-wheel[Don't build wheels]" "--no-wheel[Don't build wheels]"
{-d+,--dest+}'[Target directory to put artifacts]:directory:_files -/' {-d+,--dest+}'[Target directory to put artifacts]:directory:_files -/'
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
'--no-clean[Do not clean the target directory]' '--no-clean[Do not clean the target directory]'
{-C,--config-setting}'[Pass options to the backend. options with a value must be specified after "=": "--config-setting=--opt(=value)" or "-C--opt(=value)"]' {-C,--config-setting}'[Pass options to the backend. options with a value must be specified after "=": "--config-setting=--opt(=value)" or "-C--opt(=value)"]'
"--no-isolation[do not isolate the build in a clean environment]" "--no-isolation[do not isolate the build in a clean environment]"
@ -109,7 +105,7 @@ _pdm() {
args) args)
case $words[1] in case $words[1] in
clear) clear)
compadd -X type 'hashes' 'http' 'wheels' 'metadata' 'packages' && ret=0 compadd -X type 'hashes' 'http' 'wheels' 'metadata' && ret=0
;; ;;
*) *)
_message "pattern" && ret=0 _message "pattern" && ret=0
@ -143,7 +139,8 @@ _pdm() {
"--without-hashes[Don't include artifact hashes]" "--without-hashes[Don't include artifact hashes]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files' {-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{-o+,--output+}"[Write output to the given file, or print to stdout if not given]:output file:_files" {-o+,--output+}"[Write output to the given file, or print to stdout if not given]:output file:_files"
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups' {-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the
same species]:group:_pdm_groups'
{-d,--dev}"[Select dev dependencies]" {-d,--dev}"[Select dev dependencies]"
{--prod,--production}"[Unselect dev dependencies]" {--prod,--production}"[Unselect dev dependencies]"
"--no-default[Don't include dependencies from the default group]" "--no-default[Don't include dependencies from the default group]"
@ -169,17 +166,16 @@ _pdm() {
arguments+=( arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]' {-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-n,--non-interactive}"[Don't ask questions but use default values]" {-n,--non-interactive}"[Don't ask questions but use default values]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
) )
;; ;;
install) install)
arguments+=( arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]' {-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups' {-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the
same species]:group:_pdm_groups'
{-d,--dev}"[Select dev dependencies]" {-d,--dev}"[Select dev dependencies]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files' {-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{--prod,--production}"[Unselect dev dependencies]" {--prod,--production}"[Unselect dev dependencies]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
"--no-lock[Don't do lock if lock file is not found or outdated]" "--no-lock[Don't do lock if lock file is not found or outdated]"
"--no-default[Don\'t include dependencies from the default group]" "--no-default[Don\'t include dependencies from the default group]"
'--no-editable[Install non-editable versions for all packages]' '--no-editable[Install non-editable versions for all packages]'
@ -203,7 +199,6 @@ _pdm() {
{-g,--global}'[Use the global project, supply the project root with `-p` option]' {-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files' {-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
"--no-isolation[Do not isolate the build in a clean environment]" "--no-isolation[Do not isolate the build in a clean environment]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
"--refresh[Don't update pinned versions, only refresh the lock file]" "--refresh[Don't update pinned versions, only refresh the lock file]"
) )
;; ;;
@ -243,25 +238,12 @@ _pdm() {
esac esac
return $ret return $ret
;; ;;
publish)
arguments+=(
{-r,--repository}'[The repository name or url to publish the package to }[env var: PDM_PUBLISH_REPO]]:repository:'
{-u,--username}'[The username to access the repository [env var: PDM_PUBLISH_USERNAME]]:username:'
{-P,--password}'[The password to access the repository [env var: PDM_PUBLISH_PASSWORD]]:password:'
{-S,--sign}'[Upload the package with PGP signature]'
{-i,--identity}'[GPG identity used to sign files.]:gpg identity:'
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-c,--comment}'[The comment to include with the distribution file.]:comment:'
"--no-build[Don't build the package before publishing]"
)
;;
remove) remove)
arguments+=( arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]' {-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G,--group}'[Specify the target dependency group to remove from]:group:_pdm_groups' {-G,--group}'[Specify the target dependency group to remove from]:group:_pdm_groups'
{-d,--dev}"[Remove packages from dev dependencies]" {-d,--dev}"[Remove packages from dev dependencies]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files' {-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
"--no-sync[Only write pyproject.toml and do not uninstall packages]" "--no-sync[Only write pyproject.toml and do not uninstall packages]"
'--no-editable[Install non-editable versions for all packages]' '--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]" "--no-self[Don't install the project itself]"
@ -274,7 +256,6 @@ _pdm() {
_arguments -s \ _arguments -s \
{-g,--global}'[Use the global project, supply the project root with `-p` option]' \ {-g,--global}'[Use the global project, supply the project root with `-p` option]' \
{-l,--list}'[Show all available scripts defined in pyproject.toml]' \ {-l,--list}'[Show all available scripts defined in pyproject.toml]' \
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]' \
{-s,--site-packages}'[Load site-packages from the selected interpreter]' \ {-s,--site-packages}'[Load site-packages from the selected interpreter]' \
'(-)1:command:->command' \ '(-)1:command:->command' \
'*:arguments: _normal ' && return 0 '*:arguments: _normal ' && return 0
@ -305,15 +286,15 @@ _pdm() {
sync) sync)
arguments+=( arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]' {-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups' {-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the
same species]:group:_pdm_groups'
{-d,--dev}"[Select dev dependencies]" {-d,--dev}"[Select dev dependencies]"
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files' {-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{--prod,--production}"[Unselect dev dependencies]" {--prod,--production}"[Unselect dev dependencies]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
'--dry-run[Only prints actions without actually running them]' '--dry-run[Only prints actions without actually running them]'
{-r,--reinstall}"[Force reinstall existing dependencies]" {-r,--reinstall}"[Force reinstall existing dependencies]"
'--clean[Clean unused packages]' '--clean[Clean unused packages]'
"--only-keep[Only keep the selected packages]" "--no-clean[Don't clean unused packages]"
"--no-default[Don\'t include dependencies from the default group]" "--no-default[Don\'t include dependencies from the default group]"
'--no-editable[Install non-editable versions for all packages]' '--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]" "--no-self[Don't install the project itself]"
@ -323,7 +304,8 @@ _pdm() {
update) update)
arguments+=( arguments+=(
{-g,--global}'[Use the global project, supply the project root with `-p` option]' {-g,--global}'[Use the global project, supply the project root with `-p` option]'
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups' {-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the
same species]:group:_pdm_groups'
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files' {-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
'--save-compatible[Save compatible version specifiers]' '--save-compatible[Save compatible version specifiers]'
'--save-wildcard[Save wildcard version specifiers]' '--save-wildcard[Save wildcard version specifiers]'
@ -331,11 +313,9 @@ _pdm() {
'--save-minimum[Save minimum version specifiers]' '--save-minimum[Save minimum version specifiers]'
'--update-reuse[Reuse pinned versions already present in lock file if possible]' '--update-reuse[Reuse pinned versions already present in lock file if possible]'
'--update-eager[Try to update the packages and their dependencies recursively]' '--update-eager[Try to update the packages and their dependencies recursively]'
'--update-all[Update all dependencies and sub-dependencies]'
'--no-editable[Install non-editable versions for all packages]' '--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]" "--no-self[Don't install the project itself]"
"--no-sync[Only update lock file but do not sync packages]" "--no-sync[Only update lock file but do not sync packages]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-u,--unconstrained}'[Ignore the version constraint of packages]' {-u,--unconstrained}'[Ignore the version constraint of packages]'
{--pre,--prerelease}'[Allow prereleases to be pinned]' {--pre,--prerelease}'[Allow prereleases to be pinned]'
{-d,--dev}'[Select dev dependencies]' {-d,--dev}'[Select dev dependencies]'
@ -385,18 +365,13 @@ _pdm_groups() {
_get_packages_with_python() { _get_packages_with_python() {
command ${PDM_PYTHON} - << EOF command ${PDM_PYTHON} - << EOF
import sys import os, re, tomli
if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib
import os, re
PACKAGE_REGEX = re.compile(r'^[A-Za-z][A-Za-z0-9._-]*') PACKAGE_REGEX = re.compile(r'^[A-Za-z][A-Za-z0-9._-]*')
def get_packages(lines): def get_packages(lines):
return [PACKAGE_REGEX.match(line).group() for line in lines] return [PACKAGE_REGEX.match(line).group() for line in lines]
with open('pyproject.toml', 'rb') as f: with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f) data = tomli.load(f)
packages = get_packages(data.get('project', {}).get('dependencies', [])) packages = get_packages(data.get('project', {}).get('dependencies', []))
for reqs in data.get('project', {}).get('optional-dependencies', {}).values(): for reqs in data.get('project', {}).get('optional-dependencies', {}).values():
packages.extend(get_packages(reqs)) packages.extend(get_packages(reqs))

View file

@ -3,7 +3,7 @@
gen() { gen() {
if is-executable $1; then if is-executable $1; then
echo "$1 updated" echo "$1 updated"
"$@" | sed "s#$HOME#\$HOME#g" >"_$argv[1]" "$@" >"_$argv[1]"
else else
echo "skipping $1" echo "skipping $1"
fi fi
@ -14,7 +14,6 @@ echo "-----------------------------"
gen sheldon completions --shell zsh gen sheldon completions --shell zsh
gen just --completions zsh gen just --completions zsh
gen zellij setup --generate-completion zsh gen zellij setup --generate-completion zsh
gen pdm completion zsh
# echo "FETCHING COMPLETION SCRIPTS" echo "FETCHING COMPLETION SCRIPTS"
# wget -O _task https://raw.githubusercontent.com/go-task/task/master/completion/zsh/_task wget -O _task https://raw.githubusercontent.com/go-task/task/master/completion/zsh/_task

9
lib/custom.zsh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env zsh
# env variables
if ! [ $(cat /etc/hostname)=="thinkpad" ]; then
export BROWSER=/mnt/c/Users/daylin/AppData/Local/Vivaldi/Application/vivaldi.exe
else
export BROWSER=vivaldi-stable
fi
# aliases

View file

@ -97,23 +97,23 @@ if [ -d "$HOME/.pyenv" ]; then
fi fi
# pnpm # pnpm
export PNPM_HOME="$HOME/.local/share/pnpm" export PNPM_HOME="/home/daylin/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH" export PATH="$PNPM_HOME:$PATH"
# pnpm end # pnpm end
if [ -d "$HOME/.pkgs/google-cloud-sdk" ]; then if [ -d "$HOME/.pkgs/google-cloud-sdk" ]; then
source "$HOME/.pkgs/google-cloud-sdk/completion.zsh.inc" source /home/daylin/.pkgs/google-cloud-sdk/completion.zsh.inc
source "$HOME/.pkgs/google-cloud-sdk/path.zsh.inc" source /home/daylin/.pkgs/google-cloud-sdk/path.zsh.inc
fi fi
if [ -d "$HOME/.deno" ]; then if [ -d "$HOME/.deno" ]; then
export DENO_INSTALL="$HOME/.deno" export DENO_INSTALL="/home/daylin/.deno"
export PATH="$DENO_INSTALL/bin:$PATH" export PATH="$DENO_INSTALL/bin:$PATH"
fi fi
if [ -d "$HOME/.bun" ]; then if [ -d "$HOME/.bun" ]; then
# bun completions # bun completions
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun" [ -s "/home/daylin/.bun/_bun" ] && source "/home/daylin/.bun/_bun"
# bun # bun
export BUN_INSTALL="$HOME/.bun" export BUN_INSTALL="$HOME/.bun"