mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-04-24 21:46:52 +08:00
staged
This commit is contained in:
parent
6c8868a00c
commit
74e440bb70
8
.zshrc2
8
.zshrc2
|
@ -1,6 +1,10 @@
|
||||||
|
# env
|
||||||
export TERM="xterm-256color"
|
export TERM="xterm-256color"
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
export LANG=C.UTF-8
|
export LANG=C.UTF-8
|
||||||
|
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||||
|
export PATH="$PATH:$DOTFILES/scripts"
|
||||||
|
export LESS="-N"
|
||||||
|
|
||||||
# antigen
|
# antigen
|
||||||
if [[ -z "$DFS_NO_WALL" ]]; then
|
if [[ -z "$DFS_NO_WALL" ]]; then
|
||||||
|
@ -75,10 +79,6 @@ antigen theme ${ZSH_THEME:-$TMP_THEME}
|
||||||
antigen apply
|
antigen apply
|
||||||
# end of antigen config
|
# end of antigen config
|
||||||
|
|
||||||
# env
|
|
||||||
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
|
||||||
export PATH=$PATH:$DOTFILES/scripts
|
|
||||||
|
|
||||||
# alias
|
# alias
|
||||||
alias "pls"='sudo $(fc -ln -1)'
|
alias "pls"='sudo $(fc -ln -1)'
|
||||||
alias "se"='sudo -sE'
|
alias "se"='sudo -sE'
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||||
DOTFILES=${DOTFILES:-$( cd "$THIS_DIR/.." && pwd )}
|
source "$THIS_DIR/../tools/common.sh"
|
||||||
source "$DOTFILES/tools/common.sh"
|
|
||||||
|
|
||||||
if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then
|
if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then
|
||||||
fmt_info "usage: dogo <container>"
|
fmt_info "usage: dogo <container>"
|
||||||
|
|
|
@ -4,10 +4,9 @@ set -e
|
||||||
|
|
||||||
set_mirror()
|
set_mirror()
|
||||||
{
|
{
|
||||||
#MIRROR=${1:="mirrors.tuna.tsinghua.edu.cn"}
|
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
|
||||||
#MIRROR=${MIRROR//\//\\\/}
|
MIRROR=${MIRROR//\//\\\/}
|
||||||
#sed -i 's/(archive|security).ubuntu.com/${MIRROR}/g' /etc/apt/sources.list
|
sed -i "s/dl-cdn.alpinelinux.org/$MIRROR/g" /etc/apk/repositories
|
||||||
echo "to-do ..."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apk_add()
|
apk_add()
|
||||||
|
@ -32,7 +31,7 @@ router()
|
||||||
case $1 in
|
case $1 in
|
||||||
apk-add ) apk_add ;;
|
apk-add ) apk_add ;;
|
||||||
set-timezone | set-tz ) set_timezone ;;
|
set-timezone | set-tz ) set_timezone ;;
|
||||||
#set-mirror ) set_mirror $2 ;;
|
set-mirror ) set_mirror $2 ;;
|
||||||
* ) echo unknown command "$1". available: apk-add, set-timezone;;
|
* ) echo unknown command "$1". available: apk-add, set-timezone;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
THIS_DIR_COMMON_SH=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||||
export DOTFILES=$( cd "$THIS_DIR/.." && pwd )
|
export DOTFILES=$( cd "$THIS_DIR_COMMON_SH/.." && pwd )
|
||||||
|
|
||||||
SUDO=''
|
SUDO=''
|
||||||
if (( $EUID != 0 )); then
|
if (( $EUID != 0 )); then
|
||||||
|
@ -107,7 +107,6 @@ ask_for_yN()
|
||||||
read -p "${FMT_YELLOW}$1${FMT_RESET} [yN]: " yn
|
read -p "${FMT_YELLOW}$1${FMT_RESET} [yN]: " yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) return 1;;
|
[Yy]* ) return 1;;
|
||||||
[Nn]* ) return 0;;
|
|
||||||
* ) return 0;;
|
* ) return 0;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -132,24 +131,25 @@ get_os_type() {
|
||||||
get_linux_dist() {
|
get_linux_dist() {
|
||||||
if [ -f /etc/os-release ]; then
|
if [ -f /etc/os-release ]; then
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
ans=$ID
|
ans="$ID"
|
||||||
elif type lsb_release >/dev/null 2>&1; then
|
elif type lsb_release >/dev/null 2>&1; then
|
||||||
ans=$(lsb_release -si)
|
ans="$(lsb_release -si)"
|
||||||
elif [ -f /etc/lsb-release ]; then
|
elif [ -f /etc/lsb-release ]; then
|
||||||
. /etc/lsb-release
|
. /etc/lsb-release
|
||||||
ans=$DISTRIB_ID
|
ans="$DISTRIB_ID"
|
||||||
elif [ -f /etc/debian_version ]; then
|
elif [ -f /etc/debian_version ]; then
|
||||||
ans=Debian
|
ans="Debian"
|
||||||
elif [ -f /etc/SuSe-release ]; then
|
elif [ -f /etc/SuSe-release ]; then
|
||||||
ans=SUSE
|
ans="SUSE"
|
||||||
elif [ -f /etc/redhat-release ]; then
|
elif [ -f /etc/redhat-release ]; then
|
||||||
ans=RedHat
|
ans="RedHat"
|
||||||
else
|
else
|
||||||
ans=unknown
|
ans="unknown"
|
||||||
fi
|
fi
|
||||||
echo $ans | tr '[:upper:]' '[:lower:]'
|
echo $ans | tr '[:upper:]' '[:lower:]'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if bash-ed, else source-d
|
||||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||||
$1 "${@:2}"
|
$1 "${@:2}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -15,6 +15,7 @@ l ~
|
||||||
dfs version
|
dfs version
|
||||||
dfs log 1
|
dfs log 1
|
||||||
l
|
l
|
||||||
|
z
|
||||||
dogo
|
dogo
|
||||||
tools/common.sh get_os_type
|
tools/common.sh get_os_type
|
||||||
tools/common.sh get_linux_dist
|
tools/common.sh get_linux_dist
|
||||||
|
|
|
@ -6,7 +6,7 @@ set_mirror()
|
||||||
{
|
{
|
||||||
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
|
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
|
||||||
MIRROR=${MIRROR//\//\\\/}
|
MIRROR=${MIRROR//\//\\\/}
|
||||||
sed -i 's/(archive|security).ubuntu.com/${MIRROR}/g' /etc/apt/sources.list
|
sed -i "s/(archive|security).ubuntu.com/${MIRROR}/g" /etc/apt/sources.list
|
||||||
}
|
}
|
||||||
|
|
||||||
apt_install()
|
apt_install()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user