Skip to content

Commit

Permalink
refactor: ♻️ refactor the name patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaquero committed Apr 6, 2024
1 parent 8672b8b commit 1dda000
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 127 deletions.
82 changes: 43 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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` |
Expand Down
75 changes: 40 additions & 35 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. 文件管理

Expand Down Expand Up @@ -270,7 +275,7 @@ Oxidizer 致力于为各个包管理器提供统一的接口,以减轻敲击
pueued -d
# or macOS / Linux
bss pu
```
````
一些包管理器还有项目管理功能
Expand Down
50 changes: 29 additions & 21 deletions defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

##########################################################
Expand Down Expand Up @@ -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'
}

Expand Down
63 changes: 31 additions & 32 deletions oxidizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

##########################################################
Expand All @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 1dda000

Please sign in to comment.