惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
The Last Watchdog
The Last Watchdog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Secure Thoughts
Hacker News - Newest:
Hacker News - Newest: "LLM"
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
TaoSecurity Blog
TaoSecurity Blog
博客园 - Franky
有赞技术团队
有赞技术团队
Google Online Security Blog
Google Online Security Blog
罗磊的独立博客
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
NISL@THU
NISL@THU
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Commits to openclaw:main
Recent Commits to openclaw:main
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
W
WeLiveSecurity
SecWiki News
SecWiki News
Google DeepMind News
Google DeepMind News
O
OpenAI News
V
V2EX
AI
AI
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
美团技术团队
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 三生石上(FineUI控件)
G
GRAHAM CLULEY
月光博客
月光博客
T
Threatpost
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Vulnerabilities – Threatpost
Last Week in AI
Last Week in AI
爱范儿
爱范儿
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cloudbric
Cloudbric
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
N
News | PayPal Newsroom
Know Your Adversary
Know Your Adversary

夜行人

回家路上 第一期的直播演示项目 震动检测器 正能量 在线参观CodeLab Neverland 发布 CodeLab Adapter 3.3.1 DynamicTable 之 纸糊方向盘 CodeLab DynamicTable: 一个可实施的技术方案 CodeLab Insight 发布 Alpha 版 情人节 Home Assistant 周报 && IoT 周报 (02) Joplin: 关注隐私的 Evernote 开源替代软件 浏览器的未来与 Web 传感器 Home Assistant 周报 && IoT 周报 (01) 百宝箱(01) 论自由 介绍 WebThings Home Assistant 周报 && iot 周报 (00) 百宝箱(00) 毛姆读书心得 传世之作 周末徒步 CodeLab Adapter ❤️ Jupyter/Python 航班 躲雨 夏令营途中 [译]思想--作为一种技术 The future of coding 美国之行 三门问题的程序模拟 从Python转向Pharo https://blog.just4fun.site/post/iot/iot-open-source-projects/ Python异步编程笔记 https://blog.just4fun.site/post/iot/iot-open-source-hardware-community/ 万物积木化开发者社区 CodeLab ❤️ Blender Scratch3技术分析之云变量 API(第7篇) [译]对管道(Pipes)的偏爱 [译]提出正确的问题比得到正确答案更重要 蓝牙设备与Scratch3.0 创建你的第一个Scratch3.0 Extension Scratch3技术分析之项目内部数据(第6篇) Scratch3技术分析之社区 API(第5篇) Scratch3技术分析之User API(第4篇) Scratch3技术分析之项目主页API(第3篇) Scratch3技术分析之静态资源API(第2篇) Scratch3.0、micro:bit与Windows7 https://blog.just4fun.site/post/iot/zerynth-vs-micropython/ 核聚变、方所与半宅空间 可视化编程为何是个糟糕的主意 codelab.club周末聚会 关于codelab.club '下一件大事'是一个房间 Hungry Robot - Eat everything 编程作为一种思考方式 今日简史 史蒂夫·乔布斯传 罗素自选文集 https://blog.just4fun.site/post/edx/tianjin-scratch-ai/ https://blog.just4fun.site/post/edx/richie-cms-openedx/ 徒步武功山 WebUSB与micro:bit 积木化编程与3D场景 夜宿武功山顶 scratch3-adapter接入优必选Alpha系列机器人 https://blog.just4fun.site/post/edx/video-migration-note/ scratch3-adapter重构笔记 https://blog.just4fun.site/post/edx/edx-community-members/ 两种硬件编程风格的比较 使用micro:bit自制PPT翻页笔 柏拉图对话集 scratch3.0 + micro:bit 七月电影放映计划 非营利组织的管理 Screenly--用树莓派让任何屏幕变为可编程的数字标牌 以最佳实践开始你的Django项目 micro:bit与事件驱动 为Scratch3.0设计的插件系统(上篇) OCR应用一例 近两年读过的一些好书 blockly开发之使用python驱动浏览器中的turtle(2) 牛顿新传 文学理论入门 逻辑的引擎 人生的意义 blockly开发之生成并运行js代码(1) blockly开发之hello world(0) micro:bit使用笔记 神器之Termux https://blog.just4fun.site/post/iot/micropython-notes/ Cozmo what is this Scratch的前世今生 下段旅程 我行在远方 爆裂 途中杂记 https://blog.just4fun.site/post/edx/open-edx-startup/ cozmo系列之入门 - 有性格且可编程的机器人 PaperWeekly开发笔记 创业二三事
tmuxinator: 轻松管理复杂tmux会话
种瓜 · 2019-07-09 · via 夜行人

文章目录

前言

近期围绕Scratch3.0和CodeLab Adapter两个项目写代码。

我不大用IDE,日常在shell里工作。下边说说我是怎么开始日常工作的。

Scratch3.0

当我开始Scratch3.0相关的开发工作时,一般要做以下工作

  • 进入scratch-gui工作目录,运行webpack-dev-server --https
  • 进入scratch-vm目录运行yarn watch
  • 进入scratch-vm/src/extensions目录编辑源码
  • 进入scratch-vm-extensions目录,准备提交插件代码

开发中涉及的具体工作,参考创建你的第一个Scratch3.0 Extension

CodeLab Adapter

当我开始CodeLab Adapter相关的开发工作时,一般要做以下工作:

  • 进入codelab_adapter core目录
  • 进入Python虚拟环境
  • 启动消息监控进程
  • 使用vscode打开当前目录
  • 进入GUI(pyqt/guizero/webgui)目录,切换到Python虚拟环境
  • tail日志

有什么不爽

每次准备进入上述两个项目的开发状态,都得鼓足勇气,屏息片刻想想需要打开哪些目录、它们路径各是什么、开几个terminal tab、各自的启动指令是什么… 聚精会神完成这些准备工作,还没进入正式工作,精力就消耗了一半。

虽然上述准备工作的每一步都有自动化的策略,像makefile、fabric、tmux配置文件、alias … 但我一直期待一种简单清晰的方案。

tmuxinator是我的救星。

使用tmuxinator,可以轻松管理复杂tmux会话,为不同的项目定义不同的配置文件,即可一行命令完成所有启动/收尾工作!

当然,前提是你对tmux已经熟悉。如果你对tmux不熟,也许值得花些时间,它是个效率神器。

下边记录一下我的使用方式。 做些简单调整,你就可以做出适合自己工作习惯的配置。

环境

记录下我的本地环境(你不必于此相同):

  • MacOS 13.05
  • tmux 2.7
  • gem 2.7.6

sudo gem install tmuxinator

配置

安装完tmuxinator,需要做些配置。

创建~/.bin, 将completion里与你当前的shell对应的文件下载到~/.bin

bash

将以下内容添加到~/.bashrc

1
2
export EDITOR='vim'
source ~/.bin/tmuxinator.bash

zsh

将以下内容添加到~/.zshrc

1
2
export EDITOR='vim'
source ~/.bin/tmuxinator.zsh

使用

创建项目

1
tmuxinator new YOUR_PROJECT # scratch3/codelab_adapter

创建完成后,将进入默认配置文件里。

我的配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
name: codelab_adapter
root: ~/
windows:
  - editor:
      root: /PATH/TO/codelab_adapter
      layout: tiled # main-vertical # main-vertical
      panes:
        - source venv3.6/bin/activate && code .
        - source venv3.6/bin/activate && codelab-monitor
        - cd /PATH/TO/adapter_qt && source venv3.6/bin/activate && echo "to run it..."
        - cd /PATH/TO/codelab_adapter_UI_guizero && source venv3.6/bin/activate
  - logs: tail -f ~/codelab_adapter/info.log

scratch3

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
name: scratch3
root: ~/
windows:
  - run_server:
      root: /PATH/TO/Scratch3
      layout: tiled # main-vertical # main-vertical
      panes:
        - cd scratch-gui && webpack-dev-server --https
        - cd scratch-vm && yarn watch
  - editor:
      layout: tiled # main-vertical # main-vertical
      panes:
        - cd /PATH/TO/scratch-vm-extensions 
        - cd /PATH/TO/scratch-vm/src/ && code .

来看看运行效果:

完美!

一些常用命令

1
2
3
4
tmuxinator new YOUR_PROJECT
tmuxinator edit YOUR_PROJECT
tmuxinator start YOUR_PROJECT
tmuxinator stop YOUR_PROJECT

退出&重进

当作普通的tmux会话即可。

  • ctrl-b d
  • tmux attach -t xxx