Skip to content

Commit

Permalink
add new file to document minimal setup, clean up images
Browse files Browse the repository at this point in the history
  • Loading branch information
flowy0 committed Jun 14, 2024
1 parent 17926c1 commit 42b5f51
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ZSH_Themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Using the [spaceship theme](https://github.com/spaceship-prompt/spaceship-prompt) :

This shows the conda environment, current dir and kubectl context on the left, and the git branch on the right
<img src="spaceship-theme.png" alt="screenshot" width="750">
<img src="assets/spaceship-theme.png" alt="screenshot" width="750">


my settings in .zshrc
Expand Down Expand Up @@ -59,7 +59,7 @@ ZSH_THEME="common"
If you are using conda/miniconda, there are no modifications required for the common.zsh-theme.
It should show like this:

<img src="common_theme_conda_env.png" alt="screenshot" width="650">
<img src="assets/common_theme_conda_env.png" alt="screenshot" width="650">



Expand Down Expand Up @@ -88,7 +88,7 @@ See the result below.

In this case, the folder name is webscrape and the pyenv name is py39

<img src="common_theme_screenshot.png" alt="screenshot" width="650">
<img src="assets/common_theme_screenshot.png" alt="screenshot" width="650">


### Configuring kube-ps-1
Expand Down
File renamed without changes
File renamed without changes
Binary file added assets/ohmyposh-screenshot-moreinfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ohmyposh-shell-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
81 changes: 81 additions & 0 deletions minimal-setup-2024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# An attempt at a minimal mac dev setup


## Install Homebrew

```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/g/.zprofile\
eval "$(/opt/homebrew/bin/brew shellenv)"\
```

## Install some utilities
```bash
brew install 1password dropbox iterm2 arc shottr firefox telegram
```

## Install dev tools
```bash
brew install colima kind docker docker-credential-helper docker-compose docker-buildx kubectl visual-studio-code zed micromamba
```

## Setup custom resolutions with [hipdpi script](https://github.com/xzhih/one-key-hidpi)
- This is for my ultra wide monitor (optional)
```bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)"
# set custom resolution of 2580x1080 in the script menus
```

## Setup ZSH

### ZSH Plugins

Add ZSH Autosuggestions
```bash
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
```

ZSH Syntax Highlighting
```bash
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
```

Append to the end of the file `.zshrc

It might look like this
```bash
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
```

### `oh-my-posh`

Modified Theme [bubblesline](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/bubblesline.omp.json) to simplify the display

You may view the config [here](ohmyposh.json)

Screenshot showing the Folder Name, and kubernetes context name

![alt text](assets/ohmyposh-shell-screenshot.png)

Screenshot showing folder name, git branch , python environment name and kubernetes context and namespace:

![alt text](assets/ohmyposh-screenshot-moreinfo.png)


Source the theme using the snippet below
```
#ohmyposh
# update the file name and path accordingly
OHMYPOSHTHEMEFILE=v2a.json
eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/$OHMYPOSHTHEMEFILE)"
if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then
eval "$(oh-my-posh init zsh)"
fi
```

Reload the Shell: `exec $SHELL`
68 changes: 68 additions & 0 deletions ohmyposh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",

"version": 2,
"final_space": true,
"console_title_template": "{{ .Shell }} in {{ .Folder }}",
"blocks": [
{
"alignment": "left",
"type": "prompt",
"segments": [
{
"type": "path",
"background": "darkGray",
"foreground": "lightYellow",
"leading_diamond": "\ue0b6",
"style": "diamond",
"template": "\ue5ff {{ .Folder }}",
"trailing_diamond": "\ue0b4",
"properties": {
"style" : "full"
}
},
{
"type": "git",
"background": "darkGray",
"foreground": "blue",
"leading_diamond": " \ue0b6",
"properties": {
"branch_icon": ""
},
"style": "diamond",
"template": "{{ .HEAD }}",
"trailing_diamond": "\ue0b4"
},
{
"type": "python",
"background": "darkGray",
"foreground": "lightGreen",
"leading_diamond": " \ue0b6",
"style": "diamond",
"template": "{{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }}",
"trailing_diamond": "\ue0b4",
"properties": {
"fetch_version": false,
"fetch_virtual_env": true
}
},

{
"type": "kubectl",
"style": "diamond",
"leading_diamond": " \ue0b6",
"trailing_diamond": "\ue0b4",
"foreground": "cyan",
"background": "darkGray",
"template": " {{.Context}}{{if .Namespace}} :: {{.Namespace}}{{end}} ",
"properties": {
"context_aliases": {
"arn:aws:eks:eu-west-1:1234567890:cluster/posh": "posh"
}
}
}
]
}
]

}

0 comments on commit 42b5f51

Please sign in to comment.