Skip to content

Commit

Permalink
Merge pull request #34 from ethagnawl/feat-introduce-attached-config-…
Browse files Browse the repository at this point in the history
…option

Feature - Introduce "attached" config option
  • Loading branch information
ethagnawl authored Mar 22, 2024
2 parents 429599b + a831b3d commit 829f7ce
Show file tree
Hide file tree
Showing 5 changed files with 234 additions and 46 deletions.
59 changes: 54 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rmuxinator"
version = "1.0.0"
version = "1.1.0"
authors = ["Peter Doherty <[email protected]>"]
edition = "2018"
description = "tmux project configuration utility"
Expand All @@ -10,8 +10,9 @@ keywords = ["tmux", "productivity"]

[dependencies]
clap = "2.33"
toml = "0.4"
mockall = "0.10"
serde = { version = "1.0", features = ["derive"] }
toml = "0.4"

[dev-dependencies]
assert_cmd = "1"
Expand Down
1 change: 1 addition & 0 deletions Example.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
attached = true
layout = "main-horizontal"
name = "example"
pane_name_user_option = "custom_pane_title"
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Optional attributes will be noted below.
- `windows` (array; see dedicated entry)

###### Optional
- attached (bool; defaults to `true`; whether or not to attach to newly created tmux session)
- `hooks` (array; see dedicated entry)
- `layout` (string; preset tmux layouts: "even-horizontal", "even-vertical", "main-horizontal", "main-vertical", "tiled")
- `pane_name_user_option` (string; must have matching entry in .tmux.conf (e.g. `set -g pane-border-format "#{@custom_pane_title}"`)
Expand Down Expand Up @@ -134,7 +135,7 @@ Example:

```
let config = rmuxinator::Config::new_from_config_path(&String::from("/home/pi/foo.toml")).map_err(|error| format!("Problem parsing config file: {}", error))?;
rmuxinator::run_start(config).map_err(|error| format!("Application error: {}", error));
rmuxinator::run_start(config).map_err(|error| format!("Rmuxinator error: {}", error));
```

#### Config constructor
Expand All @@ -147,6 +148,7 @@ Example:

```
let rmuxinator_config = rmuxinator::Config {
attached: true,
hooks: vec![],
layout: None,
name: String::from("rmuxinator-library-example"),
Expand Down Expand Up @@ -216,13 +218,13 @@ remove themselves in order to prevent duplicate events.
- Handle shell failures -- `tmux kill-window` was failing silently
- Can commands can all be moved into structs and computed up front? This might
require writing a custom Serde deserializer for the Config type.
- Start detached tmux session
- Select window on attach (can this be handled by a pre-existing hook?)
- Attach if session exists instead of creating sesssion
- Search for project config file on disk (XDG_CONFIG?) instead of parsing
config (I'm not convinced this is necessary)
- Other CLI commands? (stop session, create/edit/delete project)
- Use named args in calls to format! where possible
- Implement default for Config struct

## Platforms
Here are the platforms rmuxinator is known to work on:
Expand Down
Loading

0 comments on commit 829f7ce

Please sign in to comment.