Compare commits
No commits in common. "ea774fdd8bc150857e6d259336f797f026d59d3e" and "47b217005839a81f600843d0539608676f69cbbe" have entirely different histories.
ea774fdd8b
...
47b2170058
@ -2,19 +2,15 @@
|
||||
!/.cache/zsh/compcache/.keep
|
||||
!/.cache/zsh/completion/.keep
|
||||
!/.cache/zsh/compzwc/.keep
|
||||
!/.cache/zsh/dots/.keep
|
||||
!/.config/dotfiles/bin/.keep
|
||||
!/.config/dotfiles/gen-gitignore.sh
|
||||
!/.config/dotfiles/gitattributes
|
||||
!/.config/dotfiles/gitignore
|
||||
!/.config/dotfiles/install.sh
|
||||
!/.config/dotfiles/scripts/.keep
|
||||
!/.config/dotfiles/woodpecker.yml
|
||||
!/.config/htop/htoprc.dist
|
||||
!/.config/mc/ini.dist
|
||||
!/.config/htop/htoprc.example
|
||||
!/.config/mc/ini.example
|
||||
!/.config/zsh/_.zsh
|
||||
!/.config/zsh/_wip/enclave.zsh.wip
|
||||
!/.config/zsh/_wip/starship.zsh.sample
|
||||
!/.config/zsh/alias.zsh
|
||||
!/.config/zsh/alias/containers.zsh
|
||||
!/.config/zsh/alias/diff.zsh
|
||||
@ -38,7 +34,6 @@
|
||||
!/.config/zsh/env.zsh
|
||||
!/.config/zsh/env/aux.zsh
|
||||
!/.config/zsh/env/containers.zsh
|
||||
!/.config/zsh/env/gopath.zsh
|
||||
!/.config/zsh/env/history.zsh
|
||||
!/.config/zsh/env/ld.so.zsh
|
||||
!/.config/zsh/env/pager.zsh
|
||||
@ -49,12 +44,14 @@
|
||||
!/.config/zsh/lib/cmdtime.zsh
|
||||
!/.config/zsh/lib/completion.zsh
|
||||
!/.config/zsh/lib/curl.zsh
|
||||
!/.config/zsh/lib/enclave.zsh.wip
|
||||
!/.config/zsh/lib/git.zsh
|
||||
!/.config/zsh/lib/history.zsh
|
||||
!/.config/zsh/lib/prompt.zsh
|
||||
!/.config/zsh/lib/pswalk.zsh
|
||||
!/.config/zsh/lib/say-my.zsh
|
||||
!/.config/zsh/lib/selfservice.zsh
|
||||
!/.config/zsh/lib/starship.zsh.sample
|
||||
!/.config/zsh/lib/term.zsh
|
||||
!/.config/zsh/lib/time.zsh
|
||||
!/.config/zsh/lib/title.zsh
|
||||
|
@ -56,7 +56,7 @@ main() {
|
||||
umask 0077
|
||||
|
||||
if have_cmd git ; then
|
||||
if [ -s "${HOME}/${d_repo}/HEAD" ] ; then
|
||||
if [ -s "${HOME}/${d_repo}/info/refs" ] ; then
|
||||
dot_update
|
||||
else
|
||||
dot_install
|
||||
@ -66,8 +66,6 @@ main() {
|
||||
dot_install_raw
|
||||
fi
|
||||
|
||||
propagate_dist_files
|
||||
|
||||
echo 'installed.' >&2
|
||||
}
|
||||
|
||||
@ -77,7 +75,7 @@ dot_install() {
|
||||
mkdir -p "${GIT_DIR}"
|
||||
git init
|
||||
git branch -M "${gh_br}" || true
|
||||
git_config_init
|
||||
git_config
|
||||
git_update
|
||||
}
|
||||
|
||||
@ -120,7 +118,7 @@ dot_install_raw() {
|
||||
cat < "${HOME}/$f" > "${td_backup}/$f"
|
||||
fi
|
||||
done < "${tf_list}"
|
||||
rm -f "${tf_list}" ; unset tf_list
|
||||
rm -f "${tf_list}"
|
||||
|
||||
tar -C "${td_tree}" -cf . - | tar -C "${HOME}" -xf -
|
||||
rm -rf "${td_tree}"
|
||||
@ -139,7 +137,7 @@ git_env() {
|
||||
export GIT_DIR GIT_WORK_TREE
|
||||
}
|
||||
|
||||
git_config_init() {
|
||||
git_config() {
|
||||
## remote
|
||||
git remote add origin "${u_repo}"
|
||||
git config remote.origin.fetch "+refs/heads/${gh_br}:refs/remotes/origin/${gh_br}"
|
||||
@ -148,23 +146,13 @@ git_config_init() {
|
||||
## repo-specific
|
||||
git config core.worktree "${GIT_WORK_TREE}"
|
||||
git config core.excludesfile "${f_gitignore}"
|
||||
}
|
||||
|
||||
git_config() {
|
||||
## repo-specific
|
||||
git config core.attributesfile .config/dotfiles/gitattributes
|
||||
## migration (remove later)
|
||||
git config --unset gc.auto
|
||||
git config --unset pull.ff
|
||||
## size optimization
|
||||
git config core.compression 9
|
||||
git config pack.compression 9
|
||||
## generic
|
||||
git config gc.auto 0
|
||||
git config pull.ff only
|
||||
git config receive.denyNonFastForwards true
|
||||
}
|
||||
|
||||
git_update() {
|
||||
git_config
|
||||
git remote update -p
|
||||
git pull || git reset --hard "origin/${gh_br}"
|
||||
git gc --aggressive --prune=all --force || git gc || true
|
||||
@ -207,7 +195,7 @@ backup_unconditionally() {
|
||||
mv -f "${HOME}/$f" "${td_backup}/$f"
|
||||
fi
|
||||
done < "${tf_list}"
|
||||
rm -f "${tf_list}" ; unset tf_list
|
||||
rm -f "${tf_list}"
|
||||
|
||||
if find_fast "${td_backup}/" -mindepth 1 ; then
|
||||
echo "backed-up files are here: ${td_backup}/"
|
||||
@ -217,20 +205,4 @@ backup_unconditionally() {
|
||||
fi
|
||||
}
|
||||
|
||||
propagate_dist_files() {
|
||||
tf_list=$(mktemp)
|
||||
sed -En '/^!\/(.+\.dist)$/{s//\1/;p;}' < "${HOME}/${f_gitignore}" > "${tf_list}"
|
||||
|
||||
while read -r f_dist ; do
|
||||
[ -n "${f_dist}" ] || continue
|
||||
[ -f "${f_dist}" ] || continue
|
||||
|
||||
f=${f_dist%.dist}
|
||||
if [ -f "$f" ] ; then continue ; fi
|
||||
|
||||
cp "${f_dist}" "$f"
|
||||
done < "${tf_list}"
|
||||
rm -f "${tf_list}" ; unset tf_list
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Beware! This file is rewritten by htop when settings are changed in the interface.
|
||||
# The parser is also very primitive, and not human-friendly.
|
||||
htop_version=3.3.0
|
||||
htop_version=3.2.1
|
||||
config_reader_min_version=3
|
||||
fields=0 48 17 18 38 39 40 2 46 47 49 1
|
||||
hide_kernel_threads=1
|
||||
@ -28,18 +28,20 @@ show_cpu_frequency=1
|
||||
show_cpu_temperature=1
|
||||
degree_fahrenheit=0
|
||||
update_process_names=0
|
||||
account_guest_in_cpu_meter=1
|
||||
account_guest_in_cpu_meter=0
|
||||
color_scheme=0
|
||||
enable_mouse=1
|
||||
delay=11
|
||||
hide_function_bar=0
|
||||
header_layout=three_30_40_30
|
||||
column_meters_0=Hostname System DateTime Uptime Blank Tasks LoadAverage FileDescriptors
|
||||
column_meter_modes_0=2 2 2 2 2 2 2 2
|
||||
column_meters_1=Memory HugePages Swap Blank AllCPUs2
|
||||
column_meter_modes_1=1 1 1 2 1
|
||||
column_meters_2=DiskIO NetworkIO Battery Blank PressureStallCPUSome PressureStallMemorySome PressureStallMemoryFull PressureStallIOSome PressureStallIOFull
|
||||
column_meter_modes_2=2 2 2 2 2 2 2 2 2
|
||||
header_layout=four_25_25_25_25
|
||||
column_meters_0=Hostname System DateTime Blank LeftCPUs2
|
||||
column_meter_modes_0=2 2 2 2 1
|
||||
column_meters_1=Uptime Tasks LoadAverage Blank RightCPUs2
|
||||
column_meter_modes_1=2 2 2 2 1
|
||||
column_meters_2=Memory Swap PressureStallMemorySome PressureStallMemoryFull
|
||||
column_meter_modes_2=1 1 2 2
|
||||
column_meters_3=DiskIO NetworkIO PressureStallIOSome PressureStallIOFull Blank Battery
|
||||
column_meter_modes_3=2 2 2 2 2 2
|
||||
tree_view=1
|
||||
sort_key=46
|
||||
tree_sort_key=0
|
||||
@ -50,16 +52,16 @@ all_branches_collapsed=0
|
||||
screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command
|
||||
.sort_key=PERCENT_CPU
|
||||
.tree_sort_key=PID
|
||||
.tree_view_always_by_pid=1
|
||||
.tree_view=1
|
||||
.tree_view_always_by_pid=1
|
||||
.sort_direction=-1
|
||||
.tree_sort_direction=1
|
||||
.all_branches_collapsed=0
|
||||
screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command
|
||||
.sort_key=PID
|
||||
.tree_sort_key=PID
|
||||
.tree_view_always_by_pid=1
|
||||
.tree_view=1
|
||||
.tree_view_always_by_pid=1
|
||||
.sort_direction=-1
|
||||
.tree_sort_direction=1
|
||||
.all_branches_collapsed=0
|
@ -1,24 +1,28 @@
|
||||
#!/bin/zsh
|
||||
|
||||
: "${ZDOTDIR:=${HOME}}"
|
||||
|
||||
typeset -gA ZSHU
|
||||
|
||||
ZSHU[t_begin]=${(%):-%D{%s.%6.}}
|
||||
|
||||
ZSHU[d_zdot]="${ZDOTDIR}"
|
||||
ZSHU[d_dotfiles]="${ZDOTDIR}/.config/dotfiles"
|
||||
ZSHU[d_conf]="${ZDOTDIR}/.config/zsh"
|
||||
ZSHU[d_cache]="${ZDOTDIR}/.cache/zsh"
|
||||
ZSHU[d_conf]="${ZDOTDIR}/.config/zsh"
|
||||
|
||||
ZSHU[d_var]="${ZSHU[d_conf]}/var"
|
||||
ZSHU[d_bin]="${ZSHU[d_dotfiles]}/bin"
|
||||
ZSHU[d_scripts]="${ZSHU[d_dotfiles]}/scripts"
|
||||
|
||||
ZSHU[d_bin]="${ZDOTDIR}/.config/dotfiles/bin"
|
||||
ZSHU[d_scripts]="${ZDOTDIR}/.config/dotfiles/scripts"
|
||||
|
||||
## early escape
|
||||
unsetopt global_rcs
|
||||
|
||||
## safety measure:
|
||||
## redirect all following activity within ZDOTDIR to cache
|
||||
export ZDOTDIR="${ZSHU[d_cache]}/dots"
|
||||
## (probably) these files are safe to remove
|
||||
ZDOTDIR="${ZSHU[d_cache]}"
|
||||
rm -f "${ZDOTDIR}/.zshrc" "${ZDOTDIR}/.zlogin"
|
||||
|
||||
## cleanup: start from scratch
|
||||
for i ( a s f d ) ; do unhash -$i -m '*' ; done ; unset i
|
||||
@ -29,24 +33,23 @@ umask 0022
|
||||
zshu_parts=( env opt lib rc alias local )
|
||||
|
||||
for n ( ${zshu_parts} ) ; do
|
||||
[ -s "${ZSHU[d_conf]}/$n.zsh" ] || continue
|
||||
source "${ZSHU[d_conf]}/$n.zsh"
|
||||
done ; unset n
|
||||
f="${ZSHU[d_conf]}/$n.zsh"
|
||||
[ -s "$f" ] && source "$f"
|
||||
done ; unset n f
|
||||
|
||||
for n ( ${zshu_parts} ) ; do
|
||||
[ -d "${ZSHU[d_conf]}/$n" ] || continue
|
||||
for i ( "${ZSHU[d_conf]}/$n"/*.zsh(N.r) ) ; do
|
||||
d="${ZSHU[d_conf]}/$n"
|
||||
[ -d "$d" ] || continue
|
||||
for i ( "$d"/*.zsh(N.r) ) ; do
|
||||
source "$i"
|
||||
done
|
||||
done ; unset i n
|
||||
done ; unset i n d
|
||||
|
||||
unset zshu_parts
|
||||
|
||||
hash -f
|
||||
ZSHU[t_end]=${(%):-%D{%s.%6.}}
|
||||
|
||||
t=${(%):-%D{%s.%6.}}
|
||||
t=$[ t - ZSHU[t_begin] ]
|
||||
unset 'ZSHU[t_begin]'
|
||||
n=${t#*.}
|
||||
ZSHU[t_load]=${t%.*}.${n:0:4}
|
||||
unset n t
|
||||
ZSHU[t_load]=$[ ZSHU[t_end] - ZSHU[t_begin] ]
|
||||
ZSHU[t_load]=${ZSHU[t_load]:0:6}
|
||||
|
||||
unset 'ZSHU[t_begin]' 'ZSHU[t_end]'
|
||||
|
8
.config/zsh/env/aux.zsh
vendored
8
.config/zsh/env/aux.zsh
vendored
@ -1,8 +1,6 @@
|
||||
#!/bin/zsh
|
||||
|
||||
set -a
|
||||
NO_AT_BRIDGE=1
|
||||
QT_ACCESSIBILITY=0
|
||||
export NO_AT_BRIDGE=1
|
||||
export QT_ACCESSIBILITY=0
|
||||
|
||||
MENUCONFIG_COLOR=blackbg
|
||||
set +a
|
||||
export MENUCONFIG_COLOR=blackbg
|
||||
|
21
.config/zsh/env/gopath.zsh
vendored
21
.config/zsh/env/gopath.zsh
vendored
@ -1,21 +0,0 @@
|
||||
#!/bin/zsh
|
||||
|
||||
z-gobin-fixup() {
|
||||
(( ${+commands[go]} )) || return 0
|
||||
local gobin
|
||||
gobin=$(go env GOBIN)
|
||||
if [ -z "${gobin}" ] ; then
|
||||
local gopath
|
||||
gopath=$(go env GOPATH)
|
||||
[ -n "${gopath}" ] || return 1
|
||||
[ -d "${gopath}" ] || return 0
|
||||
gobin="${gopath}/bin"
|
||||
fi
|
||||
[ -d "${gobin}" ] || mkdir "${gobin}" || return 1
|
||||
## already in PATH?
|
||||
[ "${path[(I)${gobin}]}" = 0 ] || return 0
|
||||
path=( "${gobin}" ${path} )
|
||||
hash -f
|
||||
}
|
||||
|
||||
z-gobin-fixup
|
@ -29,12 +29,12 @@ z-git-test() {
|
||||
}
|
||||
|
||||
__z_git_pwd() {
|
||||
unset 'ZSHU_PS[git_ref]' 'ZSHU_PS[git_changes]' 'ZSHU_PS[git_tag]'
|
||||
ZSHU_GIT=()
|
||||
local x
|
||||
|
||||
unset 'ZSHU_PS[git_ref]' 'ZSHU_PS[git_changes]' 'ZSHU_PS[git_tag]' 'ZSHU_GIT[path_root]' 'ZSHU_GIT[path_mid]' 'ZSHU_GIT[path_last]' 'ZSHU_GIT[commit]' 'ZSHU_GIT[detached]' 'ZSHU_GIT[ref]' 'ZSHU_GIT[remote]' 'ZSHU_GIT[tag]' 'ZSHU_GIT[ref_behind]' 'ZSHU_GIT[ref_ahead]' 'ZSHU_GIT[ref_changes]'
|
||||
|
||||
z-git-test || return
|
||||
|
||||
|
||||
local x
|
||||
x=$(__z_git rev-parse --short HEAD 2>/dev/null)
|
||||
[ -n "$x" ] || return
|
||||
ZSHU_GIT[commit]=$x
|
||||
|
@ -4,20 +4,25 @@ typeset -Uga ZSHU_PARENTS_PID
|
||||
typeset -ga ZSHU_PARENTS_NAME
|
||||
|
||||
function {
|
||||
local i c g
|
||||
local i c
|
||||
|
||||
i=${PPID}
|
||||
while : ; do
|
||||
[ -n "$i" ] || break
|
||||
i=$$ ; while : ; do
|
||||
i=$(ps -o ppid= -p $i 2>/dev/null) || :
|
||||
i=${i//[^0-9]}
|
||||
[[ "$i" =~ '^[1-9][0-9]*$' ]] || break
|
||||
## don't deal with PID1
|
||||
[ "$i" = 1 ] && break
|
||||
|
||||
[ "$i" = 1 ] && continue
|
||||
ZSHU_PARENTS_PID+=( $i )
|
||||
read -r i c g <<< $(ps -o 'ppid=,comm=' -p "$i" 2>/dev/null)
|
||||
[ -n "$c" ] && ZSHU_PARENTS_NAME+=( "${c:t}" )
|
||||
done
|
||||
|
||||
typeset -r ZSHU_PARENTS_PID ZSHU_PARENTS_NAME
|
||||
for i ( ${ZSHU_PARENTS_PID} ) ; do
|
||||
c=$(ps -o comm= -p $i 2>/dev/null) || :
|
||||
[ -n "$c" ] || continue
|
||||
ZSHU_PARENTS_NAME+=( "${c:t}" )
|
||||
done
|
||||
|
||||
typeset -r ZSHU_PARENTS_PID
|
||||
typeset -r ZSHU_PARENTS_NAME
|
||||
}
|
||||
|
||||
typeset -gA ZSHU_RUN
|
||||
|
@ -1,17 +1,15 @@
|
||||
#!/bin/zsh
|
||||
|
||||
say_my_name() {
|
||||
set -a
|
||||
GIT_COMMITTER_NAME="$1"
|
||||
GIT_AUTHOR_NAME="$1"
|
||||
DEBFULLNAME="$1"
|
||||
set +a
|
||||
export GIT_COMMITTER_NAME GIT_AUTHOR_NAME DEBFULLNAME
|
||||
}
|
||||
|
||||
say_my_email() {
|
||||
set -a
|
||||
GIT_COMMITTER_EMAIL="$1"
|
||||
GIT_AUTHOR_EMAIL="$1"
|
||||
DEBEMAIL="$1"
|
||||
set +a
|
||||
export GIT_COMMITTER_EMAIL GIT_AUTHOR_EMAIL DEBEMAIL
|
||||
}
|
||||
|
@ -1,31 +1,16 @@
|
||||
#!/bin/zsh
|
||||
|
||||
dotfiles-update() {
|
||||
"${ZSHU[d_dotfiles]}/install.sh" "$@"
|
||||
"${ZSHU[d_zdot]}/.config/dotfiles/install.sh"
|
||||
}
|
||||
|
||||
dotfiles-git() { (
|
||||
cd "${ZSHU[d_zdot]}/"
|
||||
set -a
|
||||
GIT_DIR="${ZSHU[d_dotfiles]}/repo.git"
|
||||
GIT_WORK_TREE="${ZSHU[d_zdot]}"
|
||||
set +a
|
||||
export GIT_DIR="${ZSHU[d_zdot]}/.config/dotfiles/repo.git"
|
||||
export GIT_WORK_TREE="${ZSHU[d_zdot]}"
|
||||
zsh -i
|
||||
) }
|
||||
|
||||
dotfiles-gen-gitignore() {
|
||||
local x='.config/dotfiles/gen-gitignore.sh'
|
||||
[ -x "$x" ] || {
|
||||
echo "${x:t} is somewhere else" >&2
|
||||
return 1
|
||||
}
|
||||
if [ -d .config/dotfiles/repo.git ] ; then
|
||||
echo "NOT going to change dotfiles installation" >&2
|
||||
return 1
|
||||
fi
|
||||
"$x" "$@"
|
||||
}
|
||||
|
||||
z-zwc-gen() {
|
||||
local i
|
||||
for i ( "${ZSHU[d_conf]}"/**/*.zsh(N.r) ) ; do
|
||||
|
@ -23,13 +23,13 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u ${USER} -o pid,user,comm -
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||
zstyle ':completion:*:kill:*' command 'ps -u ${USER} -o pid,%cpu,tty,cputime,cmd'
|
||||
|
||||
autoload -Uz +X compinit && \
|
||||
compinit -i -C -d "${ZSHU[f_compdump]}"
|
||||
|
||||
if autoload -Uz +X bashcompinit ; then
|
||||
bashcompinit && ZSHU[compdump_bash]=1
|
||||
fi
|
||||
|
||||
autoload -Uz +X compinit && \
|
||||
compinit -i -C -d "${ZSHU[f_compdump]}"
|
||||
|
||||
for i ( "${ZSHU[d_conf]}"/completion/*.zsh(N.r) ) ; do
|
||||
source "$i"
|
||||
done ; unset i
|
||||
|
@ -5,5 +5,6 @@ if [ -n "${PAGER}" ] ; then
|
||||
export PAGER
|
||||
READNULLCMD=$(which "${PAGER}" | xargs -r readlink -e)
|
||||
else
|
||||
unset PAGER READNULLCMD NULLCMD
|
||||
unset READNULLCMD
|
||||
unset NULLCMD
|
||||
fi
|
||||
|
@ -78,7 +78,7 @@ function {
|
||||
ZSHU_PS1[1L]="${(j::)line}"
|
||||
}
|
||||
|
||||
z-ps1() {
|
||||
z-ps() {
|
||||
[ -n "$1" ] || {
|
||||
echo "${ZSHU_PS[ps1]}"
|
||||
return
|
||||
@ -95,6 +95,6 @@ z-ps1() {
|
||||
return 1
|
||||
}
|
||||
|
||||
z-ps1 3
|
||||
[ "${ZSHU_RUN[nested]}" = 1 ] && z-ps1 2
|
||||
[ "${ZSHU_RUN[nested1L]}" = 1 ] && z-ps1 1
|
||||
z-ps 3
|
||||
[ "${ZSHU_RUN[nested]}" = 1 ] && z-ps 2
|
||||
[ "${ZSHU_RUN[nested1L]}" = 1 ] && z-ps 1
|
||||
|
@ -1,23 +1,14 @@
|
||||
#!/bin/zsh
|
||||
|
||||
z-orig-term() {
|
||||
function {
|
||||
local -a a
|
||||
local i x
|
||||
|
||||
for i ( ${ZSHU_PARENTS_PID} ) ; do
|
||||
[ -r "/proc/$i/environ" ] || continue
|
||||
x=$(sed -zEn '/^TERM=(.+)$/{s//\1/;p;}' "/proc/$i/environ" 2>/dev/null | tr -d '\0')
|
||||
x=$(sed -zEn '/^TERM=(.+)$/{s//\1/;p;}' "/proc/$i/environ" 2>/dev/null)
|
||||
[ -n "$x" ] || continue
|
||||
a+=( "$x" )
|
||||
done
|
||||
case "$1" in
|
||||
\* | @ )
|
||||
local ORIG_TERM=( $a )
|
||||
declare -p ORIG_TERM
|
||||
;;
|
||||
* )
|
||||
i='-1' ; x="${1:-$i}"
|
||||
echo "${a[$x]}"
|
||||
;;
|
||||
esac
|
||||
export ORIG_TERM="${a[-1]}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user