Skip to content

Commit

Permalink
Adding git to status (#191)
Browse files Browse the repository at this point in the history
* added git.sh file

* added instrucctions to README.md

* instruccions typo corrections

* Customize git module and instrucctions

* Correction for Shellcheck / Shellcheck (pull_request) test. added escape caracters \ in n git.sh script

* Rename the module to gitmux

* README.md corrections

* README.md typo corrections
  • Loading branch information
L-chaCon authored Apr 17, 2024
1 parent 5ed4e8a commit b26eb2f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,26 @@ Add the load module to the status modules list.
set -g @catppuccin_status_modules_right "... load ..."
```

### Gitmux module

#### Requirements
This module depends on [gitmux](https://github.com/arl/gitmux).

#### Install
To install gitmux, follow the instructions in the [gitmux documentation](https://github.com/arl/gitmux/blob/main/README.md#installing).

#### Configure
Add the gitmux module to the status modules list.
```sh
set -g @catppuccin_status_modules_right "... gitmux ..."
```

To customize the gitmux module, you can follow the instrucctions in the [gitmux documentation](https://github.com/arl/gitmux/blob/main/README.md#customizing) and add this line in your tmux configuration:
```sh
set -g @catppuccin_gitmux_text "#(gitmux -cfg $HOME/.gitmux.conf \"#{pane_current_path}\")"
```


## Create a custom module

It is possible to add a new custom module or overwrite any of the existing modules.
Expand Down
14 changes: 14 additions & 0 deletions status/gitmux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Requires https://github.com/arl/gitmux

show_gitmux() {
local index icon color text module

index=$1
icon="$(get_tmux_option "@catppuccin_gitmux_icon" "󰊢")"
color="$(get_tmux_option "@catppuccin_gitmux_color" "$thm_green")"
text="$(get_tmux_option "@catppuccin_gitmux_text" "#(gitmux \"#{pane_current_path}\")")"

module=$( build_status_module "$index" "$icon" "$color" "$text" )

echo "$module"
}

0 comments on commit b26eb2f

Please sign in to comment.