Compare commits
10 Commits
50fd5e9076
...
4d8a809e71
| Author | SHA1 | Date | |
|---|---|---|---|
|
4d8a809e71
|
|||
|
4b8b990417
|
|||
|
7c1031cf20
|
|||
|
1872cd2fc9
|
|||
|
d9e0ad2e88
|
|||
|
eb18384977
|
|||
|
d252282528
|
|||
|
e27d83cf7e
|
|||
|
77509f565a
|
|||
|
1a6fa5c1a3
|
18
dot/.bashrc
18
dot/.bashrc
@@ -48,7 +48,7 @@ if [[ -n $(type -t _comp__split_longopt) ]] && [[ -z $(type -t _split_longopt) ]
|
|||||||
alias _split_longopt="_comp__split_longopt"
|
alias _split_longopt="_comp__split_longopt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for _ in ${HOME}/.bashrc.d/*; do
|
for _ in ${HOME}/.bashrc.d/manager/*; do
|
||||||
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
|
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
|
||||||
source "$_"
|
source "$_"
|
||||||
fi
|
fi
|
||||||
@@ -57,3 +57,19 @@ done
|
|||||||
if [[ -n "$(type -t mise-activate)" ]]; then
|
if [[ -n "$(type -t mise-activate)" ]]; then
|
||||||
mise-activate
|
mise-activate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for _ in ${HOME}/.bashrc.d/*; do
|
||||||
|
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
|
||||||
|
source "$_"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "$(uname)" == "FreeBSD" ]]; then
|
||||||
|
# ls with color
|
||||||
|
alias ls="ls -G"
|
||||||
|
|
||||||
|
# bash-completion need load manually in FreeBSD
|
||||||
|
if [[ -f /usr/local/share/bash-completion/bash_completion.sh ]]; then
|
||||||
|
source /usr/local/share/bash-completion/bash_completion.sh
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ generate-bash-completion() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
||||||
local completion_file="$(realpath -m "${completion_dir}/${file}")"
|
local completion_file="${completion_dir}/${file}"
|
||||||
|
|
||||||
if [[ -d "$completion_dir" && ! -w "$completion_dir" ]]; then
|
if [[ -d "$completion_dir" && ! -w "$completion_dir" ]]; then
|
||||||
echo "ERROR: has no permission to write to directory '${completion_dir}'" >&2
|
echo "ERROR: has no permission to write to directory '${completion_dir}'" >&2
|
||||||
@@ -64,7 +64,7 @@ load-bash-completion() {
|
|||||||
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
||||||
|
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
local completion_file="$(realpath -m "${completion_dir}/${file}")"
|
local completion_file="${completion_dir}/${file}"
|
||||||
|
|
||||||
if [[ ! -e "$completion_file" ]]; then
|
if [[ ! -e "$completion_file" ]]; then
|
||||||
if [[ "$silence" == false ]]; then
|
if [[ "$silence" == false ]]; then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/../function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|
||||||
if [[ -x $(type -p mise) ]]; then
|
if [[ -x $(type -p mise) ]]; then
|
||||||
completion_cmd="mise completion --include-bash-completion-lib bash"
|
|
||||||
generate-bash-completion mise "$completion_cmd"
|
|
||||||
unset completion_cmd
|
|
||||||
|
|
||||||
mise-activate() {
|
mise-activate() {
|
||||||
eval "$(mise activate bash)"
|
eval "$(mise activate bash)"
|
||||||
|
|
||||||
|
local completion_cmd="mise completion --include-bash-completion-lib bash"
|
||||||
|
generate-bash-completion mise "$completion_cmd"
|
||||||
}
|
}
|
||||||
|
|
||||||
mise-deactivate() {
|
mise-deactivate() {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/../function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,10 +1,43 @@
|
|||||||
PROXY_IP="192.168.0.104"
|
proxy_ip="192.168.0.104"
|
||||||
HTTP_PROXY="http://${PROXY_IP}:20172"
|
proxy_http_port="20172"
|
||||||
SOCKS_PROXY="socks5://${PROXY_IP}:20170"
|
# SOCKS_PROXY="socks5://${PROXY_IP}:20170"
|
||||||
|
|
||||||
|
_proxy_config_validate() {
|
||||||
|
if [[ -z "$proxy_ip" && -z "$proxy_http_port" ]]; then
|
||||||
|
echo "error: proxy_ip and proxy_http_port is not set" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ -z "$proxy_ip" ]]; then
|
||||||
|
echo "error: proxy_id is not set"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ -z "$proxy_http_port" ]]; then
|
||||||
|
echo "error: proxy_http_port is not set"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [[ "$proxy_http_port" =~ ^[0-9]+$ ]] || ((proxy_http_port < 1 || proxy_http_port > 65535)); then
|
||||||
|
echo "error: proxy_http_port is invalid: $proxy_http_port" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v nc >/dev/null 2>&1; then
|
||||||
|
if ! nc -z -w2 "$proxy_ip" "$proxy_http_port" 2>/dev/null; then
|
||||||
|
echo "error: proxy $proxy_ip:$proxy_http_port is not reachable" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
set-shell-proxy() {
|
set-shell-proxy() {
|
||||||
export http_proxy="$HTTP_PROXY"
|
_proxy_config_validate || return 1
|
||||||
export https_proxy="$HTTP_PROXY"
|
|
||||||
|
local http_proxy_url="http://${proxy_ip}:${proxy_http_port}"
|
||||||
|
|
||||||
|
export http_proxy="$http_proxy_url"
|
||||||
|
export https_proxy="$http_proxy_url"
|
||||||
}
|
}
|
||||||
|
|
||||||
unset-shell-proxy() {
|
unset-shell-proxy() {
|
||||||
@@ -13,8 +46,10 @@ unset-shell-proxy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set-git-proxy() {
|
set-git-proxy() {
|
||||||
prefix_cmd=""
|
_proxy_config_validate || return 1
|
||||||
flag="--global"
|
|
||||||
|
local prefix_cmd=""
|
||||||
|
local flag="--global"
|
||||||
if [[ "$1" == "-s" ]]; then
|
if [[ "$1" == "-s" ]]; then
|
||||||
prefix_cmd="sudo"
|
prefix_cmd="sudo"
|
||||||
flag="--system"
|
flag="--system"
|
||||||
@@ -22,13 +57,15 @@ set-git-proxy() {
|
|||||||
flag="--local"
|
flag="--local"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$prefix_cmd git config $flag http.proxy $HTTP_PROXY
|
local http_proxy_url="http://${proxy_ip}:${proxy_http_port}"
|
||||||
|
|
||||||
|
$prefix_cmd git config $flag http.proxy $http_proxy_url
|
||||||
$prefix_cmd git config $flag http.sslVerify false
|
$prefix_cmd git config $flag http.sslVerify false
|
||||||
}
|
}
|
||||||
|
|
||||||
unset-git-proxy() {
|
unset-git-proxy() {
|
||||||
prefix_cmd=""
|
local prefix_cmd=""
|
||||||
flag="--global"
|
local flag="--global"
|
||||||
if [[ "$1" == "-s" ]]; then
|
if [[ "$1" == "-s" ]]; then
|
||||||
prefix_cmd="sudo"
|
prefix_cmd="sudo"
|
||||||
flag="--system"
|
flag="--system"
|
||||||
@@ -41,8 +78,12 @@ unset-git-proxy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set-npm-proxy() {
|
set-npm-proxy() {
|
||||||
npm config set proxy $HTTP_PROXY
|
_proxy_config_validate || return 1
|
||||||
npm config set https-proxy $HTTP_PROXY
|
|
||||||
|
local http_proxy_url="http://${proxy_ip}:${proxy_http_port}"
|
||||||
|
|
||||||
|
npm config set proxy $http_proxy_url
|
||||||
|
npm config set https-proxy $http_proxy_url
|
||||||
}
|
}
|
||||||
|
|
||||||
unset-npm-proxy() {
|
unset-npm-proxy() {
|
||||||
|
|||||||
12
dot/.bashrc.d/uv.bash
Normal file
12
dot/.bashrc.d/uv.bash
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
|
unset basedir
|
||||||
|
|
||||||
|
if [[ -x "$(type -p uv)" ]]; then
|
||||||
|
generate-bash-completion uv "uv generate-shell-completion bash"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -x "$(type -p uvx)" ]]; then
|
||||||
|
generate-bash-completion uvx "uvx --generate-shell-completion bash"
|
||||||
|
fi
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
@@ -6,10 +6,9 @@ unset basedir
|
|||||||
export VOLTA_HOME="${HOME}/.volta"
|
export VOLTA_HOME="${HOME}/.volta"
|
||||||
|
|
||||||
if [[ -x $(type -p volta) || -x "${VOLTA_HOME}/bin/volta" ]]; then
|
if [[ -x $(type -p volta) || -x "${VOLTA_HOME}/bin/volta" ]]; then
|
||||||
generate-bash-completion volta "volta completions bash"
|
|
||||||
|
|
||||||
volta-activate() {
|
volta-activate() {
|
||||||
add-to-path "${VOLTA_HOME}/bin"
|
add-to-path "${VOLTA_HOME}/bin"
|
||||||
|
generate-bash-completion volta "volta completions bash"
|
||||||
|
|
||||||
# enable pnpm support
|
# enable pnpm support
|
||||||
# export VOLTA_FEATURE_PNPM=1
|
# export VOLTA_FEATURE_PNPM=1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/bash
|
||||||
|
|
||||||
#xrandr --output HDMI-1 --same-as LVDS-1
|
#xrandr --output HDMI-1 --same-as LVDS-1
|
||||||
|
|
||||||
@@ -38,14 +38,23 @@ fcitx5 -d
|
|||||||
#sudo service shadowsocks.client start
|
#sudo service shadowsocks.client start
|
||||||
# emacs --daemon
|
# emacs --daemon
|
||||||
|
|
||||||
export PATH="~/.local/bin${PATH:+:}$PATH"
|
# shell environment setup
|
||||||
# pnpm
|
export PATH="${HOME}/.local/bin${PATH:+:}$PATH"
|
||||||
export PATH="~/.local/share/pnpm${PATH:+:}$PATH"
|
|
||||||
# pnpm end
|
|
||||||
|
|
||||||
# rust cargo
|
for _ in ${HOME}/.bashrc.d/manager/*; do
|
||||||
export PATH="~/.cargo/bin${PATH:+:}$PATH"
|
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
|
||||||
if [[ -e "$HOME/.cargo/env" ]]; then
|
echo "$_"
|
||||||
. "$HOME/.cargo/env"
|
source "$_"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$(type -t mise-activate)" ]]; then
|
||||||
|
mise-activate
|
||||||
fi
|
fi
|
||||||
# rust cargo end
|
|
||||||
|
for _ in ${HOME}/.bashrc.d/*; do
|
||||||
|
echo "$_"
|
||||||
|
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
|
||||||
|
source "$_"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# Maximum cache size to maintain
|
# Maximum cache size to maintain
|
||||||
max_size = 20.0G
|
max_size = 50.0G
|
||||||
|
|
||||||
# Allow others to run 'ebuild' and share the cache.
|
# Allow others to run 'ebuild' and share the cache.
|
||||||
umask = 002
|
umask = 002
|
||||||
|
|
||||||
|
compiler_check = %compiler% -dumpversion
|
||||||
|
|
||||||
|
cache_dir = /var/cache/ccache
|
||||||
|
# chown distcc:portage /var/cache/ccache
|
||||||
|
# chmod 2775 /var/cache/ccache
|
||||||
@@ -21,9 +21,9 @@ BINPKG_FORMAT="gpkg"
|
|||||||
EMERGE_DEFAULT_OPTS="--buildpkg --buildpkg-exclude \"virtual/* sys-kernel/*-sources */*-bin\" ${EMERGE_DEFAULT_OPTS}"
|
EMERGE_DEFAULT_OPTS="--buildpkg --buildpkg-exclude \"virtual/* sys-kernel/*-sources */*-bin\" ${EMERGE_DEFAULT_OPTS}"
|
||||||
|
|
||||||
# ccache and distcc
|
# ccache and distcc
|
||||||
# FEATURES="distcc ${FEATURES}"
|
FEATURES="distcc ccache ${FEATURES}"
|
||||||
# CCACHE_DIR="/var/cache/ccache"
|
CCACHE_DIR="/var/cache/ccache"
|
||||||
# FEATURES="ccache ${FEATURES}"
|
CCACHE_UMASK="0002"
|
||||||
|
|
||||||
# ABI_X86="32 64"
|
# ABI_X86="32 64"
|
||||||
ALSA_CARDS="hda-intel"
|
ALSA_CARDS="hda-intel"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
app-editors/cursor ~amd64
|
app-editors/cursor ~amd64
|
||||||
app-editors/emacs **
|
app-editors/emacs **
|
||||||
app-editors/vscode ~amd64
|
app-editors/vscode ~amd64
|
||||||
app-emacs/emacs-common ~amd64
|
|
||||||
|
|
||||||
# imput method
|
# imput method
|
||||||
app-i18n/fcitx ~amd64
|
app-i18n/fcitx ~amd64
|
||||||
@@ -15,7 +14,7 @@ app-i18n/librime ~amd64
|
|||||||
# dev-libs/tree-sitter* ~amd64
|
# dev-libs/tree-sitter* ~amd64
|
||||||
|
|
||||||
# audroid studio
|
# audroid studio
|
||||||
dev-util/android-studio::gentoo ~amd64
|
dev-util/android-studio ~amd64
|
||||||
|
|
||||||
# frp
|
# frp
|
||||||
net-vpn/frp ~amd64
|
net-vpn/frp ~amd64
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
app-arch/p7zip unRAR
|
app-arch/7zip unRAR
|
||||||
app-editors/cursor cursor
|
app-editors/cursor cursor
|
||||||
app-editors/vscode Microsoft-vscode
|
app-editors/vscode Microsoft-vscode
|
||||||
app-emulation/virtualbox-bin PUEL
|
app-emulation/virtualbox-bin PUEL
|
||||||
@@ -22,7 +22,7 @@ net-im/wemeet wemeet_license
|
|||||||
net-misc/anydesk AnyDesk-TOS
|
net-misc/anydesk AnyDesk-TOS
|
||||||
net-misc/baidunetdisk BaiduNetDisk
|
net-misc/baidunetdisk BaiduNetDisk
|
||||||
net-misc/teamviewer TeamViewer
|
net-misc/teamviewer TeamViewer
|
||||||
sys-kernel/linux-firmware no-source-code linux-fw-redistributable
|
sys-kernel/linux-firmware linux-fw-redistributable
|
||||||
www-client/google-chrome google-chrome
|
www-client/google-chrome google-chrome
|
||||||
www-client/microsoft-edge microsoft-edge
|
www-client/microsoft-edge microsoft-edge
|
||||||
www-plugins/adobe-flash AdobeFlash-11.x
|
www-plugins/adobe-flash AdobeFlash-11.x
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ x11-terms/rxvt-unicode 256-color blink fading-colors pixbuf unicode3
|
|||||||
#www-servers/uwsgi cgi python
|
#www-servers/uwsgi cgi python
|
||||||
|
|
||||||
# emacs
|
# emacs
|
||||||
app-editors/emacs cairo dynamic-loading gtk gui gzip-el harfbuzz json libxml2 sound source sqlite tree-sitter wide-int
|
app-editors/emacs cairo dynamic-loading -gtk gui gzip-el harfbuzz json libxml2 sound source sqlite tree-sitter wide-int
|
||||||
app-emacs/emacs-common gui
|
app-emacs/emacs-common gui
|
||||||
|
|
||||||
# p7zip
|
# 7zip
|
||||||
app-arch/p7zip rar -wxwidgets
|
app-arch/7zip rar
|
||||||
|
|
||||||
# vim
|
# vim
|
||||||
app-editors/vim lua python
|
app-editors/vim lua python
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user