Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agents/skills/install-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ commands and reusable setup leaves:
- use `$OMARCHY_INSTALL` and `$OMARCHY_PATH` instead of hard-coded Omarchy paths.
- keep root-scoped hardware setup under `install/hardware/` and orchestrate it through `install/hardware/all.sh`.
- keep every per-user setup leaf under `install/user/` (including `install/user/hardware/` and `install/user/first-run/`) so it is clear what must run for each user.
- The base install supplies matching kernel headers before hardware setup. DKMS installers should install their driver packages and assume the headers exist.
- prefer helper commands for package and command checks where available.

Raw `command -v`, `pacman`, and `pacman-key` are acceptable in package-helper
Expand Down
25 changes: 20 additions & 5 deletions bin/omarchy-capture-screenrecording
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
# start.
#
# Env: OMARCHY_SCREENRECORD_DEBUG=true appends gpu-screen-recorder's stderr (and
# the picker target it was launched with) to /tmp/omarchy-screenrecord.log so
# users can attach a log when reporting capture failures.
# the picker target it was launched with) to
# $XDG_RUNTIME_DIR/omarchy-screenrecord.log so users can attach a log when
# reporting capture failures.

[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
OUTPUT_DIR="${OMARCHY_SCREENRECORD_DIR:-${XDG_VIDEOS_DIR:-$HOME/Videos}}"
Expand All @@ -34,9 +35,18 @@ WEBCAM_SIZE="medium"
RESOLUTION=""
FULLSCREEN="false"
STOP_RECORDING="false"
RECORDING_FILE="/tmp/omarchy-screenrecord-filename"
REGION_FILE="${XDG_RUNTIME_DIR:-/tmp}/omarchy-screenrecord-region"
LOG_FILE=$([[ ${OMARCHY_SCREENRECORD_DEBUG:-false} == "true" ]] && echo "/tmp/omarchy-screenrecord.log" || echo "/dev/null")
# Both of these live in the per-user runtime directory, which is 0700. What
# RECORDING_FILE holds is read back on stop and used as a path -- ffmpeg writes
# beside it, `mv` replaces it, and `rm -f` deletes its preview -- so a name in
# world-writable /tmp is a name any other local account can create first and
# then point wherever it likes. The debug log carries the recorder's stderr and
# the picked geometry, which is nobody else's business either. Fall back to
# the state directory when there is no session runtime dir -- :-/tmp would put
# both files back at the fixed names this comment describes.
RUNTIME_DIR="${XDG_RUNTIME_DIR:-${XDG_STATE_HOME:-$HOME/.local/state}/omarchy}"
RECORDING_FILE="$RUNTIME_DIR/omarchy-screenrecord-filename"
REGION_FILE="$RUNTIME_DIR/omarchy-screenrecord-region"
LOG_FILE=$([[ ${OMARCHY_SCREENRECORD_DEBUG:-false} == "true" ]] && echo "$RUNTIME_DIR/omarchy-screenrecord.log" || echo "/dev/null")

for arg in "$@"; do
case "$arg" in
Expand Down Expand Up @@ -144,6 +154,11 @@ select_capture_target() {
}

start_screenrecording() {
mkdir -p "$RUNTIME_DIR" || return 1
# XDG_STATE_HOME may be outside a private home; protect existing fallbacks too.
if [[ -z ${XDG_RUNTIME_DIR:-} ]]; then
chmod 700 "$RUNTIME_DIR" || return 1
fi
local capture_args=()
local target

Expand Down
5 changes: 4 additions & 1 deletion bin/omarchy-capture-webcam-resize
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
set -euo pipefail

readonly MARGIN=40
readonly REGION_FILE="${XDG_RUNTIME_DIR:-/tmp}/omarchy-screenrecord-region"
# Has to resolve to whatever omarchy-capture-screenrecording writes, fallback
# included, or a recording without a session runtime dir anchors the camera to
# the whole monitor instead of the region it recorded.
readonly REGION_FILE="${XDG_RUNTIME_DIR:-${XDG_STATE_HOME:-$HOME/.local/state}/omarchy}/omarchy-screenrecord-region"

usage() {
echo "Usage: omarchy-capture-webcam-resize <smaller|larger|reset|small|medium|large>" >&2
Expand Down
4 changes: 4 additions & 0 deletions bin/omarchy-default-agent
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ else
fi
fi

if [[ $agent == "claude" ]]; then
omarchy-install-chromium-claude 2>/dev/null || true
fi

mkdir -p "$(dirname "$agent_file")"
printf '%s\n' "$agent" >"$agent_file"

Expand Down
43 changes: 43 additions & 0 deletions bin/omarchy-install-chromium-claude
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# omarchy:summary=Install the Claude extension for Chromium-based browsers
# omarchy:requires-sudo=true

set -euo pipefail

if (( EUID == 0 )); then
export PATH=/usr/bin:/bin
fi

EXTENSION_ID="fcoeoabgfenejglbffodgkkbkcdhcgfn"
EXTENSION_JSON='{ "external_update_url": "https://clients2.google.com/service/update2/crx" }'
PACKAGED_PATH=/usr/bin/omarchy-install-chromium-claude

# Brave and Brave Origin share Chromium's external extension directory.
# Seed all supported browsers, including those installed after choosing Claude.
EXTENSION_DIRS=(
/usr/share/chromium/extensions
/usr/share/google-chrome/extensions
/usr/share/microsoft-edge/extensions
)

installed=true
for dir in "${EXTENSION_DIRS[@]}"; do
if [[ ! -f $dir/$EXTENSION_ID.json ]] || [[ $(cat "$dir/$EXTENSION_ID.json") != "$EXTENSION_JSON" ]]; then
installed=false
fi
done

if [[ $installed == "true" ]]; then
exit 0
fi

if (( EUID == 0 )); then
for dir in "${EXTENSION_DIRS[@]}"; do
printf '%s\n' "$EXTENSION_JSON" | install -D -m 0644 /dev/stdin "$dir/$EXTENSION_ID.json"
done
elif [[ -t 0 ]]; then
exec sudo "$PACKAGED_PATH"
else
exec pkexec "$PACKAGED_PATH"
fi
2 changes: 1 addition & 1 deletion bin/omarchy-install-gaming-xbox-controllers
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e
echo "Installing Xbox controller Bluetooth support..."

# Install xpadneo to ensure controllers work out of the box
omarchy-pkg-add linux-headers xpadneo-dkms
omarchy-pkg-add xpadneo-dkms

# Prevent xpad/xpadneo driver conflict
echo blacklist xpad | sudo tee /etc/modprobe.d/blacklist-xpad.conf >/dev/null
Expand Down
9 changes: 9 additions & 0 deletions bin/omarchy-update-keyring
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# omarchy:summary=Ensure the Omarchy and Arch keyring packages are installed and populated
# omarchy:requires-sudo=true

# omarchy-update runs this under set -e as a trusted pre-step, so a failed recv
# or a broken keyring has to stop this script here, not surface later as
# signature errors in the middle of the main transaction.
set -euo pipefail

if omarchy-pkg-missing omarchy-keyring || ! sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 &>/dev/null; then
sudo pacman-key --recv-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 --keyserver keys.openpgp.org
sudo pacman-key --lsign-key 40DFB630FF42BCFFB047046CF0134EE680CAC571
Expand All @@ -19,4 +24,8 @@ fi
# Always reinstall, as the keyring can be updated without a package version bump.
echo -e "\e[32m\nUpdate Arch signing keys\e[0m"
sudo pacman -Sy --noconfirm archlinux-keyring >/dev/null 2> >(grep -vE '^warning: archlinux-keyring-[^ ]+ is up to date -- reinstalling$' >&2)

# Say "correct" only once the key verifiably is: before the failure checks
# above, a failed recv or reinstall still ended here with exit 0.
sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 >/dev/null
echo "Keys are correct"
27 changes: 25 additions & 2 deletions bin/omarchy-windows-vm
Original file line number Diff line number Diff line change
Expand Up @@ -1457,8 +1457,31 @@ To stop: omarchy-windows-vm stop"
fi
# If scale is less than 130%, don't set any scale (use default 100)

# Connect with RDP in fullscreen (auto-detects resolution)
xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /clipboard /cert:ignore /title:"Windows VM - Omarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE
RDP_ARGS=(
"/u:$WIN_USER"
"/p:$WIN_PASS"
/v:127.0.0.1:3389
-grab-keyboard
/sound
/microphone
/clipboard
/cert:ignore
"/title:Windows VM - Omarchy"
/dynamic-resolution
/gfx:AVC444
/floatbar:sticky:off,default:visible,show:fullscreen
)
if [[ -n $RDP_SCALE ]]; then
RDP_ARGS+=("$RDP_SCALE")
fi

# Connect with RDP in fullscreen (auto-detects resolution). The arguments go
# in over stdin rather than on the command line: /proc/<pid>/cmdline is
# world-readable, so passing the VM password as /p:"$WIN_PASS" would show it
# to every other user on the machine for as long as the session is open.
# /args-from must stay the only argument here — FreeRDP rejects it outright
# when it is combined with any other, so new flags belong in RDP_ARGS above.
printf '%s\n' "${RDP_ARGS[@]}" | xfreerdp3 /args-from:stdin

# After RDP closes, stop the container unless --keep-alive was specified
if [[ $KEEP_ALIVE = "false" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion default/agents/skills/omarchy/capture.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Recordings land in the configured Videos directory (override with
`omarchy capture webcam resize <smaller|larger|reset|small|medium|large>`.

If recording fails to start, rerun with `OMARCHY_SCREENRECORD_DEBUG=true` to
collect a log at `/tmp/omarchy-screenrecord.log` worth attaching to a bug
collect a log at `$XDG_RUNTIME_DIR/omarchy-screenrecord.log` (or `${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/omarchy-screenrecord.log` without a session runtime directory) worth attaching to a bug
report.

## Text Capture (OCR)
Expand Down
2 changes: 1 addition & 1 deletion default/agents/skills/omarchy/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ drag-and-drop in the web form, so save the capture and hand the user the file
path to attach (`gh` cannot upload media).

For screen-recording failures specifically, rerun with
`OMARCHY_SCREENRECORD_DEBUG=true` and attach `/tmp/omarchy-screenrecord.log`.
`OMARCHY_SCREENRECORD_DEBUG=true` and attach `$XDG_RUNTIME_DIR/omarchy-screenrecord.log` (or `${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/omarchy-screenrecord.log` without a session runtime directory).

File the issue with `gh` when available:

Expand Down
6 changes: 6 additions & 0 deletions etc/sysctl.d/99-omarchy-sysctl.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Solve common flakiness with SSH (MTU discovery on flaky links).
net.ipv4.tcp_mtu_probing=1

# BBR estimates bottleneck bandwidth and minimum RTT and paces to them, where
# cubic keeps pushing until packets drop. That cuts queueing latency
# (bufferbloat) on fast links. fq is the qdisc BBR is built to pace through.
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

# Tune reclaim for swap on zram, which is orders of magnitude faster than the
# disk swapfile these defaults assume.

Expand Down
2 changes: 1 addition & 1 deletion install/hardware/fix-bcm43xx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ pci_info=$(lspci -nn)

if (echo "$pci_info" | grep -q "14e4:43a0" || echo "$pci_info" | grep -q "14e4:4331"); then
echo "BCM4360 / BCM4331 detected"
omarchy-pkg-add broadcom-wl-dkms linux-headers
omarchy-pkg-add broadcom-wl-dkms
fi
3 changes: 1 addition & 2 deletions install/hardware/fix-elgato-camlink-4k.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# v4l2-relayd re-exposes it at 1280x720 under the same name.

if omarchy-hw-elgato-camlink-4k; then
mapfile -t kernel_headers < <(pacman -Qqs '^linux(-zen|-lts|-hardened|-t2|-ptl|-omarchy(-bore|-ptl-novrr-mm)?)?$' | sed 's/$/-headers/')
omarchy-pkg-add "${kernel_headers[@]}" v4l2loopback-dkms v4l2loopback-utils v4l2-relayd
omarchy-pkg-add v4l2loopback-dkms v4l2loopback-utils v4l2-relayd

sudo install -Dm644 "$OMARCHY_PATH/default/udev/elgato-camlink-4k.rules" /etc/udev/rules.d/71-elgato-camlink-4k.rules
sudo install -Dm644 "$OMARCHY_PATH/default/v4l2-relayd/camlink.conf" /etc/v4l2-relayd.d/camlink.conf
Expand Down
2 changes: 1 addition & 1 deletion install/hardware/fix-tuxedo-backlight.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Install Tuxedo drivers for keyboard backlighting on Tuxedo laptops and
# compatible devices like the Slimbook Executive (Clevo/Tuxedo chassis).
if cat /sys/class/dmi/id/sys_vendor 2>/dev/null | grep -qi "TUXEDO\|Slimbook"; then
omarchy-pkg-add linux-headers tuxedo-drivers-nocompatcheck-dkms
omarchy-pkg-add tuxedo-drivers-nocompatcheck-dkms

# Blacklist the legacy clevo_xsm_wmi module which conflicts with the tuxedo-drivers
# clevo_wmi module. When clevo_xsm_wmi loads first, it grabs the Clevo WMI GUIDs,
Expand Down
2 changes: 1 addition & 1 deletion install/hardware/fix-yt6801-ethernet-adapter.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Install drivers for Motorcomm YT6801 ethernet adapter used by the Slimbook Executive
if lspci | grep -i "YT6801\|Motorcomm.*Ethernet"; then
omarchy-pkg-add linux-headers yt6801-dkms
omarchy-pkg-add yt6801-dkms
fi
4 changes: 0 additions & 4 deletions install/hardware/nvidia.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
if lspci | grep -qi 'nvidia'; then
# Check which kernel is installed and set appropriate headers package
KERNEL_PACKAGE=$(pacman -Qqs '^linux(-zen|-lts|-hardened|-t2|-ptl|-omarchy(-bore|-ptl-novrr-mm)?)?$' | head -1 || true)
[[ -n $KERNEL_PACKAGE ]] && omarchy-pkg-add "$KERNEL_PACKAGE-headers"

if omarchy-hw-nvidia-gsp; then
PACKAGES=(nvidia-open-dkms nvidia-utils lib32-nvidia-utils libva-nvidia-driver)
elif omarchy-hw-nvidia-without-gsp; then
Expand Down
7 changes: 0 additions & 7 deletions install/user/mise-work.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
mkdir -p "$HOME/Work"
mkdir -p "$HOME/Work/tries"

cat >"$HOME/Work/.mise.toml" <<'EOF'
[env]
_.path = "{{ cwd }}/bin"
EOF

mise trust ~/Work/.mise.toml

# Offline installs unpack the Node tarball bundled by the ISO: from
# /opt/packages in the ISO chroot, or from the copy staged in provisioning state when
# omarchy-provision-owner finalizes the user at first boot.
Expand Down
2 changes: 2 additions & 0 deletions manual/17-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ To wrap an additional CLI the same way, run `omarchy-mise-install <package> [com

Pick your default agent with `omarchy default agent <name>` or under _Setup > Defaults > Agent_ in the Omarchy Menu (`Super + Space`). If the agent isn't installed yet, picking it installs it first. A fresh Omarchy will invite you to make this choice with a one-time notification.

Choosing Claude also attempts to set up its browser extension for Chromium, Chrome, Brave, Brave Origin, and Edge. The extension setup applies to all users and may ask for your system password; cancelling or a failed extension install still selects and launches Claude. Restart your browser, enable the extension if prompted, and sign in to Claude to finish connecting it. Run `/chrome` in Claude to check the connection. Firefox and Zen do not support this extension. If Claude was already your default before this setup was added, select it again to install the extension.

[Muse Code](https://dev.meta.ai) — Meta's `muse` — uses a preinstalled mise stub like the other agents. Picking it as the default installs Meta's official launcher through mise's HTTP backend. The launcher verifies and updates the native binary for your machine.

Once you've chosen, `Super + Shift + Ctrl + A` launches the default agent in a dedicated terminal window (or brings up the picker if you haven't chosen yet). You can also launch it straight into a task with `omarchy agent prompt "Review this project"`. Agents launched this way run unattended in their respective don't-stop-to-ask modes, so be ready for them to actually do things! And since agents refuse to remember trust for your home directory, launches from `$HOME` start in `~/Work` instead.
Expand Down
2 changes: 2 additions & 0 deletions manual/19-shell-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ The full manual can be found via `man yt-dlp`.
## try

[try](https://github.com/tobi/try) makes it easy to manage programming experiments with date-stamped directories. All experiments live in `~/Work/tries` and you can access them via `try`.

Omarchy does not add a project's `bin/` directory to `PATH` automatically. Run trusted project-local tools with an explicit relative path, such as `bin/rails` or `./bin/dev`.
99 changes: 99 additions & 0 deletions migrations/1789095456.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
echo "Remove automatic project bin directories from PATH"

work_dir="$HOME/Work"
mise_config="$work_dir/.mise.toml"
# install/user/mise-work.sh as shipped in Omarchy 4.0.3.
stock_sha="bd04f191d63bbde86920f44f76f0989fad980afc84e268e8474c201ec7149245"
cwd_bin='\{\{[[:space:]]*cwd[[:space:]]*\}\}/bin'
unsafe_path="^[[:space:]]*_[.]path[[:space:]]*=[[:space:]]*(\"$cwd_bin\"|'$cwd_bin')[[:space:]]*(#.*)?$"
env_section='^[[:space:]]*\[[[:space:]]*env[[:space:]]*\][[:space:]]*(#.*)?$'
any_section='^[[:space:]]*\[\[?.*\]\]?[[:space:]]*(#.*)?$'

remove_empty_work_dir=false
if [[ ! -e $work_dir ]]; then
mkdir -p "$work_dir"
remove_empty_work_dir=true
fi

was_ignored=false
if [[ -d $work_dir ]]; then
mise_state_dir=${MISE_STATE_DIR:-${XDG_STATE_HOME:-$HOME/.local/state}/mise}
ignored_configs_dir="$mise_state_dir/ignored-configs"
work_target=$(readlink -m "$work_dir")
config_path_target="$work_target/.mise.toml"
config_target=$(readlink -m "$mise_config")

if [[ -d $ignored_configs_dir ]]; then
for ignored_entry in "$ignored_configs_dir"/*; do
[[ -L $ignored_entry ]] || continue
ignored_target=$(readlink "$ignored_entry")
if [[ $ignored_target == $work_target || $ignored_target == $config_path_target || $ignored_target == $config_target ]]; then
was_ignored=true
break
fi
done
fi

if [[ $was_ignored == "false" ]]; then
# Normal Mise trust is recorded against the config-root directory, while
# paranoid trust is recorded against the file and its contents. Stage an
# empty, inert config when the legacy file is gone so either trust mode can
# resolve and revoke the original grant.
remove_empty_mise_config=false
if [[ ! -e $mise_config && ! -L $mise_config ]]; then
if (set -o noclobber; : >"$mise_config") 2>/dev/null; then
remove_empty_mise_config=true
fi
fi

untrust_target="$work_dir"
if [[ -f $mise_config ]]; then
untrust_target="$mise_config"
fi

if mise trust --untrust "$untrust_target"; then
:
else
if [[ $remove_empty_mise_config == "true" ]]; then
rm -f -- "$mise_config"
fi
exit 1
fi

if [[ $remove_empty_mise_config == "true" ]]; then
rm -f -- "$mise_config"
fi
fi
fi

if [[ -f $mise_config ]]; then
if [[ ! -L $mise_config && $(sha256sum "$mise_config" | cut -d ' ' -f 1) == $stock_sha ]]; then
rm -f -- "$mise_config"
else
unsafe_env_paths=$(sed -n -E "\\%$env_section%,\\%$any_section% { \\%$unsafe_path%p; }" "$mise_config")
if [[ -n $unsafe_env_paths ]]; then
backup=$(mktemp "$mise_config.bak.XXXXXX")
cp -p -- "$mise_config" "$backup"
sed --follow-symlinks -i -E "\\%$env_section%,\\%$any_section% { \\%$unsafe_path%d; }" "$mise_config"

printf '\n%s\n' \
"Automatic project bin directories were removed from your Mise PATH." \
"Your other Mise settings were preserved."
printf '\nBackup saved to:\n %s\n' "$backup"
fi
fi
fi

if [[ -f $mise_config ]]; then
if [[ $was_ignored == "true" ]]; then
printf '\n%s\n' "This custom config remains ignored by Mise."
else
printf '\n%s\n %s\n' \
"Mise trust for this custom config was revoked. Review it before trusting it again:" \
"mise trust $mise_config"
fi
fi

if [[ $remove_empty_work_dir == "true" ]]; then
rmdir "$work_dir" 2>/dev/null || true
fi
11 changes: 11 additions & 0 deletions migrations/1789294350.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Switch TCP congestion control to BBR with fq pacing"

# Boot applies the shipped file regardless; this only makes new connections
# use BBR now. Setting the sysctls autoloads tcp_bbr and sch_fq. Qdiscs
# already attached to interfaces stay until they are recreated, normally at
# reboot.
if [[ $(sysctl -n net.ipv4.tcp_congestion_control) == "bbr" && $(sysctl -n net.core.default_qdisc) == "fq" ]]; then
exit 0
fi

sudo sysctl -p /etc/sysctl.d/99-omarchy-sysctl.conf >/dev/null || omarchy-state set reboot-required
Loading