Add opencode (#4071)

This commit is contained in:
David Heinemeier Hansson
2026-01-03 16:50:10 -08:00
committed by GitHub
parent 6dfa5f0807
commit de2757466b
7 changed files with 27 additions and 2 deletions

3
bin/omarchy-launch-opencode Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.opencode -e bash -c 'cd ~/Work; opencode'

View File

@@ -276,7 +276,7 @@ show_install_ai_menu() {
echo ollama
)
case $(menu "Install" " Dictation [AUR]\n󱚤 Claude Code\n󱚤 Copilot CLI [AUR]\n󱚤 Cursor CLI\n󱚤 Gemini\n󱚤 OpenAI Codex\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush\n󱚤 opencode") in
case $(menu "Install" " Dictation [AUR]\n󱚤 Claude Code\n󱚤 Copilot CLI [AUR]\n󱚤 Cursor CLI\n󱚤 Gemini\n󱚤 OpenAI Codex\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush") in
*Dictation*) present_terminal "echo 'Installing Hyprwhspr from AUR...'; yay -S --noconfirm hyprwhspr && hyprwhspr setup" ;;
*Claude*) install "Claude Code" "claude-code" ;;
*Copilot*) aur_install "Copilot CLI" "github-copilot-cli" ;;
@@ -286,7 +286,6 @@ show_install_ai_menu() {
*Studio*) install "LM Studio" "lmstudio" ;;
*Ollama*) install "Ollama" $ollama_pkg ;;
*Crush*) install "Crush" "crush-bin" ;;
*opencode*) install "opencode" "opencode" ;;
*) show_install_menu ;;
esac
}

View File

@@ -14,6 +14,7 @@ bindd = SUPER SHIFT, SLASH, Passwords, exec, uwsm-app -- 1password
# If your web app url contains #, type it as ## to prevent hyprland treating it as a comment
bindd = SUPER SHIFT, A, ChatGPT, exec, omarchy-launch-webapp "https://chatgpt.com"
bindd = SUPER SHIFT ALT, A, Grok, exec, omarchy-launch-webapp "https://grok.com"
bindd = SUPER SHIFT CTRL, A, opencode, exec, omarchy-launch-opencode
bindd = SUPER SHIFT, C, Calendar, exec, omarchy-launch-webapp "https://app.hey.com/calendar/weeks/"
bindd = SUPER SHIFT, E, Email, exec, omarchy-launch-webapp "https://app.hey.com"
bindd = SUPER SHIFT, Y, YouTube, exec, omarchy-launch-webapp "https://youtube.com/"

View File

@@ -0,0 +1,4 @@
{
"$schema": "https://opencode.ai/config.json",
"theme": "system"
}

View File

@@ -31,6 +31,7 @@ alias ...='cd ../..'
alias ....='cd ../../..'
# Tools
alias c='opencode'
alias d='docker'
alias r='rails'
n() { if [ "$#" -eq 0 ]; then nvim .; else nvim "$@"; fi; }

View File

@@ -90,6 +90,7 @@ obsidian
omarchy-chromium
omarchy-nvim
omarchy-walker
opencode
pamixer
pinta
playerctl

16
migrations/1767478687.sh Normal file
View File

@@ -0,0 +1,16 @@
echo "Add opencode with dynamic themeing and Super + Shift + Ctrl + A binding"
omarchy-pkg-add opencode
# Add config using omarchy theme by default
if [[ ! -f ~/.config/opencode/opencode.json ]]; then
cp $OMARCHY_PATH/config/opencode/opencode.json ~/.config/opencode/opencode.json
fi
# Add binding if the key is available
BINDINGS_PATH="$HOME/.config/hypr/bindings.conf"
if ! grep -q "SUPER SHIFT CTRL, A" $BINDINGS_PATH; then
sed -i '/SUPER SHIFT ALT, A/a bindd = SUPER SHIFT CTRL, A, opencode, exec, omarchy-launch-opencode' "$BINDINGS_PATH"
else
echo "Add your own binding for opencode using omarchy-launch-opencode in $BINDINGS_PATH"
fi