From de2757466b73ce5ec9d0836087ff50e36059156a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 3 Jan 2026 16:50:10 -0800 Subject: [PATCH] Add opencode (#4071) --- bin/omarchy-launch-opencode | 3 +++ bin/omarchy-menu | 3 +-- config/hypr/bindings.conf | 1 + config/opencode/opencode.json | 4 ++++ default/bash/aliases | 1 + install/omarchy-base.packages | 1 + migrations/1767478687.sh | 16 ++++++++++++++++ 7 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 bin/omarchy-launch-opencode create mode 100644 config/opencode/opencode.json create mode 100644 migrations/1767478687.sh diff --git a/bin/omarchy-launch-opencode b/bin/omarchy-launch-opencode new file mode 100755 index 00000000..3df0c014 --- /dev/null +++ b/bin/omarchy-launch-opencode @@ -0,0 +1,3 @@ +#!/bin/bash + +exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.opencode -e bash -c 'cd ~/Work; opencode' diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 37b34518..40e9d37e 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -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 } diff --git a/config/hypr/bindings.conf b/config/hypr/bindings.conf index f7770dd8..cdb0118c 100644 --- a/config/hypr/bindings.conf +++ b/config/hypr/bindings.conf @@ -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/" diff --git a/config/opencode/opencode.json b/config/opencode/opencode.json new file mode 100644 index 00000000..a03a5cb0 --- /dev/null +++ b/config/opencode/opencode.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://opencode.ai/config.json", + "theme": "system" +} diff --git a/default/bash/aliases b/default/bash/aliases index eabd0c62..8e485a35 100644 --- a/default/bash/aliases +++ b/default/bash/aliases @@ -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; } diff --git a/install/omarchy-base.packages b/install/omarchy-base.packages index 9ba8823f..d91ed9ad 100644 --- a/install/omarchy-base.packages +++ b/install/omarchy-base.packages @@ -90,6 +90,7 @@ obsidian omarchy-chromium omarchy-nvim omarchy-walker +opencode pamixer pinta playerctl diff --git a/migrations/1767478687.sh b/migrations/1767478687.sh new file mode 100644 index 00000000..0eed2011 --- /dev/null +++ b/migrations/1767478687.sh @@ -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