Skip to content

Commit dfff869

Browse files
authored
Add devcontainer config and setup scripts
1 parent 59b7648 commit dfff869

File tree

6 files changed

+62
-2
lines changed

6 files changed

+62
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"features": {
3+
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
4+
"version": "latest",
5+
"packages": "shellcheck tmux ifstat"
6+
}
7+
},
8+
"postCreateCommand": "bash scripts/devcontainer_postCreateCommand.sh",
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"rogalmic.bash-debug",
13+
"timonwong.shellcheck",
14+
"mads-hartmann.bash-ide-vscode"
15+
]
16+
}
17+
}
18+
}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cSpell.words": [
3+
"powerline",
4+
"tmuxpowerlinerc"
5+
]
6+
}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- New segment vcs_rootpath [#373](https://github.com/erikw/tmux-powerline/issues/374)
1414
- New segment vpn [#383](https://github.com/erikw/tmux-powerline/issues/383)
1515
- Re-enable Linter [#414](https://github.com/erikw/tmux-powerline/pull/414)
16+
- GitHub Codespaces devcontainer config setting up all dependencies and installs tmux-powerline in the container. See [devcontainer.json](.devcontainer/devcontainer.json) and [devcontainer_postCreateCommand.sh](scripts/devcontainer_postCreateCommand.sh).
17+
1618
### Changed
1719
- Improved roll_text function [#390](https://github.com/erikw/tmux-powerline/issues/390)
1820
- Improved segment ifstat [#402](https://github.com/erikw/tmux-powerline/issues/402)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,11 @@ tmux source-file ~/.tmux.conf
214214
### Multiple lines in bash or no powerline in Zsh using iTerm (macOS)
215215
If your tmux looks like [this](https://github.com/erikw/tmux-powerline/issues/125) then you may have to in iTerm uncheck [Unicode East Asian Ambiguous characters are wide] in Preferences -> Settings -> Advanced.
216216

217-
# Hacking
217+
# Hacking (Development)
218218
This project can only gain positively from contributions. Fork today and make your own enhancements and segments to share back! If you'd like, add your name and email to AUTHORS before making a pull request so you can get some credit for your work :-)
219219

220+
You can fork this project and then start coding right away with GitHub Codespaces as this project is set up to install all development dependencies and install tmux-powerline on the devcontainer. See [devcontainer.json](.devcontainer/devcontainer.json) and [devcontainer_postCreateCommand.sh](scripts/devcontainer_postCreateCommand.sh). After starting the devcontainer, just type `tmux` in the terminal and you should see a working tmux-powerline already to start playing with.
221+
220222
## How to make a segment
221223
If you want to (of course you do!) send a pull request for a cool segment you written make sure that it follows the style of existing segments, unless you have good reason for it. Each segment resides in the `segments/` directory with a descriptive and simple name.
222224
A segment must have at least one function and that is `run_segment` which is like the main function that is called from the tmux-powerline lib. What ever text is echoed out from this function to stdout is the text displayed in the tmux status bar.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
# Devcontainer postCreateCommand.
3+
# Install dependencies for running this project in GitHub Codespaces.
4+
5+
set -eux
6+
7+
# Defensive sysop: in case user's dotfiles installed tmux configs already.
8+
## Tmux
9+
rm -rf ${XDG_CONFIG_HOME:-$HOME/.config}/tmux
10+
rm -rf $HOME/.tmux
11+
12+
## tmux-powerline
13+
rm -rf ${XDG_CONFIG_HOME:-$HOME/.config}/tmux-powerline
14+
rm -rf $HOME/.tmux-powerline
15+
rm -f $HOME/.tmuxpowerlinerc
16+
17+
18+
# Set up TPM. Ref: https://github.com/tmux-plugins/tpm?#installation
19+
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
20+
21+
cat << TMUXCONF > $HOME/.tmux.conf
22+
# List of plugins
23+
set -g @plugin 'tmux-plugins/tpm'
24+
# Install tmux-powerline as a "local plugin". Ref: https://github.com/tmux-plugins/tpm/issues/220#issuecomment-1082686994
25+
run '/workspaces/tmux-powerline/main.tmux'
26+
27+
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
28+
run '~/.tmux/plugins/tpm/tpm'
29+
TMUXCONF
30+
31+
# Install TPM plugins
32+
$HOME/.tmux/plugins/tpm/bin/install_plugins

themes/default.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ if [ -z "$TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS" ]; then
125125
"pwd 89 211"
126126
#"macos_notification_count 29 255"
127127
#"mailcount 9 255"
128-
"now_playing 234 37"
128+
# "now_playing 234 37"
129129
#"cpu 240 136"
130130
"load 237 167"
131131
#"tmux_mem_cpu_load 234 136"

0 commit comments

Comments
 (0)