Compare commits

..

No commits in common. "main" and "old-yadm" have entirely different histories.

91 changed files with 694 additions and 2294 deletions

View File

@ -0,0 +1,10 @@
{
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items",
"controlUrl": "",
"recommendationsUrl": ""
}
}

View File

@ -19,8 +19,6 @@ import:
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
env:
TERM: xterm-256color
window:
padding:
@ -60,7 +58,7 @@ font:
# The `style` can be specified to pick a specific face.
#style: Regular
size: 12.5
size: 12.0
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
@ -90,7 +88,7 @@ font:
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
window_opacity: 0.94
background_opacity: 0.94
mouse:
hide_when_typing: true

View File

@ -1,14 +1,6 @@
[include]
path = ~/.config/git/secret
# include something like this in the above file:
#[sendemail]
# smtpserver = mail.example.com
# smtpuser =
# smtpencryption = tls
# smtpserverport = 587
# annotate = yes
[user]
email = me@earne.link
name = earnest ma
@ -21,7 +13,6 @@
longpaths = true
editor = nvim
hooksPath = ~/.config/git/hooks
excludesfile = ~/.config/git/ignore
[diff]
tool = bat
@ -31,17 +22,27 @@
[commit]
gpgsign = true
verbose = true
[fetch]
prune = true
[pull]
# ff = only
rebase = true
ff = only
[push]
default = current
autoSetupRemote = true
# sudo apt install libsecret-1-0 libsecret-1-dev -y && sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
# [credential]
# helper = /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
#[sendemail]
# smtpserver = mail.example.com
# smtpuser =
# smtpencryption = tls
# smtpserverport = 587
# annotate = yes
[status]
submodulesummary = true
@ -65,7 +66,6 @@
checkup = !git log -1 && (git fetch --all 2>/dev/null || true) && git status
fuckit = reset --hard
setup = !git init && git commit --allow-empty -m \"Initial commit\"
fpr = !sh -c 'git fetch ${2:-origin} +refs/pull/$1/head:refs/remotes/${2:-origin}/pr/$1 && git checkout pr/$1' -
e = commit --allow-empty-message -m ''
br = branch
co = checkout
@ -79,8 +79,3 @@
pu = push
pl = pull
st = status
[credential]
helper = store --file ~/.config/git/credentials
[rebase]
updateRefs = true

4
.config/git/hooks/post-commit Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
COMMIT_SHA=$(git log -1 HEAD --format=reference)
notify-send 'Git commit success: ' "$COMMIT_SHA" -u low

67
.config/neomutt/binds Normal file
View File

@ -0,0 +1,67 @@
# vim: filetype=muttrc
# ESC e to "recall" messages from draft folder
# General rebindings
bind attach <return> view-mailcap
bind attach l view-mailcap
bind editor <space> noop
bind pager c imap-fetch-mail
bind index G last-entry
bind index g noop
bind index gg first-entry
bind pager,attach h exit
bind pager j next-line
bind pager k previous-line
bind pager l view-attachments
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index h noop
bind index l display-message
bind browser h goto-parent
bind browser l select-entry
bind pager,browser gg top-page
bind pager,browser G bottom-page
bind index,pager,browser d half-down
bind index,pager,browser u half-up
bind index,pager R group-reply
bind index \031 previous-undeleted # Mouse wheel
bind index \005 next-undeleted # Mouse wheel
bind pager \031 previous-line # Mouse wheel
bind pager \005 next-line # Mouse wheel
bind editor <Tab> complete-query
# sidebar mappings
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next
bind index,pager \Co sidebar-open
bind index,pager \Cp sidebar-prev-new
bind index,pager \Cn sidebar-next-new
bind index,pager B sidebar-toggle-visible
# global index and pager shortcuts
bind index,pager @ compose-to-sender
bind index,pager D purge-message
bind index <tab> sync-mailbox
bind index <space> collapse-thread
# Email completion bindings
bind editor <Tab> complete-query
bind editor ^T complete
# Press A to add contact to Khard address book
macro index,pager A \
"<pipe-message>khard add-email<return>" \
"add the sender email address to khard"
## Shortcuts
macro index,pager <f1> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/main<enter><change-folder>!<enter>'
#macro index,pager <f2> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/gmail<enter><change-folder>!<enter>'
#macro index,pager <f3> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/main<enter><change-folder>!<enter>'
#macro index,pager <f4> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/school<enter><change-folder>!<enter>'

42
.config/neomutt/colors Normal file
View File

@ -0,0 +1,42 @@
###############################################################################
# Dracula Theme for Mutt: https://draculatheme.com/
#
# @author Paul Townsend <paul@caprica.org>
# general ------------ foreground ---- background -----------------------------
color error color231 color212
color indicator color231 color241
color markers color210 default
color message default default
color normal default default
color prompt default default
color search color84 default
color status color141 color236
color tilde color231 default
color tree color141 default
# message index ------ foreground ---- background -----------------------------
color index color210 default ~D # deleted messages
color index color84 default ~F # flagged messages
color index color117 default ~N # new messages
color index color212 default ~Q # messages which have been replied to
color index color215 default ~T # tagged messages
color index color141 default ~v # messages part of a collapsed thread
# message headers ---- foreground ---- background -----------------------------
color hdrdefault color117 default
color header color231 default ^Subject:.*
# message body ------- foreground ---- background -----------------------------
color attachment color228 default
color body color231 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses
color body color228 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs
color body color231 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text
color body color231 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text
color body color231 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text
color quoted color61 default
color quoted1 color117 default
color quoted2 color84 default
color quoted3 color215 default
color quoted4 color212 default
color signature color212 default

17
.config/neomutt/mailcap Normal file
View File

@ -0,0 +1,17 @@
# HTML
# Opens HTML in w3m in separate window but unsupported in pager
# text/html; w3m -I %{charset} -T text/html;
# Opens HTML as plaintext
# text/html; w3m -I %{charset} -T text/html; copiousoutput;
text/plain; nvim %s
text/html; firefox %s; test=test -n "$DISPLAY";
text/html; w3m -v -F -T text/html %s;
# PDF
application/pdf; /usr/bin/zathura %s pdf
#Images
image/png; /usr/bin/feh %s
image/jpeg; /usr/bin/feh %s

12
.config/neomutt/neomuttrc Normal file
View File

@ -0,0 +1,12 @@
# vim: filetype=muttrc
# https://gideonwolfe.com/posts/workflow/neomutt/intro/
# https://www.gideonwolfe.com/posts/sysadmin/nextcloud/nextcloudworkflow/
source ~/.config/neomutt/settings
source ~/.config/neomutt/colors
source ~/.config/neomutt/binds
# Accounts
source ~/.config/neomutt/accounts/main
folder-hook $folder 'source ~/.config/neomutt/accounts/main'

89
.config/neomutt/settings Normal file
View File

@ -0,0 +1,89 @@
# vim: filetype=muttrc
# General neomutt settings
# Editor
set editor = "nvim"
# Name (this needs to be changed either way)
set my_name = "earnest ma"
# Get all subscribed folders
set imap_check_subscribed
# Set preferred view modes
auto_view text/html text/calendar application/ics # view html automatically
alternative_order text/plain text/html text/enriched text/*
auto_view text/html # if there is only html dump that
# Main options
set envelope_from # Determine message's sender from "From:" header
set edit_headers # show headers when composing
set fast_reply # skip to compose when replying
set askcc # ask for CC:
set fcc_attach # save attachments with the body
set forward_format = "Fwd: %s" # format of subject when forwarding
set forward_decode # decode when forwarding
set attribution = "On %d, %n wrote:" # format of quoting header
set reply_to # reply to Reply to: field
set reverse_name # reply as whomever it was to
set include # include message in replies
set forward_quote # include message in forwards
set text_flowed # Use format=flowed
# set listchars=trail:• # Mark trailing spaces
# unset sig_dashes # no dashes before sig
unset mime_forward # forward attachments as part of body
# unset help # No help bar at the top of index
set status_on_top # Status bar on top of index
set tmpdir = ~/.cache/neomutt # where to keep temp files
unset confirmappend # don't ask, just do!
set quit # don't ask, just do!!
unset mark_old # read/new is good enough for me
set beep_new # bell on new mails
set pipe_decode # strip headers and eval mimes when piping
set thorough_search # strip headers and eval mimes before searching
set timeout = 300
# status bar, date format, finding stuff etc.
set status_chars = " *%A"
set status_format = "[ Folder: %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>─%?p?( %p postponed )?"
set date_format = "%d.%m.%Y %H:%M"
set sort = threads
set sort_aux = reverse-last-date-received
set uncollapse_jump
set sort_re
set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
set send_charset = "utf-8:iso-8859-1:us-ascii"
set charset = "utf-8"
set arrow_cursor = "no" # Change `color indicator` depending
# Auto-sync
timeout-hook 'exec sync-mailbox'
# When NeoMutt first loads, run this NeoMutt command
startup-hook 'exec sync-mailbox'
# When NeoMutt quits, run this NeoMutt command
shutdown-hook 'exec sync-mailbox'
# Sidebar
set mail_check_stats = yes
set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
set sidebar_visible=yes
set sidebar_width=20
set sidebar_divider_char=' │ '
# set sidebar_short_path
# Pager View Options
set pager_index_lines = 10 # Shows 10 lines of index when pager is active
set pager_context = 3
set pager_stop
set menu_scroll
set tilde
unset markers
set mailcap_path = ~/.config/neomutt/mailcap
set header_cache = "~/.cache/neomutt"
set message_cachedir = "~/.cache/neomutt"
set query_command = "khard email --parsable --search-in-source-files '%s'"

View File

@ -0,0 +1,2 @@
# :(
{ allowUnfree = true; }

28
.config/shell/aliases.sh Normal file
View File

@ -0,0 +1,28 @@
# From https://mastodon.xyz/@CarlCravens/105758509287927276
alias clear='clear; tput cup $LINES 0'
alias camoff='sudo modprobe -r uvcvideo' # sudo rmmod -f uvcvideo
alias camon='sudo modprobe uvcvideo'
alias clip="xclip -sel clip"
ahbh(){
git rev-list --left-right --count $(git remote show origin | sed -n '/HEAD branch/s/.*: //p')...$(git branch --show-current)
}
alias pu='git push'
alias st='git st'
alias src_common='source ~/.config/shell/start.sh'
foldersize(){
du -sh $@
}
tmm(){
if [ -z $1 ]; then
tmux attach-session -t 0 || tmux
else
tmux attach-session -t $1 || tmux new-session -t $1 || tmux
fi
}

49
.config/shell/start.sh Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/sh
# Common startup shell script
# Don't re-run this script
# [ -n "$E_STARTED" ] || . $HOME/.config/shell/start.sh
export E_SCRIPTS_DIR="$HOME/.config/shell"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_USER_CONFIG_DIR="$XDG_CONFIG_HOME"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
# Make nix's desktop files show up
# export XDG_DATA_DIRS="$HOME/.nix-profile/share:$XDG_DATA_DIRS"
export LANG=en_CA.UTF-8
# TZ
export EDITOR=nvim
# functions to add directories to $PATH
path_add(){
PATH="$1:$PATH"
}
path_add_end(){
PATH="$PATH:$1"
}
# Avoid having too many things in ~/ -----------------------
path_add "$HOME/.local/bin"
path_add "$HOME/.config/shell/bin"
# Rust, cargo
export CARGO_HOME="$XDG_DATA_HOME/cargo"
[ -f $CARGO_HOME/env ] && . "$CARGO_HOME/env"
# golang
export GOPROXY=direct
export GOPATH="$XDG_DATA_HOME/go"
path_add "$GOPATH/bin"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export PATH # just in case
# Note that this script has been run
export E_STARTED=1

View File

@ -1,21 +1,11 @@
# May not be loaded on older versions of tmux
# If you're running an older version of tmux, use:
# ln -s $XDG_CONFIG_HOME/tmux/tmux.conf ~/.tmux.conf
# set -g default-terminal "tmux-256color"
set -g default-terminal "xterm-256color"
# Thanks:
# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# https://git.sr.ht/~seirdy/dotfiles/tree/HEAD/item/.config/tmux/tmux.conf
# status powerline-like theme, no dependencies.
set -g status on
set -g status-bg '#232629'
set -g status-fg colour7
set -g status-left '#[fg=colour235,bg=colour4,bold] #S #[fg=colour4,bg=colour235,nobold]'
set -g window-status-format "#[default] #I #[fg=colour240] #[default]#W "
set -g window-status-bell-style "bold"
set -g window-status-current-format "#[fg=colour235,bg=colour6]#[fg=colour235,bg=colour6,bold] #I  #[fg=colour235]#W #[fg=colour6,bg=colour235,nobold]"
set -g status-right '#{prefix_highlight}#[fg=colour6,bg=colour235]#[fg=colour235,bg=colour6] #{=21:pane_title} #[fg=colour4,bg=colour6,nobold]#[fg=colour235,bg=colour4] %H:%M '
set -g @prefix_highlight_output_prefix "#[fg=colour4]#[bg=colour235]#[bg=colour4]#[fg=colour235]"
set -g @prefix_highlight_output_suffix ""
set -g @prefix_highlight_prefix_prompt " "
set -g default-terminal "tmux-256color"
# No delay between hitting <ESC>
set-option -s escape-time 0
@ -72,7 +62,3 @@ bind-key -n WheelDownPane \
\"if-shell -Ft= '#{alternate_on}' \
'send-keys Down Down Down'\""
# source `.tmux.conf` file - as suggested in `man tmux`
bind-key R run-shell ' \
tmux source-file $XDG_CONFIG_HOME/tmux/tmux.conf > /dev/null; \
tmux display-message "sourced tmux.conf"'

View File

@ -5,5 +5,4 @@
# `.zshenv' should not contain commands that produce output or assume
# the shell is attached to a tty.
# These functions add a directory to $PATH if it exists and it isn't already
# there.
[ -n "$E_STARTED" ] || . $HOME/.config/shell/start.sh

78
.config/zsh/.zshrc Normal file
View File

@ -0,0 +1,78 @@
# `.zshrc' is sourced in interactive shells. It should contain
# commands to set up aliases, functions, options, key bindings, etc.
autoload -U colors && colors
# Set up the prompt
autoload -Uz promptinit
promptinit
setopt histignorealldups sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey -s '^L' '^Uclear^M' # clear using alias
autoload edit-command-line; zle -N edit-command-line
bindkey '^k' edit-command-line
# History
HISTSIZE=9000
SAVEHIST=9000
setopt hist_expire_dups_first
setopt hist_reduce_blanks
setopt hist_ignore_dups
setopt hist_ignore_space
HISTFILE=$XDG_CACHE_HOME/zshhistory
# Aliases
[ -f "$E_SCRIPTS_DIR/aliases.sh" ] && source "$E_SCRIPTS_DIR/aliases.sh"
# zsh-specific aliases
# clear zsh history: Adapted from Novimatrem: https://gitlab.com/Novimatrem/clear-bash-history
alias czh="echo 'Fully clearing history, then exiting...' && cat /dev/null > $XDG_CACHE_HOME/zshhistory && history -p && exit"
fpath=($ZDOTDIR/completions $fpath)
_comp_options+=(globdots) # include hidden files
# reload the zsh session. From OMZ:plugins/zsh_reload
zreload() {
local cache="$ZSH_CACHE_DIR"
autoload -U compinit zrecompile
compinit -i -d "$cache/zcomp-$HOST"
for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do
zrecompile -p $f && command rm -f $f.zwc.old
done
# Use $SHELL if available; remove leading dash if login shell
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
}
# Plugin management
[[ -f $ZDOTDIR/znap/znap.zsh ]] ||
git clone https://github.com/marlonrichert/zsh-snap $ZDOTDIR/znap
source $ZDOTDIR/znap/znap.zsh
znap source marlonrichert/zsh-autocomplete
zstyle ':autocomplete:*' min-input 1
zstyle ':autocomplete:*' min-delay 0.25
znap source hlissner/zsh-autopair
znap source zsh-users/zsh-syntax-highlighting
PURE_PROMPT_SYMBOL=
znap prompt sindresorhus/pure
zstyle :prompt:pure:git:stash show yes
znap source MichaelAquilina/zsh-you-should-use
# auto cd must be set later
setopt AUTO_CD
# Hooks
eval "$(direnv hook zsh)"

View File

@ -0,0 +1,82 @@
#compdef ghq
function _ghq () {
local context curcontext=$curcontext state line
declare -A opt_args
local ret=1
_arguments -C \
'(-h --help)'{-h,--help}'[show help]' \
'(-v --version)'{-v,--version}'[print the version]' \
'1: :__ghq_commands' \
'*:: :->args' \
&& ret=0
case $state in
(args)
case $words[1] in
(get)
_arguments -C \
'(-u --update)'{-u,--update}'[Update local repository if cloned already]' \
'-p[Clone with SSH]' \
'--shallow[Do a shallow clone]' \
'(-l --look)'{-l,--look}'[Look after get]' \
'--vcs[Specify vcs backend for cloning]' \
'(-s --silent)'{-s,--silent}'[Clone or update silently]' \
'--no-recursive[Prevent recursive fetching]' \
'(-b --branch)'{-b,--branch}'[Specify branch name]' \
'(-P --parallel)'{-P,--parallel}'[Import parallely]' \
'(-)*:: :->null_state' \
&& ret=0
;;
(list)
_arguments -C \
'(-e --exact)'{-e,--exact}'[Perform an exact match]' \
'--vcs[Specify vcs backend for matching]' \
'(-p --full-path)'{-p,--full-path}'[Print full paths]' \
'--unique[Print unique subpaths]' \
'(-)*:: :->null_state' \
&& ret=0
;;
(root)
_arguments -C \
'--all[Show all roots]' \
'(-)*:: :->null_state' \
&& ret=0
;;
(create)
_arguments -C \
'--vcs[Specify vcs backend explicitly]' \
'(-)*:: :->null_state' \
&& ret=0
;;
(help|h)
__ghq_commands && ret=0
;;
esac
;;
esac
return ret
}
__ghq_repositories () {
local -a _repos
_repos=( ${(@f)"$(_call_program repositories ghq list --unique)"} )
_describe -t repositories Repositories _repos
}
__ghq_commands () {
local -a _c
_c=(
'get:Clone/sync with a remote repository'
'list:List local repositories'
'create:Create a new repository'
"root:Show repositories' root"
'help:Show a list of commands or help for one command'
)
_describe -t commands Commands _c
}
_ghq "$@"

View File

@ -0,0 +1,166 @@
#compdef yadm
# This completion tries to fallback to git's completion for git commands.
zstyle -T ':completion:*:yadm:argument-1:descriptions:' format && \
zstyle ':completion:*:yadm:argument-1:descriptions' format '%d:'
zstyle -T ':completion:*:yadm:*:yadm' group-name && \
zstyle ':completion:*:yadm:*:yadm' group-name ''
_yadm-alt() {
return 0
}
_yadm-bootstrap() {
return 0
}
_yadm-clone() {
_arguments \
'(--bootstrap --no-bootstrap)--bootstrap[force bootstrap, without prompt]' \
'(--bootstrap --no-bootstrap)--no-bootstrap[prevent bootstrap, without prompt]' \
'-f[force overwrite of existing repository]' \
'-w[yadm work tree path]: :_files -/'
local curcontext="${curcontext%:*:*}:git:"
words=("git" "${words[@]}") CURRENT=$((CURRENT + 1)) service=git _git
}
_yadm-config() {
# TODO: complete config names
}
_yadm-decrypt() {
_arguments \
'-l[list files]'
}
_yadm-encrypt() {
return 0
}
_yadm-enter() {
_arguments \
':command: _command_names -e' \
'*::arguments: _normal'
}
_yadm-git-crypt() {
# TODO: complete git-crypt options
}
_yadm-help() {
return 0
}
_yadm-init() {
_arguments \
'-f[force overwrite of existing repository]' \
'-w[work tree path]: :_files -/'
}
_yadm-list() {
_arguments \
'-a[list all tracked files]'
}
_yadm-perms() {
return 0
}
_yadm-transcrypt() {
integer _ret=1
_call_function _ret _transcrypt
return _ret
}
_yadm-upgrade() {
_arguments \
'-f[force deinit of submodules]' \
': '
}
_yadm-version() {
return 0
}
_yadm_commands() {
local -a commands=(
alt:'create links for alternates'
bootstrap:'execute bootstrap'
clone:'clone an existing yadm repository'
config:'configure an yadm setting'
decrypt:'decrypt files'
encrypt:'encrypt files'
enter:'run sub-shell with GIT variables set'
git-crypt:'run git-crypt commands for the yadm repository'
gitconfig:'run the git config command'
help:'display yadm help information'
init:'initialize an empty yadm repository'
list:'list files tracked by yadm'
perms:'fix perms for private files'
transcrypt:'run transcrypt commands for the yadm repository'
upgrade:'upgrade legacy yadm paths'
version:'show yadm version'
)
local oldcontext="$curcontext"
local curcontext="${curcontext%:*:*}:git:"
words=("git" "${words[-1]}") CURRENT=2 service=git _git
curcontext="$oldcontext"
_describe -t yadm "yadm commands" commands
return 0
}
_yadm() {
local curcontext=$curcontext state state_descr line
declare -A opt_args
_arguments -C \
'(-Y --yadm-dir)'{-Y,--yadm-dir}'[override the standard yadm directory]: :_files -/' \
'--yadm-data[override the standard yadm data directory]: :_files -/' \
'--yadm-repo[override the standard repo path]: :_files -/' \
'--yadm-config[override the standard config path]: :_files -/' \
'--yadm-encrypt[override the standard encrypt path]: :_files -/' \
'--yadm-archive[override the standard archive path]: :_files -/' \
'--yadm-bootstrap[override the standard bootstrap path]: :_files' \
'--help[display yadm help information]' \
'--version[show yadm version]' \
'(-): :->command' \
'(-)*:: :->option-or-argument' && return
local -a repo_args
(( $+opt_args[--yadm-repo] )) && repo_args+=(--yadm-repo "$opt_args[--yadm-repo]")
(( $+opt_args[--yadm-data] )) && repo_args+=(--yadm-data "$opt_args[--yadm-data]")
local -x GIT_DIR="$(_call_program gitdir yadm "${repo_args[@]}" introspect repo)"
[[ -z "$GIT_DIR" ]] && return 1
integer _ret=1
case $state in
(command)
_yadm_commands && _ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*:*}:yadm-${words[1]}:
if ! _call_function _ret _yadm-${words[1]}; then
# Translate gitconfig to use the regular completion for config
[[ ${words[1]} = "gitconfig" ]] && words[1]=config
words=("git" "${(@)words}")
CURRENT=$(( CURRENT + 1 ))
curcontext=${curcontext%:*:*}:git:
service=git _git && _ret=0
fi
;;
esac
return _ret
}
(( $+functions[_git] )) && _yadm

View File

@ -1,4 +0,0 @@
# Do not edit this file. To specify the files to encrypt, create your own
# .gitattributes file in the directory where your files are.
* !filter !diff
*.gpg binary

2
.gitattributes vendored
View File

@ -1,2 +0,0 @@
+mail.el filter=git-crypt diff=git-crypt
.mbsyncrc filter=git-crypt diff=git-crypt

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Name=Deemix
Exec=deemix-pyweb
Icon=music-app
Terminal=false
Type=Application

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Name=Gemcraft Labyrinth
Exec=flashplayer /home/earne/Documents/giab-old-games/gcl-gs.swf
Icon=games-app
Terminal=false
Type=Application

1
.nix-channels Normal file
View File

@ -0,0 +1 @@
https://nixos.org/channels/nixpkgs-unstable nixpkgs

4
.profile Normal file
View File

@ -0,0 +1,4 @@
# ~/.profile
# load everything from ~/.config/zsh
export ZDOTDIR="$HOME/.config/zsh"
[ -f "$ZDOTDIR/.zshenv" ] && source $ZDOTDIR/.zshenv

3
.restic/.gitignore vendored
View File

@ -1,3 +0,0 @@
.env
.repo-name
.repo-pass

View File

@ -1,19 +0,0 @@
# backups!
You've come across the directory where I set up everything relating to how I do personal backups. If you see something wrong/ questionable, please let me know, thanks :)
You will need the following:
- Bash
- Restic
- msmtp configured
- credentials in pash (if temporary/ pash not set up, you can temporary overwrite the appropriate values in `restic-do`)
Within my dotfiles, there are systemd configuration files:
```bash
# Runs 6 minutes after boot and at 21:00
systemctl --user enable restic-backup.timer
systemctl --user status restic-backup.timer # view status
```

View File

@ -1,56 +0,0 @@
$HOME/.Trash
$HOME/.cache
$HOME/.config/**/cache
$HOME/.config/**/Cache
$HOME/.config/emacs/.local
$HOME/.cargo
$HOME/.config/google-chrome
$HOME/.esmtp_queue
$HOME/.java
$HOME/.local/bin
$HOME/.local/lib
$HOME/.local/share/Steam
$HOME/.mozilla/firefox/**/storage/default/**/cache
$HOME/.npm
$HOME/.rustup
$HOME/.steam
$HOME/.steampath
$HOME/.steampid
$HOME/.subversion
$HOME/.thunderbird/**/ImapMail
$HOME/.thunderbird/**/Mail
$HOME/.tmp
$HOME/.var/app/**/cache
$HOME/.wine
$HOME/.vscode-oss
$HOME/Downloads/nobkup
$HOME/Nextcloud
$HOME/rpmbuild
$HOME/tmp
$HOME/VirtualBox VMs
$HOME/point*
$HOME/ghq
$HOME/ghq/**/node_modules
$HOME/go
$HOME/GPUCache
$HOME/.restore-info/tmp
$HOME/.nix-profile
$HOME/.nix-defexpr
.owncloudsync.log
.sync_*
.sync-exclude.lst
*.part
.DS_Store
.TemporaryItems
.Trash-1000
.Trashes
._*
__pycache__

View File

@ -1,118 +0,0 @@
#!/usr/bin/env bash
# set -euo pipefail
mkdir -p ~/.restore-info/tmp
chmod 700 ~/.restore-info
# restic-do exec init
# restic-do exec mount /path/to-restorepoint (mkdir first)
export AWS_ACCESS_KEY_ID=$(pash show personal-backups/aws-key-id)
export AWS_SECRET_ACCESS_KEY=$(pash show personal-backups/aws-access-key)
repo=$(cat ~/.dotfiles/.restic/.repo-name)
script_started=$(date +%Y-%m-%d_%H%M%S)
# $RESTIC_PASSWORD_FILE or $RESTIC_PASSWORD_COMMAND
if [[ -f "$HOME/.dotfiles/.restic/.repo-pass" ]]; then
export RESTIC_PASSWORD_FILE="$HOME/.dotfiles/.restic/.repo-pass"
else
export RESTIC_PASSWORD_COMMAND="pash show personal-backups/repo-pass"
fi
# set email vars here
[ -f ~/.dotfiles/.restic/.env ] && source ~/.dotfiles/.restic/.env
# Check internet connectivity
echo "checking internet connectivity, pinging google.com"
ping -c 1 google.com
internet_check="$?"
if [[ $internet_check != 0 ]]; then
echo "You may not be connected to the internet"
notify-send -u critical "The backup was unable to run:" "you are not connected to the internet"
zenity --error --text "The backup was unable to run: you are not connected to the internet"
exit 1
fi
# Check if metered
# https://github.com/erikw/restic-systemd-automatic-backup
# http://opensource.org/licenses/BSD-3-Clause
systemctl is-active dbus.service >/dev/null 2>&1 || exit 0
systemctl is-active NetworkManager.service >/dev/null 2>&1 || exit 0
metered_status=$(dbus-send --system --print-reply=literal \
--system --dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.DBus.Properties.Get \
string:org.freedesktop.NetworkManager string:Metered \
| grep -o ".$")
if [[ $metered_status =~ (1|3) ]]; then
echo Current connection is metered
notify-send -u critical "The backup was unable to run:" "your internet connection is metered"
zenity --error --text "The backup was unable to run: your internet connection is metered"
exit 1
fi
case "$1" in
backup)
cd ~ || exit 1
# No longer echo "exporting list of packages"
# clear existing: rm ~/.restore-info/packages-*
# No longer echo "exporting dnf repos list"
# clear existing rm ~/.restore-info/dnfrepos-*
echo "starting backup"
restic backup -r "$repo" \
--one-file-system \
--exclude-caches --exclude-file ~/.dotfiles/.restic/ignore.txt \
--exclude-if-present .exclude_from_backup \
~ -v > ~/.restore-info/tmp/backup-log-${script_started}.txt
restic_exit_code="$?"
backup_stopped=$(date +%k%M%S)
echo "sending email report"
cat <<EOMAIL | msmtp --read-envelope-from $BACKUP_EMAIL_TO
To: $BACKUP_EMAIL_TO
From: $BACKUP_EMAIL_FROM
Subject: Backup report $script_started exiting $restic_exit_code
Stopped $backup_stopped
$(cat ~/.restore-info/tmp/backup-log-${script_started}.txt)
EOMAIL
;;
maintenance)
restic forget -r "$repo" -v --prune \
--keep-last 2 --keep-daily 7 --keep-weekly 5 --keep-monthly 6 --keep-yearly 3 \
> ~/.restore-info/tmp/maint-forget-log-${script_started}.txt
forget_exit_code="$?"
restic -r "$repo" check --read-data-subset=10% \
> ~/.restore-info/tmp/maint-check-log-${script_started}.txt
check_exit_code="$?"
maint_done=$(date +%k%M%S)
echo "sending email report"
cat <<EOMAIL | msmtp --read-envelope-from $BACKUP_EMAIL_TO
To: $BACKUP_EMAIL_TO
From: $BACKUP_EMAIL_FROM
Subject: Backup maintenance report: $script_started
- Finished $maint_done
- Forgetting exited $forget_exit_code
- Checking exiting $check_exit_code
$(cat ~/.restore-info/tmp/maint-forget-log-${script_started}.txt)
$(cat ~/.restore-info/tmp/maint-check-log-${script_started}.txt)
EOMAIL
;;
exec)
shift
restic -r "$repo" "$@" ;;
esac

3
.zshenv Normal file
View File

@ -0,0 +1,3 @@
# load everything from ~/.config/zsh
export ZDOTDIR="$HOME/.config/zsh"
[ -f "$ZDOTDIR/.zshenv" ] && source $ZDOTDIR/.zshenv

201
Brewfile
View File

@ -1,201 +0,0 @@
tap "b3z/small"
tap "cooklang/tap"
tap "gitea/tap", "https://gitea.com/gitea/homebrew-gitea"
tap "gromgit/fuse"
tap "homebrew/bundle"
tap "homebrew/cask-fonts"
tap "homebrew/services"
tap "railwaycat/emacsmacport"
tap "zegervdv/zathura"
brew "ansible"
brew "black"
brew "yamllint"
brew "ansible-lint"
brew "libtiff"
brew "webp"
brew "jpeg-xl"
brew "open-mpi"
brew "openblas"
brew "arpack"
brew "autoconf"
brew "automake"
brew "bandcamp-dl"
brew "bat"
brew "pkg-config"
brew "python@3.9"
brew "clang-format"
brew "cmake"
brew "coreutils"
brew "curl"
brew "direnv"
brew "dos2unix"
brew "editorconfig"
brew "ghostscript"
brew "exa"
brew "fd"
brew "unbound"
brew "leptonica"
brew "libarchive"
brew "pango"
brew "rubberband"
brew "sdl2"
brew "tesseract"
brew "ffmpeg"
brew "netpbm"
brew "fswatch"
brew "fzf"
brew "ghq"
brew "git"
brew "git-crypt"
brew "git-gui"
brew "gsettings-desktop-schemas"
brew "glib-networking"
brew "gnupg"
brew "gpgme"
brew "gnuplot"
brew "go"
brew "gobject-introspection"
brew "graphicsmagick"
brew "gtk+3"
brew "gtk4"
brew "libsoup"
brew "py3cairo"
brew "pygobject3"
brew "gstreamer"
brew "helix"
brew "htop"
brew "hugo"
brew "libheif"
brew "imagemagick"
brew "isync"
brew "python@3.10"
brew "jsonschema"
brew "just"
brew "lychee"
brew "mailutils"
brew "mercurial"
brew "meson"
brew "vapoursynth"
brew "yt-dlp"
brew "mpv"
brew "msmtp"
brew "mu"
brew "nano"
brew "neovim"
brew "node"
brew "onefetch"
brew "openjdk"
brew "openjdk@17"
brew "pandoc"
brew "php@7.4"
brew "pinentry-mac"
brew "virtualenv"
brew "poetry"
brew "poppler"
brew "pympress"
brew "qt@5"
brew "pyright"
brew "python-tk@3.11"
brew "r"
brew "rbenv"
brew "restic"
brew "ripgrep"
brew "rsync"
brew "rust-analyzer"
brew "rustup-init"
brew "sdl2_image"
brew "sdl2_mixer"
brew "sdl2_ttf"
brew "shellcheck"
brew "stow"
brew "tmux"
brew "w3m"
brew "wakatime-cli"
brew "yarn"
brew "zoxide"
brew "zsh"
brew "gitea/tap/tea"
brew "railwaycat/emacsmacport/emacs-mac"
cask "activate"
cask "alt-tab"
cask "authy"
cask "buckets"
cask "calibre"
cask "discord"
cask "firefox"
cask "font-fira-code"
cask "font-jetbrains-mono"
cask "google-chrome"
cask "gpg-suite"
cask "hiddenbar"
cask "iina"
cask "imageoptim"
cask "iterm2"
cask "jellyfin-media-player"
cask "joplin"
cask "keka"
cask "lagrange"
cask "maccy"
cask "mactex"
cask "mouse-fix"
cask "nextcloud"
cask "obs"
cask "obsidian"
cask "pocket-casts"
cask "pycharm"
cask "qbittorrent"
cask "rectangle"
cask "skim"
cask "spotify"
cask "syntax-highlight"
cask "the-unarchiver"
cask "thunderbird"
cask "visual-studio-code"
cask "zoom"
vscode "aaronduino.gemini"
vscode "arrterian.nix-env-selector"
vscode "bbenoist.Nix"
vscode "bierner.docs-view"
vscode "CharlieGerard.pride-vscode-themes"
vscode "dracula-theme.theme-dracula"
vscode "EditorConfig.EditorConfig"
vscode "floookay.vscode-wpm-monitor"
vscode "FordLabs.flux"
vscode "funketh.pride-themes"
vscode "golang.go"
vscode "hangxingliu.vscode-systemd-support"
vscode "icrawl.discord-vscode"
vscode "jdinhlife.gruvbox"
vscode "kahole.magit"
vscode "leighlondon.eml"
vscode "lmcarreiro.vscode-smart-column-indenter"
vscode "marchrock.vscode-ghq"
vscode "mattn.Lisp"
vscode "mhutchie.git-graph"
vscode "ms-azuretools.vscode-docker"
vscode "ms-python.isort"
vscode "ms-python.python"
vscode "ms-python.vscode-pylance"
vscode "ms-vscode-remote.remote-ssh"
vscode "ms-vscode-remote.remote-ssh-edit"
vscode "ms-vscode.makefile-tools"
vscode "ms-vscode.remote-explorer"
vscode "ms-vsliveshare.vsliveshare"
vscode "nico-castell.linux-desktop-file"
vscode "redhat.java"
vscode "Rubymaniac.vscode-direnv"
vscode "rust-lang.rust-analyzer"
vscode "tamasfe.even-better-toml"
vscode "technosophos.vscode-make"
vscode "timonwong.shellcheck"
vscode "usernamehw.errorlens"
vscode "VisualStudioExptTeam.intellicode-api-usage-examples"
vscode "VisualStudioExptTeam.vscodeintellicode"
vscode "vscjava.vscode-java-debug"
vscode "vscjava.vscode-java-dependency"
vscode "vscjava.vscode-java-pack"
vscode "vscjava.vscode-java-test"
vscode "vscjava.vscode-maven"
vscode "WakaTime.vscode-wakatime"
vscode "yzhang.markdown-all-in-one"
vscode "zeshuaro.vscode-python-poetry"

42
LICENSE
View File

@ -1,42 +0,0 @@
earnest's public license (EMPL), v1.0.1
This license gives everyone as much permission to work with this software as
possible, while protecting contributors from liability.
In order to receive this license, you must agree to its rules. The rules of this
license are both obligations under that agreement and conditions to your
license. You must not do anything with this software that triggers a rule that
you cannot or will not follow.
Each contributor licenses you to do everything with this software that would
otherwise infringe that contributor's copyright in it.
Notices:
- You may not use the software to accrue revenue without explicit permission
from the primary contributors.
- This software must be used for Good, not Evil, as determined by the primary
contributors to the software.
- No Law Enforcement, Military, Carceral Institutions, or Immigration
enforcement entities or individuals working in those areas may use the work or
products of the work, for any reason.
- You must ensure that everyone who gets a copy of any part of this software
from you, with or without changes, also gets the text of this license or a
link to <https://files.earne.link/empl>. An acknowledgement of the original
software is appreciated, but not mandatory.
If anyone notifies you in writing that you have not complied with Notices, you
can keep your license by taking all practical steps to comply within 30 days
after the notice. If you do not do so, your license ends immediately.
Each contributor licenses you to do everything with this software that would
otherwise infringe any patent claims they can license or become able to license.
No contributor can revoke this license.
**As far as the law allows, this software comes as is, without any warranty or
condition, and no contributor will be liable to anyone for any damages related
to this software or this license, under any kind of legal claim.**

View File

@ -1,15 +1,6 @@
# Dotfiles
# [Dotfiles](https://sr.ht/~earnestma/configuration)
These dotfiles are managed using GNU Stow and I use them on my systems running either macOS or Fedora 36 (Workstation Edition).
My personal dotfiles, run on [Pop!_OS](https://pop.system76.com) along with:
## Usage
MacOS: Install Homebrew and check the Brewfile.
Linux: Refer to [this page](https://notes.earnestma.com/notes/Linux+Computer+Setup+Guide) or the (outdated) [ansible repository](https://git.earne.link/earnestma/configs) for installing and configuring the system.
To use, clone the repository to `~/.dotfiles`, use `stow */ -[D]v` to create/ remove all the links.
# Hacks
For Git, if you have local hooks, set `core.hooksPath` to `.git/hooks`, the global ones will not be run.
- [yadm](https://yadm.io)
- [nix](https://nixos.org)

View File

@ -1 +0,0 @@
accounts.conf

1
bin/.gitignore vendored
View File

@ -1 +0,0 @@
.local/share

View File

@ -1 +0,0 @@
*

View File

@ -1,61 +0,0 @@
#!/usr/bin/env bash
# From https://gist.github.com/dshnkao/10865f32d69e40dc591e08e3af970e9d
tmpfile=$(mktemp /tmp/ffhist.XXXXX)
cp -f ~/Library/Application\ Support/Firefox/Profiles/qdk1f64u.default-release/places.sqlite $tmpfile
DB_PATH="$tmpfile"
# Relying on rofi / fzf is a bit limited
# e.g
# umenu "places.sqlite" "rofi -dmenu --no-sort"
# umenu "places.sqlite" "fzf --no-sort --exact"
# DB_PATH=${1:?ARG 1: path to firefox database}
FINDER=fzf
# FINDER=${2:?ARG 2: fzf or rofi}
QUERY="
SELECT
url, title FROM moz_places
WHERE
url NOT LIKE '%google%search%'
ORDER BY
visit_count DESC,
last_visit_date DESC;
"
SEP="∙"
ENTRY=$(
sqlite3 "$DB_PATH" "$QUERY" | \
sed -E 's/^https?:\/\///' | \
sed -E "s/\\/?\\|/ $SEP /" | \
sed -E "s/$SEP $//" | \
$FINDER
)
URL=$( echo "$ENTRY" | sed "s/$SEP.*//g" )
if [ "$URL" = "" ]; then
exit 0
fi
# google search if input end with .
if [ "${URL: -1}" = "." ]; then
SEARCH="${URL:: -1}"
URL="google.com/search?q=$SEARCH"
fi
case $(uname) in
'Linux')
xdg-open "https://$URL"
;;
'Darwin')
open "https://$URL"
;;
esac
rm "$tmpfile"

View File

@ -1,242 +0,0 @@
#!/bin/sh
#
# pash - simple password manager.
# Licensed under the MIT License
pw_add() {
name=$1
if yn "Generate a password?"; then
# Generate a password by reading '/dev/urandom' with the
# 'tr' command to translate the random bytes into a
# configurable character set.
#
# The 'dd' command is then used to read only the desired
# password length.
#
# Regarding usage of '/dev/urandom' instead of '/dev/random'.
# See: https://www.2uo.de/myths-about-urandom
pass=$(LC_ALL=C tr -dc "${PASH_PATTERN:-_A-Z-a-z-0-9}" < /dev/urandom |
dd ibs=1 obs=1 count="${PASH_LENGTH:-50}" 2>/dev/null)
else
# 'sread()' is a simple wrapper function around 'read'
# to prevent user input from being printed to the terminal.
sread pass "Enter password"
sread pass2 "Enter password (again)"
# Disable this check as we dynamically populate the two
# passwords using the 'sread()' function.
# shellcheck disable=2154
[ "$pass" = "$pass2" ] || die "Passwords do not match"
fi
[ "$pass" ] || die "Failed to generate a password"
# Mimic the use of an array for storing arguments by... using
# the function's argument list. This is very apt isn't it?
if [ "$PASH_KEYID" ]; then
set -- --trust-model always -aer "$PASH_KEYID"
else
set -- -c
fi
# Use 'gpg' to store the password in an encrypted file.
# A heredoc is used here instead of a 'printf' to avoid
# leaking the password through the '/proc' filesystem.
#
# Heredocs are sometimes implemented via temporary files,
# however this is typically done using 'mkstemp()' which
# is more secure than a leak in '/proc'.
"$gpg" "$@" -o "$name.gpg" <<-EOF &&
$pass
EOF
printf '%s\n' "Saved '$name' to the store."
}
pw_del() {
yn "Delete pass file '$1'?" && {
rm -f "$1.gpg"
# Remove empty parent directories of a password
# entry. It's fine if this fails as it means that
# another entry also lives in the same directory.
rmdir -p "${1%/*}" 2>/dev/null || :
}
}
pw_show() {
"$gpg" -dq "$1.gpg"
}
pw_copy() {
# Disable warning against word-splitting as it is safe
# and intentional (globbing is disabled).
# shellcheck disable=2086
: "${PASH_CLIP:=xclip -sel c}"
# Wait in the background for the password timeout and
# clear the clipboard when the timer runs out.
#
# If the 'sleep' fails, kill the script. This is the
# simplest method of aborting from a subshell.
[ "$PASH_TIMEOUT" != off ] && {
printf 'Clearing clipboard in "%s" seconds.\n' "${PASH_TIMEOUT:=15}"
sleep "$PASH_TIMEOUT" || kill 0
$PASH_CLIP </dev/null
} &
pw_show "$1" | $PASH_CLIP
}
pw_list() {
find . -type f -name \*.gpg | sed 's/..//;s/\.gpg$//'
}
pw_tree() {
command -v tree >/dev/null 2>&1 ||
die "'tree' command not found"
tree --noreport | sed 's/\.gpg$//'
}
yn() {
printf '%s [y/n]: ' "$1"
# Enable raw input to allow for a single byte to be read from
# stdin without needing to wait for the user to press Return.
stty -icanon
# Read a single byte from stdin using 'dd'. POSIX 'read' has
# no support for single/'N' byte based input from the user.
answer=$(dd ibs=1 count=1 2>/dev/null)
# Disable raw input, leaving the terminal how we *should*
# have found it.
stty icanon
printf '\n'
# Handle the answer here directly, enabling this function's
# return status to be used in place of checking for '[yY]'
# throughout this program.
glob "$answer" '[yY]'
}
sread() {
printf '%s: ' "$2"
# Disable terminal printing while the user inputs their
# password. POSIX 'read' has no '-s' flag which would
# effectively do the same thing.
stty -echo
read -r "$1"
stty echo
printf '\n'
}
glob() {
# This is a simple wrapper around a case statement to allow
# for simple string comparisons against globs.
#
# Example: if glob "Hello World" '* World'; then
#
# Disable this warning as it is the intended behavior.
# shellcheck disable=2254
case $1 in $2) return 0; esac; return 1
}
die() {
printf 'error: %s.\n' "$1" >&2
exit 1
}
usage() { printf %s "\
pash 2.3.0 - simple password manager.
=> [a]dd [name] - Create a new password entry.
=> [c]opy [name] - Copy entry to the clipboard.
=> [d]el [name] - Delete a password entry.
=> [l]ist - List all entries.
=> [s]how [name] - Show password for an entry.
=> [t]ree - List all entries in a tree.
Using a key pair: export PASH_KEYID=XXXXXXXX
Password length: export PASH_LENGTH=50
Password pattern: export PASH_PATTERN=_A-Z-a-z-0-9
Store location: export PASH_DIR=~/.local/share/pash
Clipboard tool: export PASH_CLIP='xclip -sel c'
Clipboard timeout: export PASH_TIMEOUT=15 ('off' to disable)
"
exit 0
}
main() {
: "${PASH_DIR:=${XDG_DATA_HOME:=$HOME/.local/share}/pash}"
# Look for both 'gpg' and 'gpg2',
# preferring 'gpg2' if it is available.
command -v gpg >/dev/null 2>&1 && gpg=gpg
command -v gpg2 >/dev/null 2>&1 && gpg=gpg2
[ "$gpg" ] ||
die "GPG not found"
mkdir -p "$PASH_DIR" ||
die "Couldn't create password directory"
cd "$PASH_DIR" ||
die "Can't access password directory"
glob "$1" '[acds]*' && [ -z "$2" ] &&
die "Missing [name] argument"
glob "$1" '[cds]*' && [ ! -f "$2.gpg" ] &&
die "Pass file '$2' doesn't exist"
glob "$1" 'a*' && [ -f "$2.gpg" ] &&
die "Pass file '$2' already exists"
glob "$2" '*/*' && glob "$2" '*../*' &&
die "Category went out of bounds"
glob "$2" '/*' &&
die "Category can't start with '/'"
glob "$2" '*/*' && { mkdir -p "${2%/*}" ||
die "Couldn't create category '${2%/*}'"; }
# Set 'GPG_TTY' to the current 'TTY' if it
# is unset. Fixes a somewhat rare `gpg` issue.
export GPG_TTY=${GPG_TTY:-$(tty)}
# Restrict permissions of any new files to
# only the current user.
umask 077
# Ensure that we leave the terminal in a usable
# state on exit or Ctrl+C.
[ -t 1 ] && trap 'stty echo icanon' INT EXIT
case $1 in
a*) pw_add "$2" ;;
c*) pw_copy "$2" ;;
d*) pw_del "$2" ;;
s*) pw_show "$2" ;;
l*) pw_list ;;
t*) pw_tree ;;
*) usage
esac
}
# Ensure that debug mode is never enabled to
# prevent the password from leaking.
set +x
# Ensure that globbing is globally disabled
# to avoid insecurities with word-splitting.
set -f
[ "$1" ] || usage && main "$@"

View File

@ -1,314 +0,0 @@
#!/usr/bin/env bash
# https://github.com/ianthehenry/sd
# ecd1ab8d3fc3a829d8abfb8bf1e3722c9c99407b
__sd_join_path() {
echo "$@" | tr ' ' /
}
__sd_which() {
echo "$1"
}
__sd_cat() {
${SD_CAT:-cat} "$1"
}
__sd_edit() {
${SD_EDITOR:-${VISUAL:-${EDITOR:-vi}}} "$1"
}
__sd_directory_help() {
local target="$1"
local i file helpfile help command
local -a commands helps
if [[ -d "$target" ]]; then
helpfile="$target/help"
else
helpfile="$target.help"
fi
# in case you have `sd help` as a command alias, we don't
# want to print that when you just run "sd" by itself.
# Admittedly we don't check this in any other place, which
# could be considered a bug, but whatever it's a weird little
# hack and no one uses this.
if [[ -e "$helpfile" && ! -x "$helpfile" ]]; then
__sd_cat "$helpfile"
echo
else
command=$(basename "$target")
echo "$command commands"
echo
fi
commands=()
helps=()
for file in "$target"/*; do
if [[ ! -x "$file" ]]; then
continue
fi
command=$(basename "$file")
if [[ -d "$file" ]]; then
helpfile="$file/help"
if [[ -f "$helpfile" ]]; then
help=$(head -n1 "$helpfile")
else
help="$command commands"
fi
command="$command ..."
else
helpfile="$file.help"
if [[ -f "$helpfile" ]]; then
help=$(head -n1 "$helpfile")
else
help=$(sed -nE -e '/^#!/d' -e '/^#/{s/^# *//; p; q;}' "$file")
fi
fi
commands+=("$command")
helps+=("$help")
done
if [[ ${#commands[@]} -eq 0 ]]; then
echo "(no subcommands found)"
else
local max_length=0
local length
for command in "${commands[@]}"; do
length=${#command}
max_length=$((length > max_length ? length : max_length))
done
if [[ -n ${ZSH_EVAL_CONTEXT+x} ]]; then
set -o LOCAL_OPTIONS
# we need to ensure we have 0-indexed arrays
# in order for this loop to work properly.
# zsh doesn't support ${!commands[@]} expansion
set -o KSH_ARRAYS
fi
for ((i = 0; i < ${#commands[@]}; i++)); do
printf "%-${max_length}s -- %s\n" "${commands[i]}" "${helps[i]}"
done
fi
}
__sd_help() {
local target=$1
if [[ -d "$target" ]]; then
__sd_directory_help "$target"
elif [[ -f "$target.help" ]]; then
__sd_cat "$target.help"
else
help=$(sed -nE -e '/^#!/d' -e $':start\n /^#/{ s/^# ?//; p; \nb start\n }' "$target")
if [[ -z "$help" ]]; then
echo "there is no help for you here" >&2
exit 1
else
echo "$help"
fi
fi
}
__sd_print_template() {
if [[ -f "$1/template" ]]; then
cat "$1/template"
else
if [[ "$1" = "${SD_ROOT:-$HOME/sd}" ]]; then
cat <<EOF
#!/usr/bin/env bash
set -euo pipefail
EOF
else
__sd_print_template "$(dirname "$1")"
fi
fi
}
__sd_new() {
local script dir target body
target="$1"
shift
local -a command_path=()
for arg in "$@"; do
case "$arg" in
--new) shift; break ;;
*) command_path+=("$arg"); shift ;;
esac
done
if [[ ${#command_path[@]} -eq 0 ]]; then
echo "error: $target already exists" >&2
exit 1
fi
if [[ -f "$target" ]]; then
echo "error: command prefix $target is a regular file" >&2
exit 1
fi
body="$*"
script="$target"/"$(__sd_join_path "${command_path[@]}")"
if [[ -e "$script" ]]; then
echo "$script already exists!" >&2
exit 1
fi
dir="$(dirname "$script")"
mkdir -p "$dir"
(
__sd_print_template "$dir"
if [[ -n "$body" ]]; then
printf "\n%s\n" "$body"
fi
) >"$script"
chmod +x "$script"
if [[ -z "$body" ]]; then
__sd_edit "$script"
fi
}
__sd_new_user_help() {
root=$1
echo >&2 "error: $root not found"
echo >&2
echo >&2 "It looks like you don't have a script directory yet!"
echo >&2
echo >&2 "Get started by creating your first script:"
echo >&2
echo >&2 " sd hello --new 'echo \"Hello, sd!\"'"
echo >&2
echo >&2 "And then run it like this:"
echo >&2
echo >&2 " sd hello"
}
__sd() {
set -euo pipefail
local root=${SD_ROOT:-$HOME/sd}
if [[ -e "$root" && ! -d "$root" ]]; then
echo "error: $root is not a directory" >&2
exit 1
fi
local target=$root
local arg
while [[ $# -gt 0 ]]; do
arg="$1"
if [[ -d "$target/$arg" ]]; then
target="$target/$arg"
shift
elif [[ -f "$target/$arg" ]]; then
target="$target/$arg"
shift
break
else
break
fi
done
local found_help="false"
local found_new="false"
local found_edit="false"
local found_cat="false"
local found_which="false"
local found_really="false"
for arg in "$@"; do
case "$arg" in
--help) found_help=true ;;
--new) found_new=true ;;
--edit) found_edit=true ;;
--cat) found_cat=true ;;
--which) found_which=true ;;
--really) found_really=true ;;
esac
done
# you're allowed to run --new even if there is no
# script directory root, in order to bootstrap it
if [[ "$found_really" = "true" || "$found_new" = "false" ]]; then
if [[ ! -d "$root" ]]; then
__sd_new_user_help "$root"
exit 1
fi
fi
if [[ "$found_really" = "true" ]]; then
local -a preserved=()
for arg in "$@"; do
case "$arg" in
'--really') shift; break ;;
*) preserved+=("$arg"); shift ;;
esac
done
if [[ ${#preserved[@]} -gt 0 ]]; then
set -- "${preserved[@]}" "$@"
fi
elif [[ "$found_new" = "true" ]]; then
__sd_new "$target" "$@"
exit 0
elif [[ "$found_help" = "true" ]]; then
__sd_help "$target"
exit 0
elif [[ "$found_edit" = "true" ]]; then
__sd_edit "$target"
exit 0
elif [[ "$found_cat" = "true" ]]; then
__sd_cat "$target"
exit 0
elif [[ "$found_which" = "true" ]]; then
__sd_which "$target"
exit 0
fi
if [[ -d "$target" ]]; then
__sd_directory_help "$target"
if [[ $# -gt 0 ]]; then
echo >&2
echo "$target/$(__sd_join_path "$@") not found" >&2
exit 1
fi
elif [[ -x "$target" ]]; then
SD="$(dirname "$target")" exec "$target" "$@"
else
__sd_cat "$@"
fi
}
# If you source this file and use function-mode sd, we want to
# wrap the execution in a subshell so that set -e doesn't kill
# the interactive shell, and so that we can exec the subshell
# without destroying the interactive shell.
sd() (
__sd "$@"
)
# If you source this file, it will define the function sd,
# which you can use from your shell. If you *run* this file
# as an executable, it will just invoke that function. We
# have to do some tricks to detect that reliably on bash/zsh.
if [[ -n ${ZSH_EVAL_CONTEXT+x} ]]; then
# we are in zsh
if [[ "$ZSH_EVAL_CONTEXT" = toplevel ]]; then
__sd "$@"
fi
elif [[ -n ${BASH_SOURCE[0]+x} ]]; then
# we are in bash
if [[ "${BASH_SOURCE[0]}" = "$0" ]]; then
__sd "$@"
fi
fi

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
# Send secrets from certain files to another trusted device.
# WILL NOT DELETE FILES, BUT WILL OVERWRITE!
set -x
if [[ -z $1 ]]; then
echo "Missing user@host to send to"
exit 2
fi
files="$HOME/.ssh $HOME/.gnupg $HOME/.wakatime.cfg"
rsync -rav \
--exclude="$HOME/.ssh/id_*" --exclude="*.sock" \
$files "${1}:"

View File

@ -1,27 +0,0 @@
#!/usr/bin/env sh
set -eu
# Things you need: ~/.config/sr.ht file, curl, jq, xclip
. ~/.config/sr.ht
PASTESRHT=${PASTESRHT:-https://paste.sr.ht}
fname=$(zenity --title="Upload" --text="File name:" --entry)
result=$(xclip -o -sel clip --no-newline | jq -sR '{
"files": [
{
"contents": .,
"filename": "'"$fname"'",
}
],
"visibility": "unlisted"
}' | curl \
-H Authorization:"token $legacy_token" \
-H Content-Type:application/json \
-X POST \
-d @- $PASTESRHT/api/pastes)
printf '%s\n' "$result"
sha=$(printf '%s' "$result" | jq -r .sha)
user=$(printf '%s' "$result" | jq -r .user.canonical_name)
xdg-open "$PASTESRHT/$user/$sha"
echo "$PASTESRHT/$user/$sha" | xclip -sel clip

View File

@ -1,7 +0,0 @@
#!/usr/bin/env sh
if [ -z "$1" ]; then
exit 1
fi
yt-dlp "$1" --write-subs

View File

@ -1,12 +0,0 @@
;;; ../../.dotfiles/doom/.config/doom/+ess.el -*- lexical-binding: t; -*-
;; https://github.com/polymode/poly-R/issues/34
(setq polymode-lsp-integration nil)
(use-package! ess-view
:after ess
:config
(setq ess-view--spreadsheet-program "open"))
(use-package! ess-view-data
:after ess)

Binary file not shown.

View File

@ -1,36 +0,0 @@
;;; $DOOMDIR/+projects.el -*- lexical-binding: t; -*-
(defvar project-locations '(("~/ghq/" . 3)
("~/.dotfiles" . 0)
("~/configs" . 0))
"Where all my projects are located.
Most of them are managed using `ghq' in ~/ghq/, however there are also some
projects in other locations.")
(use-package! projectile
:init
(setq projectile-auto-discover t)
(setq projectile-project-search-path project-locations))
(use-package! treemacs
:init
(setq treemacs-missing-project-action 'remove)
:config
(treemacs-project-follow-mode +1)
(treemacs-hide-gitignored-files-mode +1))
(after! treemacs
(define-key treemacs-mode-map [mouse-1] #'treemacs-single-click-expand-action))
(use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode
:after (treemacs persp-mode) ;;or perspective vs. persp-mode
:ensure t
:config (treemacs-set-scope-type 'Perspectives))
(after! magit
(add-hook! 'after-save-hook #'magit-after-save-refresh-status)
(setq magit-save-repository-buffers t ; ask to save modified files in repo
magit-repository-directories project-locations))
(use-package! ghq)

View File

@ -1,67 +0,0 @@
;;; $DOOMDIR/+ui.el -*- lexical-binding: t; -*-
(setq doom-font (font-spec :family "Jetbrains Mono" :size 13))
(if (string-match "tycho" (system-name))
(setq doom-font (font-spec :family "Jetbrains Mono" :size 18)))
(setq doom-theme 'doom-gruvbox)
(menu-bar-mode +1) ; add back menu bar
(setq display-line-numbers-type 'relative) ; line numbers
;; slightly nicer default buffer names
(setq doom-fallback-buffer-name "► Doom"
+doom-dashboard-name "► Doom")
;; pop-ups
(setq which-key-idle-delay 0.25)
;; centaur tabs issue: https://github.com/ema2159/centaur-tabs/issues/181
(after! centaur-tabs
(centaur-tabs-group-by-projectile-project))
;; From Tecosaur's config: hide encoding in modeline if usual
(defun doom-modeline-conditional-buffer-encoding ()
"We expect the encoding to be LF UTF-8, so only show the modeline
when this is not the case"
(setq-local doom-modeline-buffer-encoding
(unless (and (memq (plist-get (coding-system-plist buffer-file-coding-system) :category)
'(coding-category-undecided coding-category-utf-8))
(not (memq (coding-system-eol-type buffer-file-coding-system) '(1 2))))
t)))
(add-hook 'after-change-major-mode-hook #'doom-modeline-conditional-buffer-encoding)
;; https://github.com/doomemacs/doomemacs/issues/314
(after! doom-modeline
(setq doom-modeline-persp-name t))
;; pdf-tools
;; Always use midnight view with pdf-tools
(add-hook 'pdf-tools-enabled-hook 'pdf-view-midnight-minor-mode)
;; Also from Tecosaur's config (modified slightly): better window title
(setq frame-title-format
'(""
"%b" ; removed the org-roam part
(:eval
(let ((project-name (projectile-project-name)))
(unless (string= "-" project-name)
(format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name))))))
;; emojify: Was a workaround for
;; https://github.com/iqbalansari/emacs-emojify/issues/100, but keep for
;; simplicity.
(setq emojify-download-emojis-p t)
(setq emojify-emoji-set "twemoji-v2")
(setq eros-eval-result-prefix " ") ; default =>
;; (use-package auto-dark
;; :config
;; (setq auto-dark-allow-osascript t)
;; (setq auto-dark-dark-theme 'doom-gruvbox)
;; (setq auto-dark-light-theme 'doom-gruvbox-light)
;; (auto-dark-mode t))

View File

@ -1,6 +0,0 @@
.DS_Store
.idea
*.log
tmp/
.local.el

View File

@ -1,12 +0,0 @@
# doom emacs config
- Grab a copy of Doom Emacs: `git clone https://github.com/hlissner/doom-emacs --depth 1 ~/.config/emacs`
- Build: `~/.config/emacs/bin/doom sync`
- See if you're missing anything: `doom doctor`
Run `M-x nerd-icons-install-fonts` if there are problems with the modeline: <https://github.com/doomemacs/doomemacs/issues/7368>
Also check out:
- [Tecosaur's literate Doom Emacs configuration](https://github.com/tecosaur/emacs-config)
- [Diego Zamboni dot-doom](https://gitlab.com/zzamboni/dot-doom)

View File

@ -1,189 +0,0 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
(setq user-full-name "earnest ma"
user-mail-address "me@earne.link")
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/")
(load! ".local" doom-user-dir t)
(load! "+ui") ; theme, font, and appearance tweaks
(load! "+projects") ; project-related
(load! "+ess") ; ess, R
(load! "+mail") ; mu4e
;; Defaults
(setq-default delete-by-moving-to-trash t)
(setq undo-limit 80000000 ; 80Mb
evil-want-fine-undo t ; more history when in insert mode
evil-split-window-below t ; switch to window after creation
evil-vsplit-window-right t
evil-kill-on-visual-paste nil ; copy pasting
truncate-string-ellipsis "" ; Unicode ellispis are nicer than "...", and also save /precious/ space
password-cache-expiry nil ; don't expire
)
(global-subword-mode 1) ; Iterate through CamelCase words
(map! :leader
"b q" #'kill-buffer-and-window
"c m" #'justl-exec-recipe-in-dir)
;; speed-type
(use-package! speed-type)
;; company
(after! company
(setq company-idle-delay 0.2
company-minimum-prefix-length 3
;; doesn't show in childframe, but might be useful in terminal
company-show-quick-access 1))
(setq lsp-clients-clangd-args '("-j=3"
"--background-index"
"--clang-tidy"
"--completion-style=detailed"
"--header-insertion=never"
"--header-insertion-decorators=0"))
(after! lsp-clangd (set-lsp-priority! 'clangd 2))
;; pinentry for emacs ssh gpg
(use-package! pinentry
:init (setq epg-pinentry-mode `loopback)
(pinentry-start))
;; pandoc mode
;; use C-c / after (pandoc-mode)
(use-package! pandoc-mode)
;; Wakatime mode
(use-package! wakatime-mode
:config
(global-wakatime-mode))
;; Bind SPC s c to clear evil search
(map! :leader
:desc "Clear recent search result"
"s c" #'evil-ex-nohighlight)
(use-package! redacted)
;; :config
;; (add-hook 'redacted-mode-hook (lambda () (read-only-mode (if redacted-mode 1 -1)))))
;; disable tidy
(add-to-list '+format-on-save-disabled-modes 'web-mode :append)
;; (add-hook 'nim-mode-local-vars-hook #'lsp!)
(use-package! subed
:config
;; This assures evil does not conflict with subed keybinds.
;; https://github.com/haditim/.doom.d
(map! :map (subed-mode subed-srt-mode-map)
:n "M-p" #'subed-backward-subtitle-text
:n "M-n" #'subed-forward-subtitle-text
:leader
:desc "MPV play/pause" "<RET>" #'subed-mpv-toggle-pause))
;; NOTE I use Skim on MacOS and pdf-tools on Linux infrequently. Consider
;; "p d f modeline" from tecosaur's config
(defun open-in-pympress ()
"Open the current buffer (assumed to be a tex file that has the same name as
the compiled PDF version) in pympress."
(interactive)
(start-process "pympress" nil "pympress" (replace-regexp-in-string "\.tex" ".pdf" buffer-file-name)))
(add-hook! 'LaTeX-mode-hook #'hl-todo-mode)
(use-package! ispell
:config
(setq ispell-personal-dictionary (expand-file-name "~/.aspell.en.pws"))
(setq ispell-dictionary "en_CA"))
(use-package! w3m)
;; https://github.com/tarsius/keycast/issues/7
(use-package! keycast
:config
(define-minor-mode keycast-mode
"Show current command and its key binding in the mode line (fix for use with doom-mode-line)."
:global t
(if keycast-mode
(add-hook 'pre-command-hook 'keycast--update t)
(remove-hook 'pre-command-hook 'keycast--update)))
(add-to-list 'global-mode-string '("" keycast-mode-line)))
;; yasnippets
(setq yas-triggers-in-field t)
(use-package! edit-server
:config
(edit-server-start))
(defun assignment-ui-start()
"UI modifications when working on assignments (in Python) with long function
headers"
(interactive)
(which-function-mode +1)
(semantic-mode +1)
(semantic-stickyfunc-mode +1))
(defun assignment-ui-stop()
"Disable \'assignment-ui-start\'"
(interactive)
(which-function-mode -1)
(semantic-mode -1)
(semantic-stickyfunc-mode -1))
(setq magit-revision-show-gravatars '("^Author: " . "^Commit: "))
;; https://arjenwiersma.nl/posts/cleaning-up-lsp-mode/
(defun aw/cleanup-lsp ()
"Remove all the workspace folders from LSP"
(interactive)
(let ((folders (lsp-session-folders (lsp-session))))
(while folders
(lsp-workspace-folders-remove (car folders))
(setq folders (cdr folders)))))
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.

View File

@ -1,195 +0,0 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
(company +childframe) ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
(vertico +icons) ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
tabs ; a tab bar for Emacs
(treemacs +lsp) ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
(spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make
:tools
ansible
;;biblio ; Writes a PhD for you (citation needed)
;;debugger ; FIXME stepping through code, to help you add bugs
direnv
docker
editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
just
lookup ; navigate your code and its documentation
(lsp +peek) ; M-x vscode
magit ; a git porcelain for Emacs
make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;upload ; map local to remote projects via ssh/ftp
:os
(:if IS-MAC macos) ; improve compatibility with macOS
tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
(ess +lsp) ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
json ; At least it ain't XML
(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
(python +lsp +pyright +poetry) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
web ; the tubes
yaml ; JSON, but readable
;;zig ; C, but simpler
:email
;;(mu4e +org +gmail)
(mu4e)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate
(default +bindings +smartparens))

View File

@ -1,7 +0,0 @@
;;; tools/just/config.el -*- lexical-binding: t; -*-
(use-package! just-mode)
(use-package! justl
:config
(map! :n "e" 'justl-exec-recipe))

View File

@ -1,5 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; tools/just/packages.el
(package! just-mode :pin "d7f52eab8fa3828106f80acb1e2176e5877b7191")
(package! justl :pin "141daaa4b0dc07fe25423609dcd14441a9f2613e")

View File

@ -1,72 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; use 'M-x doom/reload'.
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/raxod502/straight.el#the-recipe-format
;(package! another-package
; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;(package! this-package
; :recipe (:host github :repo "username/repo"
; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;(package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;(package! builtin-package :recipe (:nonrecursive t))
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see raxod502/straight.el#279)
;(package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;(package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;(unpin! pinned-package)
;; ...or multiple packages
;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t)
(package! evil-tutor)
(package! focus)
(package! ghq :pin "582bd6daa505d04c7cc06d6c82ed8aee0624bfbe")
(package! speed-type :pin "304cb8cd6c30d07577d7d864fd32858a29a73dba")
(package! pinentry)
(package! redacted)
(package! subed
:recipe (:host github :repo "sachac/subed"
:files ("subed/*.el")))
(package! cook-mode
:recipe (:host github :repo "cooklang/cook-mode"))
(package! ess-view)
(package! ess-view-data)
(package! keycast
:recipe (:host github :repo "tarsius/keycast"
:branch "main"))
(package! pandoc-mode)
(package! wakatime-mode)
(package! w3m)
(package! edit-server)
(package! auto-dark)

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: Relates-to: ...
# key: rel
# --
Relates-to: [${0}]

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# name: checkmark
# uuid:
# key: checkmark
# condition: t
# --
\textcircled{$\checkmark$}

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# name: emoji
# uuid: emoji
# key: emoji
# condition: t
# --
{\Large \texttwemoji{${1:emoji}}}

View File

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# name: "rightarrow"
# uuid:
# key: rarr
# condition: t
# --
\rightarrow

View File

@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: one-to-one
# key: oto
# --
one-to-one

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
old_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))
if [ "${#old_kernels[@]}" -eq 0 ]; then
echo "No old kernels found"
exit 0
fi
if ! dnf remove "${old_kernels[@]}"; then
echo "Failed to remove old kernels"
exit 1
fi
echo "Removed old kernels"
exit 0

View File

@ -1,2 +0,0 @@
credentials
secret

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
### lolcommits hook (begin) ###
LANG="en_CA.UTF-8" && PATH="$PATH:/Users/earne/.rbenv/versions/3.1.2/bin:/opt/homebrew/bin" && if [ ! -d "$GIT_DIR/rebase-merge" ] && [ "$LOLCOMMITS_CAPTURE_DISABLED" != "true" ] && [ "$HOST" = "blahaj.local" ]; then lolcommits --capture ; fi
### lolcommits hook (end) ###
COMMIT_INFO=$(git log -1 HEAD --format=reference)
[ $(uname -s) = "Linux" ] && [ -z $DISPLAY ] || notify-send 'Git commit: ' "$COMMIT_INFO" -u low

View File

@ -1,13 +0,0 @@
#!/bin/sh
# Copyright (c) 2021 Sebastian LaVine <mail@smlavine.com>
# This file is licensed under the MIT license. See LICENSE at
# <https://git.sr.ht/~smlavine/pre-push> for more details.
# A simple git pre-push hook to prevent possibly bad code from being pushed
# Don't allow a push to go through if it is between midnight and 07:00am.
if [ "$(date +%H)" -lt 07 ]; then
printf "%s\n%s\n" \
"Woah there! It's a little late to be writing good code," \
"don't you think? Why don't you try this again in the morning."
exit 1
fi

View File

@ -1,6 +0,0 @@
*~
.DS_Store
Thumbs.db
# https://www.theregister.com/2021/11/18/firefox_cookies_github/
cookies.sqlite

1
gnupg/.gitignore vendored
View File

@ -1 +0,0 @@
*

View File

@ -1,10 +0,0 @@
# after making changes to file, reload the gpg-agent
# gpg-connect-agent reloadagent /bye
default-cache-ttl 86400
max-cache-ttl 86400
# pinentry-program /usr/bin/pinentry-gnome3
# macos
# pinentry-program /opt/homebrew/bin/pinentry-mac
# idk if this needs to be adjusted for macos
allow-emacs-pinentry
allow-loopback-pinentry

View File

@ -1,12 +0,0 @@
[ui]
color = yes
editor = nvim
username = earnest ma <me@earne.link>
[diff]
git = true
[email]
from = earnest ma <me@earne.link>
method = smtp

Binary file not shown.

View File

@ -1,3 +0,0 @@
# networking
config_opts['rpmbuild_networking'] = True
config_opts['use_host_resolv'] = True

View File

@ -1,10 +0,0 @@
# enables the minibar feature
set minibar
# disable inverse text for the minibar
set titlecolor normal,normal
#You can now read files into their own buffer with ctrl-R.
set multibuffer
# disables the shortcut hints
# set nohelp

View File

@ -1,77 +0,0 @@
set showmatch " show matching () {}
set ignorecase " case insensitive
set mouse=v " middle-click paste
set tabstop=4
set softtabstop=4
set expandtab
set shiftwidth=4
set autoindent
set number " current line number
set relativenumber " relative numbering
set wildmode=longest,list
set cc=80
set mouse=a " enable mouse click
set clipboard=unnamedplus " using system clipboard
filetype plugin on
set cursorline " highlight current cursorline
set ttyfast " speed up scrolling
set backupdir=~/.cache/nvim
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin(stdpath('data') . '/plugged')
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'editorconfig/editorconfig-vim'
Plug 'wakatime/vim-wakatime'
call plug#end()
colorscheme dracula
" https://github.com/henrik/vim-reveal-in-finder/blob/master/plugin/reveal_in_finder.vim
function! s:RevealInFinder()
if filereadable(expand("%"))
let l:command = "open -R " . shellescape("%")
elseif getftype(expand("%:p:h")) == "dir"
let l:command = "open " . shellescape("%") . ":p:h"
else
let l:command = "open ."
endif
execute ":silent! !" . l:command
" For terminal Vim not to look messed up.
redraw!
endfunction
command! Reveal call <SID>RevealInFinder()
" Auto close, Ctrl-v to not do
ino " ""<left>
ino ' ''<left>
ino ( ()<left>
ino [ []<left>
ino { {}<left>
ino {<CR> {<CR>}<ESC>O
" no ex mode
nnoremap Q <Nop>

View File

@ -1,60 +0,0 @@
alias usysctl='systemctl --user'
# From https://mastodon.xyz/@CarlCravens/105758509287927276
alias clear='clear; tput cup $LINES 0'
alias camoff='sudo modprobe -r uvcvideo' # sudo rmmod -f uvcvideo
alias camon='sudo modprobe uvcvideo'
alias coderadio='mpv https://coderadio-admin.freecodecamp.org/radio/8010/radio.mp3'
alias clip="xclip -sel clip"
ahbh(){ # I'm not sure if this works
git rev-list --left-right --count \
"$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"..."$(git branch --show-current)"
}
# use fzf to cd into a ghq directory
fghq(){
cd $(ghq root)/$(ghq list | fzf)
}
# use fzf to open a VSCodium project
fcode(){
codium $(ghq root)/$(ghq list | fzf)
}
# use fzf to open a file in $EDITOR or neovim
ffe() {
fname=$(fzf) || return
${EDITOR:-nvim} "$fname"
}
if [ -x "$(command -v "exa")" ]; then
alias ls='exa' # -ag
alias la='exa -l'
alias ll='exa -lahg'
else
echo "exa not installed"
fi
alias pu='git push'
alias st='git st'
foldersize(){
du -sh "$@"
}
e(){
emacsclient -a "emacs" $@
}
# Easy way to create/ connect to a tmux session
tmm(){
if [ -z "$1" ]; then
tmux attach-session -t 0 || tmux
else
tmux attach-session -t "$1" || tmux new-session -t "$1" || tmux
fi
}

View File

@ -1 +0,0 @@
. $HOME/.zprofile

View File

@ -1 +0,0 @@
*.wants

View File

@ -1,12 +0,0 @@
[Unit]
Description=code-server
After=network.target
[Service]
Type=exec
Environment=EXTENSIONS_GALLERY='{ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", "itemUrl": "https://marketplace.visualstudio.com/items", "controlUrl": "", "recommendationsUrl": "" }'
ExecStart=/usr/bin/code-server
Restart=always
[Install]
WantedBy=default.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=Emacs
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon=%i --chdir %h
ExecStop=/usr/bin/emacsclient --server-file=hud --eval "(progn (setq kill-emacs-hook 'nil) (kill-emacs))"
Restart=always
TimeoutStartSec=0
[Install]
WantedBy=default.target

View File

@ -1,7 +0,0 @@
[Unit]
Description=Restic backup service
OnFailure=systemd-notify@%n.service
[Service]
Type=oneshot
ExecStart=/home/earne/.dotfiles/.restic/restic-do backup

View File

@ -1,10 +0,0 @@
[Unit]
Description=Daily restic backup
[Timer]
OnBootSec=6min
OnCalendar=*-*-* 21:00:00
#Persistent=true
[Install]
WantedBy=timers.target

View File

@ -1,6 +0,0 @@
[Unit]
Description=Notify shell about unit failure
[Service]
Type=oneshot
ExecStart=notify-send --urgency=normal '%i failed.' 'See "systemctl --user status %i" and "journalctl --user-unit %i" for details.'

View File

@ -1,9 +0,0 @@
[Unit]
Description=UxPlay
[Service]
ExecStart=/home/earne/ghq/github.com/FDH2/UxPlay/uxplay
[Install]
WantedBy=default.target

View File

@ -1 +0,0 @@
*

View File

@ -1,10 +0,0 @@
{
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items",
"controlUrl": "",
"recommendationsUrl": ""
},
"nameLong": "Visual Studio Code"
}

View File

@ -1,51 +0,0 @@
# If you make changes to this, it's probably a good idea to log out.
[ -f $HOME/.nix-profile/etc/profile.d/nix.sh ] && source \
$HOME/.nix-profile/etc/profile.d/nix.sh
pathadd_head() {
if [ -d "$1" ] && ! echo "$PATH" | grep -q "$1" >/dev/null; then
PATH="$1${PATH:+":$PATH"}"
fi
}
pathadd_tail() {
if [ -d "$1" ] && ! echo "$PATH" | grep -q "$1" >/dev/null; then
PATH="${PATH:+"$PATH:"}$1"
fi
}
export EDITOR=nvim
pathadd_head "$HOME/.local/bin"
pathadd_head '/tmp/bin'
pathadd_head "$HOME/.config/emacs/bin"
if [[ $HOST == "core.envs.net" ]]; then
pathadd_tail '/envs/bin'
pathadd_head "$HOME/public_html/files/bin"
fi
if [[ $HOST == "tycho" ]]; then
pathadd_tail "$HOME/.wakatime"
fi
# go
pathadd_tail "$HOME/go/bin"
# rust
[ -f $HOME/.cargo/env ] && source $HOME/.cargo/env
# nim
pathadd_tail "$HOME/.nimble/bin"
# Preferences
export CALIBRE_USE_SYSTEM_THEME=0
export CALIBRE_USE_DARK_PALETTE=1
# macOS
[ -f /opt/homebrew/bin/brew ] && eval "$(/opt/homebrew/bin/brew shellenv)"
hash rbenv &>/dev/null && eval "$(rbenv init - zsh)"
export LOLCOMMITS_DELAY=2
export PATH

View File

@ -1,153 +0,0 @@
# `.zshrc' is sourced in interactive shells. It should contain
# commands to set up aliases, functions, options, key bindings, etc.
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
autoload -U colors && colors
autoload -Uz promptinit && promptinit
autoload -U compinit && compinit
# Init plugin handling
[ -f $HOME/.local/share/miniplug.zsh ] || curl \
-sL --create-dirs \
https://git.sr.ht/~yerinalexey/miniplug/blob/master/miniplug.zsh \
-o $HOME/.local/share/miniplug.zsh
source "$HOME/.local/share/miniplug.zsh"
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey -s '^L' '^Uclear^M' # clear using alias
autoload edit-command-line; zle -N edit-command-line
bindkey '^k' edit-command-line
# bindkey -s '^f' '^Ufghq^M' # fghq from alias
# History
HISTORY_IGNORE="(ls|cd|pwd|exit|sudo reboot|history|cd -|cd ..)"
HISTFILE="$HOME/.zsh_history"
HISTSIZE=99999
SAVEHIST=90000
setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # Don't add duplicate entries
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show command with history expansion to user before running it
setopt inc_append_history # add commands to HISTFILE in order of execution
setopt share_history # share command history data
setopt hist_find_no_dups # don't display duplicates in reverse search
setopt hist_reduce_blanks # remove superfluous blanks
setopt HIST_IGNORE_SPACE # put a space at the front and you won't record history
setopt interactivecomments # Comments in the interactive shell
setopt auto_continue # Send CONT signal automatically when disowning jobs
# pushd
setopt pushd_ignore_dups
export DIRSTACKSIZE=20
setopt auto_pushd
# Load aliases
source "$HOME/.config/shell_common/aliases.sh"
# zsh-specific aliases
# clear zsh history: Adapted from Novimatrem: https://gitlab.com/Novimatrem/clear-bash-history
alias czh="echo 'Fully clearing history, then exiting...' && cat /dev/null > ${HISTFILE} && history -p && exit"
# Completion
_comp_options+=(globdots) # include hidden files
# reload the zsh session. Changed from OMZ:plugins/zsh_reload
zreload() {
# Use $SHELL if available; remove leading dash if login shell
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
}
# w/ SSH
if [[ "$HOST" == core.envs.net ]]; then
export GPG_TTY=$(tty)
fi
# tycho (which is a laptop)
#if [[ "$HOST" == tycho && -z "$DISPLAY" ]]; then
# export GPG_TTY=$(tty)
#fi
gpgtemp() {
export GPG_TTY=$(tty)
echo "remember to run gpgyeet once done..."
}
# pash configuration
export PASH_KEYID=BF66E5C8A1416E2A857C774CA343F43342EB6E2A
pash() {
case $1 in
g*) # git, not using atm
cd "${PASH_DIR:=${XDG_DATA_HOME:=$HOME/.local/share}/pash}"
shift
git "$@"
;;
sync) # uses rsync, will overwrite to match local
cd "${PASH_DIR:=${XDG_DATA_HOME:=$HOME/.local/share}/pash}"
shift; send_host="$1"; shift
[ -z "$send_host" ] && echo "No destination provided" || \
rsync -ravz --delete . \
"${send_host}:${PASH_DIR:=${XDG_DATA_HOME:=$HOME/.local/share}/pash}" "$@"
;;
*)
command pash "$@"
;;
esac
}
# GPG: invalidate cache
gpgyeet() {
echo RELOADAGENT | gpg-connect-agent
unset GPG_TTY
}
# emacs magit
magit() {
emacs --eval "(progn (magit-status) (delete-other-windows))" "$@"
}
# eye candy: auto onefetch (consider if this is really needed lol)
# https://www.reddit.com/r/unixporn/comments/sxa02o/oc_neofetch_for_git_repositories/
# PLUGINS!
# `miniplug update`
miniplug plugin 'zsh-users/zsh-syntax-highlighting'
miniplug plugin 'hlissner/zsh-autopair'
miniplug theme 'tjquillan/pastel'
miniplug load
export SD_ROOT="$HOME/.dotfiles/.sd"
export SD_CAT=bat
# auto cd must be set later
setopt AUTO_CD
# Hooks
eval "$(direnv hook zsh)"
eval "$(zoxide init zsh)"
if [[ $HOST == "blahaj.local" ]]; then
export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
# -I tells GCC where to look for header files to include
export C_INCLUDE_PATH="${C_INCLUDE_PATH}:/opt/homebrew/include"
export LIBRARY_PATH="${LIBRARY_PATH}:/opt/homebrew/lib"
fi
PATH="/Users/earne/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/earne/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/earne/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/earne/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/earne/perl5"; export PERL_MM_OPT;