分享:Charles 的脚本工具盒昨天发布了《30 个方便的 Bash shell 别名》之后,一位读者也向我们分享了他的工具盒,特此向大家推荐:Charles 的脚本。以下内容引自他的项目说明。-- Charles
本文导航◈ 你为什么要安装本项目?09%◈ 内容介绍13%◈ 1. 备份/恢复16%◈ 2. 小工具29%◈ 3. 安装软件79%◈ 4. 配置软件84%◈ 安装指南88%◈ 效果图96%转载自 | https://github.com/the0demiurge/CharlesScripts
 作者 | Charles

昨天发布了《30 个方便的 Bash shell 别名[1]》之后,一位读者也向我们分享了他的工具盒,特此向大家推荐:Charles 的脚本[2]。这个工具盒可以配合作者的博客:《Ubuntu Gnome 酷炫完整指南系列[3]》使用。

他的脚本或许写得不够精妙,也许会存在一些 bug,但是正是这种对工作、生活中的积累进行整理,才是 Linux 生活的乐趣和进取之道。大家喜欢的话,也可以贡献自己的代码和贡献,使之更加完善。

以下内容引自他的项目说明[2]

你为什么要安装本项目?

凡是喜欢折腾的朋友肯定经常会遇到下面几个困扰:

☉ 操作系统被自己搞烂,需要重装,难受!☉ 换了新电脑 / 工作环境,一切常用工具又需要重新部署,麻烦!☉ 许多插件配置起来太复杂了,缺少自动或版自动化的工具☉ 常用的命令就那么几个,还又长又复杂(说的就是你!aptgit

内容介绍

最初因为我经常会因为愚蠢的操作把操作系统搞得崩溃,写下了本项目以便减轻重装系统之痛。后来我写了许多方便的小工具和脚本,把它们整合起来就变成了本项目:

1. 备份/恢复

本项目会将所有资料备份到 $CHARLES_BACKUP 即 ~/.config/CharlesBackup,可以使用网盘或 git 自动上传备份(git备份已经集成在charles-update命令中)

下面是是相关命令介绍:

◈ add-ppa: 添加 ppa 的时候同时备份 ppa 列表,在fish-shell中运行 add-ppa (add-ppa) 可以自动添加列表中全部 ppa◈ inst: 使用 apt 安装软件的时候同时备份软件名,在fish-shell中运行 inst (inst) 可以自动安装列表中全部软件◈ gnome-shell-extensions-backup 和 gnome-shell-extensions-restore: 备份和恢复 Gnome 桌面的插件◈ omf-backup 和 omf-restore: 备份和恢复 oh-my-fish(fish-shell 的包管理器)的插件列表◈ charles-backup: 调用上述部分命令备份各种插件(可以放到 cronjob 里面实现自动备份)◈ charles-update: 更新本项目及相关依赖;自动使用git上传备份

2. 小工具

通知类:

◈ ef、 fifo: ef 相当于一个短时备忘录,可以用来记录笔记,相当于编辑 fifo 命令;输入fifo即可运行之前写入的内容。◈ notify: 提醒你一定时间之后做某事◈ tomato: 简单的蕃茄钟,定时运行 fifo 命令

系统操作:

◈ update: 相当于 pacman -Syyu,更新所有软件◈ apt-unlock: 删除 apt 因为异常退出而没有删掉的文件锁◈ get-path: 获得选定的文件绝对路径,并放到剪贴板内◈ mac-addr-flush: 重置 MAC 地址(重启失效)◈ wallpaper-earthview: 更新桌面壁纸(需要先设置好桌面壁纸位置为 ~/.cache/wallpaper/background-image.jpg

其他:

◈ ssr: ShadowSocksR 的一键安装、配置、使用客户端◈ aria2c-daemon-start: 启动 aria2 的下载服务◈ gh-md-toc: Forked 自 gh-md-toc[4], 为 GitHub 的 Markdown 文件加入目录◈ gojuon: 日语五十音学习小工具◈ ipgw ipgw_py: 命令行版的东北大学校园网登录器

网页相关:

◈ wechat: 打开微信◈ pocket: 打开 Pocket◈ shanbay: 打开扇贝单词

包含在 .bashrc 或 fish-shell config.fish 中的简便操作:

写在CharlesScripts/charles/shell.rc.d中的脚本函数:

◈ backup: 将文件备份(复制一份并添加.bak后缀)◈ clscd 到指定文件夹然后ls◈ dict: 将 dict 查到的单词输出到less内,以免单词解释过长显示不完还要再翻回去看◈ g: 使用git一条龙地执行 git add -Agit diff --cachedgit statusgit commit -m <commit message>git push,并检查 push 是否成功,若失败则提醒你检查一下◈ mcd: 先mkdircd到刚刚创建的文件夹内◈ md5checkmd5check <file> <md5>,用grep检查md5是否一样◈ viz: 使用graphviz编译为指定格式的图片,用法为viz source.dot png

CharlesScripts/charles/installation.d/conf.d/config-fish配置好的命令缩写

◈ ... -> cd ...◈ c -> clear; cd◈ cl -> cd ..;ls◈ eg -> grep -E◈ ftps -> python3 -m http.server 8080: 快速开启一个简易 ftp 服务器◈ gaa -> git add -A◈ gb -> git branch -c◈ gck -> git checkout◈ gcm -> git commit -m◈ gl -> git l: 显示结构化的 git 日志◈ gm -> git merge --no-ff◈ gp -> git push◈ gpl -> git pull◈ gst -> git status◈ histg -> history | grep◈ i -> ipython --no-confirm-exit --no-banner --pprint -i --pylab=auto◈ l -> ls --color=auto◈ la -> ls --almost-all --color=auto◈ le -> ls --almost-all --color=auto|egrep◈ lg -> ls --almost-all --color=auto|grep◈ ll -> ls --almost-all -lh --color=auto◈ n -> xdg-open .◈ o -> xdg-open◈ p -> python◈ pdb -> python -mpowerline.bindings.pdb◈ su -> sudo su◈ u -> update

3. 安装软件

脚本在 CharlesScripts/charles/installation.d/get.d

标 * 的是推荐安装的


  1. get.d/

  2. ├── get-calibre

  3. ├── get-docker

  4. ├──*get-fasd

  5. ├──*get-oh-my-fish

  6. ├──*get-powerline

  7. ├── get-spacemacs

  8. ├── get-spacevim

  9. ├── get-sublime-text-3

  10. ├──*get-thefuck

  11. └── get-xsh

4. 配置软件

脚本在 CharlesScripts/charles/installation.d/conf.d

标 * 的是推荐安装的


  1. conf.d/

  2. ├──*config-bash

  3. ├──*config-fish

  4. ├──*config-git

  5. ├──*config-gnome

  6. ├──*config-powerline-bash

  7. ├── config-powerline-ipython

  8. └──*config-tmux

安装指南

装前必读:

◈ 本项目并未经过大量测试,需要读者有基本的 Linux 问题处理能力◈ 支持的操作系统:Arch Linux 或 Ubuntu Gnome 最新LTS版◈ 依赖项(需要用户自行安装): Nerd Fonts, Google Chrome, curl◈ 可选项:Anaconda, ipython (>=5.0), fortune-zh

逐步安装:

☉ 安装依赖☉ 下载本项目:git clone https://github.com/the0demiurge/CharlesScripts.git ~/.local/share/CharlesScripts☉ cd ~/.local/share/CharlesScripts/charles/installation.d☉ 阅读并运行相关软件安装脚本和配置脚本。

安装脚本(测试中):

bash <(curl -L https://git.io/get-charles)

效果图

按照《Ubuntu Gnome 酷炫完整指南系列[3]》介绍的内容配置后如下图所示。

分享:Charles 的脚本工具盒

分享:Charles 的脚本工具盒

推荐文章

< 左右滑动查看相关文章 >

分享:Charles 的脚本工具盒分享:Charles 的脚本工具盒分享:Charles 的脚本工具盒分享:Charles 的脚本工具盒分享:Charles 的脚本工具盒分享:Charles 的脚本工具盒分享:Charles 的脚本工具盒分享:Charles 的脚本工具盒

点击图片、输入文章 ID 或识别二维码直达


原文链接请访问“原文链接”获得可点击的文内链接、全尺寸原图和相关文章。



相关文章:

  • 2021-04-03
  • 2022-12-23
  • 2021-08-23
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2021-07-12
  • 2021-06-15
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-12-02
相关资源
相似解决方案