Skip to content

Instantly share code, notes, and snippets.

@pheebcodes
Last active March 29, 2022 13:17
Show Gist options
  • Save pheebcodes/b92ed6dcf26dbf30814aa8f7a832daf3 to your computer and use it in GitHub Desktop.
Save pheebcodes/b92ed6dcf26dbf30814aa8f7a832daf3 to your computer and use it in GitHub Desktop.
Adding architecture to your M1 Mac terminal with starship

Adding the current architecture to your starship command prompt.

# ~/.config/starship.toml

format = """
$username\
$hostname\
$arch\
$shlvl\
$kubernetes\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$hg_branch\
$docker_context\
$package\
$cmake\
$dart\
$dotnet\
$elixir\
$elm\
$erlang\
$golang\
$helm\
$java\
$julia\
$kotlin\
$nim\
$nodejs\
$ocaml\
$perl\
$php\
$purescript\
$python\
$ruby\
$rust\
$swift\
$terraform\
$vagrant\
$zig\
$nix_shell\
$conda\
$memory_usage\
$aws\
$gcloud\
$openstack\
$env_var\
$crystal\
$custom\
$cmd_duration\
$line_break\
$lua\
$jobs\
$battery\
$time\
$status\
$character"""

[custom.arch]
command = "arch"
format = "[$output]($style) "
style = "bold purple"
when = "true"

Adding function to zsh to swap between architectures.

# .zshrc

# Use command `rosetta` to spawn a new zsh process running in rosetta.
function rosetta {
	arch -arch x86_64 zsh
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment