Make setup ISO-only
Remove legacy online installer entrypoints, collapse migrations for 4.0, and move setup responsibilities into target-side system, hardware, and user commands.
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set the branch for Omarchy's git repository.
|
||||
# omarchy:args=<master|rc|dev>
|
||||
|
||||
if (($# == 0)); then
|
||||
echo "Usage: omarchy-branch-set [master|rc|dev]"
|
||||
exit 1
|
||||
else
|
||||
branch="$1"
|
||||
fi
|
||||
|
||||
if [[ $branch != "master" && $branch != "rc" && $branch != "dev" ]]; then
|
||||
echo "Error: Invalid branch '$branch'. Must be one of: master, rc, dev"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git -C $OMARCHY_PATH switch $branch
|
||||
@@ -1,22 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set the Omarchy channel, which dictates what git branch and package repository is used.
|
||||
# omarchy:summary=Set the Omarchy package channel.
|
||||
# omarchy:args=<stable|rc|edge|dev>
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
if (($# == 0)); then
|
||||
echo "Usage: omarchy-channel-set [stable|rc|edge|dev]"
|
||||
exit 1
|
||||
else
|
||||
channel="$1"
|
||||
fi
|
||||
|
||||
channel="$1"
|
||||
case "$channel" in
|
||||
"stable") omarchy-branch-set "master" && omarchy-refresh-pacman "stable" ;;
|
||||
"rc") omarchy-branch-set "rc" && omarchy-refresh-pacman "rc" ;;
|
||||
"edge") omarchy-branch-set "master" && omarchy-refresh-pacman "edge" ;;
|
||||
"dev") omarchy-branch-set "dev" && omarchy-refresh-pacman "edge" ;;
|
||||
*) echo "Unknown channel: $channel"; exit 1; ;;
|
||||
stable|rc|edge) omarchy-refresh-pacman "$channel" ;;
|
||||
dev) omarchy-refresh-pacman edge ;;
|
||||
*) echo "Unknown channel: $channel"; exit 1 ;;
|
||||
esac
|
||||
|
||||
omarchy-update -y
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ fi
|
||||
cat > "$LOG_FILE" <<EOF
|
||||
Date: $(date)
|
||||
Hostname: $(hostname)
|
||||
Omarchy Branch: $(git -C "$OMARCHY_PATH" branch --show-current 2>/dev/null || echo "unknown")
|
||||
Omarchy Package: $(pacman -Q omarchy 2>/dev/null || echo "unknown")
|
||||
|
||||
=========================================
|
||||
SYSTEM INFORMATION
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Creates a new Omarchy migration named after the unix timestamp of the last commit.
|
||||
# omarchy:summary=Create a new Omarchy migration in the current source tree.
|
||||
|
||||
cd ~/.local/share/omarchy
|
||||
migration_file="$HOME/.local/share/omarchy/migrations/$(git log -1 --format=%cd --date=unix).sh"
|
||||
touch $migration_file
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $1 != "--no-edit" ]]; then
|
||||
nvim $migration_file
|
||||
cd "${OMARCHY_PATH:-$(pwd)}"
|
||||
mkdir -p migrations
|
||||
migration_file="migrations/$(git log -1 --format=%cd --date=unix).sh"
|
||||
touch "$migration_file"
|
||||
|
||||
if [[ ${1:-} != "--no-edit" ]]; then
|
||||
nvim "$migration_file"
|
||||
fi
|
||||
|
||||
echo $migration_file
|
||||
printf '%s\n' "$PWD/$migration_file"
|
||||
|
||||
@@ -38,7 +38,7 @@ target=$(realpath -e "$1" 2>/dev/null) || {
|
||||
|
||||
for required in bin default shell; do
|
||||
if [[ ! -d "$target/$required" ]]; then
|
||||
echo "Warning: $target/$required not found — does this look like an omarchy-installer checkout?" >&2
|
||||
echo "Warning: $target/$required not found — does this look like an Omarchy source checkout?" >&2
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ if [[ ${1:-} == "-h" || ${1:-} == "--help" ]]; then
|
||||
cat <<USAGE
|
||||
Usage: omarchy dev pkg-test [package-name] [path-to-checkout]
|
||||
|
||||
Builds and installs an Omarchy package from a local omarchy-installer
|
||||
Builds and installs an Omarchy package from a local Omarchy source
|
||||
checkout. Use when changes need to land at fixed system paths (/etc/,
|
||||
/usr/lib/systemd/, udev rule bodies, plymouth) that omarchy-dev-link
|
||||
can't shadow.
|
||||
|
||||
+8
-30
@@ -1,45 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Finish the installation of Omarchy with items that can only be done after logging in.
|
||||
# omarchy:requires-sudo=true
|
||||
# omarchy:summary=Finish first-login setup for Omarchy.
|
||||
|
||||
set -e
|
||||
|
||||
# Always: refresh per-user defaults (skel-derived configs, AI skills, XDG
|
||||
# dirs, branding, MIME defaults, etc.). Idempotent via its own marker.
|
||||
omarchy-setup-user || true
|
||||
|
||||
# Online installs grant a one-time passwordless reboot from the installer.
|
||||
# Clean it up after first login without prompting future users for sudo.
|
||||
bash "$OMARCHY_PATH/install/first-run/cleanup-reboot-sudoers.sh"
|
||||
|
||||
state_dir=~/.local/state/omarchy
|
||||
mkdir -p "$state_dir"
|
||||
|
||||
# System-wide one-shot. Gated on first-run.mode (created by finalize.sh during
|
||||
# ISO installs). The install user is the only one whose /etc/sudoers.d/first-run
|
||||
# shim grants the passwordless commands these scripts need, so only that user
|
||||
# clears this marker.
|
||||
SYSTEM_MARKER="$state_dir/first-run.mode"
|
||||
if [[ -f $SYSTEM_MARKER ]]; then
|
||||
rm -f "$SYSTEM_MARKER"
|
||||
|
||||
bash "$OMARCHY_PATH/install/first-run/firewall.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gnome-theme-system.sh"
|
||||
omarchy-hook-install post-update "$OMARCHY_PATH/install/first-run/install-voxtype.hook"
|
||||
sudo rm -f /etc/sudoers.d/first-run
|
||||
fi
|
||||
|
||||
# Per-user one-shot. Runs on the first login for every user, including any
|
||||
# users created after install. Touches only $HOME / user dbus, no sudo.
|
||||
USER_MARKER="$state_dir/first-run-user.done"
|
||||
if [[ ! -f $USER_MARKER ]]; then
|
||||
bash "$OMARCHY_PATH/install/first-run/recover-internal-monitor.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gnome-theme-user.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/gtk-primary-paste.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/welcome.sh"
|
||||
bash "$OMARCHY_PATH/install/first-run/wifi.sh"
|
||||
omarchy-hook-install post-update "$OMARCHY_PATH/install/user/first-run/install-voxtype.hook"
|
||||
|
||||
bash "$OMARCHY_PATH/install/user/hardware/recover-internal-monitor.sh"
|
||||
bash "$OMARCHY_PATH/install/user/first-run/gnome-theme.sh"
|
||||
bash "$OMARCHY_PATH/install/user/first-run/gtk-primary-paste.sh"
|
||||
bash "$OMARCHY_PATH/install/user/first-run/welcome.sh"
|
||||
bash "$OMARCHY_PATH/install/user/first-run/wifi.sh"
|
||||
|
||||
touch "$USER_MARKER"
|
||||
fi
|
||||
|
||||
@@ -51,11 +51,7 @@ desktop_name="$game_name"
|
||||
desktop_id=$(printf '%s' "$desktop_name" | tr '[:upper:]' '[:lower:]' | tr -cs '[:alnum:]' '-' | sed 's/^-//; s/-$//')
|
||||
desktop_dir="$HOME/.local/share/applications"
|
||||
desktop_file="$desktop_dir/$desktop_id.desktop"
|
||||
icon_dir="$desktop_dir/icons"
|
||||
icon_path="$icon_dir/Retro Gaming.png"
|
||||
|
||||
mkdir -p "$desktop_dir" "$icon_dir"
|
||||
[[ -f $icon_path ]] || cp "$OMARCHY_PATH/applications/icons/Retro Gaming.png" "$icon_path"
|
||||
mkdir -p "$desktop_dir"
|
||||
|
||||
cat >"$desktop_file" <<EOF
|
||||
[Desktop Entry]
|
||||
@@ -65,7 +61,7 @@ Comment=Play $game_name with RetroArch
|
||||
Exec=retroarch -L "$core_path" "$game_path"
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=$icon_path
|
||||
Icon=retro-gaming
|
||||
StartupNotify=true
|
||||
Categories=Game;Emulator;
|
||||
EOF
|
||||
|
||||
@@ -39,7 +39,6 @@ if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF";
|
||||
echo "Fixing empty resume_offset ($RESUME_OFFSET)"
|
||||
sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" "$RESUME_DROP_IN"
|
||||
if ! $NO_REBUILD; then
|
||||
sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" /etc/default/limine
|
||||
sudo limine-mkinitcpio
|
||||
fi
|
||||
fi
|
||||
@@ -102,7 +101,6 @@ if [[ ! -f $RESUME_DROP_IN ]]; then
|
||||
if [[ -n $RESUME_OFFSET ]]; then
|
||||
sudo mkdir -p /etc/limine-entry-tool.d
|
||||
echo "KERNEL_CMDLINE[default]+=\" resume=$RESUME_DEVICE resume_offset=$RESUME_OFFSET\"" | sudo tee "$RESUME_DROP_IN" >/dev/null
|
||||
$NO_REBUILD || sudo tee -a /etc/default/limine < "$RESUME_DROP_IN" >/dev/null
|
||||
else
|
||||
echo "Warning: Could not determine resume offset for $SWAP_FILE" >&2
|
||||
fi
|
||||
@@ -115,7 +113,6 @@ if grep -q "\[s2idle\]" /sys/power/mem_sleep 2>/dev/null; then
|
||||
echo "Enabling ACPI RTC alarm for s2idle suspend"
|
||||
sudo mkdir -p /etc/limine-entry-tool.d
|
||||
echo 'KERNEL_CMDLINE[default]+=" rtc_cmos.use_acpi_alarm=1"' | sudo tee "$LIMINE_DROP_IN" >/dev/null
|
||||
$NO_REBUILD || sudo tee -a /etc/default/limine < "$LIMINE_DROP_IN" >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Online Omarchy install (on an existing Arch system)
|
||||
# omarchy:group=install
|
||||
|
||||
set -eEo pipefail
|
||||
|
||||
# Online entry point. The ISO install is driven by omarchy-iso's Python
|
||||
# orchestrator instead, which arch-chroots into /mnt and runs finalize.sh
|
||||
# directly — never touches this script.
|
||||
exec bash "${OMARCHY_PATH:-/usr/share/omarchy}/install.sh" "$@"
|
||||
@@ -63,12 +63,9 @@ EOF
|
||||
launched_installer=1
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.local/share/applications" "$HOME/.local/share/icons/hicolor/48x48/apps"
|
||||
mkdir -p "$HOME/.local/share/applications"
|
||||
install -m 644 "$OMARCHY_PATH/applications/battlenet.desktop" \
|
||||
"$HOME/.local/share/applications/battlenet.desktop"
|
||||
install -m 644 "$OMARCHY_PATH/applications/icons/Battle.net.png" \
|
||||
"$HOME/.local/share/icons/hicolor/48x48/apps/Battle.net.png"
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
|
||||
|
||||
if (( launched_installer )); then
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Print the OMARCHY_INSTALL_MODE in the current env
|
||||
# omarchy:group=install
|
||||
|
||||
# install.sh exports this during the install flow. Not persisted post-install,
|
||||
# so this prints 'unknown' outside the installer.
|
||||
echo "${OMARCHY_INSTALL_MODE:-unknown}"
|
||||
@@ -13,8 +13,6 @@ SUNSHINE_ADMIN_APP="Sunshine Admin"
|
||||
SUNSHINE_ADMIN_URL="https://localhost:47990"
|
||||
SUNSHINE_ADMIN_EXEC="omarchy-launch-webapp $SUNSHINE_ADMIN_URL --ignore-certificate-errors"
|
||||
SUNSHINE_ICON_SOURCE="/usr/share/sunshine/web/images/logo-sunshine-45.png"
|
||||
SUNSHINE_ICON_NAME="Sunshine Admin.png"
|
||||
WEBAPP_ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
HYPR_AUTOSTART_FILE="$HOME/.config/hypr/autostart.lua"
|
||||
HYPR_AUTOSTART_ENTRY='o.launch_on_start("sunshine")'
|
||||
|
||||
@@ -59,9 +57,7 @@ open_ufw_ports() {
|
||||
}
|
||||
|
||||
install_admin_webapp() {
|
||||
mkdir -p "$WEBAPP_ICON_DIR"
|
||||
cp "$SUNSHINE_ICON_SOURCE" "$WEBAPP_ICON_DIR/$SUNSHINE_ICON_NAME"
|
||||
omarchy-webapp-install "$SUNSHINE_ADMIN_APP" "$SUNSHINE_ADMIN_URL" "$SUNSHINE_ICON_NAME" "$SUNSHINE_ADMIN_EXEC"
|
||||
omarchy-webapp-install "$SUNSHINE_ADMIN_APP" "$SUNSHINE_ADMIN_URL" "$SUNSHINE_ICON_SOURCE" "$SUNSHINE_ADMIN_EXEC"
|
||||
}
|
||||
|
||||
enable_hyprland_autostart() {
|
||||
|
||||
+8
-17
@@ -1,28 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Run all pending migrations to bring the system in line with the installed version.
|
||||
# omarchy:summary=Run pending Omarchy migrations for the current user.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
STATE_DIR="$HOME/.local/state/omarchy/migrations"
|
||||
mkdir -p "$STATE_DIR"
|
||||
|
||||
# Skipped migrations are tracked separately
|
||||
mkdir -p "$STATE_DIR/skipped"
|
||||
|
||||
# Run any pending migrations
|
||||
for file in $OMARCHY_PATH/migrations/*.sh; do
|
||||
for file in "$OMARCHY_PATH"/migrations/*.sh; do
|
||||
[[ -f $file ]] || continue
|
||||
filename=$(basename "$file")
|
||||
|
||||
if [[ ! -f $STATE_DIR/$filename && ! -f $STATE_DIR/skipped/$filename ]]; then
|
||||
if [[ ! -f $STATE_DIR/$filename ]]; then
|
||||
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
|
||||
|
||||
if bash $file; then
|
||||
touch "$STATE_DIR/$filename"
|
||||
else
|
||||
if gum confirm "Migration ${filename%.sh} failed. Skip and continue?"; then
|
||||
touch "$STATE_DIR/skipped/$filename"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
bash "$file"
|
||||
touch "$STATE_DIR/$filename"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Ensure all default .desktop, web apps, TUIs, and mise wrappers are installed.
|
||||
|
||||
mkdir -p ~/.local/share/icons/hicolor/48x48/apps/
|
||||
cp "$OMARCHY_PATH"/applications/icons/*.png ~/.local/share/icons/hicolor/48x48/apps/
|
||||
gtk-update-icon-cache ~/.local/share/icons/hicolor &>/dev/null
|
||||
# omarchy:summary=Ensure default application launchers and mise wrappers are installed.
|
||||
|
||||
# Copy .desktop declarations
|
||||
mkdir -p ~/.local/share/applications
|
||||
@@ -14,10 +10,8 @@ if omarchy-cmd-present alacritty; then
|
||||
cp "$OMARCHY_PATH/default/alacritty/Alacritty.desktop" ~/.local/share/applications/
|
||||
fi
|
||||
|
||||
# Refresh the webapps, TUIs, and mise wrappers
|
||||
bash "$OMARCHY_PATH/install/packaging/icons.sh"
|
||||
bash "$OMARCHY_PATH/install/packaging/webapps.sh"
|
||||
bash "$OMARCHY_PATH/install/packaging/tuis.sh"
|
||||
bash "$OMARCHY_PATH/install/packaging/mise.sh"
|
||||
if [[ -f "$OMARCHY_PATH/install/user/mise.sh" ]]; then
|
||||
bash "$OMARCHY_PATH/install/user/mise.sh"
|
||||
fi
|
||||
|
||||
update-desktop-database ~/.local/share/applications
|
||||
|
||||
@@ -5,12 +5,9 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Attempt to reinstall all default Omarchy packages and reset all the default configs.
|
||||
echo -e "This will reinstall all default Omarchy packages and reset default configs.\nWarning: user config changes will be overwritten.\n"
|
||||
|
||||
echo -e "This will reinstall all the default Omarchy packages and reset all default configs.\nWarning: All user changes to configs will be lost.\n"
|
||||
|
||||
if gum confirm "Are you sure you want to reinstall and lose all config changes?"; then
|
||||
omarchy-reinstall-git
|
||||
if gum confirm "Are you sure you want to reinstall and lose config changes?"; then
|
||||
omarchy-reinstall-pkgs
|
||||
omarchy-reinstall-configs
|
||||
|
||||
|
||||
@@ -5,24 +5,18 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Overwrite all user configs with the Omarchy defaults.
|
||||
|
||||
if (( EUID == 0 )); then
|
||||
echo "Error: This script should not be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Resetting all Omarchy configs"
|
||||
cp -R $OMARCHY_PATH/config/* ~/.config/
|
||||
cp $OMARCHY_PATH/default/bashrc ~/.bashrc
|
||||
echo '[[ -f ~/.bashrc ]] && . ~/.bashrc' | tee ~/.bash_profile >/dev/null
|
||||
|
||||
env OMARCHY_PATH="$OMARCHY_PATH" OMARCHY_INSTALL_MODE=online bash -c '
|
||||
source "$OMARCHY_PATH/install/helpers/mode.sh"
|
||||
detect_install_mode
|
||||
source "$OMARCHY_PATH/install/config/theme-user.sh"
|
||||
'
|
||||
|
||||
omarchy-setup-user --force
|
||||
omarchy-refresh-limine
|
||||
omarchy-refresh-plymouth
|
||||
omarchy-nvim-setup
|
||||
|
||||
if omarchy-cmd-present omarchy-nvim-refresh; then
|
||||
omarchy-nvim-refresh
|
||||
elif omarchy-cmd-present omarchy-nvim-setup; then
|
||||
omarchy-nvim-setup --force
|
||||
fi
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Reinstall the stable Omarchy source directory from git
|
||||
|
||||
set -e
|
||||
|
||||
# Reinstall the Omarchy configuration directory from the git source.
|
||||
|
||||
git clone --depth=1 --branch master "https://github.com/basecamp/omarchy.git" ~/.local/share/omarchy-new >/dev/null
|
||||
mv $OMARCHY_PATH ~/.local/share/omarchy-old
|
||||
mv ~/.local/share/omarchy-new $OMARCHY_PATH
|
||||
@@ -12,9 +12,7 @@ sleep 1
|
||||
|
||||
rm -rf "$PREFIX"
|
||||
rm -f "$HOME/.local/share/applications/battlenet.desktop"
|
||||
rm -f "$HOME/.local/share/icons/hicolor/48x48/apps/Battle.net.png"
|
||||
rm -f "$HOME/.cache/omarchy/Battle.net-Setup.exe"
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
|
||||
|
||||
echo
|
||||
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Apply Omarchy hardware-specific packages and system configuration
|
||||
# omarchy:group=setup
|
||||
# omarchy:requires-sudo=true
|
||||
# omarchy:examples=omarchy setup hardware --install-user dhh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<USAGE
|
||||
Usage: omarchy setup hardware --install-user USER
|
||||
|
||||
Runs idempotent hardware detection/setup for the installed machine. This is
|
||||
called by omarchy-setup-system during ISO finalization and can be rerun later
|
||||
for diagnostics or after hardware/package updates.
|
||||
USAGE
|
||||
}
|
||||
|
||||
install_user="${OMARCHY_INSTALL_USER:-}"
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
--install-user)
|
||||
install_user="${2:-}"
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if (( EUID != 0 )); then
|
||||
echo "Error: omarchy-setup-hardware must run as root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $install_user || $install_user == "root" ]]; then
|
||||
echo "Error: --install-user must name the target non-root user" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! getent passwd "$install_user" >/dev/null; then
|
||||
echo "Error: user '$install_user' does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export OMARCHY_INSTALL_USER="$install_user"
|
||||
export OMARCHY_PATH="${OMARCHY_PATH:-/usr/share/omarchy}"
|
||||
export OMARCHY_INSTALL="${OMARCHY_INSTALL:-$OMARCHY_PATH/install}"
|
||||
export OMARCHY_INSTALL_LOG_FILE="${OMARCHY_INSTALL_LOG_FILE:-/var/log/omarchy-install.log}"
|
||||
export PATH="$OMARCHY_PATH/bin:$PATH"
|
||||
|
||||
source "$OMARCHY_INSTALL/helpers/logging.sh"
|
||||
source "$OMARCHY_INSTALL/helpers/chroot.sh"
|
||||
source "$OMARCHY_INSTALL/hardware/all.sh"
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Apply Omarchy system setup in the installed target
|
||||
# omarchy:group=setup
|
||||
# omarchy:requires-sudo=true
|
||||
# omarchy:examples=omarchy setup system --install-user dhh --first-install
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<USAGE
|
||||
Usage: omarchy setup system --install-user USER [--first-install|--upgrade]
|
||||
|
||||
Runs root-owned Omarchy system setup. The ISO calls this in the target chroot
|
||||
after packages are installed and the target user exists. It also calls
|
||||
omarchy-setup-hardware, so hardware setup cannot be accidentally skipped.
|
||||
USAGE
|
||||
}
|
||||
|
||||
install_user="${OMARCHY_INSTALL_USER:-}"
|
||||
first_install=0
|
||||
upgrade=0
|
||||
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
--install-user)
|
||||
install_user="${2:-}"
|
||||
shift 2
|
||||
;;
|
||||
--first-install)
|
||||
first_install=1
|
||||
shift
|
||||
;;
|
||||
--upgrade)
|
||||
upgrade=1
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if (( EUID != 0 )); then
|
||||
echo "Error: omarchy-setup-system must run as root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $install_user || $install_user == "root" ]]; then
|
||||
echo "Error: --install-user must name the target non-root user" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! getent passwd "$install_user" >/dev/null; then
|
||||
echo "Error: user '$install_user' does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export OMARCHY_INSTALL_USER="$install_user"
|
||||
export OMARCHY_FIRST_INSTALL="$first_install"
|
||||
export OMARCHY_UPGRADE="$upgrade"
|
||||
export OMARCHY_PATH="${OMARCHY_PATH:-/usr/share/omarchy}"
|
||||
export OMARCHY_INSTALL="${OMARCHY_INSTALL:-$OMARCHY_PATH/install}"
|
||||
export OMARCHY_INSTALL_LOG_FILE="${OMARCHY_INSTALL_LOG_FILE:-/var/log/omarchy-install.log}"
|
||||
export PATH="$OMARCHY_PATH/bin:$PATH"
|
||||
|
||||
source "$OMARCHY_INSTALL/helpers/logging.sh"
|
||||
source "$OMARCHY_INSTALL/helpers/chroot.sh"
|
||||
start_install_log
|
||||
|
||||
run_logged "$OMARCHY_INSTALL/config/theme-system.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/increase-lockout-limit.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/lockscreen-pam.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/fix-powerprofilesctl-shebang.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/docker.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/enable-services.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/firewall.sh"
|
||||
|
||||
omarchy-setup-hardware --install-user "$install_user"
|
||||
|
||||
run_logged "$OMARCHY_INSTALL/login/sddm.sh"
|
||||
|
||||
run_logged "$OMARCHY_INSTALL/post-install/dns-resolver.sh"
|
||||
run_logged "$OMARCHY_INSTALL/post-install/pacman.sh"
|
||||
run_logged "$OMARCHY_INSTALL/post-install/udev.sh"
|
||||
run_logged "$OMARCHY_INSTALL/post-install/localdb.sh"
|
||||
|
||||
stop_install_log
|
||||
+79
-36
@@ -6,28 +6,51 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<USAGE
|
||||
Usage: omarchy setup user [--force] [--first-install]
|
||||
|
||||
Idempotent user-level setup: copies/symlinks defaults from \$OMARCHY_PATH
|
||||
into \$HOME, installs user services/session defaults, refreshes app launchers,
|
||||
and applies user-scoped hardware/session tweaks.
|
||||
|
||||
--first-install is used by the ISO in the target chroot. It marks shipped
|
||||
migrations complete for the freshly-created user and enables the first graphical
|
||||
login one-shot.
|
||||
|
||||
Idempotency marker: ~/.local/state/omarchy/setup-user.done
|
||||
USAGE
|
||||
}
|
||||
|
||||
if (( EUID == 0 )); then
|
||||
echo "Error: run omarchy-setup-user as the user being configured, not as root." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
force=0
|
||||
if [[ ${1:-} == "--force" ]]; then
|
||||
force=1
|
||||
elif [[ ${1:-} == "-h" || ${1:-} == "--help" ]]; then
|
||||
cat <<USAGE
|
||||
Usage: omarchy setup user [--force]
|
||||
|
||||
Idempotent user-level setup: copies/symlinks defaults from \$OMARCHY_PATH
|
||||
into \$HOME (config files, AI skills, nautilus extensions, branding, MIME
|
||||
defaults, etc.). Runs automatically on first user login via the omarchy
|
||||
first-run flow; rerun manually after creating a new user, or with --force
|
||||
to refresh after a dev-link.
|
||||
|
||||
Idempotency marker: ~/.local/state/omarchy/setup-user.done
|
||||
USAGE
|
||||
exit 0
|
||||
fi
|
||||
first_install=0
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
--force)
|
||||
force=1
|
||||
shift
|
||||
;;
|
||||
--first-install)
|
||||
first_install=1
|
||||
force=1
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
state_dir="$HOME/.local/state/omarchy"
|
||||
marker="$state_dir/setup-user.done"
|
||||
@@ -40,15 +63,11 @@ fi
|
||||
|
||||
export OMARCHY_PATH="${OMARCHY_PATH:-/usr/share/omarchy}"
|
||||
export OMARCHY_INSTALL="${OMARCHY_INSTALL:-$OMARCHY_PATH/install}"
|
||||
export OMARCHY_SETUP_CONTEXT="${OMARCHY_SETUP_CONTEXT:-runtime}"
|
||||
export PATH="$OMARCHY_PATH/bin:$PATH"
|
||||
|
||||
if [[ -f $OMARCHY_INSTALL/helpers/mode.sh ]]; then
|
||||
source "$OMARCHY_INSTALL/helpers/mode.sh"
|
||||
detect_install_mode
|
||||
export_legacy_mode_flags
|
||||
else
|
||||
install_mode_is() { [[ ${OMARCHY_INSTALL_MODE:-online} == "$1" ]]; }
|
||||
export -f install_mode_is
|
||||
if (( first_install )); then
|
||||
export OMARCHY_SETUP_CONTEXT=iso-chroot
|
||||
fi
|
||||
|
||||
if [[ -n ${OMARCHY_INSTALL_LOG_FILE:-} && -f $OMARCHY_INSTALL/helpers/logging.sh ]]; then
|
||||
@@ -60,38 +79,60 @@ else
|
||||
}
|
||||
fi
|
||||
|
||||
# Copy over Omarchy configs for this user. /etc/skel handles newly-created
|
||||
# users, but existing users installing Omarchy need the same defaults seeded.
|
||||
omarchy_user_systemctl_enable() {
|
||||
local unit="$1" unit_path target
|
||||
local -a targets=()
|
||||
|
||||
if systemctl --user enable "$unit" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# ISO chroot setup has no running user systemd manager. Enabling a user unit
|
||||
# is just creating the [Install] WantedBy symlinks, so do that directly.
|
||||
unit_path="$HOME/.config/systemd/user/$unit"
|
||||
if [[ -f $unit_path ]]; then
|
||||
mapfile -t targets < <(awk -F= '
|
||||
/^\[Install\]/ { in_install=1; next }
|
||||
/^\[/ { in_install=0 }
|
||||
in_install && $1 == "WantedBy" {
|
||||
n=split($2, values, /[[:space:]]+/)
|
||||
for (i = 1; i <= n; i++) if (values[i] != "") print values[i]
|
||||
}
|
||||
' "$unit_path")
|
||||
fi
|
||||
((${#targets[@]})) || targets=(default.target)
|
||||
|
||||
for target in "${targets[@]}"; do
|
||||
mkdir -p "$HOME/.config/systemd/user/$target.wants"
|
||||
ln -sfn "../$unit" "$HOME/.config/systemd/user/$target.wants/$unit"
|
||||
done
|
||||
}
|
||||
export -f omarchy_user_systemctl_enable
|
||||
|
||||
mkdir -p ~/.config
|
||||
cp -R "$OMARCHY_PATH/config/." ~/.config/
|
||||
cp "$OMARCHY_PATH/default/bashrc" ~/.bashrc
|
||||
echo '[[ -f ~/.bashrc ]] && . ~/.bashrc' > ~/.bash_profile
|
||||
|
||||
# AI assistant skill symlinks. Each agent has its own conventional skills
|
||||
# directory; we drop an 'omarchy' entry into each so the skill is loaded.
|
||||
mkdir -p ~/.agents/skills ~/.claude/skills ~/.codex/skills ~/.pi/agent/skills
|
||||
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.agents/skills/omarchy
|
||||
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.claude/skills/omarchy
|
||||
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.codex/skills/omarchy
|
||||
ln -sfn "$OMARCHY_PATH/default/omarchy-skill" ~/.pi/agent/skills/omarchy
|
||||
|
||||
# Toggle state and flags
|
||||
mkdir -p ~/.local/state/omarchy/toggles/hypr
|
||||
cp "$OMARCHY_PATH/default/hypr/toggles/flags.lua" ~/.local/state/omarchy/toggles/hypr/
|
||||
|
||||
# Nautilus python extensions
|
||||
mkdir -p "$HOME/.local/share/nautilus-python/extensions"
|
||||
cp "$OMARCHY_PATH/default/nautilus-python/extensions/localsend.py" \
|
||||
"$HOME/.local/share/nautilus-python/extensions/"
|
||||
cp "$OMARCHY_PATH/default/nautilus-python/extensions/transcode.py" \
|
||||
"$HOME/.local/share/nautilus-python/extensions/"
|
||||
|
||||
# Branding (fastfetch about + screensaver text)
|
||||
mkdir -p ~/.config/omarchy/branding
|
||||
cp "$OMARCHY_PATH/icon.txt" ~/.config/omarchy/branding/about.txt
|
||||
cp "$OMARCHY_PATH/logo.txt" ~/.config/omarchy/branding/screensaver.txt
|
||||
|
||||
# XDG user dirs (folder layout, gtk bookmarks)
|
||||
mkdir -p ~/Downloads ~/Pictures ~/Videos ~/.config/gtk-3.0
|
||||
xdg-user-dirs-update --set TEMPLATES "$HOME"
|
||||
xdg-user-dirs-update --set PUBLICSHARE "$HOME"
|
||||
@@ -103,7 +144,6 @@ for dir in Downloads Projects Pictures Videos; do
|
||||
grep -qxF "$bookmark" ~/.config/gtk-3.0/bookmarks || echo "$bookmark" >>~/.config/gtk-3.0/bookmarks
|
||||
done
|
||||
|
||||
# Hyprland keyboard layout from /etc/vconsole.conf
|
||||
conf=/etc/vconsole.conf
|
||||
hyprlua="$HOME/.config/hypr/input.lua"
|
||||
if [[ -f $conf && -f $hyprlua ]]; then
|
||||
@@ -120,15 +160,18 @@ if [[ -f $conf && -f $hyprlua ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Reusable per-user install phase: theme, shell/user services, default keyring,
|
||||
# hardware-specific user session fixes, and other current-user setup.
|
||||
source "$OMARCHY_INSTALL/user/all.sh"
|
||||
|
||||
# Application catalog + MIME defaults. Run after mise/node setup from user/all
|
||||
# so npm-backed wrappers can be installed for each user.
|
||||
omarchy-refresh-applications
|
||||
xdg-settings set default-web-browser chromium.desktop
|
||||
xdg-mime default HEY.desktop x-scheme-handler/mailto
|
||||
|
||||
if (( first_install )); then
|
||||
mkdir -p "$state_dir/migrations"
|
||||
for migration in "$OMARCHY_PATH"/migrations/*.sh; do
|
||||
[[ -f $migration ]] && touch "$state_dir/migrations/$(basename "$migration")"
|
||||
done
|
||||
fi
|
||||
|
||||
touch "$marker"
|
||||
echo "User setup complete."
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
monitor_command='exec dbus-monitor --system "type='\''signal'\'',sender='\''org.freedesktop.login1'\'',interface='\''org.freedesktop.login1.Manager'\'',member='\''PrepareForSleep'\''"'
|
||||
|
||||
consume_sleep_events() {
|
||||
local line
|
||||
local line sleep_lock
|
||||
sleep_lock=$(command -v omarchy-system-sleep-lock || true)
|
||||
sleep_lock=${sleep_lock:-/usr/bin/omarchy-system-sleep-lock}
|
||||
|
||||
while IFS= read -r line; do
|
||||
if [[ $line == *"boolean true"* ]]; then
|
||||
"$OMARCHY_PATH/bin/omarchy-system-sleep-lock"
|
||||
"$sleep_lock"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
@@ -22,9 +24,12 @@ if [[ ${1:-} == "--consume" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sleep_monitor=$(command -v omarchy-system-sleep-monitor || true)
|
||||
sleep_monitor=${sleep_monitor:-/usr/bin/omarchy-system-sleep-monitor}
|
||||
|
||||
exec systemd-inhibit \
|
||||
--what=sleep \
|
||||
--mode=delay \
|
||||
--who=Omarchy \
|
||||
--why="Lock screen before suspend" \
|
||||
bash -lc "$monitor_command | \"$OMARCHY_PATH/bin/omarchy-system-sleep-monitor\" --consume"
|
||||
bash -lc "$monitor_command | \"$sleep_monitor\" --consume"
|
||||
|
||||
@@ -110,6 +110,10 @@ set_theme_background() {
|
||||
}
|
||||
|
||||
THEME_NAME=$(echo "$1" | sed -E 's/<[^>]+>//g' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
|
||||
THEME_HEADLESS=0
|
||||
if [[ ${OMARCHY_THEME_HEADLESS:-} == "1" || ${OMARCHY_THEME_OFFLINE:-} == "1" ]]; then
|
||||
THEME_HEADLESS=1
|
||||
fi
|
||||
|
||||
if [[ ! -d $OMARCHY_THEMES_PATH/$THEME_NAME ]] && [[ ! -d $USER_THEMES_PATH/$THEME_NAME ]]; then
|
||||
echo "Theme '$THEME_NAME' does not exist"
|
||||
@@ -139,7 +143,7 @@ fi
|
||||
omarchy-theme-set-templates
|
||||
|
||||
OLD_BACKGROUND_SNAPSHOT=""
|
||||
if [[ $OMARCHY_THEME_SKIP_BACKGROUND != "1" ]]; then
|
||||
if [[ $THEME_HEADLESS != "1" && $OMARCHY_THEME_SKIP_BACKGROUND != "1" ]]; then
|
||||
OLD_BACKGROUND_SNAPSHOT=$(snapshot_current_background)
|
||||
fi
|
||||
|
||||
@@ -154,7 +158,7 @@ echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name"
|
||||
# the theme hooks run.
|
||||
colors_payload=$([[ -f $CURRENT_THEME_PATH/colors.toml ]] && base64 -w 0 "$CURRENT_THEME_PATH/colors.toml")
|
||||
shell_payload=$([[ -f $CURRENT_THEME_PATH/shell.toml ]] && base64 -w 0 "$CURRENT_THEME_PATH/shell.toml")
|
||||
if [[ ${OMARCHY_THEME_OFFLINE:-} == "1" ]]; then
|
||||
if [[ $THEME_HEADLESS == "1" ]]; then
|
||||
: # No shell/session bus exists during ISO chroot finalization.
|
||||
elif [[ $OMARCHY_THEME_SKIP_BACKGROUND == "1" ]]; then
|
||||
shell_ipc shell applyTheme "$colors_payload" "$shell_payload" || true
|
||||
@@ -183,7 +187,7 @@ post_theme_commands=(
|
||||
omarchy-theme-set-keyboard
|
||||
)
|
||||
|
||||
if [[ ${OMARCHY_THEME_OFFLINE:-} != "1" ]]; then
|
||||
if [[ $THEME_HEADLESS != "1" ]]; then
|
||||
run_parallel "${post_theme_commands[@]}"
|
||||
|
||||
# Call hook on theme set
|
||||
|
||||
+48
-12
@@ -1,40 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Create a desktop launcher for a terminal UI app
|
||||
# omarchy:args=[name command window-style icon-url]
|
||||
# omarchy:args=[name command window-style icon-url-or-name]
|
||||
|
||||
set -e
|
||||
|
||||
ICON_DIR="$HOME/.local/share/icons/hicolor/256x256/apps"
|
||||
|
||||
safe_icon_name() {
|
||||
printf '%s\n' "$1" \
|
||||
| tr '[:upper:]' '[:lower:]' \
|
||||
| sed 's/[^[:alnum:]]\+/-/g; s/^-//; s/-$//'
|
||||
}
|
||||
|
||||
icon_name_from_ref() {
|
||||
local ref="$1"
|
||||
local name
|
||||
name=$(basename "$ref")
|
||||
|
||||
if [[ $name == *.* ]]; then
|
||||
safe_icon_name "${name%.*}"
|
||||
else
|
||||
printf '%s\n' "$name"
|
||||
fi
|
||||
}
|
||||
|
||||
install_user_icon() {
|
||||
local source="$1"
|
||||
local name="$2"
|
||||
local ext="${source##*.}"
|
||||
|
||||
[[ $ext == "$source" ]] && ext="png"
|
||||
mkdir -p "$ICON_DIR"
|
||||
cp "$source" "$ICON_DIR/$name.$ext"
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
printf '%s\n' "$name"
|
||||
}
|
||||
|
||||
if (( $# != 4 )); then
|
||||
echo -e "\e[32mLet's create a TUI shortcut you can start with the app launcher.\n\e[0m"
|
||||
APP_NAME=$(gum input --prompt "Name> " --placeholder "My TUI")
|
||||
APP_EXEC=$(gum input --prompt "Launch Command> " --placeholder "lazydocker or bash -c 'dust; read -n 1 -s'")
|
||||
WINDOW_STYLE=$(gum choose --header "Window style" float tile)
|
||||
ICON_URL=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG or SVG!)")
|
||||
ICON_REF=$(gum input --prompt "Icon URL/name> " --placeholder "See https://dashboardicons.com or enter an installed icon name")
|
||||
else
|
||||
APP_NAME="$1"
|
||||
APP_EXEC="$2"
|
||||
WINDOW_STYLE="$3"
|
||||
ICON_URL="$4"
|
||||
ICON_REF="$4"
|
||||
fi
|
||||
|
||||
if [[ -z $APP_NAME || -z $APP_EXEC || -z $ICON_URL ]]; then
|
||||
echo "You must set app name, app command, and icon URL!"
|
||||
if [[ -z $APP_NAME || -z $APP_EXEC || -z $ICON_REF ]]; then
|
||||
echo "You must set app name, app command, and icon URL/name!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"
|
||||
mkdir -p "$(dirname "$DESKTOP_FILE")"
|
||||
|
||||
if [[ ! $ICON_URL =~ ^https?:// ]] && [[ -f $ICON_URL ]]; then
|
||||
ICON_PATH="$ICON_URL"
|
||||
else
|
||||
ICON_PATH="$ICON_DIR/$APP_NAME.png"
|
||||
if [[ $ICON_REF =~ ^https?:// ]]; then
|
||||
ICON_VALUE=$(safe_icon_name "$APP_NAME")
|
||||
mkdir -p "$ICON_DIR"
|
||||
if ! curl -sL -o "$ICON_PATH" "$ICON_URL"; then
|
||||
if ! curl -sL -o "$ICON_DIR/$ICON_VALUE.png" "$ICON_REF"; then
|
||||
echo "Error: Failed to download icon."
|
||||
exit 1
|
||||
fi
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
elif [[ -f $ICON_REF ]]; then
|
||||
ICON_VALUE=$(install_user_icon "$ICON_REF" "$(safe_icon_name "$APP_NAME")")
|
||||
else
|
||||
# Bundled Omarchy icons are package-owned under /usr/share/icons/hicolor.
|
||||
ICON_VALUE=$(icon_name_from_ref "$ICON_REF")
|
||||
fi
|
||||
|
||||
if [[ $WINDOW_STYLE == "float" ]]; then
|
||||
@@ -51,7 +87,7 @@ Comment=$APP_NAME
|
||||
Exec=xdg-terminal-exec --app-id=$APP_CLASS -e $APP_EXEC
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=$ICON_PATH
|
||||
Icon=$ICON_VALUE
|
||||
StartupNotify=true
|
||||
EOF
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
ICON_DIR="$HOME/.local/share/icons/hicolor/256x256/apps"
|
||||
OLD_ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
DESKTOP_DIR="$HOME/.local/share/applications/"
|
||||
|
||||
if (( $# == 0 )); then
|
||||
@@ -32,6 +33,7 @@ if [[ -z $APP_NAME ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
icon_name=$(printf '%s\n' "$APP_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^[:alnum:]]\+/-/g; s/^-//; s/-$//')
|
||||
rm -f "$DESKTOP_DIR/$APP_NAME.desktop"
|
||||
rm -f "$ICON_DIR/$APP_NAME.png"
|
||||
rm -f "$ICON_DIR/$icon_name.png" "$ICON_DIR/$APP_NAME.png" "$OLD_ICON_DIR/$APP_NAME.png"
|
||||
omarchy-notification-send -g "TUI removed" "$APP_NAME"
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
set -e
|
||||
|
||||
APP_DIR="${1:-$HOME/.local/share/applications}"
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
ICON_DIR="$HOME/.local/share/icons/hicolor/256x256/apps"
|
||||
OLD_ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
|
||||
echo "Scanning for TUIs in $APP_DIR..."
|
||||
|
||||
@@ -23,9 +24,10 @@ fi
|
||||
|
||||
for file in "${tui_desktop_files[@]}"; do
|
||||
app_name=$(basename "$file" .desktop)
|
||||
icon_name=$(printf '%s\n' "$app_name" | tr '[:upper:]' '[:lower:]' | sed 's/[^[:alnum:]]\+/-/g; s/^-//; s/-$//')
|
||||
echo "Removing TUI: $app_name"
|
||||
rm -f "$file"
|
||||
rm -f "$ICON_DIR/$app_name.png"
|
||||
rm -f "$ICON_DIR/$icon_name.png" "$ICON_DIR/$app_name.png" "$OLD_ICON_DIR/$app_name.png"
|
||||
done
|
||||
|
||||
if command -v update-desktop-database &>/dev/null; then
|
||||
|
||||
+1
-4
@@ -7,8 +7,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Run the update inside a PTY so pacman/yay keep showing download progress
|
||||
# while still logging the full session for later analysis.
|
||||
if [[ -z $OMARCHY_UPDATE_LOGGED ]]; then
|
||||
script_command=$(printf '%q ' "$0" "$@")
|
||||
exec env OMARCHY_UPDATE_LOGGED=1 script -qefc "$script_command" "/tmp/omarchy-update.log"
|
||||
@@ -16,8 +14,7 @@ fi
|
||||
|
||||
trap 'echo ""; echo -e "\033[0;31mSomething went wrong during the update!\n\nPlease review the output above carefully, correct the error, and retry the update.\n\nIf you need assistance, get help from the community at https://omarchy.org/discord\033[0m"' ERR
|
||||
|
||||
if [[ $1 == "-y" ]] || omarchy-update-confirm; then
|
||||
if [[ ${1:-} == "-y" ]] || omarchy-update-confirm; then
|
||||
omarchy-snapshot create || (($? == 127))
|
||||
omarchy-update-git
|
||||
omarchy-update-perform
|
||||
fi
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Get remote tag
|
||||
# omarchy:summary=Check whether the Omarchy package has an available update.
|
||||
|
||||
latest_tag=$(git -C "$OMARCHY_PATH" ls-remote --tags origin | grep -v "{}" | awk '{print $2}' | sed 's#refs/tags/##' | sort -V | tail -n 1)
|
||||
if [[ -z $latest_tag ]]; then
|
||||
echo "Error: Could not retrieve latest tag."
|
||||
exit 1
|
||||
fi
|
||||
set -e
|
||||
|
||||
# Get local tag
|
||||
current_tag=$(git -C "$OMARCHY_PATH" describe --tags $(git -C "$OMARCHY_PATH" rev-list --tags --max-count=1))
|
||||
if [[ -z $current_tag ]]; then
|
||||
echo "Error: Could not retrieve current tag."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $current_tag != $latest_tag ]]; then
|
||||
echo "Omarchy update available ($latest_tag)"
|
||||
if pacman -Qu omarchy >/tmp/omarchy-update-available.$$ 2>/dev/null; then
|
||||
cat /tmp/omarchy-update-available.$$
|
||||
rm -f /tmp/omarchy-update-available.$$
|
||||
exit 0
|
||||
else
|
||||
echo "Omarchy is up to date ($current_tag)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f /tmp/omarchy-update-available.$$
|
||||
echo "Omarchy is up to date"
|
||||
exit 1
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Switch Omarchy branches and update from the selected branch
|
||||
# omarchy:args=<branch>
|
||||
|
||||
set -e
|
||||
|
||||
if (($# == 0)); then
|
||||
echo "Usage: omarchy-update-branch [master|dev]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
branch="$1"
|
||||
|
||||
# Snapshot before switching branch
|
||||
omarchy-snapshot create || (( $? == 127 ))
|
||||
|
||||
if ! git -C "$OMARCHY_PATH" diff --quiet || ! git -C "$OMARCHY_PATH" diff --cached --quiet; then
|
||||
stashed=true
|
||||
git -C "$OMARCHY_PATH" stash push -u -m "Autostash before switching to $branch"
|
||||
else
|
||||
stashed=false
|
||||
fi
|
||||
|
||||
# Switch branches
|
||||
git -C "$OMARCHY_PATH" switch "$branch"
|
||||
|
||||
# Reapply stash if we made one
|
||||
if [[ $stashed == "true" ]]; then
|
||||
if ! git -C "$OMARCHY_PATH" stash pop; then
|
||||
echo "⚠️ Conflicts when applying stash — stash kept"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Update the system from the new branch
|
||||
omarchy-update-perform
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Pull the latest Omarchy git changes
|
||||
|
||||
set -e
|
||||
|
||||
echo -e "\e[32mUpdate Omarchy\e[0m"
|
||||
|
||||
omarchy-update-time
|
||||
|
||||
# Suppress Hyprland config errors while git updates default config files mid-pull
|
||||
hyprctl keyword debug:suppress_errors true &>/dev/null || true
|
||||
hyprctl eval 'hl.config({ debug = { suppress_errors = true } })' &>/dev/null || true
|
||||
|
||||
git -C $OMARCHY_PATH pull --autostash
|
||||
git -C $OMARCHY_PATH --no-pager diff --check || git -C $OMARCHY_PATH reset --merge
|
||||
|
||||
hyprctl reload &>/dev/null || true
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Print the current Omarchy git branch
|
||||
|
||||
echo $(git -C "$OMARCHY_PATH" rev-parse --abbrev-ref HEAD)
|
||||
+48
-12
@@ -1,11 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Create a desktop launcher for a web app
|
||||
# omarchy:args=[name url icon [custom-exec] [mime-types]]
|
||||
# omarchy:args=[name url icon-url-or-name [custom-exec] [mime-types]]
|
||||
|
||||
set -e
|
||||
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
ICON_DIR="$HOME/.local/share/icons/hicolor/256x256/apps"
|
||||
|
||||
safe_icon_name() {
|
||||
printf '%s\n' "$1" \
|
||||
| tr '[:upper:]' '[:lower:]' \
|
||||
| sed 's/[^[:alnum:]]\+/-/g; s/^-//; s/-$//'
|
||||
}
|
||||
|
||||
icon_name_from_ref() {
|
||||
local ref="$1"
|
||||
local name
|
||||
name=$(basename "$ref")
|
||||
|
||||
if [[ $name == *.* ]]; then
|
||||
safe_icon_name "${name%.*}"
|
||||
else
|
||||
printf '%s\n' "$name"
|
||||
fi
|
||||
}
|
||||
|
||||
install_user_icon() {
|
||||
local source="$1"
|
||||
local name="$2"
|
||||
local ext="${source##*.}"
|
||||
|
||||
[[ $ext == "$source" ]] && ext="png"
|
||||
mkdir -p "$ICON_DIR"
|
||||
cp "$source" "$ICON_DIR/$name.$ext"
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
printf '%s\n' "$name"
|
||||
}
|
||||
|
||||
if (( $# < 3 )); then
|
||||
echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m"
|
||||
@@ -18,10 +48,12 @@ if (( $# < 3 )); then
|
||||
# Try to fetch favicon automatically first.
|
||||
FAVICON_URL="https://www.google.com/s2/favicons?domain=${APP_URL}&sz=128"
|
||||
mkdir -p "$ICON_DIR"
|
||||
if curl -fsSL -o "$ICON_DIR/$APP_NAME.png" "$FAVICON_URL" && [[ -s $ICON_DIR/$APP_NAME.png ]]; then
|
||||
ICON_REF="$APP_NAME.png"
|
||||
ICON_VALUE=$(safe_icon_name "$APP_NAME")
|
||||
if curl -fsSL -o "$ICON_DIR/$ICON_VALUE.png" "$FAVICON_URL" && [[ -s $ICON_DIR/$ICON_VALUE.png ]]; then
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
ICON_REF="$ICON_VALUE"
|
||||
else
|
||||
ICON_REF=$(gum input --prompt "Icon URL> " --placeholder "Could not fetch favicon automatically. Enter PNG icon URL (see https://dashboardicons.com)")
|
||||
ICON_REF=$(gum input --prompt "Icon URL/name> " --placeholder "Could not fetch favicon automatically. Enter PNG icon URL or icon name")
|
||||
fi
|
||||
|
||||
CUSTOM_EXEC=""
|
||||
@@ -45,21 +77,24 @@ if [[ -z $APP_NAME || -z $APP_URL ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Resolve icon from URL or from a local icon name.
|
||||
mkdir -p "$ICON_DIR"
|
||||
|
||||
if [[ -z $ICON_REF ]]; then
|
||||
ICON_REF="https://www.google.com/s2/favicons?domain=${APP_URL}&sz=128"
|
||||
fi
|
||||
|
||||
if [[ $ICON_REF =~ ^https?:// ]]; then
|
||||
ICON_PATH="$ICON_DIR/$APP_NAME.png"
|
||||
if ! curl -fsSL -o "$ICON_PATH" "$ICON_REF" || [[ ! -s $ICON_PATH ]]; then
|
||||
ICON_VALUE=$(safe_icon_name "$APP_NAME")
|
||||
mkdir -p "$ICON_DIR"
|
||||
if ! curl -fsSL -o "$ICON_DIR/$ICON_VALUE.png" "$ICON_REF" || [[ ! -s $ICON_DIR/$ICON_VALUE.png ]]; then
|
||||
echo "Error: Failed to download icon."
|
||||
exit 1
|
||||
fi
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
||||
elif [[ -f $ICON_REF ]]; then
|
||||
ICON_VALUE=$(install_user_icon "$ICON_REF" "$(safe_icon_name "$APP_NAME")")
|
||||
else
|
||||
ICON_PATH="$ICON_DIR/$ICON_REF"
|
||||
# Bundled Omarchy icons are package-owned under /usr/share/icons/hicolor.
|
||||
# Accept either "HEY" or the historical "HEY.png" argument form.
|
||||
ICON_VALUE=$(icon_name_from_ref "$ICON_REF")
|
||||
fi
|
||||
|
||||
# Use custom exec if provided, otherwise default behavior
|
||||
@@ -67,6 +102,7 @@ EXEC_COMMAND="${CUSTOM_EXEC:-omarchy-launch-webapp $APP_URL}"
|
||||
|
||||
# Create application .desktop file
|
||||
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"
|
||||
mkdir -p "$(dirname "$DESKTOP_FILE")"
|
||||
|
||||
cat >"$DESKTOP_FILE" <<EOF
|
||||
[Desktop Entry]
|
||||
@@ -76,7 +112,7 @@ Comment=$APP_NAME
|
||||
Exec=$EXEC_COMMAND
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=$ICON_PATH
|
||||
Icon=$ICON_VALUE
|
||||
StartupNotify=true
|
||||
EOF
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
ICON_DIR="$HOME/.local/share/icons/hicolor/256x256/apps"
|
||||
OLD_ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
DESKTOP_DIR="$HOME/.local/share/applications/"
|
||||
|
||||
if (( $# == 0 )); then
|
||||
@@ -32,8 +33,9 @@ if [[ -z $APP_NAME ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
icon_name=$(printf '%s\n' "$APP_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^[:alnum:]]\+/-/g; s/^-//; s/-$//')
|
||||
rm -f "$DESKTOP_DIR/$APP_NAME.desktop"
|
||||
rm -f "$ICON_DIR/$APP_NAME.png"
|
||||
rm -f "$ICON_DIR/$icon_name.png" "$ICON_DIR/$APP_NAME.png" "$OLD_ICON_DIR/$APP_NAME.png"
|
||||
|
||||
omarchy-notification-send -g "Web app removed" "$APP_NAME"
|
||||
update-desktop-database "$DESKTOP_DIR" &>/dev/null
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
set -e
|
||||
|
||||
APP_DIR="${1:-$HOME/.local/share/applications}"
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
ICON_DIR="$HOME/.local/share/icons/hicolor/256x256/apps"
|
||||
OLD_ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
|
||||
echo "Scanning for web apps in $APP_DIR..."
|
||||
|
||||
@@ -23,9 +24,10 @@ fi
|
||||
|
||||
for file in "${webapp_desktop_files[@]}"; do
|
||||
app_name=$(basename "$file" .desktop)
|
||||
icon_name=$(printf '%s\n' "$app_name" | tr '[:upper:]' '[:lower:]' | sed 's/[^[:alnum:]]\+/-/g; s/^-//; s/-$//')
|
||||
echo "Removing web app: $app_name"
|
||||
rm -f "$file"
|
||||
rm -f "$ICON_DIR/$app_name.png"
|
||||
rm -f "$ICON_DIR/$icon_name.png" "$ICON_DIR/$app_name.png" "$OLD_ICON_DIR/$app_name.png"
|
||||
done
|
||||
|
||||
if command -v update-desktop-database &>/dev/null; then
|
||||
|
||||
@@ -44,19 +44,14 @@ install_windows() {
|
||||
|
||||
mkdir -p "$HOME/.windows"
|
||||
mkdir -p "$HOME/.config/windows"
|
||||
mkdir -p "$HOME/.local/share/applications/icons"
|
||||
|
||||
# Install Windows VM icon and desktop file
|
||||
if [[ -f $OMARCHY_PATH/applications/icons/windows.png ]]; then
|
||||
cp "$OMARCHY_PATH/applications/icons/windows.png" "$HOME/.local/share/applications/icons/windows.png"
|
||||
fi
|
||||
mkdir -p "$HOME/.local/share/applications"
|
||||
|
||||
cat << EOF | tee "$HOME/.local/share/applications/windows-vm.desktop" > /dev/null
|
||||
[Desktop Entry]
|
||||
Name=Windows
|
||||
Comment=Start Windows VM via Docker and connect with RDP
|
||||
Exec=uwsm app -- omarchy-windows-vm launch
|
||||
Icon=$HOME/.local/share/applications/icons/windows.png
|
||||
Icon=windows
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=System;Virtualization;
|
||||
|
||||
Reference in New Issue
Block a user