From 1dda0006e0fb2f6d50dd87b8c2505dc56f785c3e Mon Sep 17 00:00:00 2001 From: ivaquero Date: Sat, 6 Apr 2024 14:54:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20refactor=20the?= =?UTF-8?q?=20name=20patterns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 82 +++++++++++++++++++++++++++------------------------- README_CN.md | 75 +++++++++++++++++++++++++---------------------- defaults.sh | 50 ++++++++++++++++++-------------- oxidizer.sh | 63 ++++++++++++++++++++-------------------- 4 files changed, 143 insertions(+), 127 deletions(-) diff --git a/README.md b/README.md index 81c5958f..36b8cb49 100755 --- a/README.md +++ b/README.md @@ -121,44 +121,48 @@ Oxidizer is designed to be extensible, you can personalize `OX_PLUGINS` in `cust Of course, you are allowed to write your own plugins, see [Writing A Plugin](https://github.com/ivaquero/oxidizer/blob/master/docs/plugins.md) for details. -The plugins are hosted in [OxPlugins](https://github.com/ivaquero/oxplugins) - -> [OxPlugins-PowerShell](https://github.com/ivaquero/oxplugins-pwsh) has stopped maintenance. - -| Plugin | Linux | macOS | Windows | Autoload? | -| :-----------------------------------------------: | :---: | :---: | :-----: | :-------: | -| [Brew](https://github.com/Homebrew/brew) | ✅ | ✅ | ❌ | ✅ | -| [Scoop](https://github.com/ScoopInstaller/Scoop) | ❌ | ❌ | ✅ | ✅ | -| [Pueue](https://github.com/Nukesor/pueue) | ✅ | ✅ | ✅ | ✅ | -| System | ✅¹ | ✅ | ✅ | ✅ | -| File Utility (backup/import config, etc.) | ✅ | ✅ | ✅ | ✅ | -| [Git](https://git-scm.com/) | ✅ | ✅ | ✅ | | -| [Bitwarden](https://github.com/bitwarden/clients) | 🕒 | 🕒 | 🕒 | | -| [Conan](https://github.com/conan-io/conan) | ✅ | ✅ | ✅ | | -| [Conda](https://github.com/conda/conda) | ✅ | ✅ | ✅ | | -| [Julia](https://github.com/JuliaLang/julia) | ✅ | ✅ | 🚧 | | -| [Jupyter](https://github.com/jupyter/jupyter) | ✅ | ✅ | ✅ | | -| [Node](https://github.com/nodejs/node) | ✅ | ✅ | ✅ | | -| [Rust](https://github.com/rust-lang/rust) | ✅ | ✅ | ✅ | | -| [Espanso](https://github.com/espanso/espanso) | ✅ | ✅ | ✅ | | -| [TeXLive](https://tug.org/texlive/) | ✅ | ✅ | ✅ | | -| [VSCode](https://github.com/microsoft/vscode) | ✅ | ✅ | ✅ | | -| Container² | ✅ | ✅ | ✅ | | -| Formats (conversion) | 🕒 | 🕒 | 🕒 | | -| Network (proxy and mirror) | 🕒 | 🕒 | 🕒 | | -| Weather | 🕒 | 🕒 | 🕒 | | -| Notes (obsidian) | 🕒 | 🕒 | 🕒 | | - -✅: complete functionality -🚧: partial functionality -🕒: basic functionality, needs more features -❌: not exist - -> ¹: Currently, on Linux only provide with Debian-family shortcuts -> -> ²: Only for [Docker](https://docker.com/) and [Podman](https://github.com/containers/podman). - -Oxidizer uses Homebrew or Scoop to manage packages and software programs to bypass the requirement of administrator privilege. +The plugins are hosted in [OxPlugins](https://github.com/ivaquero/oxplugins) [OxPlugins-PowerShell](https://github.com/ivaquero/oxpluginsw) has stopped maintenance. + +| Abbr. | Category | Support | AutoLoad? | +| :------: | :-------------: | :----------------------------: | :-------: | +| `oxpbg` | Better to Have | Git | | +| `oxpom` | OS Shortcuts | macOS | ✓ | +| `oxpod` | OS Shortcuts | Debian-Based Systems | ✓ | +| `oxpor` | OS Shortcuts | RedHat-Based Systems | ✓ | +| `oxpow` | OS Shortcuts | Windows (include winget) | ✓ | +| `oxppb` | Package Manager | Homebrew (macOS & Linux) | ✓ | +| `oxpps` | Package Manager | Scoop (Windows) | ✓ | +| `oxppc` | Package Manager | Conda (Multi-Languages) | | +| `oxppcn` | Package Manager | Conan (C++) | | +| `oxppn` | Package Manager | NPM (JavaScript) | | +| `oxpptl` | Package Manager | tlmgr (TeXLive) | | +| `oxpljl` | Language | Julia | | +| `oxplrb` | Language | Ruby (include gem) | | +| `oxplrs` | Language | Rust (include cargo, rustup) | | +| `oxpsc` | Service | Container (Docker & Podman) | | +| `oxpsp` | Service | Pueue | | +| `oxpcbw` | App CLI | Bitwarden | | +| `oxpces` | App CLI | Espanso | | +| `oxpcjr` | App CLI | Jupyter (notebook, lab, book) | | +| `oxpcvs` | App CLI | VSCode | | +| `oxpuf` | System Utils | File Operation | ✓ | +| `oxpufm` | System Utils | Formats Conversion | | +| `oxpunw` | System Utils | Network Configuration | ✓ | +| `oxptwr` | Terminal Utils | Weather (wttr-based) | | +| `oxptzj` | Terminal Utils | Zellij (macOS & Linux) | | +| `oxpxns` | Extra Utils | Notes Apps (Obsidian & Logseq) | | + +To load a plugin, simply add its abbreviation into the `OX_PLUGINS` array of `~/oxidizer/custom.sh`, like + +```sh +OX_PLUGINS=( + oxpbg + oxpufm + oxplrs +) +``` + +Oxidizer uses `Homebrew` or `Scoop to` manage packages and software programs to bypass the requirement of administrator privilege. ## 3. File Management @@ -206,7 +210,7 @@ The table below lists the information of specific configuration files: | julia | `jlx` | `julia-pkgs.txt` | | julia | `jlp` | `Project.toml` | | julia | `jlm` | `Manifest.toml` | -| jupyter | `jn` | `jupyter_notebook_config.py` | +| jupyter | `jr` | `jupyter_notebook_config.py` | | latex | `tl` | `texlive-pkgs` | | node | `nj` | `.npmrc` | | node | `njx` | `node-pkgs.txt` | diff --git a/README_CN.md b/README_CN.md index 116966bc..032712ad 100644 --- a/README_CN.md +++ b/README_CN.md @@ -111,40 +111,45 @@ Oxidizer 起初主要为非管理员用户设计,用于快速搭建跨平台 > [OxPlugins-PowerShell](https://github.com/ivaquero/oxplugins-pwsh) 已停止维护。 -| 插件 | Linux | macOS | Windows | 自动加载? | -| :-----------------------------------------------: | :---: | :---: | :-----: | :--------: | -| [Brew](https://github.com/Homebrew/brew) | ✅ | ✅ | ❌ | ✅ | -| [Scoop](https://github.com/ScoopInstaller/Scoop) | ❌ | ❌ | ✅ | ✅ | -| [Pueue](https://github.com/Nukesor/pueue) | ✅ | ✅ | ✅ | ✅ | -| System | ✅¹ | ✅ | ✅ | ✅ | -| File Utility | ✅ | ✅ | ✅ | ✅ | -| [Git](https://git-scm.com/) | ✅ | ✅ | ✅ | | -| [Bitwarden](https://github.com/bitwarden/clients) | 🕒 | 🕒 | 🕒 | | -| [Conan](https://github.com/conan-io/conan) | ✅ | ✅ | ✅ | | -| [Conda](https://github.com/conda/conda) | ✅ | ✅ | ✅ | | -| [Julia](https://github.com/JuliaLang/julia) | ✅ | ✅ | 🚧 | | -| [Jupyter](https://github.com/jupyter/jupyter) | ✅ | ✅ | ✅ | | -| [Node](https://github.com/nodejs/node) | ✅ | ✅ | ✅ | | -| [Rust](https://github.com/rust-lang/rust) | ✅ | ✅ | ✅ | | -| [Espanso](https://github.com/espanso/espanso) | ✅ | ✅ | ✅ | | -| [TeXLive](https://tug.org/texlive/) | ✅ | ✅ | ✅ | | -| [VSCode](https://github.com/microsoft/vscode) | ✅ | ✅ | ✅ | | -| Container² | ✅ | ✅ | ✅ | | -| Formats(格式转换) | 🕒 | 🕒 | 🕒 | | -| Network(代理与镜像) | 🕒 | 🕒 | 🕒 | | -| Weather | 🕒 | 🕒 | 🕒 | | -| Notes (Obsidian) | 🕒 | 🕒 | 🕒 | | - -✅:完整功能 -🚧:部分功能 -🕒:基础功能,有待补充 -❌:不存在 - -> ¹:目前在 Linux 只提供 Debian 系的相关快捷操作 -> -> ²: 仅支持 [Docker](https://docker.com/) 和 [Podman](https://github.com/containers/podman). - -Oxidizer 通过 Homebrew 或 Scoop 管理包和软件,以绕过管理员权限的要求。 +| 插件缩写 | 类别 | macOS | 自动加载? | +| :------: | :--------------: | :----------------------------: | :--------: | +| `oxpbg` | 推荐 | Git | | +| `oxpom` | 系统快捷操作 | macOS | ✓ | +| `oxpod` | 系统快捷操作 | Debian-Based Systems | ✓ | +| `oxpor` | 系统快捷操作 | RedHat-Based Systems | ✓ | +| `oxpow` | 系统快捷操作 | Windows (包括 winget) | ✓ | +| `oxppb` | 包管理器 | Homebrew (macOS & Linux) | ✓ | +| `oxpps` | 包管理器 | Scoop (Windows) | ✓ | +| `oxppc` | 包管理器 | Conda (多语言,主要是 Python ) | | +| `oxppcn` | 包管理器 | Conan (C++) | | +| `oxppn` | 包管理器 | NPM (JavaScript) | | +| `oxpptl` | 包管理器 | tlmgr (TeXLive) | | +| `oxpljl` | 编程语言 | Julia | | +| `oxplrb` | 编程语言 | Ruby (包括 gem) | | +| `oxplrs` | 编程语言 | Rust (包括 cargo, rustup) | | +| `oxpsc` | 服务 | Container (Docker & Podman) | | +| `oxpsp` | 服务 | Pueue | | +| `oxpcbw` | 软件的命令行界面 | Bitwarden | | +| `oxpces` | 软件的命令行界面 | Espanso | | +| `oxpcjr` | 软件的命令行界面 | Jupyter (notebook, lab, book) | | +| `oxpcvs` | 软件的命令行界面 | VSCode | | +| `oxpuf` | 系统工具 | 文件操作 | ✓ | +| `oxpufm` | 系统工具 | 格式转换 | | +| `oxpunw` | 系统工具 | 网络配置 | ✓ | +| `oxptwr` | 终端工具 | 天气 (基于 wttr) | | +| `oxptzj` | 终端工具 | Zellij (macOS & Linux) | | +| `oxpxns` | 其他 | 笔记备份 (Obsidian & Logseq) | | + +将对应的缩写放入 `~/oxidizer/custom.sh` 的 `OX_PLUGINS` 即可加载插件 + +````sh +OX_PLUGINS=( + oxpbg + oxpufm + oxplrs +) + +Oxidizer 通过 `Homebrew` 或 `Scoop` 管理包和软件,以绕过管理员权限的要求。 ## 3. 文件管理 @@ -270,7 +275,7 @@ Oxidizer 致力于为各个包管理器提供统一的接口,以减轻敲击 pueued -d # or macOS / Linux bss pu -``` +```` 一些包管理器还有项目管理功能 diff --git a/defaults.sh b/defaults.sh index 1431137e..7ddb0b6e 100644 --- a/defaults.sh +++ b/defaults.sh @@ -19,28 +19,36 @@ export EDITOR_T='vi' # select ox-plugins ########################################################## -# oxpg: ox-git -# oxpc: ox-conda -# oxpbw: ox-bitwarden -# oxpcn: ox-conan -# oxpct: ox-container -# oxpes: ox-espanso -# oxpfm: ox-format -# oxpjl: ox-julia -# oxpjn: ox-jupyter -# oxpnj: ox-nodejs -# oxpns: ox-notes -# oxppu: ox-pueue -# oxprb: ox-ruby -# oxprs: ox-rust -# oxptl: ox-texlive -# oxpvs: ox-vscode -# oxpwr: ox-weather -# oxpzj: ox-zellij +# better have +# - oxpbg: git +# package managers +# - oxppc: conda +# - oxppc: conan (c++) +# - oxppn: npm +# - oxppt: tlmgr (texlive) +# languages +# - oxplj: julia +# - oxplr: ruby (include gem) +# - oxplr: rust (include cargo) +# services +# - oxpsc: container (docker & podman) +# - oxpsp: pueue +# app cli +# - oxpcbw: bitwarden +# - oxpces: espanso +# - oxpcjr: jupyter (notebook, lab, book) +# - oxpcv: vscode +# system utils +# - oxpufm: format conversion +# terminal utils +# - oxptwr: weather +# - oxptzj: zellij +# extra utils +# - oxpxns: notes OX_PLUGINS=( - oxpg - oxpwr + oxpbg + oxpufm ) ########################################################## @@ -122,7 +130,7 @@ upp() { pueue parallel 3 -g up_all pueue add -g up_all 'brew update && brew upgrade' pueue add -g up_all 'conda update --all --yes' - # or use predefined items in pueue_aliase + # or use predefined items in pueue_aliases # pueue add -g up_all 'cup' } diff --git a/oxidizer.sh b/oxidizer.sh index 401bfc50..24cc117f 100644 --- a/oxidizer.sh +++ b/oxidizer.sh @@ -9,33 +9,32 @@ export OXIDIZER=${OXIDIZER:-"${HOME}/oxidizer"} declare -A OX_OXYGEN=( [oxd]=${OXIDIZER}/defaults.sh [oxwz]=${OXIDIZER}/defaults/wezterm.lua - [oxpm]=${OXIDIZER}/plugins/ox-macos.sh - [oxpd]=${OXIDIZER}/plugins/ox-debians.sh - [oxpr]=${OXIDIZER}/plugins/ox-rehats.sh - [oxpw]=${OXIDIZER}/plugins/ox-windows.sh - [oxpb]=${OXIDIZER}/plugins/ox-brew.sh - [oxps]=${OXIDIZER}/plugins/ox-scoop.sh - [oxpg]=${OXIDIZER}/plugins/ox-git.sh - [oxpc]=${OXIDIZER}/plugins/ox-conda.sh - [oxpbw]=${OXIDIZER}/plugins/ox-bitwarden.sh - [oxpcn]=${OXIDIZER}/plugins/ox-conan.sh - [oxpct]=${OXIDIZER}/plugins/ox-container.sh - [oxpes]=${OXIDIZER}/plugins/ox-espanso.sh - [oxpfm]=${OXIDIZER}/plugins/ox-formats.sh - [oxpjl]=${OXIDIZER}/plugins/ox-julia.sh - [oxpjn]=${OXIDIZER}/plugins/ox-jupyter.sh - [oxpnj]=${OXIDIZER}/plugins/ox-node.sh - [oxpns]=${OXIDIZER}/plugins/ox-notes.sh - [oxpnw]=${OXIDIZER}/plugins/ox-network.sh - [oxppd]=${OXIDIZER}/plugins/ox-podman.sh - [oxppu]=${OXIDIZER}/plugins/ox-pueue.sh - [oxprb]=${OXIDIZER}/plugins/ox-ruby.sh - [oxprs]=${OXIDIZER}/plugins/ox-rust.sh - [oxptl]=${OXIDIZER}/plugins/ox-texlive.sh - [oxput]=${OXIDIZER}/plugins/ox-utils.sh - [oxpvs]=${OXIDIZER}/plugins/ox-vscode.sh - [oxpwr]=${OXIDIZER}/plugins/ox-weather.sh - [oxpzj]=${OXIDIZER}/plugins/ox-zellij.sh + [oxpbg]=${OXIDIZER}/plugins/ox-bone-git.sh + [oxpom]=${OXIDIZER}/plugins/ox-os-macos.sh + [oxpod]=${OXIDIZER}/plugins/ox-os-debians.sh + [oxpor]=${OXIDIZER}/plugins/ox-os-rehats.sh + [oxpow]=${OXIDIZER}/plugins/ox-os-windows.sh + [oxppb]=${OXIDIZER}/plugins/ox-pkg-brew.sh + [oxpps]=${OXIDIZER}/plugins/ox-pkg-scoop.sh + [oxppc]=${OXIDIZER}/plugins/ox-pkg-conda.sh + [oxppcn]=${OXIDIZER}/plugins/ox-pkg-conan.sh + [oxppn]=${OXIDIZER}/plugins/ox-pkg-npm.sh + [oxpptl]=${OXIDIZER}/plugins/ox-pkg-texlive.sh + [oxpuf]=${OXIDIZER}/plugins/ox-utils-files.sh + [oxpufm]=${OXIDIZER}/plugins/ox-utils-formats.sh + [oxpunw]=${OXIDIZER}/plugins/ox-utils-network.sh + [oxpljl]=${OXIDIZER}/plugins/ox-lang-julia.sh + [oxplrb]=${OXIDIZER}/plugins/ox-lang-ruby.sh + [oxplrs]=${OXIDIZER}/plugins/ox-lang-rust.sh + [oxpcbw]=${OXIDIZER}/plugins/ox-cli-bitwarden.sh + [oxpces]=${OXIDIZER}/plugins/ox-cli-espanso.sh + [oxpcjr]=${OXIDIZER}/plugins/ox-cli-jupyter.sh + [oxpcvs]=${OXIDIZER}/plugins/ox-cli-vscode.sh + [oxpsc]=${OXIDIZER}/plugins/ox-svc-container.sh + [oxpsp]=${OXIDIZER}/plugins/ox-svc-pueue.sh + [oxptwr]=${OXIDIZER}/plugins/ox-term-weather.sh + [oxptzj]=${OXIDIZER}/plugins/ox-term-zellij.sh + [oxpxns]=${OXIDIZER}/plugins/ox-xtra-notes.sh ) ########################################################## @@ -56,13 +55,13 @@ declare -A OX_OXIDE # load system plugin case $(uname -a) in *Darwin*) - . "${OX_OXYGEN[oxpm]}" + . "${OX_OXYGEN[oxpom]}" ;; *Ubuntu* | *Debian* | *WSL*) - . "${OX_OXYGEN[oxpd]}" + . "${OX_OXYGEN[oxpod]}" ;; *MINGW*) - . "${OX_OXYGEN[oxpw]}" + . "${OX_OXYGEN[oxpow]}" ;; esac @@ -84,10 +83,10 @@ done declare -a OX_CORE_PLUGINS case $(uname -a) in *Darwin* | *Ubuntu* | *Debian* | *WSL*) - OX_CORE_PLUGINS=(oxpb oxput oxpnw) + OX_CORE_PLUGINS=(oxppb oxpuf oxpunw) ;; *MINGW*) - OX_CORE_PLUGINS=(oxps oxput oxpnw) + OX_CORE_PLUGINS=(oxpps oxpuf oxpunw) ;; esac