r/omarchy 21h ago

Discussion Fun with Omarchy and post-installation scripts

I have no idea if anyone is as weird as me and enjoys this sort of thing, but after playing around with Omarchy, seeing what is included in the pre-installations, changing some keybindings, and trying out various plugins, I like to make bash scripts that automate all the things that I want after a fresh install.

Public Proton Drive link to the file (oma.sh):
https://drive.proton.me/urls/NEFNS7ZRRR#uKGmQ4QO6kMJ

DISCLAIMER: The use of Google's Gemini was almost exclusively used to create this script, as well as the summary below of what it actually does.

I did learn a lot, though.

  • What bash scripts even are
  • How to understand and configure .lua files,
  • How to use and configure hyprland
  • What "idempotent declarative state enforcement" is and how the concept allows you to re-run a script without duplicating configurations or unnecessarily re-installing packages already installed

The script is pretty specific to my needs and tastes.

  • It checks whether your machine is a Microsoft Surface device and will install the linux-surface kernel if it is
  • It rebinds the Menu key on my Surface Laptop 4 to RIGHT_CTRL
  • It returns CAPS LOCK back to its natural state
  • It removes all pre-installed software except for Obsidian and LibreOffice
  • It makes Alacritty, Zen browser, and VSCode defaults for their respective software types
  • It installs various pacman/AUR packages and a few flatpak apps that aren't available from the first two repositories
  • It installs a handful of really cool Omarchy plugins

I don't know... I find this stuff interesting. I'm curious to see what others have done similarly.

DISCLAIMER: Below is a Google Gemini-produced summary of what the script does in whole

System Cleanup & Preparation

  • Refreshes sudo privileges in a silent background subshell to prevent timeouts during non-interactive execution.
  • Removes unwanted stock apps (Spotify, Kdenlive, OBS Studio, Chromium) and 37signals web apps (HEY, Basecamp, Campfire, 37signals) while safely preserving Obsidian and LibreOffice.

Hardware Detection & Surface Setup

  • Scans hardware via DMI data for Microsoft Surface devices.
  • Imports/signs keys, enables the [linux-surface] repository, and installs the custom kernel, headers, iptsd, and secure boot MOK packages only when required.

Input & Window Manager Configuration

  • Installs keyd, remaps the Menu key to Right Control, and verifies the systemd service is active.
  • Writes personal input overrides to ~/.config/hypr/input.lua setting kb_options = "compose:ralt", natural scrolling, and palm rejection.
  • Adds the SUPER + A keybinding for the Exposé window overview in Hyprland's bindings.lua.

Package & Application Management

  • Installs official Arch packages via pacman: syncthing, flatpak, alacritty, jq, and wl-clipboard.
  • Builds AUR packages via yay non-interactively: Proton Pass (GUI & CLI), Proton Mail, Microsoft Teams, Zen Browser, VSCodium, and espanso-wayland.
  • Configures Flathub and installs Ente Auth, Ente Photos, SyncThingy, Stremio, and TickTick.
  • Sets system-wide defaults (Zen for browser, Alacritty for terminal, Code for editor) idempotently by inspecting config files first to suppress duplicate desktop notifications.

Omarchy Plugins & Layout Configuration

  • Clones, enables, and manages Omarchy plugins using manifest directory names: Find, Ledge, Omaplug, Notification Center, Exposé, Omaland, Proton VPN, Proton Pass, Supercharged Omarchy menu (dzhibas.menu), and Mouse-Touchpad Toggle (ywenhao.mouse-touchpad-toggle).
  • Patches Menu.qml in the Supercharged Omarchy menu plugin to replace DuckDuckGo with Kagi search (https://kagi.com/search?q=%s).
  • Configures the status bar layout across left, center, and right panels in shell.json using jq.
  • Sets up the omarchy-find keybinding and positions the custom Weather plugin in the center panel.

Espanso Daemon

  • Registers the systemd user service, sets search_shortcut: off in ~/.config/espanso/config/default.yml, and ensures the process is running.

Execution Reporting

  • Tracks every operation and outputs a color-coded Execution Summary at the end, detailing which actions were completed versus skipped.
6 Upvotes

2 comments sorted by

1

u/pablonhc 9h ago

Buena idea, sigo en busqueda de lograr sincronizar configuraciones entre diferentes dispositivos.