{"id":23545402,"url":"https://github.com/MrSloth-dev/Zmux","last_synced_at":"2025-08-29T04:33:47.142Z","repository":{"id":268072006,"uuid":"903230820","full_name":"MrSloth-dev/Zmux","owner":"MrSloth-dev","description":"A script for creating and managing sessions in Tmux","archived":false,"fork":false,"pushed_at":"2025-03-25T15:56:54.000Z","size":351,"stargazers_count":29,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T20:56:21.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrSloth-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-14T03:57:33.000Z","updated_at":"2025-03-30T14:22:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"652598e8-e84e-4b6c-81f4-2e327791b6d8","html_url":"https://github.com/MrSloth-dev/Zmux","commit_stats":null,"previous_names":["mrsloth-dev/ezmux","mrsloth-dev/zmux"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MrSloth-dev/Zmux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSloth-dev%2FZmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSloth-dev%2FZmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSloth-dev%2FZmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSloth-dev%2FZmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrSloth-dev","download_url":"https://codeload.github.com/MrSloth-dev/Zmux/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrSloth-dev%2FZmux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272628249,"owners_count":24966881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-26T08:17:04.524Z","updated_at":"2025-08-29T04:33:47.118Z","avatar_url":"https://github.com/MrSloth-dev.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# ⚡⚙️ Zmux-Sessionizer ⚡⚙️\n\nZmux is a bash script designed to make, managing and creating Tmux sessions a breeze.\n\nWhether you're juggling multiple projects or just need a quick way to organize your workflow, Zmux has got you covered!\n\n\n![with splits](assets/preview2.png)\n![without splits](assets/preview.png)\n\n\n## Instalation 📥\n\n### Step 1: Download Zmux\nChoose a directory where you want to install Zmux (e.g., `~/.local/bin`, `~/bin`, or any directory in your `$PATH`).\n``` bash\n# Example: Install to ~/.local/bin\nmkdir -p ~/.local/bin\ncurl -o ~/.local/bin/zmux https://raw.githubusercontent.com/MrSloth-dev/eZmux/main/zmux\nchmod +x ~/.local/bin/zmux\n```\n\n### Step 2: Add to $PATH\nEnsure the installation directory is in your `$PATH`. Add the following line to your shell configuration file (`~/.bashrc`, `~/.zshrc`, etc.):\n\n``` bash\nexport PATH=$PATH:~/.local/bin  # Replace with your chosen directory\n```\nThen reload your shell:\n```bash\nsource ~/.zshrc  # or ~/.bashrc\n```\n### Step 3: Verify Instalation\nCheck if Zmux is installed correctly\n```bash\nzmux -v\n```\n\n## Dependencies ⚙️\n\n- `tmux` version greater or equal to `v3.3`.\n- `yq` version greater or equal to `v4.44.6`. This tool allows the configuration parsing.\n- `fzf` This tool allows quick and interactive listing of all pre-configured and opened sessions.\n- `yamllint` This tool check if configuration files are well formatted.\n\n## Usage 🛠️\n\nZmux is designed to be simple and intuitive. You can use it in several ways:\n\n### List and Select Sessions\n\nRun zmux without any arguments to open an interactive fzf window. This lists all active and pre-configured sessions.\n\n![img](assets/preview.png)\n\nPress Ctrl-t to toggle the preview window, which shows detailed information about the selected session, including:\n\n - Session status (active/inactive).\n\n - Configured windows and panes.\n\n - Layouts and commands for each pane.\n\n### Open or Create a Specific Session\n\nRun `zmux \u003csession-name\u003e` to open or create a specific session. If the session does not exist, Zmux will prompt you to create it.\n - If the session is pre-configured in your YAML files, Zmux will create the session with the specified windows, panes, and commands.\n\n - If the session does not exist, Zmux will create a new session with the given name.\n\n### Export Current Session Configuration\n\nUse the -e or --export flag to export the current session configuration to a YAML file. This is useful for saving session setups for future use.\n\n - Zmux will prompt you to select a configuration file or create a new one.\n\n - The exported configuration will include:\n\n  - Root directory.\n\n  - Windows and their respective panes.\n\n  - Commands for each pane.\n\n- Note: The export of panes in split is currently not implemented.\n\n### Kill Session or Server\n\nUse the `-k \u003csession-name\u003e` or --kill flag to kill the selected session. To kill the Tmux server and close all sessions use `-k all`\n\n### Check Configuration Files\n\nUse the `-c` or `--check` flag to validate your YAML configuration files with `yamllint`.\n - This ensures your configuration files are well-formatted and free of errors.\n\n### Print Help\n\nUse the `-h` or `--help` flag to display the help message.\n\n### Using Split (v0.4.0+)\n\nYou can now configure splits (panes) within windows in your session configuration. Each window can have multiple panes with customizable layouts and commands.\n\n### Example Configuration\n\n``` yaml\nsessions:\n  project_a:\n    root: ~/Projects/ProjectA/\n    windows:\n      - name: Editor\n        layout: tiled  # Supported layouts: tiled, even-horizontal, even-vertical\n        panes:\n          - command: nvim .\n          - command: htop\n      - name: Server\n        command: npm run dev\n```\n### Supported Layouts\n - `tiled` : Panes are arranged in a grid.\n - `even-horizontal `: Panel are arranged horizontally with equal width.\n - `even-vertical `: Panel are arranged horizontally with equal height.\n - `main-horizontal` : Panel are arranged horizontally with equal height but the first index, this will occupy half of the screen.\n - `main-vertical` : Panel are arranged horizontally with equal width but the first index, this will occupy half of the screen.\n\n\n## Configuration ⚙️\n\nAll configurations will be sourced in `YAML` format under `~/.config/zmux/` directory.\n\nYou can have multiple sessions pre-configured in each file:\n```\n~/.config/zmux/\n  ├── work.yaml      # Work-related sessions\n  ├── personal.yaml  # Personal project sessions\n  ├── dev.yaml       # Development environment sessions\n  └── server.yaml    # Server management sessions\n```\n\nExample session:\n\n``` yaml\nsessions:\n  project_a:\n    root: ~/Projects/ProjectA/\n    windows:\n      - name: Editor\n        layout: tiled\n        panes:\n          - command: nvim .\n          - command: htop\n      - name: Server\n        command: npm run dev\n```\n### Key Fields 🔑\n- root: Root directory for the session.\n\n- windows: List of windows.\n\n  - name: Window name.\n\n  - command: Command to run in the window (or pane).\n\n  - layout: (Optional) Layout for splits. Supported: tiled, even-horizontal, even-vertical. (v0.4.0+)\n\n  - panes: (Optional) List of panes for splits. Each pane can have a command. (v0.4.0+)\n\n- Note: Due to how tmux commands works, I suggest to not put dots '.' in the name of windows and panes, because it leads to undefined behaviour that (currently) I cannot fix.\n\n## Roadmap | TODO 🗺️\n- [x] Create Session with `zmux \u003csession_name\u003e`\n  - [x] Assign root directory\n  - [x] Create Normal Windows and rename them\n  - [x] Create Windows with different Panes\n  - [x] Send Commands to each pane\n- [x] `zmux` without args list all available sessions opened and in the configuration file\n  - [x] fzf\n- [x] Export the current session into a YAML file for future usage\n  - [ ] Export working with splits!\n- [x] Use multiple files instead of only `config.yaml`\n- [x] Configuration Checker\n- [x] Preview windows in fzf list\n- [x] Splits!\n  - [x] Different Layouts!\n- [x] CI and testing to make sure it doesn't break anything\n- [ ] Sugestions are welcome!\n\n## Changelog 📜\n\n### [0.4.1] - 2024-03-25\n\n#### Added\n- Error Handling: Created a default config because of configuration checks [#4](https://github.com/MrSloth-dev/Zmux/issues/4)\n\n#### Changed\n- Prevented some helper functions to be passed for subshells. [#5](https://github.com/MrSloth-dev/Zmux/issues/5)\n\n#### Bugfix\n- Fixed Typos.\n\n### [0.4.0] - 2024-01-31\n\n#### Added\n- Splits Support: Now you can configure splits (panes) within windows in your session configuration.\n- Improved Preview in `fzf`: The preview window now shows detailed information about splits.\n- Session Kill: Now you can kill a specific session with `zmux -k \u003csession-name\u003e` or kill the server `zmux -k all`\n\n#### Changed\n- Configuration Format: The `windows` section now supports a `panes` field for defining splits.\n- Error Handling: Improved error messages for invalid split configurations.\n\n#### Bugfix\n- Fixed an issue where the `root` directory was not being correctly set for panes.\n- Fixed a bug where the `fzf` preview window would not display pane information correctly.\n- Fixed an issue when export into a new file the `sessions:` header was missing\n\n\n### [0.3.2] - 2025-01-17\n\n### Added\n\n- Now you can check your configuration files with `zmux --check` or `zmux -c`!\n- `-v` flag for checking the version\n- Testing with `bats` and CI.\n\n### Bugfix\n\n- Correct the file list when creating new file through export, now also follows symbolic links.\n\n\n### [0.3.1] - 2025-01-16\n\n### Added\n\n- Added preconfigured sessions check for duplicates. Now duplicates are forbidden.\n- `-v` flag for checking the version\n\n### Changed\n\n- Changed the way that export works, now creates (correctly) a .yaml file if there isn't one or appends if the user want to group configurations.\n\n### Bugfix\n\n- Sometimes the yaml generated text was badly formatted.\n\n\n### [0.3] - 2025-01-03\n\n### Added\n\n- Added support for multiple configuration files, now you can do it like this:\n- Added window Preview when seeing in `fzf list` , can press `ctrl-t` to toggle preview-window.\n\n\n### [0.2] - 2024-12-29\n \n### Added\n   \n- Now you can see help with `-h` or `--help`\n- Easier kill server with `-k` or `--kill` flag.\n- Now you can export configuration of current session using `-e` or `--export` flag.\n - Note: The command will be always empty. It still exist to easen the completion of the configuration. Still finding a way to implement this. \n- Added creating new sessions if the user inputs a non-existant name (still need to export if want to save)\n- If Config file isn't found, create an empty one.\n\n### Bugfix\n- When there wasn't a tmux server, `zmux` didn't work.\n- Now `session_name` can only have alphanumeric, underscore and hyphen.\n- If there wasn't any sessions in config file `zmuz` didn't work.\n\n\n### [0.1.1] - 2024-12-22\n\n### Bugfix\n\n- Fixed yq parse because I was using an older version. Now it requires v4.44.6.\n- Fixed error when user inserted an non existent and not configured session name.\n- Root folder wasn't being set correctly.\n\n\n### [0.1] - 2024-12-14\n \n### Added\n   \n- This is the first Version.\n- List all avaiable sessions trough `fzf`\n- It fetch the preconfigured sessions in '~/.config/zmux/config.yaml'\n- When Selected, it create/opens the session.\n\n## License 📄\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrSloth-dev%2FZmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMrSloth-dev%2FZmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrSloth-dev%2FZmux/lists"}