From 2462553423d1cfedbbabda69578db7a40049a4ee Mon Sep 17 00:00:00 2001 From: zhkong Date: Mon, 7 Aug 2023 02:13:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0oh-my-zsh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/xiaomi_ax3600-stock.config | 4 ++ data/zsh/.zshrc | 101 ++++++++++++++++++++++++++++++ scripts/prepare.sh | 21 ++++--- scripts/preset-terminal-tools.sh | 24 +++++++ 4 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 data/zsh/.zshrc create mode 100644 scripts/preset-terminal-tools.sh diff --git a/config/xiaomi_ax3600-stock.config b/config/xiaomi_ax3600-stock.config index 560f600..ba303bd 100644 --- a/config/xiaomi_ax3600-stock.config +++ b/config/xiaomi_ax3600-stock.config @@ -225,6 +225,10 @@ CONFIG_PACKAGE_uhttpd-mod-ubus=y CONFIG_PACKAGE_unzip=y CONFIG_PACKAGE_usbutils=y CONFIG_PACKAGE_vlmcsd=y +CONFIG_PACKAGE_zsh=y +CONFIG_PACKAGE_vim=y +CONFIG_PACKAGE_vsftpd=y +CONFIG_PACKAGE_git-http=y # CONFIG_PACKAGE_wireless-regdb is not set # CONFIG_PACKAGE_wpad-basic-mbedtls is not set CONFIG_PACKAGE_zlib=y diff --git a/data/zsh/.zshrc b/data/zsh/.zshrc new file mode 100644 index 0000000..6793a29 --- /dev/null +++ b/data/zsh/.zshrc @@ -0,0 +1,101 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="ys" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git command-not-found extract z docker zsh-syntax-highlighting zsh-autosuggestions zsh-completions) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +autoload -U compinit && compinit diff --git a/scripts/prepare.sh b/scripts/prepare.sh index 07d9172..360e709 100755 --- a/scripts/prepare.sh +++ b/scripts/prepare.sh @@ -1,10 +1,9 @@ ### # @Author: zhkong # @Date: 2023-07-25 17:07:02 - # @LastEditors: zhkong - # @LastEditTime: 2023-08-06 21:08:38 - # @FilePath: /xiaomi-ax3600-openwrt-build/scripts/prepare.sh -# @Description: Do not edit +# @LastEditors: zhkong +# @LastEditTime: 2023-08-07 02:06:04 +# @FilePath: /xiaomi-ax3600-openwrt-build/scripts/prepare.sh ### git clone https://github.com/bitthief/openwrt.git -b qualcommax-6.1-nss --single-branch openwrt --depth 1 @@ -20,11 +19,16 @@ git cherry-pick 10c91d822e ./scripts/feeds install -a # 添加第三方软件包 +## openclash git clone https://github.com/vernesong/OpenClash.git --single-branch --depth 1 package/new/luci-openclash -git clone https://github.com/jerrykuku/luci-theme-argon.git --single-branch --depth 1 package/new/luci-theme-argon +## argon theme +git clone https://github.com/jerrykuku/luci-theme-argon.git --single-branch --depth 1 package/new/luci-theme-argon +## KMS激活 git clone https://github.com/flytosky-f/openwrt-vlmcsd.git --single-branch --depth 1 package/new/vlmcsd git clone https://github.com/ssuperh/luci-app-vlmcsd-new.git --single-branch --depth 1 package/new/luci-app-vlmcsd-new - +## adguardhome +svn export https://github.com/immortalwrt/packages/branches/master/net/adguardhome package/new/adguardhome +## mosdns git clone https://github.com/sbwml/luci-app-mosdns -b v5 package/new/mosdns git clone https://github.com/sbwml/v2ray-geodata package/new/v2ray-geodata @@ -37,7 +41,7 @@ rm -rf feeds/luci/modules/luci-mod-status rm -rf feeds/packages/utils/coremark rm -rf package/emortal/default-settings -svn export https://github.com/immortalwrt/luci/branches/openwrt-23.05/modules/luci-base feeds/luci/modules/luci-base +svn export https://github.com/immortalwrt/luci/branches/openwrt-23.05/modules/luci-base feeds/luci/modules/luci-base svn export https://github.com/immortalwrt/luci/branches/openwrt-23.05/modules/luci-mod-status feeds/luci/modules/luci-mod-status svn export https://github.com/immortalwrt/packages/branches/openwrt-23.05/utils/coremark feeds/packages/utils/coremark svn export https://github.com/immortalwrt/immortalwrt/branches/openwrt-23.05/package/emortal/default-settings package/emortal/default-settings @@ -46,7 +50,8 @@ svn export https://github.com/immortalwrt/immortalwrt/branches/openwrt-23.05/pac # 修复Architecture显示错误问题 # sed -i 's/cpuinfo.cpuinfo || boardinfo.system/boardinfo.system/g' feeds/luci/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js - +# 增加 oh-my-zsh +bash ../scripts/preset-terminal-tools.sh # config file # cp ../config/xiaomi_ax3600-stock.config .config diff --git a/scripts/preset-terminal-tools.sh b/scripts/preset-terminal-tools.sh new file mode 100644 index 0000000..c060ad9 --- /dev/null +++ b/scripts/preset-terminal-tools.sh @@ -0,0 +1,24 @@ +### +# @Author: zhkong +# @Date: 2023-08-07 01:49:18 +# @LastEditors: zhkong +# @LastEditTime: 2023-08-07 01:53:26 +# @FilePath: /xiaomi-ax3600-openwrt-build/scripts/preset-terminal-tools.sh +### + +mkdir -p files/root + +## Install oh-my-zsh +# Clone oh-my-zsh repository +git clone https://github.com/robbyrussell/oh-my-zsh files/root/.oh-my-zsh + +# Install extra plugins +git clone https://github.com/zsh-users/zsh-autosuggestions files/root/.oh-my-zsh/custom/plugins/zsh-autosuggestions +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git files/root/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting +git clone https://github.com/zsh-users/zsh-completions files/root/.oh-my-zsh/custom/plugins/zsh-completions + +# Get .zshrc dotfile +cp ../data/zsh/.zshrc ./files/root/.zshrc + +# Change default shell to zsh +sed -i 's/\/bin\/ash/\/usr\/bin\/zsh/g' package/base-files/files/etc/passwd