Compare commits

...

3 Commits

Author SHA1 Message Date
yosh 7305adfd45 weechat 2023-07-25 14:28:00 -05:00
yosh 8184b44fe4 testing out yash shell 2023-07-25 14:27:43 -05:00
yosh 0607468b86 mimix: update paths 2023-07-25 14:22:51 -05:00
20 changed files with 512 additions and 13 deletions

View File

@ -6,12 +6,12 @@ text/: $TERMINAL -e $VISUAL --
audio/: mpv --player-operation-mode=pseudo-gui --
video/: mpv --player-operation-mode=pseudo-gui --
image/: nsxiv-rifle --
image/x-xcf: gimp --
inode/directory: $TERMINAL -e nnn --
application/pdf: zathura --
epub: zathura --
djvu: zathura --
inode/directory: $TERMINAL -e nnn --
image/x-xcf: gimp --
application/pdf: zathura --
application/epub+zip: zathura --
image/vnd.djvu: zathura --
x-scheme-handler/magnet: $TERMINAL -e aria2c --
application/x-bittorrent: $TERMINAL -e aria2c --

View File

@ -2,7 +2,7 @@ unbind C-b
unbind M-a
set -g prefix M-a
bind M-a send-prefix
set -g default-command bash
set -g default-command yash
set -g base-index 1
set -g pane-base-index 1
set -g aggressive-resize on

View File

@ -207,7 +207,7 @@ libera.local_hostname
libera.usermode
libera.command
libera.command_delay
libera.autojoin
libera.autojoin = "##furry,#voidlinux"
libera.autojoin_dynamic
libera.autorejoin
libera.autorejoin_delay

View File

@ -17,9 +17,9 @@ salt = on
[data]
__passphrase__ = on
libera = "AE8B519A70830A28AF000F811729E7DE78C9908EE909CA2A87102540FA7D7190AC00783FE4047D7769423CCD8D03E6E8E8892C6F9F4E5A769C25F7D7DAD1E78CA67EC29F5089E3B15A6B719459BC21B76A"
abime = "5E4C50640C095EE7A68409A525A8F83B5633B30D663C002B4DFCC773808BB839FD40C20D67D1FD3A0D1CA7163C3C1CA3B805A886C206DDECA46B66CF16BDA18091F7E805EB393D18F50D90305D0CF32BD1"
anthrochat = "5162D3A544594214D028CA8AF8F6FCC7BAD920ECF7B5A8C12BB017BF74DB704CBEB1C9563DAEAACB4A3D97AE7779E59F08406634A7F68F683EF0D4C332"
furnet = "43682D4B700684E555102E26C61B8AEB9C4BAFD273CBF63941B927864F20B69121F333D275CA4F1CBAAB58C865DA2FDA95BAE163BF52B47B3638A43383B747944FC821D801D4474F01"
entropynet = "050E3BE5DFD074F156CCC933518F2DB4056CE80448BCC3476B39ECCF5ADE251BA6A7A3F8750F67200EA58BA1AF26C48B987B19EAE64380816EE10E4427EAF04DF3BBD4D9521FB75823278E21067CFD1278"
espernet = "90976DA6930EE9C224ECF3F99B0F749092EFC9EED62AB4437DA24E4E830EA44BAFD100DA73A8F9F8B3F6BBE9D435E10AB0E639136E0FAE268E266925A10FEC36F1F5F932A508005C5E270A5BCF9C6825828E05DAE94159F937EB4B1368F3B5D38F12F6F68E57E6FC9B"
libera = "752AD9FF47065C63A306995C9108C16849BC1AE82BD3200A67D8915DBBACB62FCECA9C315B6DE4E1C4A6237D94B26C916E084FE2C2B6C21316EED5CC6E47677853B7A9DC52EE2E99607D0D00FA18C372E5"
abime = "6473A5B86E68FF8633BF7DB993F24BC0FAAE4AAF37E6DC025205B3DF11690BADBDCCB460BC1FBFA45377F6941513B812EB1FD47601FB1D13E497ECB6A065CE255353D0EFE869390C933C51E283C266BF55"
anthrochat = "7723B7CE39C359A6195352AAE1BB528ACAE73F3FE070983D17E45A8F5F984F6270B4BFEDD2398C576C2DE1C455BA65B7E9387CB91CEB141DDC46551E0E"
furnet = "52F1AF859488AA3CA28DE5B723B9A880DE9377C14A685CD6B417D4CB1C15D29B984669D669E053BB167BE9F4A7159BB684DF8F1DE82EC05C7640B29B228333B89DB14631637E7EDE07"
entropynet = "4084485B8C3C404C6C5A94E0CCF6BCCB93CC2E74BC00E23FF4F94DCE9C6D7273765B6839CDF9157471715499FBB66C5DD6D0CCCE93B706FE6F70799E651C29DE3045F5F7F2C4BC195C2464A11577E9BBFF"
espernet = "D1040E5D525D767593851E5FCDE92290A23AAF44AB97B3F11D14CF2B19EF13AAD2AF71FE43FD437127C99E69DDC01BA615895914F9AEEFB5553693EB885731028825818E244B361692E3CA371B970720A5094B54C7C0A098B88093B0EE6E312C3A362EEE1818087896"

View File

@ -0,0 +1,29 @@
# Completion script for the "doas" command.
function completion/doas {
typeset OPTIONS ARGOPT
OPTIONS=( #>#
"C:; specify a config file to parse"
"L; clear any persisted authentications, then exit"
"n; non-interactive mode, fail if rule doesn't have nopass"
"s; execute the shell from \$SHELL or /etc/passwd"
"u:; specify the user to execute the command as"
) #<#
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(C)
complete -f
;;
(u)
complete -u
;;
(*)
command -f completion//getoperands
command -f completion//reexecute
;;
esac
}

View File

@ -0,0 +1,346 @@
# (C) 2023 yosh
# Completion script for the xbps suite.
function completion/xbps::parse_help {
typeset IFS line word copt lopt
while IFS="" read -r line; do
# line must start with a blank
[[ "$line" == [[:blank:]]* ]] || continue
if [[ "$line" =~ ^[[:blank:]]{1,5}"-" ]]; then
[[ -n "${copt:-}" ]] && printf '%s\n' "$copt" && copt=""
IFS=" =,"
set -f
set -- $line
set +f
# if $1 is a short option, remove leading dash and shift. trim line.
[[ "$1" == "-"[a-zA-Z0-9] ]] && copt="${1#-}" && shift
# test if long option, will add space if short option exists. trim line.
[[ "$1" =~ ^"--"[a-zA-Z-]+$ ]] && copt="${copt:+$copt }$1" && line="${line#*$1}" && shift
# test opt args
if [[ "$1" == "<"*">" ]]; then copt="${copt/ /: }:" && shift
elif [[ "$1" == "["*"]" ]]; then copt="${copt/ /:: }::" && shift
elif [[ "$1" =~ ^[][,.A-Z]{2,}$ ]]; then copt="${copt/ /: }:" && shift; fi
# trim *anything* before the first instance of 2 spaces or ending chars
# this catches xbps-query's --cat=FILE PKG option and xbps-query --property
# also trim everything before first tab
line="${line#*[] ] }"
line="${line#* }"
# trim leading and trailing whitespace
line="${line#"${line%%[![:blank:]]*}"}"
line="${line%"${line##*[![:blank:]]}"}"
copt="$copt;${line:+ $line}"
elif [[ "$line" =~ ^[[:blank:]]{5,} ]]; then
# this only triggers if it starts with > 5 blanks but there's no --,
# which means it can only be an extension of a prev cmd description
# or a footer note, which can be detected by number of spaces
line="$(IFS=" "; printf ' %s' $line)"
[[ "$copt" == *";" ]] && line=" ${line# }"
[[ "$line" == " "[A-Z]* ]] && [[ "$copt" != *";" ]] && [[ "$copt" != *"." ]] && line=".$line"
copt="${copt% }$line"
fi
done <( "$1" --help 2>&1 )
printf '%s\n' "$copt"
}
function completion/xbps::installed_packages {
xbps-query -s "$1*" | sed 's/^... \([^ ]*\)-[^-]* .*/\1/'
}
function completion/xbps::all_packages {
xbps-query -Rs "$1*" | sed 's/^... \([^ ]*\)-[^-]* .*/\1/'
}
function completion/xbps::set_options {
typeset IFS='
'
OPTIONS=( $(command -f completion/xbps::parse_help "$1") )
}
function completion/xbps::query_words {
for word in "${WORDS[@]}"; do
for arg in "$@"; do
[[ "$word" == "$arg" ]] && return 0
done
done
return 1
}
function completion/xbps-alternatives {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-alternatives
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([Cc]|--config|--rootdir)
complete -P "$PREFIX" -d
;;
(g|--group)
complete -P "$PREFIX" $(xbps-alternatives -l | grep -v '^ ')
;;
(*)
complete $(command -f completion/xbps::installed_packages "$TARGETWORD")
;;
esac
}
function completion/xbps-checkvers {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-checkvers
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([CDr]|--config|--distdir|--rootdir)
complete -P "$PREFIX" -d
;;
(*)
complete -f
esac
}
function completion/xbps-create {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-create
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(*)
complete -d
;;
esac
}
function completion/xbps-dgraph {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-dgraph
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([Cr]|--config|--rootdir)
complete -P "$PREFIX" -d
;;
(c|--graph-config)
complete -P "$PREFIX" -f
;;
(*)
complete $(command -f completion/xbps::all_packages)
;;
esac
}
function completion/xbps-digest {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-digest
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(*)
complete -f
;;
esac
}
function completion/xbps-fetch {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-fetch
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(o)
complete -P "$PREFIX" -f
;;
(*)
;;
esac
}
function completion/xbps-install {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-install
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([Ccr]|--config|--cachedir|--rootdir)
complete -P "$PREFIX" -d
;;
(*)
complete $(command -f completion/xbps::all_packages "$TARGETWORD")
;;
esac
}
function completion/xbps-pkgdb {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-pkgdb
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([Cr]|--config|--rootdir)
complete -P "$PREFIX" -d
;;
(m|--mode)
complete -P "$PREFIX" -D "mark PKGNAME as if it was installed automatically" auto
complete -P "$PREFIX" -D "mark PKGNAME as if it was installed manually" manual
complete -P "$PREFIX" -D "hold PKGNAME. Held packages are not updated" hold
complete -P "$PREFIX" -D "unhold PKGNAME" unhold
complete -P "$PREFIX" -D "make PKGNAME only accept updates from the same repo used for installation" repolock
complete -P "$PREFIX" -D "allow PKGNAME to accept updates from any repo" repounlock
;;
(*)
complete $(command -f completion/xbps::installed_packages "$TARGETWORD")
;;
esac
}
function completion/xbps-query {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-query
command -f completion//parseoptions -e
case $ARGOPT in
("-")
command -f completion//completeoptions
;;
([Ccr]|--config|--cachedir|--rootdir)
complete -P "$PREFIX" -d
;;
(p|--property)
if [ -n "$PREFIX" ]; then
complete -P "$PREFIX" ""
else
PREFIX="${TARGETWORD%"${TARGETWORD##*,}"}"
complete -T -S ',' -P "$PREFIX" -D 'group and file alternatives provided by the package.' alternatives
complete -T -S ',' -P "$PREFIX" -D 'target architecture the package was build for.' architecture
complete -T -S ',' -P "$PREFIX" -D 'returns "yes" if the package was installed automatically.' automatic-install
complete -T -S ',' -P "$PREFIX" -D 'enabled options the package was built with.' build-options
complete -T -S ',' -P "$PREFIX" -D 'changelog URL for the package.' changelog
complete -T -S ',' -P "$PREFIX" -D 'configuration file(s) installed by the package.' conf_files
complete -T -S ',' -P "$PREFIX" -D 'other packages this package conflicts with.' conflicts
complete -T -S ',' -P "$PREFIX" -D 'hash of the package file.' filename-sha256
complete -T -S ',' -P "$PREFIX" -D 'size of the package file.' filename-size
complete -T -S ',' -P "$PREFIX" -D 'returns "yes" if the package is held and will not be updated.' hold
complete -T -S ',' -P "$PREFIX" -D 'home URL of the package project.' homepage
complete -T -S ',' -P "$PREFIX" -D 'date when the package was installed.' install-date
complete -T -S ',' -P "$PREFIX" -D 'post-install message provided by the package.' install-msg
complete -T -S ',' -P "$PREFIX" -D 'script used for installing the package.' install-script
complete -T -S ',' -P "$PREFIX" -D 'total size of files installed by the package.' installed_size
complete -T -S ',' -P "$PREFIX" -D 'license(s) for distributing the package.' license
complete -T -S ',' -P "$PREFIX" -D 'contact of the maintainer of the package.' maintainer
complete -T -S ',' -P "$PREFIX" -D 'hash of the plist package files metadata.' metafile-sha256
complete -T -S ',' -P "$PREFIX" -D 'name of the package.' pkgname
complete -T -S ',' -P "$PREFIX" -D 'version of the package.' pkgver
complete -T -S ',' -P "$PREFIX" -D 'returns "yes" if the package will not be removed automatically on update.' preserve
complete -T -S ',' -P "$PREFIX" -D 'abstract facility provided by the package.' provides
complete -T -S ',' -P "$PREFIX" -D 'post-remove message provided by the package.' remove-msg
complete -T -S ',' -P "$PREFIX" -D 'script used for removing the package.' remove-script
complete -T -S ',' -P "$PREFIX" -D 'other packages that the package replaces.' replaces
complete -T -S ',' -P "$PREFIX" -D 'returns "yes" if the package only accepts updates from original repository.' repolock
complete -T -S ',' -P "$PREFIX" -D 'repository where the package was installed from.' repository
complete -T -S ',' -P "$PREFIX" -D 'previous provided version this package replaces.' reverts
complete -T -S ',' -P "$PREFIX" -D 'other runtime dependency packages for the package.' run_depends
complete -T -S ',' -P "$PREFIX" -D 'shared libraries provided by the package.' shlib-provides
complete -T -S ',' -P "$PREFIX" -D 'shared libraries required by the package.' shlib-requires
complete -T -S ',' -P "$PREFIX" -D 'short description of the package.' short_desc
complete -T -S ',' -P "$PREFIX" -D 'commit hash of package last change from the void-packages repository.' source-revisions
complete -T -S ',' -P "$PREFIX" -D 'installation state of the package.' state
complete -T -S ',' -P "$PREFIX" -D 'list of categories the package is associated with.' tags
fi
;;
(o|--cat)
complete -P "$PREFIX" -f
;;
(*)
if command -f completion/xbps::query_words "-R" "--repository"; then complete $(command -f completion/xbps::all_packages "$TARGETWORD")
else complete $(command -f completion/xbps::installed_packages "$TARGETWORD"); fi
;;
esac
}
function completion/xbps-reconfigure {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-reconfigure
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([Cr]|--config|--rootdir)
complete -P "$PREFIX" -d
;;
(*)
complete $(command -f completion/xbps::installed_packages "$TARGETWORD")
;;
esac
}
function completion/xbps-remove {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-remove
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([Ccr]|--config|--cachedir|--rootdir)
complete -P "$PREFIX" -d
;;
(*)
complete $(command -f completion/xbps::installed_packages "$TARGETWORD")
;;
esac
}
function completion/xbps-rindex {
typeset OPTIONS ARGOPT PREFIX
command -f completion/xbps::set_options xbps-rindex
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([crs]|--clean|--remove-obsoletes|--sign)
complete -P "$PREFIX" -d
;;
([aS]|--add|--sign-pkg)
complete -P "$PREFIX" -A '*.xbps' -df
;;
(--compression)
complete -P "$PREFIX" none gzip bzip2 lz4 xz zstd
;;
(*)
complete -f
;;
esac
}
# the rest will be created when xbps updates to 0.60, since that update will
# have more consistent --help naming schemes.

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1 @@
/home/yosh/.config/yash/completion/xbps

View File

@ -0,0 +1,50 @@
# aliases
# man() { vim -R -c 'filetype plugin on' -c 'set ft=man' -c "Man $*"; }
chtsh() { IFS='+' curl cht.sh/"$*" ; }
# local
alias usv="SVDIR=${HOME}/.local/service sv"
# convenience
alias view='vim -R'
alias ls='lsd'
alias xdt='xdotool'
alias tearfree='xrandr --output HDMI-A-0 --set TearFree'
alias ts="stranslate"
alias ed="ed -p '* '"
alias diff='diff --color -u'
alias dotfiles='/usr/bin/git --git-dir=$HOME/.local/dotfiles --work-tree=$HOME'
# XDG aliases
alias startx='startx "$XDG_CONFIG_HOME/X11/xinitrc"'
# Prompt and nnn
_c=("\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]" "\[\]")
if [ "${NNNLVL:-0}" -ge 1 ]; then
alias nnn="echo don\'t nest nnn!"
export nnnsel="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection"
_prompt_flags="${_prompt_flags:-} ${_c[10]}nnn"
fi
YASH_PS1="${_c[16]}[${_c[14]}"'$USER'"${_c[16]}@${_c[11]}"'$(uname -n)'"${_c[16]}]${_prompt_flags:-}${_c[16]} ${_c[9]}*${_c[16]} ${_c[7]}"'${PWD/#~/\~}'"
${_c[10]}└─────${_c[17]} "
YASH_PS1S=''
YASH_PS1P='\fkt.'
PS1='[$USER@$(uname -n)] /${PWD##*/} $ '
PS1S="$YASH_PS1S"
PS1P="$YASH_PS1P"
unset _c
unset _prompt_flags
set -o emacs
set -o le-predict
# keybinds {{{
bindkey -e '\^L' clear-and-redraw-all
bindkey -a '\^L' clear-and-redraw-all
bindkey -v '\^L' clear-and-redraw-all
# }}}
# vim: ft=sh

62
.yash_profile Normal file
View File

@ -0,0 +1,62 @@
# load global profile
. /etc/profile
# xdg yash loadpath
export YASH_LOADPATH="$XDG_CONFIG_HOME/yash:$YASH_LOADPATH"
export HISTFILE="$XDG_CONFIG_HOME/yash/history"
# xdg support shit {{{
export INPUTRC="$XDG_CONFIG_HOME/inputrc"
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc"
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
export VIMINIT="set nocp | source $XDG_CONFIG_HOME/vim/vimrc"
export WINEPREFIX="$XDG_DATA_HOME/wine"
export PASSAGE_DIR="$XDG_DATA_HOME/passage/store"
export PASSAGE_IDENTITIES_FILE="$XDG_DATA_HOME/passage/identities"
export PENTADACTYL_INIT="source $XDG_CONFIG_HOME/pentadactyl/pentadactylrc"
export PENTADACTYL_RUINTIME="$XDG_CONFIG_HOME/pentadactyl"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export SRB2WADDIR="$XDG_DATA_HOME/srb2kart/wads"
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonstartup.py"
# }}}
# other config {{{
export PATH="$HOME/.local/bin:$HOME/.local/scripts:$PATH"
export MANPATH="$XDG_DATA_HOME/man:"
export EDITOR="vim"
export VISUAL="vim"
export QT_STYLE_OVERRIDE=kvantum
# }}}
# program options {{{
# misc {{{
export JAVA_HOME="/usr/lib/jvm/openjdk17"
export LESS='-Ri'
# }}}
# fzf {{{
export FZF_DEFAULT_COMMAND="fd -t f --strip-cwd-prefix"
export FZF_DEFAULT_OPTS='
--color "fg:7,bg:-1,hl:12,fg+:11,bg+:0,hl+:13,info:9,border:0,prompt:4,pointer:10,marker:2,spinner:13,header:7"
--border -e
--bind ctrl-space:print-query+abort
'
# }}}
# nnn {{{
export NNN_OPTS="aAeQ"
export NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$"
export NNN_COLORS='#0d0d0d0d0d0d0d0d'
BLK="0B" CHR="0B" DIR="0d" EXE="0a" REG="07" HARDLINK="0e" SYMLINK="0e" MISSING="08" ORPHAN="09" FIFO="03" SOCK="0B" OTHER="06"
export NNN_FCOLORS="$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$OTHER"
_nc='c:-!magick convert "$nnn" png:- | xclip -sel clipboard -t image/png*'
_nm='h:-!hx "$nnn"*;o:-fzopen;d:dragdrop;p:preview-tui'
export NNN_PLUG="$_nc;$_nm"
# }}}
# }}}
# vim: ft=sh