#!/bin/bash # coder-desktop setup, run by install.sh's `setup` step after the files are in # place. Everything here is state outside ~/.config. Idempotent; honours # OMARCHY_SETUP_DRY=1. set -uo pipefail run() { if [[ ${OMARCHY_SETUP_DRY:-0} == 1 ]]; then echo " ? would: $*"; else "$@"; fi; } state=$HOME/.local/state/omarchy-setup export OMARCHY_PATH=${OMARCHY_PATH:-/usr/share/omarchy} # No idle lock or screensaver: Omarchy's stay-awake mode. The desktop user has # no password (the image locks it), so a locked screen could never be unlocked, # and an idle lock would darken the stream. The image build checks for this. marker=$HOME/.local/state/omarchy/indicators/stay-awake if [[ -e $marker ]]; then echo " = stay-awake" else run mkdir -p "${marker%/*}" && run touch "$marker" && echo " + stay-awake" fi # Reduced motion, so Chromium reports prefers-reduced-motion and pages that # honour it stop animating (see layers/80-coder-desktop.lua for why). No # session during the image build, hence dbus-run-session. if command -v gsettings >/dev/null; then gs=(gsettings); [[ -n ${DBUS_SESSION_BUS_ADDRESS:-} ]] || gs=(dbus-run-session -- gsettings) if [[ $("${gs[@]}" get org.gnome.desktop.interface enable-animations 2>/dev/null) == false ]]; then echo " = gtk animations off" else run "${gs[@]}" set org.gnome.desktop.interface enable-animations false && echo " + gtk animations off" fi fi # Default theme: Omarchy's Retro 82. Only on the first apply, because install.sh # also runs at every workspace start (for the roles parameter) and must not undo # a theme the developer picked. The image also installs the Covert Cloud themes # for anyone who chooses them. if [[ -e $state/coder-desktop-theme ]]; then echo " = default theme already set once (left alone)" else run env OMARCHY_THEME_HEADLESS=1 "$OMARCHY_PATH/bin/omarchy-theme-set" "Retro 82" \ && run mkdir -p "$state" && run touch "$state/coder-desktop-theme" && echo " + theme: Retro 82" fi