Full Code of basecamp/omarchy for AI

dev 886320acee68 cached
856 files
555.4 KB
192.3k tokens
1 requests
Download .txt
Showing preview only (709K chars total). Download the full file or copy to clipboard to get everything.
Repository: basecamp/omarchy
Branch: dev
Commit: 886320acee68
Files: 856
Total size: 555.4 KB

Directory structure:
gitextract_zabo41o_/

├── .editorconfig
├── .github/
│   └── ISSUE_TEMPLATE/
│       ├── bug.yml
│       └── config.yml
├── AGENTS.md
├── LICENSE
├── README.md
├── applications/
│   ├── Alacritty.desktop
│   ├── hidden/
│   │   ├── avahi-discover.desktop
│   │   ├── bssh.desktop
│   │   ├── btop.desktop
│   │   ├── bvnc.desktop
│   │   ├── cmake-gui.desktop
│   │   ├── cups.desktop
│   │   ├── dropbox.desktop
│   │   ├── electron34.desktop
│   │   ├── electron36.desktop
│   │   ├── electron37.desktop
│   │   ├── fcitx5-configtool.desktop
│   │   ├── fcitx5-wayland-launcher.desktop
│   │   ├── java-java-openjdk.desktop
│   │   ├── jconsole-java-openjdk.desktop
│   │   ├── jshell-java-openjdk.desktop
│   │   ├── kbd-layout-viewer5.desktop
│   │   ├── kcm_fcitx5.desktop
│   │   ├── kcm_kaccounts.desktop
│   │   ├── kvantummanager.desktop
│   │   ├── limine-snapper-restore.desktop
│   │   ├── org.fcitx.Fcitx5.desktop
│   │   ├── org.fcitx.fcitx5-config-qt.desktop
│   │   ├── org.fcitx.fcitx5-migrator.desktop
│   │   ├── org.fcitx.fcitx5-qt5-gui-wrapper.desktop
│   │   ├── org.fcitx.fcitx5-qt6-gui-wrapper.desktop
│   │   ├── qv4l2.desktop
│   │   ├── qvidcap.desktop
│   │   ├── uuctl.desktop
│   │   ├── wiremix.desktop
│   │   ├── xgps.desktop
│   │   └── xgpsspeed.desktop
│   ├── imv.desktop
│   ├── mpv.desktop
│   └── typora.desktop
├── bin/
│   ├── omarchy-battery-capacity
│   ├── omarchy-battery-monitor
│   ├── omarchy-battery-present
│   ├── omarchy-battery-remaining
│   ├── omarchy-battery-remaining-time
│   ├── omarchy-battery-status
│   ├── omarchy-branch-set
│   ├── omarchy-brightness-display
│   ├── omarchy-brightness-display-apple
│   ├── omarchy-brightness-keyboard
│   ├── omarchy-channel-set
│   ├── omarchy-cmd-audio-switch
│   ├── omarchy-cmd-first-run
│   ├── omarchy-cmd-missing
│   ├── omarchy-cmd-present
│   ├── omarchy-cmd-screenrecord
│   ├── omarchy-cmd-screensaver
│   ├── omarchy-cmd-screenshot
│   ├── omarchy-cmd-share
│   ├── omarchy-cmd-terminal-cwd
│   ├── omarchy-config-direct-boot
│   ├── omarchy-debug
│   ├── omarchy-dev-add-migration
│   ├── omarchy-drive-info
│   ├── omarchy-drive-select
│   ├── omarchy-drive-set-password
│   ├── omarchy-font-current
│   ├── omarchy-font-list
│   ├── omarchy-font-set
│   ├── omarchy-hibernation-available
│   ├── omarchy-hibernation-remove
│   ├── omarchy-hibernation-setup
│   ├── omarchy-hook
│   ├── omarchy-hw-asus-rog
│   ├── omarchy-hw-framework16
│   ├── omarchy-hw-intel
│   ├── omarchy-hw-surface
│   ├── omarchy-hyprland-monitor-scaling-cycle
│   ├── omarchy-hyprland-window-close-all
│   ├── omarchy-hyprland-window-gaps-toggle
│   ├── omarchy-hyprland-window-pop
│   ├── omarchy-hyprland-window-single-square-aspect-toggle
│   ├── omarchy-hyprland-workspace-layout-toggle
│   ├── omarchy-install-chromium-google-account
│   ├── omarchy-install-dev-env
│   ├── omarchy-install-docker-dbs
│   ├── omarchy-install-dropbox
│   ├── omarchy-install-geforce-now
│   ├── omarchy-install-nordvpn
│   ├── omarchy-install-steam
│   ├── omarchy-install-tailscale
│   ├── omarchy-install-terminal
│   ├── omarchy-install-vscode
│   ├── omarchy-install-xbox-controllers
│   ├── omarchy-launch-about
│   ├── omarchy-launch-audio
│   ├── omarchy-launch-bluetooth
│   ├── omarchy-launch-browser
│   ├── omarchy-launch-editor
│   ├── omarchy-launch-floating-terminal-with-presentation
│   ├── omarchy-launch-or-focus
│   ├── omarchy-launch-or-focus-tui
│   ├── omarchy-launch-or-focus-webapp
│   ├── omarchy-launch-screensaver
│   ├── omarchy-launch-tui
│   ├── omarchy-launch-walker
│   ├── omarchy-launch-webapp
│   ├── omarchy-launch-wifi
│   ├── omarchy-lock-screen
│   ├── omarchy-menu
│   ├── omarchy-menu-keybindings
│   ├── omarchy-migrate
│   ├── omarchy-notification-dismiss
│   ├── omarchy-npx-install
│   ├── omarchy-pkg-add
│   ├── omarchy-pkg-aur-accessible
│   ├── omarchy-pkg-aur-add
│   ├── omarchy-pkg-aur-install
│   ├── omarchy-pkg-drop
│   ├── omarchy-pkg-install
│   ├── omarchy-pkg-missing
│   ├── omarchy-pkg-present
│   ├── omarchy-pkg-remove
│   ├── omarchy-powerprofiles-list
│   ├── omarchy-refresh-applications
│   ├── omarchy-refresh-chromium
│   ├── omarchy-refresh-config
│   ├── omarchy-refresh-fastfetch
│   ├── omarchy-refresh-hypridle
│   ├── omarchy-refresh-hyprland
│   ├── omarchy-refresh-hyprlock
│   ├── omarchy-refresh-hyprsunset
│   ├── omarchy-refresh-limine
│   ├── omarchy-refresh-pacman
│   ├── omarchy-refresh-plymouth
│   ├── omarchy-refresh-sddm
│   ├── omarchy-refresh-swayosd
│   ├── omarchy-refresh-tmux
│   ├── omarchy-refresh-walker
│   ├── omarchy-refresh-waybar
│   ├── omarchy-reinstall
│   ├── omarchy-reinstall-configs
│   ├── omarchy-reinstall-git
│   ├── omarchy-reinstall-pkgs
│   ├── omarchy-remove-dev-env
│   ├── omarchy-remove-preinstalls
│   ├── omarchy-restart-app
│   ├── omarchy-restart-bluetooth
│   ├── omarchy-restart-btop
│   ├── omarchy-restart-hyprctl
│   ├── omarchy-restart-hypridle
│   ├── omarchy-restart-hyprsunset
│   ├── omarchy-restart-makima
│   ├── omarchy-restart-mako
│   ├── omarchy-restart-opencode
│   ├── omarchy-restart-pipewire
│   ├── omarchy-restart-swayosd
│   ├── omarchy-restart-terminal
│   ├── omarchy-restart-tmux
│   ├── omarchy-restart-walker
│   ├── omarchy-restart-waybar
│   ├── omarchy-restart-wifi
│   ├── omarchy-restart-xcompose
│   ├── omarchy-setup-dns
│   ├── omarchy-setup-fido2
│   ├── omarchy-setup-fingerprint
│   ├── omarchy-setup-makima
│   ├── omarchy-show-done
│   ├── omarchy-show-logo
│   ├── omarchy-snapshot
│   ├── omarchy-state
│   ├── omarchy-sudo-keepalive
│   ├── omarchy-sudo-passwordless-toggle
│   ├── omarchy-sudo-reset
│   ├── omarchy-swayosd-brightness
│   ├── omarchy-swayosd-kbd-brightness
│   ├── omarchy-system-logout
│   ├── omarchy-system-reboot
│   ├── omarchy-system-shutdown
│   ├── omarchy-theme-bg-install
│   ├── omarchy-theme-bg-next
│   ├── omarchy-theme-bg-set
│   ├── omarchy-theme-current
│   ├── omarchy-theme-install
│   ├── omarchy-theme-list
│   ├── omarchy-theme-refresh
│   ├── omarchy-theme-remove
│   ├── omarchy-theme-set
│   ├── omarchy-theme-set-browser
│   ├── omarchy-theme-set-gnome
│   ├── omarchy-theme-set-keyboard
│   ├── omarchy-theme-set-keyboard-asus-rog
│   ├── omarchy-theme-set-keyboard-f16
│   ├── omarchy-theme-set-obsidian
│   ├── omarchy-theme-set-templates
│   ├── omarchy-theme-set-vscode
│   ├── omarchy-theme-update
│   ├── omarchy-toggle-hybrid-gpu
│   ├── omarchy-toggle-idle
│   ├── omarchy-toggle-nightlight
│   ├── omarchy-toggle-notification-silencing
│   ├── omarchy-toggle-screensaver
│   ├── omarchy-toggle-suspend
│   ├── omarchy-toggle-waybar
│   ├── omarchy-tui-install
│   ├── omarchy-tui-remove
│   ├── omarchy-tui-remove-all
│   ├── omarchy-tz-select
│   ├── omarchy-update
│   ├── omarchy-update-analyze-logs
│   ├── omarchy-update-aur-pkgs
│   ├── omarchy-update-available
│   ├── omarchy-update-available-reset
│   ├── omarchy-update-branch
│   ├── omarchy-update-confirm
│   ├── omarchy-update-firmware
│   ├── omarchy-update-git
│   ├── omarchy-update-keyring
│   ├── omarchy-update-orphan-pkgs
│   ├── omarchy-update-perform
│   ├── omarchy-update-restart
│   ├── omarchy-update-system-pkgs
│   ├── omarchy-update-time
│   ├── omarchy-update-without-idle
│   ├── omarchy-upload-log
│   ├── omarchy-version
│   ├── omarchy-version-branch
│   ├── omarchy-version-channel
│   ├── omarchy-version-pkgs
│   ├── omarchy-voxtype-config
│   ├── omarchy-voxtype-install
│   ├── omarchy-voxtype-model
│   ├── omarchy-voxtype-remove
│   ├── omarchy-voxtype-status
│   ├── omarchy-webapp-handler-hey
│   ├── omarchy-webapp-handler-zoom
│   ├── omarchy-webapp-install
│   ├── omarchy-webapp-remove
│   ├── omarchy-webapp-remove-all
│   ├── omarchy-wifi-powersave
│   └── omarchy-windows-vm
├── boot.sh
├── config/
│   ├── Typora/
│   │   └── themes/
│   │       ├── ia_typora.css
│   │       └── ia_typora_night.css
│   ├── alacritty/
│   │   └── alacritty.toml
│   ├── brave-flags.conf
│   ├── btop/
│   │   └── btop.conf
│   ├── chromium/
│   │   └── Default/
│   │       └── Preferences
│   ├── chromium-flags.conf
│   ├── elephant/
│   │   ├── calc.toml
│   │   ├── desktopapplications.toml
│   │   └── symbols.toml
│   ├── environment.d/
│   │   └── fcitx.conf
│   ├── fastfetch/
│   │   └── config.jsonc
│   ├── fcitx5/
│   │   └── conf/
│   │       ├── clipboard.conf
│   │       └── xcb.conf
│   ├── fontconfig/
│   │   └── fonts.conf
│   ├── ghostty/
│   │   └── config
│   ├── git/
│   │   └── config
│   ├── hypr/
│   │   ├── autostart.conf
│   │   ├── bindings.conf
│   │   ├── hypridle.conf
│   │   ├── hyprland.conf
│   │   ├── hyprlock.conf
│   │   ├── hyprsunset.conf
│   │   ├── input.conf
│   │   ├── looknfeel.conf
│   │   ├── monitors.conf
│   │   └── xdph.conf
│   ├── hyprland-preview-share-picker/
│   │   └── config.yaml
│   ├── imv/
│   │   └── config
│   ├── kitty/
│   │   └── kitty.conf
│   ├── lazygit/
│   │   └── config.yml
│   ├── omarchy/
│   │   ├── extensions/
│   │   │   └── menu.sh
│   │   ├── hooks/
│   │   │   ├── battery-low.sample
│   │   │   ├── font-set.sample
│   │   │   ├── post-update.sample
│   │   │   └── theme-set.sample
│   │   └── themed/
│   │       └── alacritty.toml.tpl.sample
│   ├── opencode/
│   │   └── opencode.json
│   ├── starship.toml
│   ├── swayosd/
│   │   ├── config.toml
│   │   └── style.css
│   ├── systemd/
│   │   └── user/
│   │       ├── omarchy-battery-monitor.service
│   │       └── omarchy-battery-monitor.timer
│   ├── tmux/
│   │   └── tmux.conf
│   ├── uwsm/
│   │   ├── default
│   │   └── env
│   ├── walker/
│   │   └── config.toml
│   ├── waybar/
│   │   ├── config.jsonc
│   │   └── style.css
│   ├── wiremix/
│   │   └── wiremix.toml
│   ├── xdg-terminals.list
│   └── xournalpp/
│       └── settings.xml
├── default/
│   ├── alacritty/
│   │   └── screensaver.toml
│   ├── bash/
│   │   ├── aliases
│   │   ├── envs
│   │   ├── fns/
│   │   │   ├── compression
│   │   │   ├── drives
│   │   │   ├── ssh-port-forwarding
│   │   │   ├── tmux
│   │   │   ├── transcoding
│   │   │   └── worktrees
│   │   ├── functions
│   │   ├── init
│   │   ├── inputrc
│   │   ├── rc
│   │   └── shell
│   ├── bashrc
│   ├── chromium/
│   │   └── extensions/
│   │       └── copy-url/
│   │           ├── background.js
│   │           └── manifest.json
│   ├── elephant/
│   │   ├── omarchy_background_selector.lua
│   │   └── omarchy_themes.lua
│   ├── ghostty/
│   │   └── screensaver
│   ├── gpg/
│   │   └── dirmngr.conf
│   ├── hypr/
│   │   ├── apps/
│   │   │   ├── 1password.conf
│   │   │   ├── bitwarden.conf
│   │   │   ├── browser.conf
│   │   │   ├── davinci-resolve.conf
│   │   │   ├── geforce.conf
│   │   │   ├── hyprshot.conf
│   │   │   ├── jetbrains.conf
│   │   │   ├── localsend.conf
│   │   │   ├── moonlight.conf
│   │   │   ├── pip.conf
│   │   │   ├── qemu.conf
│   │   │   ├── retroarch.conf
│   │   │   ├── steam.conf
│   │   │   ├── system.conf
│   │   │   ├── telegram.conf
│   │   │   ├── terminals.conf
│   │   │   ├── walker.conf
│   │   │   └── webcam-overlay.conf
│   │   ├── apps.conf
│   │   ├── autostart.conf
│   │   ├── bindings/
│   │   │   ├── clipboard.conf
│   │   │   ├── media.conf
│   │   │   ├── tiling-v2.conf
│   │   │   ├── tiling.conf
│   │   │   └── utilities.conf
│   │   ├── bindings.conf
│   │   ├── envs.conf
│   │   ├── input.conf
│   │   ├── looknfeel.conf
│   │   ├── plain-bindings.conf
│   │   └── windows.conf
│   ├── limine/
│   │   ├── default.conf
│   │   └── limine.conf
│   ├── makima/
│   │   └── AT Translated Set 2 keyboard.toml
│   ├── mako/
│   │   └── core.ini
│   ├── omarchy-skill/
│   │   └── SKILL.md
│   ├── pacman/
│   │   ├── mirrorlist-edge
│   │   ├── mirrorlist-rc
│   │   ├── mirrorlist-stable
│   │   ├── pacman-edge.conf
│   │   ├── pacman-rc.conf
│   │   └── pacman-stable.conf
│   ├── plymouth/
│   │   ├── omarchy.plymouth
│   │   └── omarchy.script
│   ├── sddm/
│   │   └── omarchy/
│   │       ├── Main.qml
│   │       ├── metadata.desktop
│   │       └── theme.conf
│   ├── systemd/
│   │   ├── faster-shutdown.conf
│   │   ├── system/
│   │   │   └── supergfxd.service.d/
│   │   │       └── delay-start.conf
│   │   ├── system-sleep/
│   │   │   ├── force-igpu
│   │   │   ├── keyboard-backlight
│   │   │   └── unmount-fuse
│   │   └── user@.service.d/
│   │       └── faster-shutdown.conf
│   ├── themed/
│   │   ├── alacritty.toml.tpl
│   │   ├── btop.theme.tpl
│   │   ├── chromium.theme.tpl
│   │   ├── ghostty.conf.tpl
│   │   ├── hyprland-preview-share-picker.css.tpl
│   │   ├── hyprland.conf.tpl
│   │   ├── hyprlock.conf.tpl
│   │   ├── keyboard.rgb.tpl
│   │   ├── kitty.conf.tpl
│   │   ├── mako.ini.tpl
│   │   ├── obsidian.css.tpl
│   │   ├── swayosd.css.tpl
│   │   ├── walker.css.tpl
│   │   └── waybar.css.tpl
│   ├── udev/
│   │   └── framework16-qmk-hid.rules
│   ├── voxtype/
│   │   └── config.toml
│   ├── walker/
│   │   ├── restart.conf
│   │   ├── themes/
│   │   │   └── omarchy-default/
│   │   │       ├── layout.xml
│   │   │       └── style.css
│   │   └── walker.desktop
│   ├── waybar/
│   │   └── indicators/
│   │       ├── idle.sh
│   │       ├── notification-silencing.sh
│   │       └── screen-recording.sh
│   ├── wireplumber/
│   │   └── wireplumber.conf.d/
│   │       └── alsa-soft-mixer.conf
│   └── xcompose
├── icon.txt
├── install/
│   ├── config/
│   │   ├── all.sh
│   │   ├── branding.sh
│   │   ├── config.sh
│   │   ├── detect-keyboard-layout.sh
│   │   ├── docker.sh
│   │   ├── fast-shutdown.sh
│   │   ├── fix-powerprofilesctl-shebang.sh
│   │   ├── git.sh
│   │   ├── gpg.sh
│   │   ├── hardware/
│   │   │   ├── bluetooth.sh
│   │   │   ├── fix-apple-spi-keyboard.sh
│   │   │   ├── fix-apple-suspend-nvme.sh
│   │   │   ├── fix-apple-t2.sh
│   │   │   ├── fix-asus-rog-audio-mixer.sh
│   │   │   ├── fix-asus-rog-mic.sh
│   │   │   ├── fix-bcm43xx.sh
│   │   │   ├── fix-dell-xps-audio.sh
│   │   │   ├── fix-dell-xps-haptic-touchpad.sh
│   │   │   ├── fix-f13-amd-audio-input.sh
│   │   │   ├── fix-fkeys.sh
│   │   │   ├── fix-intel-panther-lake-display.sh
│   │   │   ├── fix-surface-keyboard.sh
│   │   │   ├── fix-synaptic-touchpad.sh
│   │   │   ├── fix-tuxedo-backlight.sh
│   │   │   ├── fix-yt6801-ethernet-adapter.sh
│   │   │   ├── framework16-qmk-hid.sh
│   │   │   ├── ignore-power-button.sh
│   │   │   ├── intel-ipu7-camera.sh
│   │   │   ├── intel-thermald.sh
│   │   │   ├── intel.sh
│   │   │   ├── network.sh
│   │   │   ├── nvidia.sh
│   │   │   ├── printer.sh
│   │   │   ├── set-wireless-regdom.sh
│   │   │   ├── usb-autosuspend.sh
│   │   │   └── vulkan.sh
│   │   ├── increase-file-watchers.sh
│   │   ├── increase-lockout-limit.sh
│   │   ├── increase-sudo-tries.sh
│   │   ├── input-group.sh
│   │   ├── kernel-modules-hook.sh
│   │   ├── localdb.sh
│   │   ├── mimetypes.sh
│   │   ├── mise-work.sh
│   │   ├── omarchy-ai-skill.sh
│   │   ├── plocate-ac-only.sh
│   │   ├── powerprofilesctl-rules.sh
│   │   ├── remove-fcitx5-autostart.sh
│   │   ├── ssh-flakiness.sh
│   │   ├── sudoless-asdcontrol.sh
│   │   ├── theme.sh
│   │   ├── timezones.sh
│   │   ├── unmount-fuse.sh
│   │   ├── walker-elephant.sh
│   │   ├── wifi-powersave-rules.sh
│   │   └── xcompose.sh
│   ├── first-run/
│   │   ├── battery-monitor.sh
│   │   ├── cleanup-reboot-sudoers.sh
│   │   ├── dns-resolver.sh
│   │   ├── elephant.sh
│   │   ├── firewall.sh
│   │   ├── gnome-theme.sh
│   │   ├── welcome.sh
│   │   └── wifi.sh
│   ├── helpers/
│   │   ├── all.sh
│   │   ├── chroot.sh
│   │   ├── errors.sh
│   │   ├── logging.sh
│   │   └── presentation.sh
│   ├── login/
│   │   ├── all.sh
│   │   ├── default-keyring.sh
│   │   ├── limine-snapper.sh
│   │   ├── plymouth.sh
│   │   └── sddm.sh
│   ├── omarchy-base.packages
│   ├── omarchy-other.packages
│   ├── packaging/
│   │   ├── all.sh
│   │   ├── asus-rog.sh
│   │   ├── base.sh
│   │   ├── fonts.sh
│   │   ├── framework16.sh
│   │   ├── icons.sh
│   │   ├── npx.sh
│   │   ├── nvim.sh
│   │   ├── surface.sh
│   │   ├── tuis.sh
│   │   └── webapps.sh
│   ├── post-install/
│   │   ├── all.sh
│   │   ├── allow-reboot.sh
│   │   ├── finished.sh
│   │   ├── hibernation.sh
│   │   └── pacman.sh
│   └── preflight/
│       ├── all.sh
│       ├── begin.sh
│       ├── disable-mkinitcpio.sh
│       ├── first-run-mode.sh
│       ├── guard.sh
│       ├── migrations.sh
│       ├── pacman.sh
│       └── show-env.sh
├── install.sh
├── logo.txt
├── migrations/
│   ├── 1751134560.sh
│   ├── 1751134562.sh
│   ├── 1751134563.sh
│   ├── 1751134564.sh
│   ├── 1751134568.sh
│   ├── 1751135253.sh
│   ├── 1751510848.sh
│   ├── 1751667620.sh
│   ├── 1751669258.sh
│   ├── 1751672984.sh
│   ├── 1751679069.sh
│   ├── 1751821819.sh
│   ├── 1751887718.sh
│   ├── 1752081088.sh
│   ├── 1752082381.sh
│   ├── 1752091783.sh
│   ├── 1752104271.sh
│   ├── 1752168292.sh
│   ├── 1752188554.sh
│   ├── 1752292967.sh
│   ├── 1752535084.sh
│   ├── 1752535341.sh
│   ├── 1752543801.sh
│   ├── 1752643269.sh
│   ├── 1752678932.sh
│   ├── 1752725616.sh
│   ├── 1752793122.sh
│   ├── 1752797704.sh
│   ├── 1752874371.sh
│   ├── 1752896442.sh
│   ├── 1752897642.sh
│   ├── 1752955912.sh
│   ├── 1752981883.sh
│   ├── 1753138691.sh
│   ├── 1753224615.sh
│   ├── 1753495989.sh
│   ├── 1753689791.sh
│   ├── 1753908454.sh
│   ├── 1754047941.sh
│   ├── 1754109724.sh
│   ├── 1754215533.sh
│   ├── 1754221967.sh
│   ├── 1754228071.sh
│   ├── 1754331529.sh
│   ├── 1754332200.sh
│   ├── 1754389057.sh
│   ├── 1754390772.sh
│   ├── 1754509222.sh
│   ├── 1754514972.sh
│   ├── 1754566681.sh
│   ├── 1754668999.sh
│   ├── 1754856741.sh
│   ├── 1754860578.sh
│   ├── 1754984734.sh
│   ├── 1754996869.sh
│   ├── 1755109182.sh
│   ├── 1755139080.sh
│   ├── 1755208929.sh
│   ├── 1755340533.sh
│   ├── 1755436367.sh
│   ├── 1755455095.sh
│   ├── 1755459930.sh
│   ├── 1755494432.sh
│   ├── 1755507891.sh
│   ├── 1755795450.sh
│   ├── 1755865046.sh
│   ├── 1755867743.sh
│   ├── 1755870033.sh
│   ├── 1755904244.sh
│   ├── 1755920552.sh
│   ├── 1755930114.sh
│   ├── 1756060611.sh
│   ├── 1756115364.sh
│   ├── 1756153445.sh
│   ├── 1756203383.sh
│   ├── 1756205202.sh
│   ├── 1756300740.sh
│   ├── 1756360552.sh
│   ├── 1756371020.sh
│   ├── 1756410649.sh
│   ├── 1756411333.sh
│   ├── 1756411865.sh
│   ├── 1756491748.sh
│   ├── 1756494998.sh
│   ├── 1756507384.sh
│   ├── 1756556731.sh
│   ├── 1756629295.sh
│   ├── 1756642681.sh
│   ├── 1756650507.sh
│   ├── 1756911131.sh
│   ├── 1757021485.sh
│   ├── 1757147211.sh
│   ├── 1757279511.sh
│   ├── 1757361127.sh
│   ├── 1757361128.sh
│   ├── 1757435811.sh
│   ├── 1757435812.sh
│   ├── 1757483378.sh
│   ├── 1757511571.sh
│   ├── 1757515650.sh
│   ├── 1757535736.sh
│   ├── 1757783204.sh
│   ├── 1757861484.sh
│   ├── 1757866485.sh
│   ├── 1757877123.sh
│   ├── 1757877852.sh
│   ├── 1757879836.sh
│   ├── 1758019332.sh
│   ├── 1758051607.sh
│   ├── 1758104201.sh
│   ├── 1758107879.sh
│   ├── 1758111304.sh
│   ├── 1758142943.sh
│   ├── 1758436991.sh
│   ├── 1758455816.sh
│   ├── 1758487660_change_dm_to_sddm.sh
│   ├── 1758487662_move_to_custom_uki.sh
│   ├── 1758562032.sh
│   ├── 1758564460.sh
│   ├── 1759093827.sh
│   ├── 1759270604.sh
│   ├── 1759355846.sh
│   ├── 1759691413.sh
│   ├── 1759694076.sh
│   ├── 1759895423.sh
│   ├── 1759913695.sh
│   ├── 1760144906.sh
│   ├── 1760301290.sh
│   ├── 1760304963.sh
│   ├── 1760434895.sh
│   ├── 1760441237.sh
│   ├── 1760462260.sh
│   ├── 1760471009.sh
│   ├── 1760684828.sh
│   ├── 1760693222.sh
│   ├── 1760724934.sh
│   ├── 1760730253.sh
│   ├── 1760787158.sh
│   ├── 1761180745.sh
│   ├── 1761241493.sh
│   ├── 1761247569.sh
│   ├── 1761269603.sh
│   ├── 1761274806.sh
│   ├── 1761274980.sh
│   ├── 1761569743.sh
│   ├── 1761585764.sh
│   ├── 1761638377.sh
│   ├── 1761758552.sh
│   ├── 1761897226.sh
│   ├── 1762121828.sh
│   ├── 1762150269.sh
│   ├── 1762156000.sh
│   ├── 1762352101.sh
│   ├── 1762417304.sh
│   ├── 1762446739.sh
│   ├── 1762684663.sh
│   ├── 1762685081.sh
│   ├── 1762711005.sh
│   ├── 1762768186.sh
│   ├── 1762770442.sh
│   ├── 1762770815.sh
│   ├── 1762781907.sh
│   ├── 1762802472.sh
│   ├── 1762873545.sh
│   ├── 1763386443.sh
│   ├── 1763393133.sh
│   ├── 1763409182.sh
│   ├── 1763409505.sh
│   ├── 1763478660.sh
│   ├── 1763558828.sh
│   ├── 1763560161.sh
│   ├── 1763561396.sh
│   ├── 1763583093.sh
│   ├── 1763626772.sh
│   ├── 1763633307.sh
│   ├── 1763634099.sh
│   ├── 1763653692.sh
│   ├── 1763743755.sh
│   ├── 1763753641.sh
│   ├── 1764067068.sh
│   ├── 1764067963.sh
│   ├── 1764332115.sh
│   ├── 1764333665.sh
│   ├── 1764378788.sh
│   ├── 1765587218.sh
│   ├── 1765729055.sh
│   ├── 1765739892.sh
│   ├── 1765744321.sh
│   ├── 1765846739.sh
│   ├── 1765884267.sh
│   ├── 1766942230.sh
│   ├── 1767138576.sh
│   ├── 1767227973.sh
│   ├── 1767306902.sh
│   ├── 1767414310.sh
│   ├── 1767478141.sh
│   ├── 1767478687.sh
│   ├── 1767685679.sh
│   ├── 1767716691.sh
│   ├── 1767865784.sh
│   ├── 1768236764.sh
│   ├── 1768270644.sh
│   ├── 1768906440.sh
│   ├── 1768916735.sh
│   ├── 1769182209.sh
│   ├── 1769183359.sh
│   ├── 1769510847.sh
│   ├── 1769543550.sh
│   ├── 1769566732.sh
│   ├── 1769616857.sh
│   ├── 1769619823.sh
│   ├── 1769964367.sh
│   ├── 1770159912.sh
│   ├── 1770372978.sh
│   ├── 1770375655.sh
│   ├── 1770375817.sh
│   ├── 1770380577.sh
│   ├── 1770393078.sh
│   ├── 1770483021.sh
│   ├── 1770638893.sh
│   ├── 1770811646.sh
│   ├── 1771002522.sh
│   ├── 1771188969.sh
│   ├── 1771345870.sh
│   ├── 1771403119.sh
│   ├── 1771602477.sh
│   ├── 1771602647.sh
│   ├── 1771606080.sh
│   ├── 1771606249.sh
│   ├── 1771615907.sh
│   ├── 1771618300.sh
│   ├── 1771651931.sh
│   ├── 1771667323.sh
│   ├── 1771670389.sh
│   ├── 1771682500.sh
│   ├── 1771683168.sh
│   ├── 1771683296.sh
│   ├── 1771847961.sh
│   ├── 1772051864.sh
│   ├── 1772120972.sh
│   ├── 1772211023.sh
│   ├── 1772293693.sh
│   ├── 1772294096.sh
│   ├── 1772379119.sh
│   ├── 1772389838.sh
│   ├── 1772632144.sh
│   ├── 1772907198.sh
│   ├── 1772964511.sh
│   ├── 1772981555.sh
│   ├── 1772981757.sh
│   ├── 1772988614.sh
│   ├── 1772990935.sh
│   ├── 1773012889.sh
│   ├── 1773505447.sh
│   ├── 1773598247.sh
│   └── 1773599943.sh
├── themes/
│   ├── catppuccin/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   ├── vscode.json
│   │   └── waybar.css
│   ├── catppuccin-latte/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── light.mode
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── ethereal/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── everforest/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── flexoki-light/
│   │   ├── btop.theme
│   │   ├── chromium.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── light.mode
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── gruvbox/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── hackerman/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── kanagawa/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── hyprland.conf
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── lumon/
│   │   ├── btop.theme
│   │   ├── chromium.theme
│   │   ├── colors.toml
│   │   ├── hyprland.conf
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   ├── swayosd.css
│   │   └── waybar.css
│   ├── matte-black/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── miasma/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── nord/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── osaka-jade/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── ristretto/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── rose-pine/
│   │   ├── btop.theme
│   │   ├── chromium.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── light.mode
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── tokyo-night/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── keyboard.rgb
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── vantablack/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   └── white/
│       ├── btop.theme
│       ├── colors.toml
│       ├── icons.theme
│       ├── light.mode
│       ├── neovim.lua
│       └── vscode.json
└── version

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
root = true

[*]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8


================================================
FILE: .github/ISSUE_TEMPLATE/bug.yml
================================================
name: Bug
description: Report a validated bug -- NOT FOR SUPPORT REQUESTS
labels: [bug]
body:
  - type: markdown
    attributes:
      value: |
        Remember: Omarchy is an open source gift, not a product you bought from a vendor

  - type: input
    id: system-details
    attributes:
      label: System details
      placeholder: e.g. AMD 9950X, NVIDIA 5090, Omarchy 2.1.0
    validations:
      required: true

  - type: textarea
    id: steps
    attributes:
      label: What's wrong?
      description: Describe the issue, include steps to recreate it if possible, and attach the output of `omarchy-debug` if possible
    validations:
      required: true


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
  - name: Suggestion
    url: https://github.com/basecamp/omarchy/discussions/categories/suggestions
    about: Suggest a new feature, change to existing feature, or other ideas in Discussions.
  - name: Support
    url: https://omarchy.org/discord
    about: Need help? Join our Discord community for support with any issues. GitHub issues should be used for verified bugs only.


================================================
FILE: AGENTS.md
================================================
# Style

- Two spaces for indentation, no tabs
- Use bash 5 conditionals: use `[[ ]]` for string/file tests and `(( ))` for numeric tests
- In `[[ ]]`, don't quote variables, but do quote string literals when comparing values (e.g., `[[ $branch == "dev" ]]`)
- Prefer `(( ))` over numeric operators inside `[[ ]]` (e.g., `(( count < 50 ))`, not `[[ $count -lt 50 ]]`)
- For strings/paths with spaces, quote them instead of escaping spaces with `\ ` (e.g., `"$APP_DIR/Disk Usage.desktop"`, not `$APP_DIR/Disk\ Usage.desktop`)
- Shebangs must use `#!/bin/bash` consistently (never `#!/usr/bin/env bash`)

# Command Naming

All commands start with `omarchy-`. Prefixes indicate purpose:

- `cmd-` - check if commands exist, misc utility commands
- `pkg-` - package management helpers
- `hw-` - hardware detection (return exit codes for use in conditionals)
- `refresh-` - copy default config to user's `~/.config/`
- `restart-` - restart a component
- `launch-` - open applications
- `install-` - install optional software
- `setup-` - interactive setup wizards
- `toggle-` - toggle features on/off
- `theme-` - theme management
- `update-` - update components

# Helper Commands

Use these instead of raw shell commands:

- `omarchy-cmd-missing` / `omarchy-cmd-present` - check for commands
- `omarchy-pkg-missing` / `omarchy-pkg-present` - check for packages
- `omarchy-pkg-add` - install packages (handles both pacman and AUR)
- `omarchy-hw-asus-rog` - detect ASUS ROG hardware (and similar `hw-*` commands)

# Config Structure

- `config/` - default configs copied to `~/.config/`
- `default/themed/*.tpl` - templates with `{{ variable }}` placeholders for theme colors
- `themes/*/colors.toml` - theme color definitions (accent, background, foreground, color0-15)

# Refresh Pattern

To copy a default config to user config with automatic backup:

```bash
omarchy-refresh-config hypr/hyprlock.conf
```

This copies `~/.local/share/omarchy/config/hypr/hyprlock.conf` to `~/.config/hypr/hyprlock.conf`.

# Migrations

To create a new migration, run `omarchy-dev-add-migration --no-edit`. This creates a migration file named after the unix timestamp of the last commit.

Migration format:
- No shebang line
- Start with an `echo` describing what the migration does
- Use `$OMARCHY_PATH` to reference the omarchy directory

Example:
```bash
echo "Disable fingerprint in hyprlock if fingerprint auth is not configured"

if omarchy-cmd-missing fprintd-list || ! fprintd-list "$USER" 2>/dev/null | grep -q "finger"; then
  sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf
fi
```


================================================
FILE: LICENSE
================================================
Copyright (c) David Heinemeier Hansson

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
# Omarchy

Omarchy is a beautiful, modern & opinionated Linux distribution by DHH.

Read more at [omarchy.org](https://omarchy.org).

## License

Omarchy is released under the [MIT License](https://opensource.org/licenses/MIT).


================================================
FILE: applications/Alacritty.desktop
================================================
[Desktop Entry]
Type=Application
TryExec=alacritty
Exec=alacritty
Icon=Alacritty
Terminal=false
Categories=System;TerminalEmulator;
Name=Alacritty
GenericName=Terminal
Comment=A fast, cross-platform, OpenGL terminal emulator
StartupNotify=true
StartupWMClass=Alacritty
Actions=New;
X-TerminalArgExec=-e
X-TerminalArgAppId=--class=
X-TerminalArgTitle=--title=
X-TerminalArgDir=--working-directory=

[Desktop Action New]
Name=New Terminal
Exec=alacritty


================================================
FILE: applications/hidden/avahi-discover.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/bssh.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/btop.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/bvnc.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/cmake-gui.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/cups.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/dropbox.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/electron34.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/electron36.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/electron37.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/fcitx5-configtool.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/fcitx5-wayland-launcher.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/java-java-openjdk.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/jconsole-java-openjdk.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/jshell-java-openjdk.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/kbd-layout-viewer5.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/kcm_fcitx5.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/kcm_kaccounts.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/kvantummanager.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/limine-snapper-restore.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/org.fcitx.Fcitx5.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/org.fcitx.fcitx5-config-qt.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/org.fcitx.fcitx5-migrator.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/org.fcitx.fcitx5-qt5-gui-wrapper.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/org.fcitx.fcitx5-qt6-gui-wrapper.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/qv4l2.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/qvidcap.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/uuctl.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/wiremix.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/xgps.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/hidden/xgpsspeed.desktop
================================================
[Desktop Entry]
Hidden=true


================================================
FILE: applications/imv.desktop
================================================
[Desktop Entry]
Name=Image Viewer
Exec=imv %F
Icon=imv
Type=Application
MimeType=image/png;image/jpeg;image/jpg;image/gif;image/bmp;image/webp;image/tiff;image/x-xcf;image/x-portable-pixmap;image/x-xbitmap;
Terminal=false
Categories=Graphics;Viewer;


================================================
FILE: applications/mpv.desktop
================================================
[Desktop Entry]
Type=Application
Name=Media Player
Name[ar]=مشغل وسائط mpv
Name[ca]=Reproductor multimèdia mpv
Name[cs]=mpv přehrávač
Name[da]=mpv-medieafspiller
Name[fr]=Lecteur multimédia mpv
Name[it]=Lettore multimediale mpv
Name[ja]=mpv メディアプレイヤー
Name[pl]=Odtwarzacz mpv
Name[ru]=Проигрыватель mpv
Name[tr]=mpv Ortam Oynatıcı
Name[zh_CN]=mpv 媒体播放器
Name[zh_TW]=mpv 媒體播放器
GenericName=Multimedia player
GenericName[ar]=مُشَغِّل وسائط متعددة
GenericName[cs]=Multimediální přehrávač
GenericName[da]=Multimedieafspiller
GenericName[fr]=Lecteur multimédia
GenericName[it]=Lettore multimediale
GenericName[ja]=マルチメディアプレイヤー
GenericName[ru]=Мультимедийный проигрыватель
GenericName[tr]=Çoklu ortam oynatıcı
GenericName[zh_CN]=多媒体播放器
GenericName[zh_TW]=多媒體播放器
Comment=Play movies and songs
Comment[ar]=شَغِّل الأفلام والأغاني
Comment[ca]=Reproduïu vídeos i cançons
Comment[cs]=Přehrává filmy a hudbu
Comment[da]=Afspil film og sange
Comment[de]=Filme und Musik abspielen
Comment[es]=Reproduzca vídeos y canciones
Comment[fr]=Lire des vidéos et des musiques
Comment[ja]=映画や音楽を再生する
Comment[it]=Riproduci video e canzoni
Comment[pl]=Odtwarzaj filmy i muzykę
Comment[ru]=Воспроизведение фильмов и музыки
Comment[tr]=Filmleri ve şarkıları oynatın
Comment[zh_CN]=播放电影和歌曲
Comment[zh_TW]=播放電影和歌曲
Icon=mpv
TryExec=mpv
Exec=mpv --player-operation-mode=pseudo-gui -- %U
Terminal=false
Categories=AudioVideo;Audio;Video;Player;TV;
MimeType=application/ogg;application/x-ogg;application/mxf;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/aiff;audio/x-aiff;audio/m4a;audio/x-m4a;application/x-extension-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/mpeg2;audio/mpeg3;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/musepack;audio/x-musepack;audio/ogg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg2;video/x-mpeg3;video/mp4v-es;video/x-m4v;video/mp4;application/x-extension-mp4;video/divx;video/vnd.divx;video/msvideo;video/x-msvideo;video/ogg;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;audio/x-ms-asf;application/vnd.ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/avi;video/x-flic;video/fli;video/x-flc;video/flv;video/x-flv;video/x-theora;video/x-theora+ogg;video/x-matroska;video/mkv;audio/x-matroska;application/x-matroska;video/webm;audio/webm;audio/vorbis;audio/x-vorbis;audio/x-vorbis+ogg;video/x-ogm;video/x-ogm+ogg;application/x-ogm;application/x-ogm-audio;application/x-ogm-video;application/x-shorten;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;audio/eac3;audio/amr-wb;video/mp2t;audio/flac;audio/mp4;application/x-mpegurl;video/vnd.mpegurl;application/vnd.apple.mpegurl;audio/x-pn-au;video/3gp;video/3gpp;video/3gpp2;audio/3gpp;audio/3gpp2;video/dv;audio/dv;audio/opus;audio/vnd.dts;audio/vnd.dts.hd;audio/x-adpcm;application/x-cue;audio/m3u;audio/vnd.wave;video/vnd.avi;
X-KDE-Protocols=appending,file,ftp,hls,http,https,mms,mpv,rtmp,rtmps,rtmpt,rtmpts,rtp,rtsp,rtsps,sftp,srt,srtp,webdav,webdavs
StartupWMClass=mpv
Keywords=mpv;media;player;video;audio;tv;
Keywords[ar]=mpv;إم بي في;ام بي في;وسائط;مشغل;فيديو;مرئية;صوتي;تلفاز;


================================================
FILE: applications/typora.desktop
================================================
[Desktop Entry]
Name=Typora
GenericName=Markdown Editor
Exec=typora --enable-wayland-ime %U
Icon=typora
Type=Application
StartupNotify=true
Categories=Office;WordProcessor;
MimeType=text/markdown;text/x-markdown;



================================================
FILE: bin/omarchy-battery-capacity
================================================
#!/bin/bash

# Returns the battery full capacity in Wh (rounded to whole number).
# Used by omarchy-battery-status for displaying battery capacity.

battery_info=$(upower -i $(upower -e | grep BAT))

echo "$battery_info" | awk '/energy-full:/ {
    printf "%d", $2
    exit
}'


================================================
FILE: bin/omarchy-battery-monitor
================================================
#!/bin/bash

# Designed to be run by systemd timer every 30 seconds and alerts if battery is low

BATTERY_THRESHOLD=10
NOTIFICATION_FLAG="/run/user/$UID/omarchy_battery_notified"
BATTERY_LEVEL=$(omarchy-battery-remaining)
BATTERY_STATE=$(upower -i $(upower -e | grep 'BAT') | grep -E "state" | awk '{print $2}')

send_notification() {
  notify-send -u critical "󱐋 Time to recharge!" "Battery is down to ${1}%" -i battery-caution -t 30000
  omarchy-hook battery-low "$1"
}

if [[ -n $BATTERY_LEVEL && $BATTERY_LEVEL =~ ^[0-9]+$ ]]; then
  if [[ $BATTERY_STATE == "discharging" ]] && (( BATTERY_LEVEL <= BATTERY_THRESHOLD )); then
    if [[ ! -f $NOTIFICATION_FLAG ]]; then
      send_notification $BATTERY_LEVEL
      touch $NOTIFICATION_FLAG
    fi
  else
    rm -f $NOTIFICATION_FLAG
  fi
fi


================================================
FILE: bin/omarchy-battery-present
================================================
#!/bin/bash

# Returns true if a battery is present on the system.
# Used by the battery monitor and other battery-related checks.

for bat in /sys/class/power_supply/BAT*; do
  [[ -r $bat/present ]] &&
  [[ $(cat $bat/present) == "1" ]] &&
  [[ $(cat $bat/type) == "Battery" ]] &&
  exit 0
done

exit 1


================================================
FILE: bin/omarchy-battery-remaining
================================================
#!/bin/bash

# Returns the battery percentage remaining as an integer.
# Used by the battery monitor and the Ctrl + Shift + Super + B hotkey.

upower -i $(upower -e | grep BAT) | awk '/percentage/ { 
    print int($2)
    exit
}'


================================================
FILE: bin/omarchy-battery-remaining-time
================================================
#!/bin/bash

# Returns the battery time remaining (to empty or full) in a compact format.

battery_info=$(upower -i $(upower -e | grep BAT))

echo "$battery_info" | awk '/time to (empty|full)/ {
    value = $4
    unit = $5
    if (unit == "minutes") {
        hours = int(value / 60)
        minutes = int(value % 60)
    } else {
        hours = int(value)
        minutes = int((value - hours) * 60)
    }
    if (hours > 0 && minutes > 0) {
        printf "%dh %dm", hours, minutes
    } else if (hours > 0) {
        printf "%dh", hours
    } else {
        printf "%dm", minutes
    }
    exit
}'


================================================
FILE: bin/omarchy-battery-status
================================================
#!/bin/bash

# Returns a formatted battery status string with percentage and power draw/charge.
# Used by the battery notification hotkey (Ctrl + Shift + Super + B).

battery_info=$(upower -i $(upower -e | grep BAT))

percentage=$(echo "$battery_info" | awk '/percentage/ {
    print int($2)
    exit
}')

power_rate=$(echo "$battery_info" | awk '/energy-rate/ {
    rounded = sprintf("%.1f", $2)
    sub(/\.0$/, "", rounded)
    print rounded
    exit
}')

state=$(echo "$battery_info" | awk '/state/ { print $2; exit }')
time_remaining=$(omarchy-battery-remaining-time)
capacity=$(omarchy-battery-capacity)

if [[ $state == "charging" ]]; then
    echo "󰁹    Battery ${percentage}%  ·  ${time_remaining} to full  ·   ${power_rate}W / ${capacity}Wh"
else
    echo "󰁹    Battery ${percentage}%  ·  ${time_remaining} left  ·   ${power_rate}W / ${capacity}Wh"
fi


================================================
FILE: bin/omarchy-branch-set
================================================
#!/bin/bash

# Set the branch for Omarchy's git repository.

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


================================================
FILE: bin/omarchy-brightness-display
================================================
#!/bin/bash

# Adjust brightness on the most likely display device.
# Usage: omarchy-brightness-display <step>

step="${1:-+5%}"

# Start with the first possible output, then refine to the most likely given an order heuristic.
device="$(ls -1 /sys/class/backlight 2>/dev/null | head -n1)"
for candidate in amdgpu_bl* intel_backlight acpi_video*; do
  if [[ -e /sys/class/backlight/$candidate ]]; then
    device="$candidate"
    break
  fi
done

# Set the actual brightness of the display device.
brightnessctl -d "$device" set "$step" >/dev/null

# Use SwayOSD to display the new brightness setting.
omarchy-swayosd-brightness "$(brightnessctl -d "$device" -m | cut -d',' -f4 | tr -d '%')"


================================================
FILE: bin/omarchy-brightness-display-apple
================================================
#!/bin/bash

# Adjust the brightness on Apple Studio Displays and Apple XDR Displays using asdcontrol.

if (( $# == 0 )); then
  echo "Adjust Apple Display Brightness by passing +5000 or -5000 (or any range from 0-60000)"
else
  device="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)"
  sudo asdcontrol "$device" -- "$1" >/dev/null
  value="$(sudo asdcontrol "$device" | awk -F= '/BRIGHTNESS=/{print $2+0}')"
  omarchy-swayosd-brightness "$(( value * 100 / 60000 ))"
fi


================================================
FILE: bin/omarchy-brightness-keyboard
================================================
#!/bin/bash

# Adjust keyboard backlight brightness using available steps.
# Usage: omarchy-brightness-keyboard <up|down|cycle>

direction="${1:-up}"

# Find keyboard backlight device (look for *kbd_backlight* pattern in leds class).
device=""
for candidate in /sys/class/leds/*kbd_backlight*; do
  if [[ -e $candidate ]]; then
    device="$(basename "$candidate")"
    break
  fi
done

if [[ -z $device ]]; then
  echo "No keyboard backlight device found" >&2
  exit 1
fi

# Get current and max brightness to determine step size.
max_brightness="$(brightnessctl -d "$device" max)"
current_brightness="$(brightnessctl -d "$device" get)"

# Calculate step as one unit (keyboards typically have discrete levels like 0-3).
if [[ $direction == "cycle" ]]; then
  new_brightness=$(( (current_brightness + 1) % (max_brightness + 1) ))
elif [[ $direction == "up" ]]; then
  new_brightness=$((current_brightness + 1))
  (( new_brightness > max_brightness )) && new_brightness=$max_brightness
else
  new_brightness=$((current_brightness - 1))
  (( new_brightness < 0 )) && new_brightness=0
fi

# Set the new brightness.
brightnessctl -d "$device" set "$new_brightness" >/dev/null

# Use SwayOSD to display the new brightness setting.
percent=$((new_brightness * 100 / max_brightness))
omarchy-swayosd-kbd-brightness "$percent"


================================================
FILE: bin/omarchy-channel-set
================================================
#!/bin/bash

# Set the Omarchy channel, which dictates what git branch and package repository is used.
#
# Stable uses the master branch, which only sees updates on official releases, and
# the stable package repository, which typically lags the edge by a month to ensure
# better compatibility.
#
# Edge tracks the latest package repository, but still relies on the master branch,
# so new packages which require config changes may cause conflicts or errors.
#
# Dev tracks the active development dev branch, which may include partial or broken updates,
# as well as the latest package repository. This should only be used by Omarchy developers
# and people with a lot of experience managing Linux systems.

if (($# == 0)); then
  echo "Usage: omarchy-channel-set [stable|rc|edge|dev]"
  exit 1
else
  channel="$1"
fi

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; ;;
esac

omarchy-update -y


================================================
FILE: bin/omarchy-cmd-audio-switch
================================================
#!/bin/bash

# Switch between audio outputs while preserving the mute status. By default mapped to Super + Mute.

focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')"

sinks=$(pactl -f json list sinks | jq '[.[] | select((.ports | length == 0) or ([.ports[]? | .availability != "not available"] | any))]')
sinks_count=$(echo "$sinks" | jq '. | length')

if (( sinks_count == 0 )); then
  swayosd-client \
    --monitor "$focused_monitor" \
    --custom-message "No audio devices found"
  exit 1
fi

current_sink_name=$(pactl get-default-sink)
current_sink_index=$(echo "$sinks" | jq -r --arg name "$current_sink_name" 'map(.name) | index($name)')

if [[ $current_sink_index != "null" ]]; then
  next_sink_index=$(((current_sink_index + 1) % sinks_count))
else
  next_sink_index=0
fi

next_sink=$(echo "$sinks" | jq -r ".[$next_sink_index]")
next_sink_name=$(echo "$next_sink" | jq -r '.name')

next_sink_description=$(echo "$next_sink" | jq -r '.description')
if [[ $next_sink_description == "(null)" ]] || [[ $next_sink_description == "null" ]] || [[ -z $next_sink_description ]]; then
  # For Bluetooth devices, the friendly name is on the Device entry (device.id), not the Sink entry (object.id)
  device_id=$(echo "$next_sink" | jq -r '.properties."device.id"')
  if [[ $device_id != "null" ]] && [[ -n $device_id ]]; then
    next_sink_description=$(wpctl status | grep -E "^\s*│?\s+${device_id}\." | sed -E 's/^.*[0-9]+\.\s+//' | sed -E 's/\s+\[.*$//')
  fi
  # Fall back to object.id lookup if device.id didn't yield a result
  if [[ -z $next_sink_description ]]; then
    sink_id=$(echo "$next_sink" | jq -r '.properties."object.id"')
    next_sink_description=$(wpctl status | grep -E "\s+\*?\s+${sink_id}\." | sed -E 's/^.*[0-9]+\.\s+//' | sed -E 's/\s+\[.*$//')
  fi
fi

next_sink_volume=$(echo "$next_sink" | jq -r \
  '.volume | to_entries[0].value.value_percent | sub("%"; "")')
next_sink_is_muted=$(echo "$next_sink" | jq -r '.mute')

if [[ $next_sink_is_muted = "true" ]] || (( next_sink_volume == 0 )); then
  icon_state="muted"
elif (( next_sink_volume <= 33 )); then
  icon_state="low"
elif (( next_sink_volume <= 66 )); then
  icon_state="medium"
else
  icon_state="high"
fi

next_sink_volume_icon="sink-volume-${icon_state}-symbolic"

if [[ $next_sink_name != $current_sink_name ]]; then
  pactl set-default-sink "$next_sink_name"
fi

swayosd-client \
  --monitor "$focused_monitor" \
  --custom-message "$next_sink_description" \
  --custom-icon "$next_sink_volume_icon"


================================================
FILE: bin/omarchy-cmd-first-run
================================================
#!/bin/bash

# Finish the installation of Omarchy with items that can only be done after logging in.

set -e

FIRST_RUN_MODE=~/.local/state/omarchy/first-run.mode

if [[ -f $FIRST_RUN_MODE ]]; then
  rm -f "$FIRST_RUN_MODE"

  bash "$OMARCHY_PATH/install/first-run/battery-monitor.sh"
  bash "$OMARCHY_PATH/install/first-run/cleanup-reboot-sudoers.sh"
  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.sh"
  bash "$OMARCHY_PATH/install/first-run/elephant.sh"
  sudo rm -f /etc/sudoers.d/first-run

  bash "$OMARCHY_PATH/install/first-run/welcome.sh"
  bash "$OMARCHY_PATH/install/first-run/wifi.sh"
fi


================================================
FILE: bin/omarchy-cmd-missing
================================================
#!/bin/bash

# Returns true if any of the commands passed in as arguments are missing on the system.

for cmd in "$@"; do
  if ! command -v "$cmd" &>/dev/null; then
    exit 0
  fi
done

exit 1


================================================
FILE: bin/omarchy-cmd-present
================================================
#!/bin/bash

# Returns true if all the commands passed in as arguments exit on the system.

for cmd in "$@"; do
  command -v "$cmd" &>/dev/null || exit 1
done

exit 0


================================================
FILE: bin/omarchy-cmd-screenrecord
================================================
#!/bin/bash

# Start and stop a screenrecording, which will be saved to ~/Videos by default.
# Alternative location can be set via OMARCHY_SCREENRECORD_DIR or XDG_VIDEOS_DIR ENVs.
# Resolution is capped to 4K for monitors above 4K, native otherwise.
# Override via --resolution= (e.g. --resolution=1920x1080, --resolution=0x0 for native).

[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
OUTPUT_DIR="${OMARCHY_SCREENRECORD_DIR:-${XDG_VIDEOS_DIR:-$HOME/Videos}}"

if [[ ! -d $OUTPUT_DIR ]]; then
  notify-send "Screen recording directory does not exist: $OUTPUT_DIR" -u critical -t 3000
  exit 1
fi

DESKTOP_AUDIO="false"
MICROPHONE_AUDIO="false"
WEBCAM="false"
WEBCAM_DEVICE=""
RESOLUTION=""
STOP_RECORDING="false"
RECORDING_FILE="/tmp/omarchy-screenrecord-filename"

for arg in "$@"; do
  case "$arg" in
  --with-desktop-audio) DESKTOP_AUDIO="true" ;;
  --with-microphone-audio) MICROPHONE_AUDIO="true" ;;
  --with-webcam) WEBCAM="true" ;;
  --webcam-device=*) WEBCAM_DEVICE="${arg#*=}" ;;
  --resolution=*) RESOLUTION="${arg#*=}" ;;
  --stop-recording) STOP_RECORDING="true" ;;
  esac
done

start_webcam_overlay() {
  cleanup_webcam

  # Auto-detect first available webcam if none specified
  if [[ -z $WEBCAM_DEVICE ]]; then
    WEBCAM_DEVICE=$(v4l2-ctl --list-devices 2>/dev/null | grep -m1 "^[[:space:]]*/dev/video" | tr -d '\t')
    if [[ -z $WEBCAM_DEVICE ]]; then
      notify-send "No webcam devices found" -u critical -t 3000
      return 1
    fi
  fi

  # Get monitor scale
  local scale=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .scale')

  # Target width (base 360px, scaled to monitor)
  local target_width=$(awk "BEGIN {printf \"%.0f\", 360 * $scale}")

  # Try preferred 16:9 resolutions in order, use first available
  local preferred_resolutions=("640x360" "1280x720" "1920x1080")
  local video_size_arg=""
  local available_formats=$(v4l2-ctl --list-formats-ext -d "$WEBCAM_DEVICE" 2>/dev/null)

  for resolution in "${preferred_resolutions[@]}"; do
    if echo "$available_formats" | grep -q "$resolution"; then
      video_size_arg="-video_size $resolution"
      break
    fi
  done

  ffplay -f v4l2 $video_size_arg -framerate 30 "$WEBCAM_DEVICE" \
    -vf "crop=iw/2:ih,scale=${target_width}:-1" \
    -window_title "WebcamOverlay" \
    -noborder \
    -fflags nobuffer -flags low_delay \
    -probesize 32 -analyzeduration 0 \
    -loglevel quiet &
  sleep 1
}

cleanup_webcam() {
  pkill -f "WebcamOverlay" 2>/dev/null
}

default_resolution() {
  local width height
  read -r width height < <(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.width) \(.height)"')
  if ((width > 3840 || height > 2160)); then
    echo "3840x2160"
  else
    echo "0x0"
  fi
}

start_screenrecording() {
  local filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4"
  local audio_devices=""
  local audio_args=()

  [[ $DESKTOP_AUDIO == "true" ]] && audio_devices+="default_output"

  if [[ $MICROPHONE_AUDIO == "true" ]]; then
    # Merge audio tracks into one - separate tracks only play one at a time in most players
    [[ -n $audio_devices ]] && audio_devices+="|"
    audio_devices+="default_input"
  fi

  [[ -n $audio_devices ]] && audio_args+=(-a "$audio_devices" -ac aac)

  local resolution="${RESOLUTION:-$(default_resolution)}"

  gpu-screen-recorder -w portal -k auto -s "$resolution" -f 60 -fm cfr -fallback-cpu-encoding yes -o "$filename" "${audio_args[@]}" &
  local pid=$!

  # Wait for recording to actually start (file appears after portal selection)
  while kill -0 $pid 2>/dev/null && [[ ! -f $filename ]]; do
    sleep 0.2
  done

  if kill -0 $pid 2>/dev/null; then
    echo "$filename" >"$RECORDING_FILE"
    toggle_screenrecording_indicator
  fi
}

stop_screenrecording() {
  pkill -SIGINT -f "^gpu-screen-recorder" # SIGINT required to save video properly

  # Wait a maximum of 5 seconds to finish before hard killing
  local count=0
  while pgrep -f "^gpu-screen-recorder" >/dev/null && ((count < 50)); do
    sleep 0.1
    count=$((count + 1))
  done

  toggle_screenrecording_indicator
  cleanup_webcam

  if pgrep -f "^gpu-screen-recorder" >/dev/null; then
    pkill -9 -f "^gpu-screen-recorder"
    notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000
  else
    trim_first_frame
    local filename=$(cat "$RECORDING_FILE" 2>/dev/null)
    local preview="${filename%.mp4}-preview.png"

    # Generate a preview thumbnail from the first frame
    ffmpeg -y -i "$filename" -ss 00:00:00.1 -vframes 1 -q:v 2 "$preview" -loglevel quiet 2>/dev/null

    (
      ACTION=$(notify-send "Screen recording saved" "Open with Super + Alt + , (or click this)" -t 10000 -i "${preview:-$filename}" -A "default=open")
      [[ $ACTION == "default" ]] && mpv "$filename"
      rm -f "$preview"
    ) &
  fi

  rm -f "$RECORDING_FILE"
}

toggle_screenrecording_indicator() {
  pkill -RTMIN+8 waybar
}

screenrecording_active() {
  pgrep -f "^gpu-screen-recorder" >/dev/null
}

trim_first_frame() {
  local latest
  latest=$(cat "$RECORDING_FILE" 2>/dev/null)

  if [[ -n $latest && -f $latest ]]; then
    local trimmed="${latest%.mp4}-trimmed.mp4"
    if ffmpeg -y -ss 0.1 -i "$latest" -c copy "$trimmed" -loglevel quiet 2>/dev/null; then
      mv "$trimmed" "$latest"
    else
      rm -f "$trimmed"
    fi
  fi
}

if screenrecording_active; then
  stop_screenrecording
elif [[ $STOP_RECORDING == "true" ]]; then
  exit 1
else
  [[ $WEBCAM == "true" ]] && start_webcam_overlay

  start_screenrecording || cleanup_webcam
fi


================================================
FILE: bin/omarchy-cmd-screensaver
================================================
#!/bin/bash

# Run the Omarchy screensaver using random effects from TTE.

screensaver_in_focus() {
  hyprctl activewindow -j | jq -e '.class == "org.omarchy.screensaver"' >/dev/null 2>&1
}

exit_screensaver() {
  hyprctl keyword cursor:invisible false &>/dev/null || true
  pkill -x tte 2>/dev/null
  pkill -f org.omarchy.screensaver 2>/dev/null
  exit 0
}

# Exit the screensaver on signals and input from keyboard and mouse
trap exit_screensaver SIGINT SIGTERM SIGHUP SIGQUIT

printf '\033]11;rgb:00/00/00\007'  # Set background color to black

hyprctl keyword cursor:invisible true &>/dev/null

tty=$(tty 2>/dev/null)

while true; do
  tte -i ~/.config/omarchy/branding/screensaver.txt \
    --frame-rate 120 --canvas-width 0 --canvas-height 0 --reuse-canvas --anchor-canvas c --anchor-text c\
    --random-effect --exclude-effects dev_worm \
    --no-eol --no-restore-cursor &

  while pgrep -t "${tty#/dev/}" -x tte >/dev/null; do
    if read -n1 -t 1 || ! screensaver_in_focus; then
      exit_screensaver
    fi
  done
done


================================================
FILE: bin/omarchy-cmd-screenshot
================================================
#!/bin/bash

# Take a screenshot of the whole screen, a specific window, or a user-drawn region.
# Saves to ~/Pictures by default, but that can be changed via OMARCHY_SCREENSHOT_DIR or XDG_PICTURES_DIR ENVs.
# Editor defaults to Satty but can be changed via --editor=<name> or OMARCHY_SCREENSHOT_EDITOR env

[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
OUTPUT_DIR="${OMARCHY_SCREENSHOT_DIR:-${XDG_PICTURES_DIR:-$HOME/Pictures}}"

if [[ ! -d $OUTPUT_DIR ]]; then
  notify-send "Screenshot directory does not exist: $OUTPUT_DIR" -u critical -t 3000
  exit 1
fi

pkill slurp && exit 0

SCREENSHOT_EDITOR="${OMARCHY_SCREENSHOT_EDITOR:-satty}"

# Parse --editor flag from any position
ARGS=()
for arg in "$@"; do
  if [[ $arg == --editor=* ]]; then
    SCREENSHOT_EDITOR="${arg#--editor=}"
  else
    ARGS+=("$arg")
  fi
done
set -- "${ARGS[@]}"

open_editor() {
  local filepath="$1"
  if [[ $SCREENSHOT_EDITOR == "satty" ]]; then
    satty --filename "$filepath" \
      --output-filename "$filepath" \
      --actions-on-enter save-to-clipboard \
      --save-after-copy \
      --copy-command 'wl-copy'
  else
    $SCREENSHOT_EDITOR "$filepath"
  fi
}

MODE="${1:-smart}"
PROCESSING="${2:-slurp}"

# accounting for portrait/transformed displays
JQ_MONITOR_GEO='
  def format_geo:
    .x as $x | .y as $y |
    (.width / .scale | floor) as $w |
    (.height / .scale | floor) as $h |
    .transform as $t |
    if $t == 1 or $t == 3 then
      "\($x),\($y) \($h)x\($w)"
    else
      "\($x),\($y) \($w)x\($h)"
    end;
'

get_rectangles() {
  local active_workspace=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .activeWorkspace.id')
  hyprctl monitors -j | jq -r --arg ws "$active_workspace" "${JQ_MONITOR_GEO} .[] | select(.activeWorkspace.id == (\$ws | tonumber)) | format_geo"
  hyprctl clients -j | jq -r --arg ws "$active_workspace" '.[] | select(.workspace.id == ($ws | tonumber)) | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"'
}

# Select based on mode
case "$MODE" in
region)
  hyprpicker -r -z >/dev/null 2>&1 &
  PID=$!
  sleep .1
  SELECTION=$(slurp 2>/dev/null)
  kill $PID 2>/dev/null
  ;;
windows)
  hyprpicker -r -z >/dev/null 2>&1 &
  PID=$!
  sleep .1
  SELECTION=$(get_rectangles | slurp -r 2>/dev/null)
  kill $PID 2>/dev/null
  ;;
fullscreen)
  SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo")
  ;;
smart | *)
  RECTS=$(get_rectangles)
  hyprpicker -r -z >/dev/null 2>&1 &
  PID=$!
  sleep .1
  SELECTION=$(echo "$RECTS" | slurp 2>/dev/null)
  kill $PID 2>/dev/null

  # If the selection area is L * W < 20, we'll assume you were trying to select whichever
  # window or output it was inside of to prevent accidental 2px snapshots
  if [[ $SELECTION =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+)$ ]]; then
    if ((${BASH_REMATCH[3]} * ${BASH_REMATCH[4]} < 20)); then
      click_x="${BASH_REMATCH[1]}"
      click_y="${BASH_REMATCH[2]}"

      while IFS= read -r rect; do
        if [[ $rect =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+) ]]; then
          rect_x="${BASH_REMATCH[1]}"
          rect_y="${BASH_REMATCH[2]}"
          rect_width="${BASH_REMATCH[3]}"
          rect_height="${BASH_REMATCH[4]}"

          if ((click_x >= rect_x && click_x < rect_x + rect_width && click_y >= rect_y && click_y < rect_y + rect_height)); then
            SELECTION="${rect_x},${rect_y} ${rect_width}x${rect_height}"
            break
          fi
        fi
      done <<<"$RECTS"
    fi
  fi
  ;;
esac

[[ -z $SELECTION ]] && exit 0

FILENAME="screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png"
FILEPATH="$OUTPUT_DIR/$FILENAME"

if [[ $PROCESSING == "slurp" ]]; then
  grim -g "$SELECTION" "$FILEPATH" || exit 1
  wl-copy <"$FILEPATH"

  (
    ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit")
    [[ $ACTION == "default" ]] && open_editor "$FILEPATH"
  ) &
else
  grim -g "$SELECTION" - | wl-copy
fi


================================================
FILE: bin/omarchy-cmd-share
================================================
#!/bin/bash

# Share clipboard, file, or folder using LocalSend. Bound to Super + Ctrl + S by default.

if (($# == 0)); then
  echo "Usage: omarchy-cmd-share [clipboard|file|folder]"
  exit 1
fi

MODE="$1"
shift

if [[ $MODE == "clipboard" ]]; then
  TEMP_FILE=$(mktemp --suffix=.txt)
  wl-paste >"$TEMP_FILE"
  FILES="$TEMP_FILE"
else
  if (($# > 0)); then
    FILES="$*"
  else
    if [[ $MODE == "folder" ]]; then
      # Pick a single folder from home directory
      FILES=$(find "$HOME" -type d 2>/dev/null | fzf)
    else
      # Pick one or more files from home directory
      FILES=$(find "$HOME" -type f 2>/dev/null | fzf --multi)
    fi
    [[ -z $FILES ]] && exit 0
  fi
fi

# Run LocalSend in its own systemd service (detached from terminal)
# Convert newline-separated files to space-separated arguments
if [[ $MODE != "clipboard" ]] && echo "$FILES" | grep -q $'\n'; then
  # Multiple files selected - convert newlines to array
  readarray -t FILE_ARRAY <<<"$FILES"
  systemd-run --user --quiet --collect localsend --headless send "${FILE_ARRAY[@]}"
else
  # Single file or clipboard mode
  systemd-run --user --quiet --collect localsend --headless send "$FILES"
fi

# Note: Temporary file will remain until system cleanup for clipboard mode
# This ensures the file content is available for the LocalSend GUI

exit 0


================================================
FILE: bin/omarchy-cmd-terminal-cwd
================================================
#!/bin/bash

# Returns the current working directory of the active terminal window,
# so a new terminal window can be started in the same directory.

# Go from current active terminal to its child shell process and run cwd there
terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}')
shell_pid=$(pgrep -P "$terminal_pid" | tail -n1)

if [[ -n $shell_pid ]]; then
  cwd=$(readlink -f "/proc/$shell_pid/cwd" 2>/dev/null)
  shell=$(readlink -f "/proc/$shell_pid/exe" 2>/dev/null)

  # Check if $shell is a valid shell and $cwd is a directory.
  if grep -qs "$shell" /etc/shells && [[ -d $cwd ]]; then
    echo "$cwd"
  else
    echo "$HOME"
  fi
else
  echo "$HOME"
fi


================================================
FILE: bin/omarchy-config-direct-boot
================================================
#!/bin/bash

# Add an EFI boot entry for the Omarchy UKI, allowing the system to boot directly
# without a bootloader like Limine. Requires UEFI firmware and a built UKI.

if [[ ! -d /sys/firmware/efi ]]; then
  echo "Error: System is not booted in UEFI mode" >&2
  exit 1
fi

if ! efibootmgr &>/dev/null; then
  echo "Error: efibootmgr is not available or not functional" >&2
  exit 1
fi

if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "American Megatrends"; then
  echo "Error: American Megatrends firmware may not safely support custom EFI entries" >&2
  exit 1
fi

if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then
  echo "Error: Apple firmware uses its own boot manager" >&2
  exit 1
fi

uki_file=$(find /boot/EFI/Linux/ -name "omarchy*.efi" -printf "%f\n" 2>/dev/null | head -1)

if [[ -z $uki_file ]]; then
  echo "Error: No Omarchy UKI found in /boot/EFI/Linux/" >&2
  exit 1
fi

boot_source=$(findmnt -n -o SOURCE /boot)
disk=$(echo "$boot_source" | sed 's/p\?[0-9]*$//')
part=$(echo "$boot_source" | grep -o 'p\?[0-9]*$' | sed 's/^p//')

if gum confirm "Setup direct boot (so snapshot booting must be done via bios)?"; then
  echo "Creating EFI boot entry for $uki_file"

  sudo efibootmgr --create \
    --disk "$disk" \
    --part "$part" \
    --label "Omarchy" \
    --loader "\\EFI\\Linux\\$uki_file"
fi


================================================
FILE: bin/omarchy-debug
================================================
#!/bin/bash

# Return exhaustive debugging information about the system to help diagnose problems.

NO_SUDO=false
PRINT_ONLY=false

while (( $# > 0 )); do
  case "$1" in
    --no-sudo)
      NO_SUDO=true
      shift
      ;;
    --print)
      PRINT_ONLY=true
      shift
      ;;
    *)
      echo "Unknown option: $1"
      echo "Usage: omarchy-debug [--no-sudo] [--print]"
      exit 1
      ;;
  esac
done

LOG_FILE="/tmp/omarchy-debug.log"

if [[ $NO_SUDO = "true" ]]; then
  DMESG_OUTPUT="(skipped - --no-sudo flag used)"
else
  DMESG_OUTPUT="$(sudo dmesg)"
fi

cat > "$LOG_FILE" <<EOF
Date: $(date)
Hostname: $(hostname)
Omarchy Branch: $(git -C "$OMARCHY_PATH" branch --show-current 2>/dev/null || echo "unknown")

=========================================
SYSTEM INFORMATION
=========================================
$(inxi -Farz)

=========================================
DMESG
=========================================
$DMESG_OUTPUT

=========================================
JOURNALCTL (CURRENT BOOT, WARNINGS+ERRORS)
=========================================
$(journalctl -b -p 4..1)

=========================================
INSTALLED PACKAGES
=========================================
$({ expac -S '%n %v (%r)' $(pacman -Qqe) 2>/dev/null; comm -13 <(pacman -Sql | sort) <(pacman -Qqe | sort) | xargs -r expac -Q '%n %v (AUR)'; } | sort)
EOF

if [[ $PRINT_ONLY = "true" ]]; then
  cat "$LOG_FILE"
  exit 0
fi

OPTIONS=("View log" "Save in current directory")
if ping -c 1 8.8.8.8 >/dev/null 2>&1; then
  OPTIONS=("Upload log" "${OPTIONS[@]}")
fi

ACTION=$(gum choose "${OPTIONS[@]}")

case "$ACTION" in
  "Upload log")
    echo "Uploading debug log to 0x0.st..."
    URL=$(curl -sF "file=@$LOG_FILE" -Fexpires=24 https://0x0.st)
    if (( $? == 0 )) && [[ -n $URL ]]; then
      echo "✓ Log uploaded successfully!"
      echo "Share this URL:"
      echo ""
      echo "  $URL"
      echo ""
      echo "This link will expire in 24 hours."
    else
      echo "Error: Failed to upload log file"
      exit 1
    fi
    ;;
  "View log")
    less "$LOG_FILE"
    ;;
  "Save in current directory")
    cp "$LOG_FILE" "./omarchy-debug.log"
    echo "✓ Log saved to $(pwd)/omarchy-debug.log"
    ;;
esac


================================================
FILE: bin/omarchy-dev-add-migration
================================================
#!/bin/bash

# Creates a new Omarchy migration named after the unix timestamp of the last commit.
# Only intended for Omarchy developers.

cd ~/.local/share/omarchy
migration_file="$HOME/.local/share/omarchy/migrations/$(git log -1 --format=%cd --date=unix).sh"
touch $migration_file

if [[ $1 != "--no-edit" ]]; then
  nvim $migration_file
fi

echo $migration_file


================================================
FILE: bin/omarchy-drive-info
================================================
#!/bin/bash

# Returns drive information about a given volumne, like /dev/nvme0, which is used by omarchy-drive-select.

if (($# == 0)); then
  echo "Usage: omarchy-drive-info [/dev/drive]"
  exit 1
else
  drive="$1"
fi

# Find the root drive in case we are looking at partitions
root_drive=$(lsblk -no PKNAME "$drive" 2>/dev/null | tail -n1)
if [[ -n $root_drive ]]; then
  root_drive="/dev/$root_drive"
else
  root_drive="$drive"
fi

# Get basic disk information
size=$(lsblk -dno SIZE "$drive" 2>/dev/null)
vendor=$(lsblk -dno VENDOR "$root_drive" 2>/dev/null | sed 's/ *$//')
model=$(lsblk -dno MODEL "$root_drive" 2>/dev/null | sed 's/ *$//')

# Combine vendor and model, avoiding duplication
label=""
if [[ -n $vendor && -n $model ]]; then
  if [[ $model == *$vendor* ]]; then
    label="$model"
  else
    label="$vendor $model"
  fi
elif [[ -n $model ]]; then
  label="$model"
elif [[ -n $vendor ]]; then
  label="$vendor"
fi

# Format display string
display="$drive"
[[ -n $size ]] && display="$display ($size)"
[[ -n $label ]] && display="$display - $label"

# Append compact partition summary
part_summary=$(lsblk -nro TYPE,NAME,FSTYPE,MOUNTPOINT "$root_drive" 2>/dev/null | \
  awk '$1=="part" { printf "%s%s%s", s, ($3==""?"unknown":$3), ($4==""?"":"("$4")"); s=", " }')
[[ -n $part_summary ]] && display+=" [$part_summary]"

echo "$display"


================================================
FILE: bin/omarchy-drive-select
================================================
#!/bin/bash

# Select a drive from a list with info that includes space and brand. Used by omarchy-drive-set-password.

if (($# == 0)); then
  drives=$(lsblk -dpno NAME | grep -E '/dev/(sd|hd|vd|nvme|mmcblk|xv)')
else
  drives="$@"
fi

drives_with_info=""
while IFS= read -r drive; do
  [[ -n $drive ]] || continue
  drives_with_info+="$(omarchy-drive-info "$drive")"$'\n'
done <<<"$drives"

selected_drive="$(printf "%s" "$drives_with_info" | gum choose --header "Select drive")" || exit 1
printf "%s\n" "$selected_drive" | awk '{print $1}'


================================================
FILE: bin/omarchy-drive-set-password
================================================
#!/bin/bash

# Set a new encryption password for a drive selected.

encrypted_drives=$(blkid -t TYPE=crypto_LUKS -o device)

if [[ -n $encrypted_drives ]]; then
  if (( $(wc -l <<<encrypted_drives) == 1 )); then
    drive_to_change="$encrypted_drives"
  else
    drive_to_change="$(omarchy-drive-select "$encrypted_drives")"
  fi

  if [[ -n $drive_to_change ]]; then
    echo "Changing full-disk encryption password for $drive_to_change"
    sudo cryptsetup luksChangeKey --pbkdf argon2id --iter-time 2000 "$drive_to_change"
  else
    echo "No drive selected."
  fi
else
  echo "No encrypted drives available."
  exit 1
fi


================================================
FILE: bin/omarchy-font-current
================================================
#!/bin/bash

# Returns the name of the current monospace font being used by extracting it from the Waybar stylesheet.
# This can be changed using omarchy-font-set.

grep -oP 'font-family:\s*["'\'']?\K[^;"'\'']+' ~/.config/waybar/style.css | head -n1


================================================
FILE: bin/omarchy-font-list
================================================
#!/bin/bash

# Returns a list of all the monospace fonts available on the system that can be set using omarchy-font-set.

fc-list :spacing=100 -f "%{family[0]}\n" | grep -v -i -E 'emoji|signwriting|omarchy' | sort -u


================================================
FILE: bin/omarchy-font-set
================================================
#!/bin/bash

# Set the system-wide monospace font that should be used by the terminal, hyprlock, waybar, swayosd, etc.
# The font name must be one of the ones returned by omarchy-font-list.

font_name="$1"

if [[ -n $font_name ]]; then
  if fc-list | grep -iq "$font_name"; then
    if [[ -f ~/.config/alacritty/alacritty.toml ]]; then
      sed -i "s/family = \".*\"/family = \"$font_name\"/g" ~/.config/alacritty/alacritty.toml
    fi

    if [[ -f ~/.config/kitty/kitty.conf ]]; then
      sed -i "s/^font_family .*/font_family $font_name/g" ~/.config/kitty/kitty.conf
      pkill -USR1 kitty
    fi

    if [[ -f ~/.config/ghostty/config ]]; then
      sed -i "s/font-family = \".*\"/font-family = \"$font_name\"/g" ~/.config/ghostty/config
      pkill -SIGUSR2 ghostty
    fi

    sed -i "s/font_family = .*/font_family = $font_name/g" ~/.config/hypr/hyprlock.conf
    sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/waybar/style.css
    sed -i "s/font-family: .*/font-family: '$font_name';/g" ~/.config/swayosd/style.css
    xmlstarlet ed -L \
      -u '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/string' \
      -v "$font_name" \
      ~/.config/fontconfig/fonts.conf

    omarchy-restart-waybar
    omarchy-restart-swayosd

    if pgrep -x ghostty; then
      notify-send "    You must restart Ghostty to see font change"
    fi

    omarchy-hook font-set "$font_name"
  else
    echo "Font '$font_name' not found."
    exit 1
  fi
else
  echo "Usage: omarchy-font-set <font-name>"
fi


================================================
FILE: bin/omarchy-hibernation-available
================================================
#!/bin/bash

# Check if hibernation is supported
if [[ ! -f /sys/power/image_size ]]; then
  exit 1
fi

# Sum all swap sizes (excluding zram)
SWAPSIZE_KB=$(awk '!/Filename|zram/ {sum += $3} END {print sum+0}' /proc/swaps)
SWAPSIZE=$(( 1024 * ${SWAPSIZE_KB:-0} ))

HIBERNATION_IMAGE_SIZE=$(cat /sys/power/image_size)

if (( SWAPSIZE > HIBERNATION_IMAGE_SIZE )) && [[ -f /etc/mkinitcpio.conf.d/omarchy_resume.conf ]]; then
  exit 0
else
  exit 1
fi


================================================
FILE: bin/omarchy-hibernation-remove
================================================
#!/bin/bash

# Removes hibernation setup: disables swap, removes swapfile, removes fstab entry,
# removes resume hook, and removes suspend-then-hibernate configuration.

MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/omarchy_resume.conf"

# Check if hibernation is configured
if [[ ! -f $MKINITCPIO_CONF ]] || ! grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then
  echo "Hibernation is not set up"
  exit 0
fi

if ! gum confirm "Remove hibernation setup?"; then
  exit 0
fi

SWAP_SUBVOLUME="/swap"
SWAP_FILE="$SWAP_SUBVOLUME/swapfile"

# Disable swap if active
if swapon --show | grep -q "$SWAP_FILE"; then
  echo "Disabling swap on $SWAP_FILE"
  sudo swapoff "$SWAP_FILE"
fi

# Remove swapfile
if [[ -f $SWAP_FILE ]]; then
  echo "Removing swapfile"
  sudo rm "$SWAP_FILE"
fi

# Remove swap subvolume
if sudo btrfs subvolume show "$SWAP_SUBVOLUME" &>/dev/null; then
  echo "Removing Btrfs subvolume $SWAP_SUBVOLUME"
  sudo btrfs subvolume delete "$SWAP_SUBVOLUME"
fi

# Remove fstab entry
if grep -Fq "$SWAP_FILE" /etc/fstab; then
  echo "Removing swapfile from /etc/fstab"
  sudo cp -a /etc/fstab "/etc/fstab.$(date +%Y%m%d%H%M%S).back"
  sudo sed -i "\|$SWAP_FILE|d" /etc/fstab
  sudo sed -i '/^# Btrfs swapfile for system hibernation$/d' /etc/fstab
fi

# Remove suspend-then-hibernate configuration
echo "Removing suspend-then-hibernate configuration"
sudo rm -f /etc/systemd/logind.conf.d/lid.conf
sudo rm -f /etc/systemd/sleep.conf.d/hibernate.conf

# Remove mkinitcpio resume hook
echo "Removing resume hook"
sudo rm "$MKINITCPIO_CONF"

echo "Regenerating initramfs..."
sudo limine-mkinitcpio

echo "Hibernation removed"


================================================
FILE: bin/omarchy-hibernation-setup
================================================
#!/bin/bash

# Creates a swap file in the btrfs subvolume, adds the swap file to /etc/fstab,
# adds a resume hook to mkinitcpio, and configures suspend-then-hibernate.

if [[ ! -f /sys/power/image_size ]]; then
  echo -e "Hibernation is not supported on your system" >&2
  exit 0
fi

if ! command -v limine-mkinitcpio &>/dev/null; then
  echo "Skipping hibernation setup (requires Limine bootloader)"
  exit 0
fi

MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/omarchy_resume.conf"

# Check if hibernation is already configured
if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then
  echo "Hibernation is already set up"
  exit 0
fi

if [[ $1 != "--force" ]]; then
  MEM_TOTAL_HUMAN=$(free --human | awk '/Mem/ {print $2}')
  if ! gum confirm "Use $MEM_TOTAL_HUMAN on boot drive to make hibernation available?"; then
    exit 0
  fi
fi

SWAP_SUBVOLUME="/swap"
SWAP_FILE="$SWAP_SUBVOLUME/swapfile"

# Create btrfs subvolume for swap
if ! sudo btrfs subvolume show "$SWAP_SUBVOLUME" &>/dev/null; then
  echo "Creating Btrfs subvolume"
  sudo btrfs subvolume create "$SWAP_SUBVOLUME"
  sudo chattr +C "$SWAP_SUBVOLUME"
fi

# Create swapfile
if ! sudo swaplabel "$SWAP_FILE" &>/dev/null; then
  echo "Creating swapfile in Btrfs subvolume"
  MEM_TOTAL_KB="$(awk '/MemTotal/ {print $2}' /proc/meminfo)k"
  sudo btrfs filesystem mkswapfile -s "$MEM_TOTAL_KB" "$SWAP_FILE"
fi

# Add swapfile to fstab
if ! grep -Fq "$SWAP_FILE" /etc/fstab; then
  echo "Adding swapfile to /etc/fstab"
  sudo cp -a /etc/fstab "/etc/fstab.$(date +%Y%m%d%H%M%S).back"
  printf "\n# Btrfs swapfile for system hibernation\n%s none swap defaults,pri=0 0 0\n" "$SWAP_FILE" | sudo tee -a /etc/fstab >/dev/null
fi

# Enable swap
if ! swapon --show | grep -q "$SWAP_FILE"; then
  echo "Enabling swap on $SWAP_FILE"
  sudo swapon -p 0 "$SWAP_FILE"
fi

# Add resume hook to mkinitcpio
sudo mkdir -p /etc/mkinitcpio.conf.d
echo "Adding resume hook to $MKINITCPIO_CONF"
echo "HOOKS+=(resume)" | sudo tee "$MKINITCPIO_CONF" >/dev/null

# Ensure keyboard backlight doesn't prevent sleep
sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/lib/systemd/system-sleep/

# Add resume= kernel parameters so the initramfs resume hook knows where to find the
# hibernation image. Without these, resume happens late (after GPU drivers load) and fails.
RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf"
if [[ ! -f $RESUME_DROP_IN ]]; then
  echo "Adding resume kernel parameters"
  sudo swapon -p 0 "$SWAP_FILE" 2>/dev/null
  RESUME_DEVICE=$(findmnt -no SOURCE -T "$SWAP_FILE" | sed 's/\[.*\]//')
  RESUME_OFFSET=$(sudo btrfs inspect-internal map-swapfile -r "$SWAP_FILE")
  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
  sudo tee -a /etc/default/limine < "$RESUME_DROP_IN" >/dev/null
fi

# Use ACPI alarm for RTC wakeup on s2idle systems (needed for suspend-then-hibernate)
if grep -q "\[s2idle\]" /sys/power/mem_sleep 2>/dev/null; then
  LIMINE_DROP_IN="/etc/limine-entry-tool.d/rtc-alarm.conf"
  if [[ ! -f $LIMINE_DROP_IN ]]; 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
    sudo tee -a /etc/default/limine < "$LIMINE_DROP_IN" >/dev/null
  fi
fi

# Regenerate initramfs and boot entry
echo "Regenerating initramfs..."
sudo limine-mkinitcpio
sudo limine-update

echo

if [[ $1 != "--force" ]] && gum confirm "Reboot to enable hibernation?"; then
  omarchy-system-reboot
fi


================================================
FILE: bin/omarchy-hook
================================================
#!/bin/bash

# Run a named hook, like post-update (available in ~/.config/omarchy/hooks/post-update).

set -e

if (( $# < 1 )); then
  echo "Usage: omarchy-hook [name] [args...]"
  exit 1
fi

HOOK=$1
HOOK_PATH="$HOME/.config/omarchy/hooks/$1"
shift

if [[ -f $HOOK_PATH ]]; then
  bash "$HOOK_PATH" "$@"
fi


================================================
FILE: bin/omarchy-hw-asus-rog
================================================
#!/bin/bash

# Detect whether the computer is an Asus ROG machine.

[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "ASUSTeK COMPUTER INC." ]] &&
   grep -q "ROG" /sys/class/dmi/id/product_family 2>/dev/null


================================================
FILE: bin/omarchy-hw-framework16
================================================
#!/bin/bash

# Detect whether the computer is a Framework Laptop 16.

[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Framework" ]] &&
  grep -q "Laptop 16" /sys/class/dmi/id/product_name 2>/dev/null


================================================
FILE: bin/omarchy-hw-intel
================================================
#!/bin/bash

# Detect whether the computer has an Intel CPU.

[[ $(grep -m1 "vendor_id" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | tr -d ' ') == "GenuineIntel" ]]


================================================
FILE: bin/omarchy-hw-surface
================================================
#!/bin/bash

# Detect whether the computer is a Microsoft Surface device.

[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] &&
  grep -q "Surface" /sys/class/dmi/id/product_name 2>/dev/null


================================================
FILE: bin/omarchy-hyprland-monitor-scaling-cycle
================================================
#!/bin/bash

# Get the active monitor (the one with the cursor)
MONITOR_INFO=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)')
ACTIVE_MONITOR=$(echo "$MONITOR_INFO" | jq -r '.name')
CURRENT_SCALE=$(echo "$MONITOR_INFO" | jq -r '.scale')
WIDTH=$(echo "$MONITOR_INFO" | jq -r '.width')
HEIGHT=$(echo "$MONITOR_INFO" | jq -r '.height')
REFRESH_RATE=$(echo "$MONITOR_INFO" | jq -r '.refreshRate')

# Cycle through scales: 1 → 1.6 → 2 → 3 → 1
CURRENT_INT=$(awk -v s="$CURRENT_SCALE" 'BEGIN { printf "%.0f", s * 10 }')

case "$CURRENT_INT" in
10) NEW_SCALE=1.6 ;;
16) NEW_SCALE=2 ;;
20) NEW_SCALE=3 ;;
*) NEW_SCALE=1 ;;
esac

hyprctl keyword misc:disable_scale_notification true
hyprctl keyword monitor "$ACTIVE_MONITOR,${WIDTH}x${HEIGHT}@${REFRESH_RATE},auto,$NEW_SCALE"
hyprctl keyword misc:disable_scale_notification false
notify-send "󰍹    Display scaling set to ${NEW_SCALE}x"


================================================
FILE: bin/omarchy-hyprland-window-close-all
================================================
#!/bin/bash

# Close all open windows
hyprctl clients -j | \
  jq -r ".[].address" | \
  xargs -I{} hyprctl dispatch closewindow address:{}

# Move to first workspace
hyprctl dispatch workspace 1


================================================
FILE: bin/omarchy-hyprland-window-gaps-toggle
================================================
#!/bin/bash

# Toggles the window gaps globally between no gaps and the default 10/5/2.

gaps=$(hyprctl getoption general:gaps_out -j | jq -r '.custom' | awk '{print $1}')

if [[ $gaps == "0" ]]; then
  hyprctl keyword general:gaps_out 10
  hyprctl keyword general:gaps_in 5
  hyprctl keyword general:border_size 2
else
  hyprctl keyword general:gaps_out 0
  hyprctl keyword general:gaps_in 0
  hyprctl keyword general:border_size 0
fi


================================================
FILE: bin/omarchy-hyprland-window-pop
================================================
#!/bin/bash

# Toggle to pop-out a tile to stay fixed on a display basis.

# Usage:
# omarchy-hyprland-window-pop [width height [x y]]
#
# Arguments:
#   width   Optional. Width of the floating window. Default: 1300
#   height  Optional. Height of the floating window. Default: 900
#   x       Optional. X position of the window. Must provide both X and Y to take effect.
#   y       Optional. Y position of the window. Must provide both X and Y to take effect.
#
# Behavior:
#   - If the window is already pinned, it will be unpinned and removed from the pop layer.
#   - If the window is not pinned, it will be floated, resized, moved/centered, pinned, brought to top, and popped.

width=${1:-1300}
height=${2:-900}
x=${3:-}
y=${4:-}

active=$(hyprctl activewindow -j)
pinned=$(echo "$active" | jq ".pinned")
addr=$(echo "$active" | jq -r ".address")

if [[ $pinned == "true" ]]; then
  hyprctl -q --batch \
    "dispatch pin address:$addr;" \
    "dispatch togglefloating address:$addr;" \
    "dispatch tagwindow -pop address:$addr;"
elif [[ -n $addr ]]; then
  hyprctl dispatch togglefloating address:$addr
  hyprctl dispatch resizeactive exact $width $height address:$addr

  if [[ -n $x && -n $y ]]; then
    hyprctl dispatch moveactive $x $y address:$addr
  else
    hyprctl dispatch centerwindow address:$addr
  fi

  hyprctl -q --batch \
    "dispatch pin address:$addr;" \
    "dispatch alterzorder top address:$addr;" \
    "dispatch tagwindow +pop address:$addr;"
fi


================================================
FILE: bin/omarchy-hyprland-window-single-square-aspect-toggle
================================================
#!/bin/bash

# Check current single_window_aspect_ratio setting
CURRENT_VALUE=$(hyprctl getoption "layout:single_window_aspect_ratio" 2>/dev/null | head -1)

# Parse vec2 output: "vec2: [1, 1]" or "vec2: [0, 0]"
if [[ $CURRENT_VALUE == *"[1, 1]"* ]]; then
  hyprctl keyword layout:single_window_aspect_ratio "0 0"
  notify-send "    Disable single-window square aspect ratio"
else
  hyprctl keyword layout:single_window_aspect_ratio "1 1"
  notify-send "    Enable single-window square aspect"
fi


================================================
FILE: bin/omarchy-hyprland-workspace-layout-toggle
================================================
#!/bin/bash

# Toggle the layout on the current active workspace between dwindle and scrolling

ACTIVE_WORKSPACE=$(hyprctl activeworkspace -j | jq -r '.id')
CURRENT_LAYOUT=$(hyprctl activeworkspace -j | jq -r '.tiledLayout')

case "$CURRENT_LAYOUT" in
  dwindle) NEW_LAYOUT=scrolling ;;
  *) NEW_LAYOUT=dwindle ;;
esac

hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT
notify-send "󱂬    Workspace layout set to $NEW_LAYOUT"


================================================
FILE: bin/omarchy-install-chromium-google-account
================================================
#!/bin/bash

# Allow Chromium to sign in to Google accounts by adding the correct
# oauth client id and secret to ~/.config/chromium-flags.conf.

if [[ -f ~/.config/chromium-flags.conf ]]; then
  CONF=~/.config/chromium-flags.conf

  grep -qxF -- "--oauth2-client-id=77185425430.apps.googleusercontent.com" "$CONF" ||
    echo "--oauth2-client-id=77185425430.apps.googleusercontent.com" >>"$CONF"

  grep -qxF -- "--oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT" "$CONF" ||
    echo "--oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT" >>"$CONF"

  echo "Now you can login to your Google Account in Chromium."
fi


================================================
FILE: bin/omarchy-install-dev-env
================================================
#!/bin/bash

# Install one of the supported development environments. Usually called via Install > Development > * in the Omarchy Menu.

if [[ -z $1 ]]; then
  echo "Usage: omarchy-install-dev-env <ruby|node|bun|deno|go|laravel|symfony|php|python|elixir|phoenix|rust|java|zig|ocaml|dotnet|clojure|scala>" >&2
  exit 1
fi

install_php() {
  omarchy-pkg-add php composer php-sqlite xdebug

  # Install Path for Composer
  if [[ :$PATH: != *:$HOME/.config/composer/vendor/bin:* ]]; then
    echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >>"$HOME/.bashrc"
    source "$HOME/.bashrc"
    echo "Added Composer global bin directory to PATH."
  else
    echo "Composer global bin directory already in PATH."
  fi

  # Enable some extensions
  local php_ini_path="/etc/php/php.ini"
  local extensions_to_enable=(
    "bcmath"
    "intl"
    "iconv"
    "openssl"
    "pdo_sqlite"
    "pdo_mysql"
  )

  # Enable Xdebug
  sudo sed -i \
    -e 's/^;zend_extension=xdebug.so/zend_extension=xdebug.so/' \
    -e 's/^;xdebug.mode=debug/xdebug.mode=debug/' \
    /etc/php/conf.d/xdebug.ini

  for ext in "${extensions_to_enable[@]}"; do
    sudo sed -i "s/^;extension=${ext}/extension=${ext}/" "$php_ini_path"
  done
}

install_node() {
  echo -e "Installing Node.js...\n"
  mise use --global node
}

case "$1" in
ruby)
  echo -e "Installing Ruby on Rails...\n"
  omarchy-pkg-add libyaml
  mise settings add ruby.compile false
  mise settings add idiomatic_version_file_enable_tools ruby
  mise use --global ruby@latest
  echo "gem: --no-document" >~/.gemrc
  mise x ruby -- gem install rails --no-document
  echo -e "\nYou can now run: rails new myproject"
  ;;
node)
  install_node
  ;;
bun)
  echo -e "Installing Bun...\n"
  mise use -g bun@latest
  ;;
deno)
  echo -e "Installing Deno...\n"
  mise use -g deno@latest
  ;;
go)
  echo -e "Installing Go...\n"
  mise use --global go@latest
  ;;
php)
  echo -e "Installing PHP...\n"
  install_php
  ;;
laravel)
  echo -e "Installing PHP and Laravel...\n"
  install_php
  install_node
  composer global require laravel/installer
  echo -e "\nYou can now run: laravel new myproject"
  ;;
symfony)
  echo -e "Installing PHP and Symfony...\n"
  install_php
  omarchy-pkg-add symfony-cli
  echo -e "\nYou can now run: symfony new --webapp myproject"
  ;;
python)
  echo -e "Installing Python...\n"
  mise use --global python@latest
  echo -e "\nInstalling uv...\n"
  curl -fsSL https://astral.sh/uv/install.sh | sh
  ;;
elixir)
  echo -e "Installing Elixir...\n"
  mise use --global erlang@latest
  mise use --global elixir@latest
  mise x elixir -- mix local.hex --force
  ;;
phoenix)
  echo -e "Installing Phoenix Framework...\n"
  # Ensure Erlang/Elixir first
  mise use --global erlang@latest
  mise use --global elixir@latest
  # Hex & Rebar
  mise x elixir -- mix local.hex --force
  mise x elixir -- mix local.rebar --force
  # Phoenix project (phx_new)
  mise x elixir -- mix archive.install hex phx_new --force
  echo -e "\nYou can now run: mix phx.new my_app"
  ;;
rust)
  echo -e "Installing Rust...\n"
  bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)" -- -y
  ;;
java)
  echo -e "Installing Java...\n"
  mise use --global java@latest
  ;;
zig)
  echo -e "Installing Zig...\n"
  mise use --global zig@latest
  mise use -g zls@latest
  ;;
ocaml)
  echo -e "Installing OCaml...\n"
  bash -c "$(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"
  opam init --yes
  eval "$(opam env)"
  opam install ocaml-lsp-server odoc ocamlformat utop --yes
  ;;
dotnet)
  echo -e "Installing .NET...\n"
  mise use --global dotnet@latest
  ;;
clojure)
  echo -e "Installing Clojure...\n"
  omarchy-pkg-add rlwrap
  mise use --global clojure@latest
  ;;
scala)
  echo -e "Installing Scala...\n"
  mise use --global java@latest
  mise use --global scala@latest
  mise use --global scala-cli@latest
  ;;
esac


================================================
FILE: bin/omarchy-install-docker-dbs
================================================
#!/bin/bash

# Install one of the supported databases in a Docker container with the suitable development options.
# Usually called via Install > Development > Docker DB from the Omarchy Menu.

options=("MySQL" "PostgreSQL" "Redis" "MongoDB" "MariaDB" "MSSQL")

if (( $# == 0 )); then
  choices=$(printf "%s\n" "${options[@]}" | gum choose --header "Select database (return to install, esc to cancel)") || main_menu
else
  choices="$@"
fi

if [[ -n $choices ]]; then
  for db in $choices; do
    case $db in
    MySQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4 ;;
    PostgreSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres18 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:18 ;;
    MariaDB) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mariadb11 -e MARIADB_ROOT_PASSWORD= -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=true mariadb:11.8 ;;
    Redis) sudo docker run -d --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7 ;;
    MongoDB) sudo docker run -d --restart unless-stopped -p "127.0.0.1:27017:27017" --name mongodb -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin123 mongo:noble ;;
    MSSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:1433:1433" --name mssql -e MSSQL_PID=Developer -e ACCEPT_EULA=Y -e "MSSQL_SA_PASSWORD=@dmin123" mcr.microsoft.com/mssql/server:2022-CU12-ubuntu-22.04 ;;
    esac
  done
else
  echo "No databases selected for installation."
fi


================================================
FILE: bin/omarchy-install-dropbox
================================================
#!/bin/bash

# Install and start the Dropbox service. Must then be authenticated via the web.

echo "Installing all dependencies..."
omarchy-pkg-add dropbox dropbox-cli libappindicator-gtk3 python-gpgme nautilus-dropbox

echo "Starting Dropbox..."
uwsm-app -- dropbox-cli start &>/dev/null &
echo "See Dropbox icon behind  hover tray in top right and right-click for setup."


================================================
FILE: bin/omarchy-install-geforce-now
================================================
#!/bin/bash

# Install and launch Geforce Now.

set -e

omarchy-pkg-add flatpak
cd /tmp

# Download and run GeForce NOW
curl -LO https://international.download.nvidia.com/GFNLinux/GeForceNOWSetup.bin
chmod +x GeForceNOWSetup.bin
./GeForceNOWSetup.bin

# Ensure a separate browser process not started by GFN is available.
# If not, it seems like GFN has a tendency to hang on login.
setsid omarchy-launch-browser


================================================
FILE: bin/omarchy-install-nordvpn
================================================
#!/bin/bash

# Install the NordVPN service with optional GUI.

echo "Installing NordVPN..."
omarchy-pkg-aur-add nordvpn-bin

echo "Enabling NordVPN daemon..."
sudo systemctl enable --now nordvpnd

echo "Adding user to nordvpn group..."
sudo usermod -aG nordvpn "$USER"

echo -e "\nNordVPN installed! After reboot, run 'nordvpn login' to authenticate."

echo
gum confirm "Reboot now to make NordVPN usable?" && omarchy-system-reboot


================================================
FILE: bin/omarchy-install-steam
================================================
#!/bin/bash

# Install and launch Steam after first letting the user pick the correct grahics card drivers.

set -e

echo "Now pick dependencies matching your graphics card"
sudo pacman -S steam
setsid gtk-launch steam >/dev/null 2>&1 &


================================================
FILE: bin/omarchy-install-tailscale
================================================
#!/bin/bash

# Install the Tailscale mesh VPN service and a web app for the Tailscale Admin Console.

curl -fsSL https://tailscale.com/install.sh | sh

echo -e "\nStarting Tailscale..."
sudo tailscale up --accept-routes

omarchy-webapp-install "Tailscale" "https://login.tailscale.com/admin/machines" https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png


================================================
FILE: bin/omarchy-install-terminal
================================================
#!/bin/bash

# Install one of the approved terminals and set it as the default for Omarchy (Super + Return etc).

if (($# == 0)); then
  echo "Usage: omarchy-install-terminal [alacritty|ghostty|kitty]"
  exit 1
fi

package="$1"

# Map package name to desktop entry ID
case "$package" in
alacritty) desktop_id="Alacritty.desktop" ;;
ghostty) desktop_id="com.mitchellh.ghostty.desktop" ;;
kitty) desktop_id="kitty.desktop" ;;
*)
  echo "Unknown terminal: $package"
  exit 1
  ;;
esac

# Install package
if omarchy-pkg-add $package; then
  # Copy custom desktop entry for alacritty with X-TerminalArg* keys
  if [[ $package == "alacritty" ]]; then
    mkdir -p ~/.local/share/applications
    cp $OMARCHY_PATH/applications/Alacritty.desktop ~/.local/share/applications/
  fi

  # Update xdg-terminals.list to prioritize the proper terminal
  cat >~/.config/xdg-terminals.list <<EOF
# Terminal emulator preference order for xdg-terminal-exec
# The first found and valid terminal will be used
$desktop_id
EOF
else
  echo "Failed to install $package"
fi


================================================
FILE: bin/omarchy-install-vscode
================================================
#!/bin/bash

# Install VSCode and configure it to use the gnome-libsecret password store, not to update automatically, and to use the current Omarchy theme.

echo "Installing VSCode..."
omarchy-pkg-add visual-studio-code-bin

mkdir -p ~/.vscode ~/.config/Code/User

cat > ~/.vscode/argv.json << 'EOF'
// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelihood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
//
// NOTE: Changing this file requires a restart of VS Code.
{
  "password-store":"gnome-libsecret"
}
EOF

# Ensure VSC's own auto-update feature is turned off
printf '{\n  "update.mode": "none"\n}\n' > ~/.config/Code/User/settings.json

# Apply Omarchy theme to VSCode
omarchy-theme-set-vscode

setsid gtk-launch code


================================================
FILE: bin/omarchy-install-xbox-controllers
================================================
#!/bin/bash

# Install support for using Xbox controllers with Steam/RetroArch/etc.

set -e

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

# Prevent xpad/xpadneo driver conflict
echo blacklist xpad | sudo tee /etc/modprobe.d/blacklist-xpad.conf >/dev/null
echo hid_xpadneo | sudo tee /etc/modules-load.d/xpadneo.conf >/dev/null

# Give user access to game controllers
sudo usermod -a -G input $USER

# Modules need to be loaded
gum confirm "Install requires reboot. Ready?" && sudo reboot now


================================================
FILE: bin/omarchy-launch-about
================================================
#!/bin/bash

# Launch the fastfetch TUI that gives information about the current system.

exec omarchy-launch-or-focus-tui "bash -c 'fastfetch; read -n 1 -s'"


================================================
FILE: bin/omarchy-launch-audio
================================================
#!/bin/bash

# Launch the Omarchy audio controls TUI (provided by wiremix).

omarchy-launch-or-focus-tui wiremix


================================================
FILE: bin/omarchy-launch-bluetooth
================================================
#!/bin/bash

# Launch the Omarchy bluetooth controls TUI (provided by bluetui).
# Also attempts to unblock bluetooth service if rfkill had blocked it.

rfkill unblock bluetooth
exec omarchy-launch-or-focus-tui bluetui


================================================
FILE: bin/omarchy-launch-browser
================================================
#!/bin/bash

# Launch the default browser as determined by xdg-settings.
# Automatically converts --private into the correct flag for the given browser.

default_browser=$(xdg-settings get default-web-browser)
browser_exec=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$default_browser 2>/dev/null | head -1)

if $browser_exec --help | grep -q MOZ_LOG; then
  private_flag="--private-window"
elif [[ $browser_exec =~ edge ]]; then
  private_flag="--inprivate"
else
  private_flag="--incognito"
fi

exec setsid uwsm-app -- "$browser_exec" "${@/--private/$private_flag}"


================================================
FILE: bin/omarchy-launch-editor
================================================
#!/bin/bash

# Launch the default editor as determined by $EDITOR (set via ~/.config/uwsm/default) (or nvim if missing).
# Starts suitable editors in a terminal window and otherwise as a regular application.

omarchy-cmd-present "$EDITOR" || EDITOR=nvim

case "$EDITOR" in
nvim | vim | nano | micro | hx | helix | fresh)
  exec omarchy-launch-tui "$EDITOR" "$@"
  ;;
*)
  exec setsid uwsm-app -- "$EDITOR" "$@"
  ;;
esac


================================================
FILE: bin/omarchy-launch-floating-terminal-with-presentation
================================================
#!/bin/bash

# Launch a floating terminal with the Omarchy logo presentation, then execute the command passed in, and finally end with the omarchy-show-done presentation.
# Used by actions such as Update System.

cmd="$*"
exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.terminal --title=Omarchy -e bash -c "omarchy-show-logo; $cmd; if (( \$? != 130 )); then omarchy-show-done; fi"


================================================
FILE: bin/omarchy-launch-or-focus
================================================
#!/bin/bash

# Launch or focus on a given command identified by the passed in window-pattern.
# Use by some default bindings, like the one for Spotify, to ensure there is only one instance of the application open.

if (($# == 0)); then
  echo "Usage: omarchy-launch-or-focus [window-pattern] [launch-command]"
  exit 1
fi

WINDOW_PATTERN="$1"
LAUNCH_COMMAND="${2:-"uwsm-app -- $WINDOW_PATTERN"}"
WINDOW_ADDRESS=$(hyprctl clients -j | jq -r --arg p "$WINDOW_PATTERN" '.[]|select((.class|test("\\b" + $p + "\\b";"i")) or (.title|test("\\b" + $p + "\\b";"i")))|.address' | head -n1)

if [[ -n $WINDOW_ADDRESS ]]; then
  hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
else
  eval exec setsid $LAUNCH_COMMAND
fi


================================================
FILE: bin/omarchy-launch-or-focus-tui
================================================
#!/bin/bash

# Launch or focus on a given TUI identified by the passed in as the command.
# Use by commands like omarchy-launch-wifi to ensure there is only one wifi configuration screen open.

APP_ID="org.omarchy.$(basename "$1")"
LAUNCH_COMMAND="omarchy-launch-tui $@"

exec omarchy-launch-or-focus "$APP_ID" "$LAUNCH_COMMAND"


================================================
FILE: bin/omarchy-launch-or-focus-webapp
================================================
#!/bin/bash

# Launch or focus on a given web app identified by the window-pattern.
# Use by some default bindings, like the one for WhatsApp, to ensure there is only one instance of the application open.

if (($# == 0)); then
  echo "Usage: omarchy-launch-or-focus-webapp [window-pattern] [url-and-flags...]"
  exit 1
fi

WINDOW_PATTERN="$1"
shift
LAUNCH_COMMAND="omarchy-launch-webapp $@"

exec omarchy-launch-or-focus "$WINDOW_PATTERN" "$LAUNCH_COMMAND"


================================================
FILE: bin/omarchy-launch-screensaver
================================================
#!/bin/bash

# Launch the Omarchy screensaver in the default terminal on the system with the correct font configuration.

# Exit early if we don't have the tte show
if ! command -v tte &>/dev/null; then
  exit 1
fi

# Exit early if screensave is already running
pgrep -f org.omarchy.screensaver && exit 0

# Allow screensaver to be turned off but also force started
if [[ -f ~/.local/state/omarchy/toggles/screensaver-off ]] && [[ $1 != "force" ]]; then
  exit 1
fi

# Silently quit Walker on overlay
walker -q

focused=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')
terminal=$(xdg-terminal-exec --print-id)

for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
  hyprctl dispatch focusmonitor $m

  case $terminal in
  *Alacritty*)
    hyprctl dispatch exec -- \
      alacritty --class=org.omarchy.screensaver \
      --config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \
      -e omarchy-cmd-screensaver
    ;;
  *ghostty*)
    hyprctl dispatch exec -- \
      ghostty --class=org.omarchy.screensaver \
      --config-file=~/.local/share/omarchy/default/ghostty/screensaver \
      --font-size=18 \
      -e omarchy-cmd-screensaver
    ;;
  *kitty*)
    hyprctl dispatch exec -- \
      kitty --class=org.omarchy.screensaver \
      --override font_size=18 \
      --override window_padding_width=0 \
      -e omarchy-cmd-screensaver
    ;;
  *)
    notify-send "✋  Screensaver only runs in Alacritty, Ghostty, or Kitty"
    ;;
  esac
done

hyprctl dispatch focusmonitor $focused


================================================
FILE: bin/omarchy-launch-tui
================================================
#!/bin/bash

# Launch the TUI command passed in as an argument in the default terminal with an org.omarchy.COMMAND app id for styling.

exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.$(basename $1) -e "$1" "${@:2}"


================================================
FILE: bin/omarchy-launch-walker
================================================
#!/bin/bash

# Launch the Walker application launcher while ensuring that it's data provider (called elephant) is running first.

# Ensure elephant is running before launching walker
if ! pgrep -x elephant > /dev/null; then
  setsid uwsm-app -- elephant &
fi

# Ensure walker service is running
if ! pgrep -f "walker --gapplication-service" > /dev/null; then
  setsid uwsm-app -- walker --gapplication-service &
fi

exec walker --width 644 --maxheight 300 --minheight 300 "$@"


================================================
FILE: bin/omarchy-launch-webapp
================================================
#!/bin/bash

# Launch the passed in URL as a web app in the default browser (or chromium if the default doesn't support --app).

browser=$(xdg-settings get default-web-browser)

case $browser in
google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
*) browser="chromium.desktop" ;;
esac

exec setsid uwsm-app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$1" "${@:2}"


================================================
FILE: bin/omarchy-launch-wifi
================================================
#!/bin/bash

# Launch the Omarchy wifi controls (provided by the Impala TUI).
# Attempts to unblock the wifi service first in case it should be been blocked.

rfkill unblock wifi
omarchy-launch-or-focus-tui impala


================================================
FILE: bin/omarchy-lock-screen
================================================
#!/bin/bash

# Locks the system using hyprlock, but not before ensuring 1password has also been locked, and the screensaver stopped.

# Lock the screen
pidof hyprlock || hyprlock &

# Set keyboard layout to default (first layout)
hyprctl switchxkblayout all 0 > /dev/null 2>&1

# Ensure 1password is locked
if pgrep -x "1password" >/dev/null; then
  1password --lock &
fi

# Avoid running screensaver when locked
pkill -f org.omarchy.screensaver


================================================
FILE: bin/omarchy-menu
================================================
#!/bin/bash

# Launch the Omarchy Menu or takes a parameter to jump straight to a submenu.

export PATH="$HOME/.local/share/omarchy/bin:$PATH"

# Set to true when going directly to a submenu, so we can exit directly
BACK_TO_EXIT=false

back_to() {
  local parent_menu="$1"

  if [[ $BACK_TO_EXIT == "true" ]]; then
    exit 0
  elif [[ -n $parent_menu ]]; then
    "$parent_menu"
  else
    show_main_menu
  fi
}

toggle_existing_menu() {
  if pgrep -f "walker.*--dmenu" >/dev/null; then
    walker --close >/dev/null 2>&1
    exit 0
  fi
}

menu() {
  local prompt="$1"
  local options="$2"
  local extra="$3"
  local preselect="$4"

  read -r -a args <<<"$extra"

  if [[ -n $preselect ]]; then
    local index
    index=$(echo -e "$options" | grep -nxF "$preselect" | cut -d: -f1)
    if [[ -n $index ]]; then
      args+=("-c" "$index")
    fi
  fi

  echo -e "$options" | omarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 630 -p "$prompt…" "${args[@]}" 2>/dev/null
}

terminal() {
  xdg-terminal-exec --app-id=org.omarchy.terminal "$@"
}

present_terminal() {
  omarchy-launch-floating-terminal-with-presentation $1
}

open_in_editor() {
  notify-send "Editing config file" "$1"
  omarchy-launch-editor "$1"
}

install() {
  present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2"
}

install_and_launch() {
  present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2 && setsid gtk-launch $3"
}

install_font() {
  present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2 && sleep 2 && omarchy-font-set '$3'"
}

install_terminal() {
  present_terminal "omarchy-install-terminal $1"
}

aur_install() {
  present_terminal "echo 'Installing $1 from AUR...'; omarchy-pkg-aur-add $2"
}

aur_install_and_launch() {
  present_terminal "echo 'Installing $1 from AUR...'; omarchy-pkg-aur-add $2 && setsid gtk-launch $3"
}

show_learn_menu() {
  case $(menu "Learn" "  Keybindings\n  Omarchy\n  Hyprland\n󰣇  Arch\n  Neovim\n󱆃  Bash") in
  *Keybindings*) omarchy-menu-keybindings ;;
  *Omarchy*) omarchy-launch-webapp "https://learn.omacom.io/2/the-omarchy-manual" ;;
  *Hyprland*) omarchy-launch-webapp "https://wiki.hypr.land/" ;;
  *Arch*) omarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;;
  *Bash*) omarchy-launch-webapp "https://devhints.io/bash" ;;
  *Neovim*) omarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;;
  *) show_main_menu ;;
  esac
}

show_trigger_menu() {
  case $(menu "Trigger" "  Capture\n  Share\n󰔎  Toggle\n  Hardware") in
  *Capture*) show_capture_menu ;;
  *Share*) show_share_menu ;;
  *Toggle*) show_toggle_menu ;;
  *Hardware*) show_hardware_menu ;;
  *) show_main_menu ;;
  esac
}

show_capture_menu() {
  case $(menu "Capture" "  Screenshot\n  Screenrecord\n󰃉  Color") in
  *Screenshot*) omarchy-cmd-screenshot ;;
  *Screenrecord*) show_screenrecord_menu ;;
  *Color*) pkill hyprpicker || hyprpicker -a ;;
  *) back_to show_trigger_menu ;;
  esac
}

get_webcam_list() {
  v4l2-ctl --list-devices 2>/dev/null | while IFS= read -r line; do
    if [[ $line != $'\t'* && -n $line ]]; then
      local name="$line"
      IFS= read -r device || break
      device=$(echo "$device" | tr -d '\t' | head -1)
      [[ -n $device ]] && echo "$device  $name"
    fi
  done
}

show_webcam_select_menu() {
  local devices=$(get_webcam_list)
  local count=$(echo "$devices" | grep -c . 2>/dev/null || echo 0)

  if [[ -z $devices ]] || ((count == 0)); then
    notify-send "No webcam devices found" -u critical -t 3000
    return 1
  fi

  if ((count == 1)); then
    echo "$devices" | awk '{print $1}'
  else
    menu "Select Webcam" "$devices" | awk '{print $1}'
  fi
}

show_screenrecord_menu() {
  omarchy-cmd-screenrecord --stop-recording && exit 0

  case $(menu "Screenrecord" "  With no audio\n  With desktop audio\n  With desktop + microphone audio\n  With desktop + microphone audio + webcam") in
  *"With no audio") omarchy-cmd-screenrecord ;;
  *"With desktop audio") omarchy-cmd-screenrecord --with-desktop-audio ;;
  *"With desktop + microphone audio") omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;;
  *"With desktop + microphone audio + webcam")
    local device=$(show_webcam_select_menu) || {
      back_to show_capture_menu
      return
    }
    omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio --with-webcam --webcam-device="$device"
    ;;
  *) back_to show_capture_menu ;;
  esac
}

show_share_menu() {
  case $(menu "Share" "  Clipboard\n  File \n  Folder") in
  *Clipboard*) omarchy-cmd-share clipboard ;;
  *File*) terminal bash -c "omarchy-cmd-share file" ;;
  *Folder*) terminal bash -c "omarchy-cmd-share folder" ;;
  *) back_to show_trigger_menu ;;
  esac
}

show_toggle_menu() {
  case $(menu "Toggle" "󱄄  Screensaver\n󰔎  Nightlight\n󱫖  Idle Lock\n󰍜  Top Bar\n󱂬  Workspace Layout\n  Window Gaps\n  1-Window Ratio\n󰍹  Display Scaling") in

  *Screensaver*) omarchy-toggle-screensaver ;;
  *Nightlight*) omarchy-toggle-nightlight ;;
  *Idle*) omarchy-toggle-idle ;;
  *Bar*) omarchy-toggle-waybar ;;
  *Layout*) omarchy-hyprland-workspace-layout-toggle ;;
  *Ratio*) omarchy-hyprland-window-single-square-aspect-toggle ;;
  *Gaps*) omarchy-hyprland-window-gaps-toggle ;;
  *Scaling*) omarchy-hyprland-monitor-scaling-cycle ;;
  *) back_to show_trigger_menu ;;
  esac
}

show_hardware_menu() {
  case $(menu "Toggle" "  Hybrid GPU") in
  *"Hybrid GPU"*) present_terminal omarchy-toggle-hybrid-gpu ;;
  *) show_trigger_menu ;;
  esac
}

show_style_menu() {
  case $(menu "Style" "󰸌  Theme\n  Font\n  Background\n  Hyprland\n󱄄  Screensaver\n  About") in
  *Theme*) show_theme_menu ;;
  *Font*) show_font_menu ;;
  *Background*) show_background_menu ;;
  *Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
  *Screensaver*) open_in_editor ~/.config/omarchy/branding/screensaver.txt ;;
  *About*) open_in_editor ~/.config/omarchy/branding/about.txt ;;
  *) show_main_menu ;;
  esac
}

show_theme_menu() {
  omarchy-launch-walker -m menus:omarchythemes --width 800 --minheight 400
}

show_background_menu() {
  omarchy-launch-walker -m menus:omarchyBackgroundSelector --width 800 --minheight 400
}

show_font_menu() {
  theme=$(menu "Font" "$(omarchy-font-list)" "--width 350" "$(omarchy-font-current)")
  if [[ $theme == "CNCLD" || -z $theme ]]; then
    back_to show_style_menu
  else
    omarchy-font-set "$theme"
  fi
}

show_setup_menu() {
  local options="  Audio\n  Wifi\n󰂯  Bluetooth\n󱐋  Power Profile\n  System Sleep\n󰍹  Monitors"
  [[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n  Keybindings"
  options="$options\n  Key Remapping"
  [[ -f ~/.config/hypr/input.conf ]] && options="$options\n  Input"
  options="$options\n󰱔  DNS\n  Security\n  Config"

  case $(menu "Setup" "$options") in
  *Audio*) omarchy-launch-audio ;;
  *Wifi*) omarchy-launch-wifi ;;
  *Bluetooth*) omarchy-launch-bluetooth ;;
  *Power*) show_setup_power_menu ;;
  *System*) show_setup_system_menu ;;
  *Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;;
  *Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;;
  *Input*) open_in_editor ~/.config/hypr/input.conf ;;
  *Key\ Remapping*) omarchy-setup-makima && open_in_editor "$HOME/.config/makima/AT Translated Set 2 keyboard.toml" && omarchy-restart-makima ;;
  *DNS*) present_terminal omarchy-setup-dns ;;
  *Security*) show_setup_security_menu ;;
  *Config*) show_setup_config_menu ;;
  *) show_main_menu ;;
  esac
}

show_setup_power_menu() {
  profile=$(menu "Power Profile" "$(omarchy-powerprofiles-list)" "" "$(powerprofilesctl get)")

  if [[ $profile == "CNCLD" || -z $profile ]]; then
    back_to show_setup_menu
  else
    powerprofilesctl set "$profile"
  fi
}

show_setup_security_menu() {
  case $(menu "Setup" "󰈷  Fingerprint\n  Fido2") in
  *Fingerprint*) present_terminal omarchy-setup-fingerprint ;;
  *Fido2*) present_terminal omarchy-setup-fido2 ;;
  *) show_setup_menu ;;
  esac
}

show_setup_config_menu() {
  case $(menu "Setup" "  Defaults\n  Hyprland\n  Hypridle\n  Hyprlock\n  Hyprsunset\n  Swayosd\n󰌧  Walker\n󰍜  Waybar\n󰞅  XCompose") in
  *Defaults*) open_in_editor ~/.config/uwsm/default ;;
  *Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
  *Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && omarchy-restart-hypridle ;;
  *Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
  *Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && omarchy-restart-hyprsunset ;;
  *Swayosd*) open_in_editor ~/.config/swayosd/config.toml && omarchy-restart-swayosd ;;
  *Walker*) open_in_editor ~/.config/walker/config.toml && omarchy-restart-walker ;;
  *Waybar*) open_in_editor ~/.config/waybar/config.jsonc && omarchy-restart-waybar ;;
  *XCompose*) open_in_editor ~/.XCompose && omarchy-restart-xcompose ;;
  *) show_setup_menu ;;
  esac
}

show_setup_system_menu() {
  local options=""

  if [[ -f ~/.local/state/omarchy/toggles/suspend-off ]]; then
    options="$options󰒲  Enable Suspend"
  else
    options="$options󰒲  Disable Suspend"
  fi

  if omarchy-hibernation-available; then
    options="$options\n󰤁  Disable Hibernate"
  else
    options="$options\n󰤁  Enable Hibernate"
  fi

  case $(menu "System" "$options") in
  *Suspend*) omarchy-toggle-suspend ;;
  *"Enable Hibernate"*) present_terminal omarchy-hibernation-setup ;;
  *"Disable Hibernate"*) present_terminal omarchy-hibernation-remove ;;
  *) show_setup_menu ;;
  esac
}

show_install_menu() {
  case $(menu "Install" "󰣇  Package\n󰣇  AUR\n  Web App\n  TUI\n  Service\n  Style\n󰵮  Development\n  Editor\n  Terminal\n󱚤  AI\n󰍲  Windows\n  Gaming") in
  *Package*) terminal omarchy-pkg-install ;;
  *AUR*) terminal omarchy-pkg-aur-install ;;
  *Web*) present_terminal omarchy-webapp-install ;;
  *TUI*) present_terminal omarchy-tui-install ;;
  *Service*) show_install_service_menu ;;
  *Style*) show_install_style_menu ;;
  *Development*) show_install_development_menu ;;
  *Editor*) show_install_editor_menu ;;
  *Terminal*) show_install_terminal_menu ;;
  *AI*) show_install_ai_menu ;;
  *Windows*) present_terminal "omarchy-windows-vm install" ;;
  *Gaming*) show_install_gaming_menu ;;
  *) show_main_menu ;;
  esac
}

show_install_service_menu() {
  case $(menu "Install" "  Dropbox\n  Tailscale\n󱇱  NordVPN [AUR]\n󰟵  Bitwarden\n  Chromium Account") in
  *Dropbox*) present_terminal omarchy-install-dropbox ;;
  *Tailscale*) present_terminal omarchy-install-tailscale ;;
  *NordVPN*) present_terminal omarchy-install-nordvpn ;;
  *Bitwarden*) install_and_launch "Bitwarden" "bitwarden bitwarden-cli" "bitwarden" ;;
  *Chromium*) present_terminal omarchy-install-chromium-google-account ;;
  *) show_install_menu ;;
  esac
}

show_install_editor_menu() {
  case $(menu "Install" "  VSCode\n  Cursor\n  Zed\n  Sublime Text\n  Helix\n  Emacs") in
  *VSCode*) present_terminal omarchy-install-vscode ;;
  *Cursor*) install_and_launch "Cursor" "cursor-bin" "cursor" ;;
  *Zed*) install_and_launch "Zed" "zed" "dev.zed.Zed" ;;
  *Sublime*) install_and_launch "Sublime Text" "sublime-text-4" "sublime_text" ;;
  *Helix*) install "Helix" "helix" ;;
  *Emacs*) install "Emacs" "emacs-wayland" && systemctl --user enable --now emacs.service ;;
  *) show_install_menu ;;
  esac
}

show_install_terminal_menu() {
  case $(menu "Install" "  Alacritty\n  Ghostty\n  Kitty") in
  *Alacritty*) install_terminal "alacritty" ;;
  *Ghostty*) install_terminal "ghostty" ;;
  *Kitty*) install_terminal "kitty" ;;
  *) show_install_menu ;;
  esac
}

show_install_ai_menu() {
  ollama_pkg=$(
    (command -v nvidia-smi &>/dev/null && echo ollama-cuda) ||
      (command -v rocminfo &>/dev/null && echo ollama-rocm) ||
      echo ollama
  )

  case $(menu "Install" "  Dictation\n󱚤  LM Studio\n󱚤  Ollama\n󱚤  Crush") in
  *Dictation*) present_terminal omarchy-voxtype-install ;;
  *Studio*) install "LM Studio" "lmstudio-bin" ;;
  *Ollama*) install "Ollama" $ollama_pkg ;;
  *Crush*) install "Crush" "crush-bin" ;;
  *) show_install_menu ;;
  esac
}

show_install_gaming_menu() {
  case $(menu "Install" "  Steam\n󰢹  NVIDIA GeForce NOW\n  RetroArch [AUR]\n󰍳  Minecraft\n󰖺  Xbox Controller [AUR]") in
  *Steam*) present_terminal omarchy-install-steam ;;
  *GeForce*) present_terminal omarchy-install-geforce-now ;;
  *RetroArch*) aur_install_and_launch "RetroArch" "retroarch retroarch-assets libretro libretro-fbneo" "com.libretro.RetroArch.desktop" ;;
  *Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;;
  *Xbox*) present_terminal omarchy-install-xbox-controllers ;;
  *) show_install_menu ;;
  esac
}

show_install_style_menu() {
  case $(menu "Install" "󰸌  Theme\n  Background\n  Font") in
  *Theme*) present_terminal omarchy-theme-install ;;
  *Background*) omarchy-theme-bg-install ;;
  *Font*) show_install_font_menu ;;
  *) show_install_menu ;;
  esac
}

show_install_font_menu() {
  case $(menu "Install" "  Cascadia Mono\n  Meslo LG Mono\n  Fira Code\n  Victor Code\n  Bistream Vera Mono\n  Iosevka" "--width 350") in
  *Cascadia*) install_font "Cascadia Mono" "ttf-cascadia-mono-nerd" "CaskaydiaMono Nerd Font" ;;
  *Meslo*) install_font "Meslo LG Mono" "ttf-meslo-nerd" "MesloLGL Nerd Font" ;;
  *Fira*) install_font "Fira Code" "ttf-firacode-nerd" "FiraCode Nerd Font" ;;
  *Victor*) install_font "Victor Code" "ttf-victor-mono-nerd" "VictorMono Nerd Font" ;;
  *Bistream*) install_font "Bistream Vera Code" "ttf-bitstream-vera-mono-nerd" "BitstromWera Nerd Font" ;;
  *Iosevka*) install_font "Iosevka" "ttf-iosevka-nerd" "Iosevka Nerd Font Mono" ;;
  *) show_install_menu ;;
  esac
}

show_install_development_menu() {
  case $(menu "Install" "󰫏  Ruby on Rails\n  Docker DB\n  JavaScript\n  Go\n  PHP\n  Python\n  Elixir\n  Zig\n  Rust\n  Java\n  .NET\n  OCaml\n  Clojure\n  Scala") in
  *Rails*) present_terminal "omarchy-install-dev-env ruby" ;;
  *Docker*) present_terminal omarchy-install-docker-dbs ;;
  *JavaScript*) show_install_javascript_menu ;;
  *Go*) present_terminal "omarchy-install-dev-env go" ;;
  *PHP*) show_install_php_menu ;;
  *Python*) present_terminal "omarchy-install-dev-env python" ;;
  *Elixir*) show_install_elixir_menu ;;
  *Zig*) present_terminal "omarchy-install-dev-env zig" ;;
  *Rust*) present_terminal "omarchy-install-dev-env rust" ;;
  *Java*) present_terminal "omarchy-install-dev-env java" ;;
  *NET*) present_terminal "omarchy-install-dev-env dotnet" ;;
  *OCaml*) present_terminal "omarchy-install-dev-env ocaml" ;;
  *Clojure*) present_terminal "omarchy-install-dev-env clojure" ;;
  *Scala*) present_terminal "omarchy-install-dev-env scala" ;;
  *) show_install_menu ;;
  esac
}

show_install_javascript_menu() {
  case $(menu "Install" "  Node.js\n  Bun\n  Deno") in
  *Node*) present_terminal "omarchy-install-dev-env node" ;;
  *Bun*) present_terminal "omarchy-install-dev-env bun" ;;
  *Deno*) present_terminal "omarchy-install-dev-env deno" ;;
  *) show_install_development_menu ;;
  esac
}

show_install_php_menu() {
  case $(menu "Install" "  PHP\n  Laravel\n  Symfony") in
  *PHP*) present_terminal "omarchy-install-dev-env php" ;;
  *Laravel*) present_terminal "omarchy-install-dev-env laravel" ;;
  *Symfony*) present_terminal "omarchy-install-dev-env symfony" ;;
  *) show_install_development_menu ;;
  esac
}

show_install_elixir_menu() {
  case $(menu "Install" "  Elixir\n  Phoenix") in
  *Elixir*) present_terminal "omarchy-install-dev-env elixir" ;;
  *Phoenix*) present_terminal "omarchy-install-dev-env phoenix" ;;
  *) show_install_development_menu ;;
  esac
}

show_remove_menu() {
  case $(menu "Remove" "󰣇  Package\n  Web App\n  TUI\n󰵮  Development\n󰏓  Preinstalls\n  Dictation\n󰸌  Theme\n󰍲  Windows\n󰈷  Fingerprint\n  Fido2") in
  *Package*) terminal omarchy-pkg-remove ;;
  *Web*) present_terminal omarchy-webapp-remove ;;
  *TUI*) present_terminal omarchy-tui-remove ;;
  *Development*) show_remove_development_menu ;;
  *Preinstalls*) present_terminal omarchy-remove-preinstalls ;;
  *Dictation*) present_terminal omarchy-voxtype-remove ;;
  *Theme*) present_terminal omarchy-theme-remove ;;
  *Windows*) present_terminal "omarchy-windows-vm remove" ;;
  *Fingerprint*) present_terminal "omarchy-setup-fingerprint --remove" ;;
  *Fido2*) present_terminal "omarchy-setup-fido2 --remove" ;;
  *) show_main_menu ;;
  esac
}

show_remove_development_menu() {
  case $(menu "Remove" "󰫏  Ruby on Rails\n  JavaScript\n  Go\n  PHP\n  Python\n  Elixir\n  Zig\n  Rust\n  Java\n  .NET\n  OCaml\n  Clojure\n  Scala") in
  *Rails*) present_terminal "omarchy-remove-dev-env ruby" ;;
  *JavaScript*) show_remove_javascript_menu ;;
  *Go*) present_terminal "omarchy-remove-dev-env go" ;;
  *PHP*) show_remove_php_menu ;;
  *Python*) present_terminal "omarchy-remove-dev-env python" ;;
  *Elixir*) show_remove_elixir_menu ;;
  *Zig*) present_terminal "omarchy-remove-dev-env zig" ;;
  *Rust*) present_terminal "omarchy-remove-dev-env rust" ;;
  *Java*) present_terminal "omarchy-remove-dev-env java" ;;
  *NET*) present_terminal "omarchy-remove-dev-env dotnet" ;;
  *OCaml*) present_terminal "omarchy-remove-dev-env ocaml" ;;
  *Clojure*) present_terminal "omarchy-remove-dev-env clojure" ;;
  *Scala*) present_terminal "omarchy-remove-dev-env scala" ;;
  *) show_remove_menu ;;
  esac
}

show_remove_javascript_menu() {
  case $(menu "Remove" "  Node.js\n  Bun\n  Deno") in
  *Node*) present_terminal "omarchy-remove-dev-env node" ;;
  *Bun*) present_terminal "omarchy-remove-dev-env bun" ;;
  *Deno*) present_terminal "omarchy-remove-dev-env deno" ;;
  *) show_remove_development_menu ;;
  esac
}

show_remove_php_menu() {
  case $(menu "Remove" "  PHP\n  Laravel\n  Symfony") in
  *PHP*) present_terminal "omarchy-remove-dev-env php" ;;
  *Laravel*) present_terminal "omarchy-remove-dev-env laravel" ;;
  *Symfony*) present_terminal "omarchy-remove-dev-env symfony" ;;
  *) show_remove_development_menu ;;
  esac
}

show_remove_elixir_menu() {
  case $(menu "Remove" "  Elixir\n  Phoenix") in
  *Elixir*) present_terminal "omarchy-remove-dev-env elixir" ;;
  *Phoenix*) present_terminal "omarchy-remove-dev-env phoenix" ;;
  *) show_remove_development_menu ;;
  esac
}

show_update_menu() {
  case $(menu "Update" "  Omarchy\n󰔫  Channel\n  Config\n󰸌  Extra Themes\n  Process\n󰇅  Hardware\n  Firmware\n  Password\n  Timezone\n  Time") in
  *Omarchy*) present_terminal omarchy-update ;;
  *Channel*) show_update_channel_menu ;;
  *Config*) show_update_config_menu ;;
  *Themes*) present_terminal omarchy-theme-update ;;
  *Process*) show_update_process_menu ;;
  *Hardware*) show_update_hardware_menu ;;
  *Firmware*) present_terminal omarchy-update-firmware ;;
  *Timezone*) present_terminal omarchy-tz-select ;;
  *Time*) present_terminal omarchy-update-time ;;
  *Password*) show_update_password_menu ;;
  *) show_main_menu ;;
  esac
}

show_update_channel_menu() {
  case $(menu "Update channel" "🟢 Stable\n🟡 RC\n🟠 Edge\n🔴 Dev") in
  *Stable*) present_terminal "omarchy-channel-set stable" ;;
  *RC*) present_terminal "omarchy-channel-set rc" ;;
  *Edge*) present_terminal "omarchy-channel-set edge" ;;
  *Dev*) present_terminal "omarchy-channel-set dev" ;;
  *) show_update_menu ;;
  esac
}
show_update_process_menu() {
  case $(menu "Restart" "  Hypridle\n  Hyprsunset\n  Swayosd\n󰌧  Walker\n󰍜  Waybar") in
  *Hypridle*) omarchy-restart-hypridle ;;
  *Hyprsunset*) omarchy-restart-hyprsunset ;;
  *Swayosd*) omarchy-restart-swayosd ;;
  *Walker*) omarchy-restart-walker ;;
  *Waybar*) omarchy-restart-waybar ;;
  *) show_update_menu ;;
  esac
}

show_update_config_menu() {
  case $(menu "Use default config" "  Hyprland\n  Hypridle\n  Hyprlock\n  Hyprsunset\n󱣴  Plymouth\n  Swayosd\n  Tmux\n󰌧  Walker\n󰍜  Waybar") in
  *Hyprland*) present_terminal omarchy-refresh-hyprland ;;
  *Hypridle*) present_terminal omarchy-refresh-hypridle ;;
  *Hyprlock*) present_terminal omarchy-refresh-hyprlock ;;
  *Hyprsunset*) present_terminal omarchy-refresh-hyprsunset ;;
  *Plymouth*) present_terminal omarchy-refresh-plymouth ;;
  *Swayosd*) present_terminal omarchy-refresh-swayosd ;;
  *Tmux*) present_terminal omarchy-refresh-tmux ;;
  *Walker*) present_terminal omarchy-refresh-walker ;;
  *Waybar*) present_terminal omarchy-refresh-waybar ;;
  *) show_update_menu ;;
  esac
}

show_update_hardware_menu() {
  case $(menu "Restart" "  Audio\n󱚾  Wi-Fi\n󰂯  Bluetooth") in
  *Audio*) present_terminal omarchy-restart-pipewire ;;
  *Wi-Fi*) present_terminal omarchy-restart-wifi ;;
  *Bluetooth*) present_terminal omarchy-restart-bluetooth ;;
  *) show_update_menu ;;
  esac
}

show_update_password_menu() {
  case $(menu "Update Password" "  Drive Encryption\n  User") in
  *Drive*) present_terminal omarchy-drive-set-password ;;
  *User*) present_terminal passwd ;;
  *) show_update_menu ;;
  esac
}

show_about() {
  omarchy-launch-about
}

show_system_menu() {
  local options="󱄄  Screensaver\n  Lock"
  [[ ! -f ~/.local/state/omarchy/toggles/suspend-off ]] && options="$options\n󰒲  Suspend"
  omarchy-hibernation-available && options="$options\n󰤁  Hibernate"
  options="$options\n󰍃  Logout\n󰜉  Restart\n󰐥  Shutdown"

  case $(menu "System" "$options") in
  *Screensaver*) omarchy-launch-screensaver force ;;
  *Lock*) omarchy-lock-screen ;;
  *Suspend*) systemctl suspend ;;
  *Hibernate*) systemctl hibernate ;;
  *Logout*) omarchy-system-logout ;;
  *Restart*) omarchy-system-reboot ;;
  *Shutdown*) omarchy-system-shutdown ;;
  *) back_to show_main_menu ;;
  esac
}

show_main_menu() {
  go_to_menu "$(menu "Go" "󰀻  Apps\n󰧑  Learn\n󱓞  Trigger\n  Style\n  Setup\n󰉉  Install\n󰭌  Remove\n  Update\n  About\n  System")"
}

go_to_menu() {
  case "${1,,}" in
  *apps*) walker -p "Launch…" ;;
  *learn*) show_learn_menu ;;
  *trigger*) show_trigger_menu ;;
  *toggle*) show_toggle_menu ;;
  *share*) show_share_menu ;;
  *background*) show_background_menu ;;
  *capture*) show_capture_menu ;;
  *style*) show_style_menu ;;
  *theme*) show_theme_menu ;;
  *screenrecord*) show_screenrecord_menu ;;
  *setup*) show_setup_menu ;;
  *power*) show_setup_power_menu ;;
  *install*) show_install_menu ;;
  *remove*) show_remove_menu ;;
  *update*) show_update_menu ;;
  *about*) show_about ;;
  *system*) show_system_menu ;;
  esac
}

# Allow user extensions and overrides
USER_EXTENSIONS="$HOME/.config/omarchy/extensions/menu.sh"
[[ -f $USER_EXTENSIONS ]] && source "$USER_EXTENSIONS"

toggle_existing_menu

if [[ -n $1 ]]; then
  BACK_TO_EXIT=true
  go_to_menu "$1"
else
  show_main_menu
fi


================================================
FILE: bin/omarchy-menu-keybindings
================================================
#!/bin/bash

# Display Hyprland keybindings defined in your configuration using walker for an interactive search menu.

declare -A KEYCODE_SYM_MAP

build_keymap_cache() {
  local keymap
  keymap="$(xkbcli compile-keymap)" || {
    echo "Failed to compile keymap" >&2
    return 1
  }

  while IFS=, read -r code sym; do
    [[ -z $code || -z $sym ]] && continue
    KEYCODE_SYM_MAP["$code"]="$sym"
  done < <(
    awk '
      BEGIN { sec = "" }
      /xkb_keycodes/ { sec = "codes"; next }
      /xkb_symbols/  { sec = "syms";  next }
      sec == "codes" {
        if (match($0, /<([A-Za-z0-9_]+)>\s*=\s*([0-9]+)\s*;/, m)) code_by_name[m[1]] = m[2]
      }
      sec == "syms" {
        if (match($0, /key\s*<([A-Za-z0-9_]+)>\s*\{\s*\[\s*([^, \]]+)/, m)) sym_by_name[m[1]] = m[2]
      }
      END {
        for (k in code_by_name) {
          c = code_by_name[k]
          s = sym_by_name[k]
          if (c != "" && s != "" && s != "NoSymbol") print c "," s
        }
      }
    ' <<<"$keymap"
  )
}

lookup_keycode_cached() {
  printf '%s\n' "${KEYCODE_SYM_MAP[$1]}"
}

parse_keycodes() {
  local start end elapsed
  [[ ${DEBUG:-0} == "1" ]] && start=$(date +%s.%N)
  while IFS= read -r line; do
    if [[ $line =~ code:([0-9]+) ]]; then
      code="${BASH_REMATCH[1]}"
      symbol=$(lookup_keycode_cached "$code" "$XKB_KEYMAP_CACHE")
      echo "${line/code:${code}/$symbol}"
    elif [[ $line =~ mouse:([0-9]+) ]]; then
      code="${BASH_REMATCH[1]}"

      case "$code" in
        272) symbol="LEFT MOUSE BUTTON" ;;
        273) symbol="RIGHT MOUSE BUTTON" ;;
        274) symbol="MIDDLE MOUSE BUTTON" ;;
        *)   symbol="mouse:${code}" ;;
      esac

      echo "${line/mouse:${code}/$symbol}"
    else
      echo "$line"
    fi
  done

  if [[ $DEBUG == "1" ]]; then
    end=$(date +%s.%N)
    # fall back to awk if bc is missing
    if command -v bc >/dev/null 2>&1; then
      elapsed=$(echo "$end - $start" | bc)
    else
      elapsed=$(awk -v s="$start" -v e="$end" 'BEGIN{printf "%.6f", (e - s)}')
    fi
    echo "[DEBUG] parse_keycodes elapsed: ${elapsed}s" >&2
  fi
}

# Fetch dynamic keybindings from Hyprland
#
# Also do some pre-processing:
# - Remove standard Omarchy bin path prefix
# - Remove uwsm prefix
# - Map numeric modifier key mask to a textual rendition
# - Output comma-separated values that the parser can understand
dynamic_bindings() {
  hyprctl -j binds |
    jq -r '.[] | {modmask, key, keycode, description, dispatcher, arg} | "\(.modmask),\(.key)@\(.keycode),\(.description),\(.dispatcher),\(.arg)"' |
    sed -r \
      -e 's/null//' \
      -e 's,~/.local/share/omarchy/bin/,,' \
      -e 's,uwsm app -- ,,' \
      -e 's,uwsm-app -- ,,' \
      -e 's/@0//' \
      -e 's/,@/,code:/' \
      -e 's/^0,/,/' \
      -e 's/^1,/SHIFT,/' \
      -e 's/^4,/CTRL,/' \
      -e 's/^5,/SHIFT CTRL,/' \
      -e 's/^8,/ALT,/' \
      -e 's/^9,/SHIFT ALT,/' \
      -e 's/^12,/CTRL ALT,/' \
      -e 's/^13,/SHIFT CTRL ALT,/' \
      -e 's/^64,/SUPER,/' \
      -e 's/^65,/SUPER SHIFT,/' \
      -e 's/^68,/SUPER CTRL,/' \
      -e 's/^69,/SUPER SHIFT CTRL,/' \
      -e 's/^72,/SUPER ALT,/' \
      -e 's/^73,/SUPER SHIFT ALT,/' \
      -e 's/^76,/SUPER CTRL ALT,/' \
      -e 's/^77,/SUPER SHIFT CTRL ALT,/'
}

# Hardcoded bindings, like the copy-url extension and such
static_bindings() {
    echo "SHIFT ALT,L,Copy URL from Web App,extension,copy-url"
}

# Parse and format keybindings
#
# `awk` does the heavy lifting:
# - Set the field separator to a comma ','.
# - Joins the key combination (e.g., "SUPER + Q").
# - Joins the command that the key executes.
# - Prints everything in a nicely aligned format.
parse_bindings() {
  awk -F, '
{
    # Combine the modifier and key (first two fields)
    key_combo = $1 " + " $2;

    # Clean up: strip leading "+" if present, trim spaces
    gsub(/^[ \t]*\+?[ \t]*/, "", key_combo);
    gsub(/[ \t]+$/, "", key_combo);

    # Use description, if set
    action = $3;

    if (action == "") {
        # Reconstruct the command from the remaining fields
        for (i = 4; i <= NF; i++) {
            action = action $i (i < NF ? "," : "");
        }

        # Clean up trailing commas, remove leading "exec, ", and trim
        sub(/,$/, "", action);
        gsub(/(^|,)[[:space:]]*exec[[:space:]]*,?/, "", action);
        gsub(/^[ \t]+|[ \t]+$/, "", action);
        gsub(/[ \t]+/, " ", key_combo);  # Collapse multiple spaces to one

        # Escape XML entities
        gsub(/&/, "\\&amp;", action);
        gsub(/</, "\\&lt;", action);
        gsub(/>/, "\\&gt;", action);
        gsub(/"/, "\\&quot;", action);
        gsub(/'"'"'/, "\\&apos;", action);
    }

    if (action != "") {
        printf "%-35s → %s\n", key_combo, action;
    }
}'
}

prioritize_entries() {
  awk '
  {
    line = $0
    prio = 50
    if (match(line, /Terminal/)) prio = 0
    if (match(line, /Tmux/)) prio = 1
    if (match(line, /Browser/) && !match(line, /Browser[[:space:]]*\(/) && !match(line, /SUPER SHIFT.*\+.*B.*→.*Browser/)) prio = 2
    if (match(line, /File manager/) && !match(line, /File manager \(cwd\)/))  prio = 3
    if (match(line, /Launch apps/))  prio = 4
    if (match(line, /Omarchy menu/))  prio = 5
    if (match(line, /System menu/))  prio = 6
    if (match(line, /Theme menu/))  prio = 7
    if (match(line, /Full screen/))  prio = 8
    if (match(line, /Full width/))  prio = 9
    if (match(line, /Close window/))  prio = 10
    if (match(line, /Close all windows/))  prio = 11
    if (match(line, /Lock system/))  prio = 12
    if (match(line, /Toggle window floating/))  prio = 13
    if (match(line, /Toggle window split/))  prio = 14
    if (match(line, /Pop window/))  prio = 15
    if (match(line, /Universal/))  prio = 16
    if (match(line, /Clipboard/))  prio = 17
    if (match(line, /Audio controls/))  prio = 18
    if (match(line, /Bluetooth controls/))  prio = 19
    if (match(line, /Wifi controls/))  prio = 20
    if (match(line, /Emoji picker/))  prio = 21
    if (match(line, /Color picker/))  prio = 22
    if (match(line, /Screenshot/))  prio = 23
    if (match(line, /Screenrecording/))  prio = 24
    if (match(line, /SUPER SHIFT.*\+.*B.*→.*Browser/)) prio = 25
    if (match(line, /File manager \(cwd\)/))  prio = 26
    if (match(line, /(Switch|Next|Former|Previous).*workspace/))  prio = 27
    if (match(line, /Move window to workspace/))  prio = 28
    if (match(line, /Move window silently to workspace/))  prio = 29
    if (match(line, /Swap window/))  prio = 30
    if (match(line, /Move window focus/))  prio = 31
    if (match(line, /Move window$/))  prio = 32
    if (match(line, /Resize window/))  prio = 33
    if (match(line, /Expand window/))  prio = 34
    if (match(line, /Shrink window/))  prio = 35
    if (match(line, /scratchpad/))  prio = 36
    if (match(line, /notification/))  prio = 37
    if (match(line, /Toggle window transparency/))  prio = 38
    if (match(line, /Toggle workspace gaps/))  prio = 39
    if (match(line, /Toggle nightlight/))  prio = 40
    if (match(line, /Toggle locking/))  prio = 41
    if (match(line, /group/))  prio = 94
    if (match(line, /Scroll active workspace/))  prio = 95
    if (match(line, /Cycle to/))  prio = 96
    if (match(line, /Reveal active/))  prio = 97
    if (match(line, /Apple Display/))  prio = 98
    if (match(line, /XF86/))  prio = 99

    # print "priority<TAB>line"
    printf "%d\t%s\n", prio, line
  }' |
  sort -k1,1n -k2,2 |
  cut -f2-
}

output_keybindings() {
  build_keymap_cache

  {
    dynamic_bindings
    static_bindings
  } |
    sort -u |
    parse_keycodes |
    parse_bindings |
    prioritize_entries
}

if [[ $1 == "--print" || $1 == "-p" ]]; then
  output_keybindings
else
  monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height')
  menu_height=$((monitor_height * 40 / 100))

  output_keybindings |
    walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height"
fi


================================================
FILE: bin/omarchy-migrate
================================================
#!/bin/bash

# Run all pending migrations to bring the system in line with the installed version.

# Where we store an empty file for each migration that has already been performed.
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 ~/.local/share/omarchy/migrations/*.sh; do
  filename=$(basename "$file")

  if [[ ! -f $STATE_DIR/$filename && ! -f $STATE_DIR/skipped/$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
  fi
done


================================================
FILE: bin/omarchy-notification-dismiss
================================================
#!/bin/bash

# Dismiss a mako notification on the basis of its summary. Used by the first-run notifications to dismiss them after clicking for action.

if (($# == 0)); then
  echo "Usage: omarchy-notification-dismiss <summary>"
  exit 1
fi

# Find the first notification whose 'summary' matches the regex in $1
notification_id=$(makoctl list | grep -F "$1" | head -n1 | sed -E 's/^Notification ([0-9]+):.*/\1/')

if [[ -n $notification_id ]]; then
  makoctl dismiss -n $notification_id
fi


================================================
FILE: bin/omarchy-npx-install
================================================
#!/bin/bash

# Install an npx wrapper for a given npm package.
# Usage: omarchy-npx-install <package> [command-name]
#
# If command-name is omitted, it defaults to the package name.
# Example: omarchy-npx-install opencode-ai opencode

if [[ -z $1 ]]; then
  echo "Usage: omarchy-npx-install <package> [command-name]"
  exit 1
fi

package=$1
command=${2:-$1}

mkdir -p "$HOME/.local/bin"

cat > "$HOME/.local/bin/$command" <<EOF
#!/bin/bash
exec npx --yes $package "\$@"
EOF

chmod +x "$HOME/.local/bin/$command"


================================================
FILE: bin/omarchy-pkg-add
================================================
#!/bin/bash

# Add the named packages to the system if they're missing. Returns false if it couldn't be done.

if omarchy-pkg-missing "$@"; then
  sudo pacman -S --noconfirm --needed "$@" || exit 1
fi

for pkg in "$@"; do
  # Secondary check to handle states where pacman doesn't actually register an error
  if ! pacman -Q "$pkg" &>/dev/null; then
    echo -e "\033[31mError: Package '$pkg' did not install\033[0m" >&2
    exit 1
  fi
done

exit 0


================================================
FILE: bin/omarchy-pkg-aur-accessible
================================================
#!/bin/bash

# Returns true if the AUR is up and available.
# Used by omarchy-update-system-pkgs to ensure the AUR is available before updating packages from it.

curl -sf --connect-timeout 30 --retry 3 --retry-delay 3 -A "omarchy-update" \
  "https://aur.archlinux.org/rpc/?v=5&type=info&arg=base" >/dev/null


================================================
FILE: bin/omarchy-pkg-aur-add
================================================
#!/bin/bash

# Add the named packages to the system from the AUR if they're missing. Returns false if it couldn't be done.

if omarchy-pkg-missing "$@"; then
  yay -S --noconfirm --needed "$@" || exit 1
fi

for pkg in "$@"; do
  # Secondary check to handle states where pacman doesn't actually register an error
  if ! pacman -Q "$pkg" &>/dev/null; then
    echo -e "\033[31mError: Package '$pkg' did not install\033[0m" >&2
    exit 1
  fi
done

exit 0


================================================
FILE: bin/omarchy-pkg-aur-install
================================================
#!/bin/bash

# Show a fuzzy-finder TUI for picking new AUR packages to install.

fzf_args=(
  --multi
  --preview 'yay -Siia {1}'
  --preview-label='alt-p: toggle description, alt-b/B: toggle PKGBUILD, alt-j/k: scroll, tab: multi-select'
  --preview-label-pos='bottom'
  --preview-window 'down:65%:wrap'
  --bind 'alt-p:toggle-preview'
  --bind 'alt-d:preview-half-page-down,alt-u:preview-half-page-up'
  --bind 'alt-k:preview-up,alt-j:preview-down'
  --bind 'alt-b:change-preview:yay -Gpa {1} | tail -n +5'
  --bind 'alt-B:change-preview:yay -Siia {1}'
  --color 'pointer:green,marker:green'
)

pkg_names=$(yay -Slqa | fzf "${fzf_args[@]}")

if [[ -n $pkg_names ]]; then
  # Add aur/ prefix to each package name and convert to space-separated for yay
  source omarchy-sudo-keepalive

  echo "$pkg_names" | sed 's/^/aur\//' | tr '\n' ' ' | xargs yay -S --noconfirm
  sudo updatedb
  omarchy-show-done
fi


================================================
FILE: bin/omarchy-pkg-drop
================================================
#!/bin/bash

# Remove all the named packages from the system if they're installed (otherwise ignore).

for pkg in "$@"; do
  if pacman -Q "$pkg" &>/dev/null; then
    sudo pacman -Rns --noconfirm "$pkg"
  fi
done


================================================
FILE: bin/omarchy-pkg-install
================================================
#!/bin/bash

# Show a fuzzy-finder TUI for picking new Arch and OPR packages to install.

fzf_args=(
  --multi
  --preview 'pacman -Sii {1}'
  --preview-label='alt-p: toggle description, alt-j/k: scroll, tab: multi-select'
  --preview-label-pos='bottom'
  --preview-window 'down:65%:wrap'
  --bind 'alt-p:toggle-preview'
  --bind 'alt-d:preview-half-page-down,alt-u:preview-half-page-up'
  --bind 'alt-k:preview-up,alt-j:preview-down'
  --color 'pointer:green,marker:green'
)

pkg_names=$(pacman -Slq | fzf "${fzf_args[@]}")

if [[ -n $pkg_names ]]; then
  source omarchy-sudo-keepalive

  # Convert newline-separated selections to space-separated for pacman
  echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm
  omarchy-show-done
fi


================================================
FILE: bin/omarchy-pkg-missing
================================================
#!/bin/bash

# Returns true if any of the named packages are missing from the system (or false if they're all there).

for pkg in "$@"; do
  if ! pacman -Q "$pkg" &>/dev/null; then
    exit 0
  fi
done

exit 1


================================================
FILE: bin/omarchy-pkg-present
================================================
#!/bin/bash

# Returns true if all of the named packages are installed on the system (or false if any of them are missing).

for pkg in "$@"; do
  pacman -Q "$pkg" &>/dev/null || exit 1
done

exit 0


================================================
FILE: bin/omarchy-pkg-remove
================================================
#!/bin/bash

# Show a fuzzy-finder TUI for picking packages installed on the system to be removed.

fzf_args=(
  --multi
  --preview 'yay -Qi {1}'
  --preview-label='alt-p: toggle description, alt-j/k: scroll, tab: multi-select'
  --preview-label-pos='bottom'
  --preview-window 'down:65%:wrap'
  --bind 'alt-p:toggle-preview'
  --bind 'alt-d:preview-half-page-down,alt-u:preview-half-page-up'
  --bind 'alt-k:preview-up,alt-j:preview-down'
  --color 'pointer:red,marker:red'
)

pkg_names=$(yay -Qqe | fzf "${fzf_args[@]}")

if [[ -n $pkg_names ]]; then
  # Convert newline-separated selections to space-separated for yay
  echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -Rns --noconfirm
  omarchy-show-done
fi


================================================
FILE: bin/omarchy-powerprofiles-list
================================================
#!/bin/bash

# Returns a list of all the available power profiles on the system.
# Used by the Omarchy Menu under Setup > Power Profile.

powerprofilesctl list |
  awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }' |
  tac


================================================
FILE: bin/omarchy-refresh-applications
================================================
#!/bin/bash

# Ensure all default .desktop, web apps, and TUIs are installed.

# Copy and sync icon files
mkdir -p ~/.local/share/icons/hicolor/48x48/apps/
cp ~/.local/share/omarchy/applications/icons/*.png ~/.local/share/icons/hicolor/48x48/apps/
gtk-update-icon-cache ~/.local/share/icons/hicolor &>/dev/null

# Copy .desktop declarations
mkdir -p ~/.local/share/applications
cp ~/.local/share/omarchy/applications/*.desktop ~/.local/share/applications/
cp ~/.local/share/omarchy/applications/hidden/*.desktop ~/.local/share/applications/

# Refresh the webapps and TUIs
bash $OMARCHY_PATH/install/packaging/icons.sh
bash $OMARCHY_PATH/install/packaging/webapps.sh
bash $OMARCHY_PATH/install/packaging/tuis.sh

update-desktop-database ~/.local/share/applications


================================================
FILE: bin/omarchy-refresh-chromium
================================================
#!/bin/bash

# Refresh the ~/.config/chromium-flags.conf file from the Omarchy defaults.

CONFIG_FILE="$HOME/.config/chromium-flags.conf"
INSTALL_GOOGLE_ACCOUNTS=false

# Check if google accounts were installed
if [[ -f $CONFIG_FILE ]] && \
  grep -q -- "--oauth2-client-id" "$CONFIG_FILE" && \
  grep -q -- "--oauth2-client-secret" "$CONFIG_FILE"; then
  INSTALL_GOOGLE_ACCOUNTS=true
fi

# Refresh the Chromium configuration
omarchy-refresh-config chromium-flags.conf

# Re-install Google accounts if previously configured
if [[ $INSTALL_GOOGLE_ACCOUNTS == "true" ]]; then
  omarchy-install-chromium-google-account
fi


================================================
FILE: bin/omarchy-refresh-config
================================================
#!/bin/bash

# Copies the named config from ~/.local/share/omarchy/config/X/Y/Z -> ~/.config/X/Y/Z.
# If the config already exists, a backup of the existing will be taken as .bak.TIMESTAMP.

config_file=$1

if [[ -z $config_file ]]; then
  cat <<USAGE
  Usage: $0 [config_file]

  Must provide a file path from the .config directory to be refreshed.
  To copy ~/.local/share/omarchy/config/hypr/hyprlock.conf to ~/.config/hypr/hyprlock.conf

    $0 hypr/hyprlock.conf
USAGE
  exit 1
fi

# Backup the destination file (with timestamp) to avoid clobbering (Ex: hyprlock.conf.bak.1753817951)
user_config_file="${HOME}/.config/$config_file"
default_config_file="${HOME}/.local/share/omarchy/config/$config_file"
backup_config_file="$user_config_file.bak.$(date +%s)"

if [[ -f $user_config_file ]]; then
  # Create preliminary backup
  cp -f "$user_config_file" "$backup_config_file" 2>/dev/null

  # Replace config with new default
  cp -f "$default_config_file" "$user_config_file" 2>/dev/null

  # Compare and delete/inform accordingly
  if cmp -s "$user_config_file" "$backup_config_file"; then
    rm "$backup_config_file"
  else
    echo -e "\e[31mReplaced $user_config_file with new Omarchy default.\nSaved backup as ${backup_config_file}.\n\n\e[32mChanges:\e[0m"
    diff "$user_config_file" "$backup_config_file" || true
  fi
else
  # Config file did not exist already
  cp -f "$default_config_file" "$user_config_file" 2>/dev/null
fi


================================================
FILE: bin/omarchy-refresh-fastfetch
================================================
#!/bin/bash

# Overwrite the user config for fastfetch with the Omarchy default.

omarchy-refresh-config fastfetch/config.jsonc


================================================
FILE: bin/omarchy-refresh-hypridle
================================================
#!/bin/bash

# Overwrite the user config for hypridle with the Omarchy default and restart the service.

omarchy-refresh-config hypr/hypridle.conf
omarchy-restart-hypridle


================================================
FILE: bin/omarchy-refresh-hyprland
================================================
#!/bin/bash

# Overwrite all the user configs in ~/.config/hypr with the Omarchy defaults.

omarchy-refresh-config hypr/autostart.conf
omarchy-refresh-config hypr/bindings.conf
omarchy-refresh-config hypr/input.conf
omarchy-refresh-config hypr/looknfeel.conf
omarchy-refresh-config hypr/hyprland.conf


================================================
FILE: bin/omarchy-refresh-hyprlock
================================================
#!/bin/bash

# Overwrite the user config for hyprlock with the Omarchy default.

omarchy-refresh-config hypr/hyprlock.conf


================================================
FILE: bin/omarchy-refresh-hyprsunset
================================================
#!/bin/bash

# Overwrite the user config for hyprsunset with the Omarchy default and restart the service.
#
omarchy-refresh-config hypr/hyprsunset.conf
omarchy-restart-hyprsunset


================================================
FILE: bin/omarchy-refresh-limine
================================================
#!/bin/bash

# Overwrite the user config for the Limine bootloader and rebuild it.

if [[ -f /boot/EFI/Linux/omarchy_linux.efi ]] && [[ -f /boot/EFI/Linux/$(cat /etc/machine-id)_linux.efi ]]; then
  echo "Cleanup extra UKI"
  sudo rm -f /boot/EFI/Linux/$(cat /etc/machine-id)_linux.efi
fi
echo "Resetting limine config"

sudo mv /boot/limine.conf /boot/limine.conf.bak

sudo cp ~/.local/share/omarchy/default/limine/limine.conf /boot/limine.conf

sudo limine-update
sudo limine-snapper-sync


================================================
FILE: bin/omarchy-refresh-pacman
================================================
#!/bin/bash

# Overwrite the package configuration for /etc/pacman with the Omarchy default of using its dedicated mirrors and repositories, then update all packages.
# This is used after switching between Omarchy release channels to ensure the right packages for the right channel are available.

# Take backup of existing files
sudo cp -f /etc/pacman.conf /etc/pacman.conf.bak
sudo cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak

channel="${1:-stable}"

if [[ $channel != "stable" && $channel != "rc" && $channel != "edge" ]]; then
  echo "Error: Invalid channel '$channel'. Must be one of: stable, rc, edge"
  exit 1
fi

echo "Setting channel to $channel"
echo

sudo cp -f "$OMARCHY_PATH/default/pacman/pacman-$channel.conf" /etc/pacman.conf
sudo cp -f "$OMARCHY_PATH/default/pacman/mirrorlist-$channel" /etc/pacman.d/mirrorlist

# Reset all package DBs and then update
sudo pacman -Syyuu --noconfirm


================================================
FILE: bin/omarchy-refresh-plymouth
================================================
#!/bin/bash

# Overwrite the user config for the Plymouth drive decryption and boot sequence with the Omarchy default and rebuild it.

sudo cp ~/.local/share/omarchy/default/plymouth/* /usr/share/plymouth/themes/omarchy/
sudo plymouth-set-default-theme omarchy

if command -v limine-mkinitcpio &>/dev/null; then
  sudo limine-mkinitcpio
else
  sudo mkinitcpio -P
fi


================================================
FILE: bin/omarchy-refresh-sddm
================================================
#!/bin/bash

# Refresh the SDDM theme from default

sudo rm -rf /usr/share/sddm/themes/omarchy
sudo cp -r $OMARCHY_PATH/default/sddm/omarchy /usr/share/sddm/themes/omarchy


================================================
FILE: bin/omarchy-refresh-swayosd
================================================
#!/bin/bash

# Overwrite the user configs for swayosd (controls on-screen feedback for changing volume/songs etc) with the Omarchy defaults and restart the service.

omarchy-refresh-config swayosd/config.toml
omarchy-refresh-config swayosd/style.css
omarchy-restart-swayosd


================================================
FILE: bin/omarchy-refresh-tmux
================================================
#!/bin/bash

# Overwrite the user tmux config with the Omarchy default and reload tmux.

omarchy-refresh-config tmux/tmux.conf
omarchy-restart-tmux


================================================
FILE: bin/omarchy-refresh-walker
================================================
#!/bin/bash

# Overwrite the user configs for the Walker application launcher (which also powers the Omarchy Menu) and restart the services.

# Ensure walker is set to autostart
mkdir -p ~/.config/autostart/
cp $OMARCHY_PATH/default/walker/walker.desktop ~/.config/autostart/

# And restarts if it crashes or is killed
mkdir -p ~/.config/systemd/user/app-walker@autostart.service.d/
cp $OMARCHY_PATH/default/walker/restart.conf ~/.config/systemd/user/app-walker@autostart.service.d/restart.conf

systemctl --user daemon-reload

# Refresh configs
omarchy-refresh-config walker/config.toml
omarchy-refresh-config elephant/calc.toml
omarchy-refresh-config elephant/desktopapplications.toml

# Restart service
omarchy-restart-walker


================================================
FILE: bin/omarchy-refresh-waybar
================================================
#!/bin/bash

# Overwrite the user configs for the Waybar menu bar with the Omarchy defaults and restart the service.

omarchy-refresh-config waybar/config.jsonc
omarchy-refresh-config waybar/style.css
omarchy-restart-waybar


================================================
FILE: bin/omarchy-reinstall
================================================
#!/bin/bash
set -e

# Attempt to reinstall all default Omarchy packages and reset all the default configs.

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
  omarchy-reinstall-pkgs
  omarchy-reinstall-configs

  gum confirm "System has been reinstalled. Reboot?" && omarchy-system-reboot
fi


================================================
FILE: bin/omarchy-reinstall-configs
================================================
#!/bin/bash
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 ~/.local/share/omarchy/config/* ~/.config/
cp ~/.local/share/omarchy/default/bashrc ~/.bashrc
echo '[[ -f ~/.bashrc ]] && . ~/.bashrc' | tee ~/.bash_profile >/dev/null

$(bash $OMARCHY_PATH/install/config/theme.sh)

omarchy-refresh-limine
omarchy-refresh-plymouth
omarchy-nvim-setup


================================================
FILE: bin/omarchy-reinstall-git
================================================
#!/bin/bash
set -e

# Reinstall the Omarchy configuration directory from the git source.

git clone --depth=1 "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


================================================
FILE: bin/omarchy-reinstall-pkgs
================================================
#!/bin/bash
set -e

# Reinstall all default Omarchy packages from the stable channel and downgrade any packages that are too new.

# Set the package repository to the stable mirrors
omarchy-refresh-pacman

# Downgrade any packages to the stable setup
sudo pacman -Suu --noconfirm

# Ensure all packages are installed
mapfile -t packages < <(grep -v '^#' "$OMARCHY_PATH/install/omarchy-base.packages" | grep -v '^$')
sudo pacman -Syu --noconfirm --needed "${packages[@]}"


================================================
FILE: bin/omarchy-remove-dev-env
================================================
#!/bin/bash

# Remove a development environment that was previously installed via omarchy-install-dev-env.
# Usage: omarchy-remove-dev-env <ruby|node|bun|deno|go|php|laravel|symfony|python|elixir|phoenix|zig|rust|java|dotnet|ocaml|clojure|scala>

if [[ -z $1 ]]; then
  echo "Usage: omarchy-remove-dev-env <ruby|node|bun|deno|go|php|laravel|symfony|python|elixir|phoenix|zig|rust|java|dotnet|ocaml|clojure|scala>" >&2
  exit 1
fi

remove_php() {
  sudo pacman -Rns --noconfirm php composer php-sqlite xdebug 2>/dev/null || true
}

case "$1" in
ruby)
  echo -e "Removing Ruby...\n"
  mise uninstall ruby --all
  mise rm -g ruby
  rm -f ~/.gemrc
  ;;
node)
  echo -e "Removing Node.js...\n"
  mise uninstall node --all
  mise rm -g node
  ;;
bun)
  echo -e "Removing Bun...\n"
  mise uninstall bun --all
  mise rm -g bun
  ;;
deno)
  echo -e "Removing Deno...\n"
  mise uninstall deno --all
  mise rm -g deno
  ;;
go)
  echo -e "Removing Go...\n"
  mise uninstall go --all
  mise rm -g go
  ;;
php)
  echo -e "Removing PHP...\n"
  remove_php
  ;;
laravel)
  echo -e "Removing Laravel...\n"
  composer global remove laravel/installer 2>/dev/null || true
  ;;
symfony)
  echo -e "Removing Symfony CLI...\n"
  sudo pacman -Rns --noconfirm symfony-cli 2>/dev/null || true
  ;;
python)
  echo -e "Removing Python...\n"
  mise uninstall python --all
  mise rm -g python
  rm -rf ~/.local/bin/uv ~/.local/bin/uvx ~/.cargo/bin/uv 2>/dev/null || true
  ;;
elixir|phoenix)
  echo -e "Removing Elixir/Erlang...\n"
  mise uninstall elixir --all
  mise uninstall erlang --all
  mise rm -g elixir
  mise rm -g erlang
  ;;
zig)
  echo -e "Removing Zig...\n"
  mise uninstall zig --all
  mise uninstall zls --all
  mise rm -g zig
  mise rm -g zls
  ;;
rust)
  echo -e "Removing Rust...\n"
  rustup self uninstall -y 2>/dev/null || true
  ;;
java)
  echo -e "Removing Java...\n"
  mise uninstall java --all
  mise rm -g java
  ;;
dotnet)
  echo -e "Removing .NET...\n"
  mise uninstall dotnet --all
  mise rm -g dotnet
  ;;
ocaml)
  echo -e "Removing OCaml...\n"
  opam switch remove default -y 2>/dev/null || true
  rm -rf ~/.opam 2>/dev/null || true
  sudo rm -f /usr/local/bin/opam 2>/dev/null || true
  ;;
clojure)
  echo -e "Removing Clojure...\n"
  mise uninstall clojure --all
  mise rm -g clojure
  ;;
scala)
  echo -e "Removing Scala...\n"
  mise uninstall scala --all
  mise uninstall scala-cli --all
  mise rm -g scala
  mise rm -g scala-cli
  ;;
*)
  echo "Unknown environment: $1"
  exit 1
  ;;
esac

echo -e "\nDone!"


================================================
FILE: bin/omarchy-remove-preinstalls
================================================
#!/bin/bash

# Remove preinstalled Omarchy applications (web apps, TUIs, and selected packages).
# This removes all web apps, TUIs, plus specific desktop applications.

if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI wrappers, and desktop applications?"; then
  echo -e "Removing preinstalled Omarchy applications...\n"

  omarchy-webapp-remove-all
  omarchy-tui-remove-all

  cp ~/.config/hypr/bindings.conf ~/.config/hypr/bindings.conf.bak
  cp "$OMARCHY_PATH/default/hypr/plain-bindings.conf" ~/.config/hypr/bindings.conf
  hyprctl reload

  omarchy-pkg-drop \
    aether \
    typora \
    spotify \
    libreoffice-fresh \
    1password-beta \
    1password-cli \
    xournalpp \
    signal-desktop \
    pinta \
    obsidian \
    obs-studio \
    kdenlive \
    lazydocker \
    opencode \
    claude-code
fi


================================================
FILE: bin/omarchy-restart-app
================================================
#!/bin/bash

# Restart an application by killing it and relaunching via uwsm.
# Usage: omarchy-restart-app <application-name> [application-args...]

pkill -x $1
setsid uwsm-app -- "$@" >/dev/null 2>&1 &


================================================
FILE: bin/omarchy-restart-bluetooth
================================================
#!/bin/bash

# Unblock and restart the bluetooth service.

echo -e "Unblocking bluetooth...\n"
rfkill unblock bluetooth
rfkill list bluetooth


================================================
FILE: bin/omarchy-restart-btop
================================================
#!/bin/bash

# Reload btop configuration (used by the Omarchy theme switching).

pkill -SIGUSR2 btop


================================================
FILE: bin/omarchy-restart-hyprctl
================================================
#!/bin/bash

# Reload hyprland configuration (used by the Omarchy theme switching).

hyprctl reload >/dev/null


================================================
FILE: bin/omarchy-restart-hypridle
================================================
#!/bin/bash

# Restart the hypridle service (used for idle detection and auto-lock).

omarchy-restart-app hypridle


================================================
FILE: bin/omarchy-restart-hyprsunset
================================================
#!/bin/bash

# Restart the hyprsunset service (used for blue light filtering/night light).

omarchy-restart-app hyprsunset


================================================
FILE: bin/omarchy-restart-makima
================================================
#!/bin/bash

# Restart makima - key remapping service for remapping Copilot key to Omarchy Menu

sudo systemctl restart makima


================================================
FILE: bin/omarchy-restart-mako
================================================
#!/bin/bash

# Reload mako configuration (used by the Omarchy theme switching).

makoctl reload


================================================
FILE: bin/omarchy-restart-opencode
================================================
#!/bin/bash

# Reload opencode configuration (used by the Omarchy theme switching).

if pgrep -x opencode >/dev/null; then
  killall -SIGUSR2 opencode
fi


================================================
FILE: bin/omarchy-restart-pipewire
================================================
#!/bin/bash

# Restart the PipeWire audio service to fix audio issues or apply new configuration.

echo -e "Restarting pipewire audio service...\n"
systemctl --user restart pipewire.service


================================================
FILE: bin/omarchy-restart-swayosd
================================================
#!/bin/bash

omarchy-restart-app swayosd-server


================================================
FILE: bin/omarchy-restart-terminal
================================================
#!/bin/bash

if [[ -f ~/.config/alacritty/alacritty.toml ]]; then
  touch ~/.config/alacritty/alacritty.toml
fi

if pgrep -x kitty >/dev/null; then
  killall -SIGUSR1 kitty >/dev/null
fi

if pgrep -x ghostty >/dev/null; then
  killall -SIGUSR2 ghostty
fi


================================================
FILE: bin/omarchy-restart-tmux
================================================
#!/bin/bash

# Restart tmux if running with the latest configuration

if pgrep -x tmux; then
  tmux source-file ~/.config/tmux/tmux.conf
fi


================================================
FILE: bin/omarchy-restart-walker
================================================
#!/bin/bash

restart_services() {
  if systemctl --user is-enabled elephant.service &>/dev/null; then
    systemctl --user restart elephant.service
  fi

  if systemctl --user is-enabled app-walker@autostart.service &>/dev/null; then
    systemctl --user restart app-walker@autostart.service
  else
    echo -e "\e[31mUnable to restart Walker -- RESTART MANUALLY\e[0m"
  fi
}

if (( EUID == 0 )); then
  SCRIPT_OWNER=$(stat -c '%U' "$0")
  USER_UID=$(id -u "$SCRIPT_OWNER")
  systemd-run --uid="$SCRIPT_OWNER" --setenv=XDG_RUNTIME_DIR="/run/user/$USER_UID" \
    bash -c "$(declare -f restart_services); restart_services"
else
  restart_services
fi


================================================
FILE: bin/omarchy-restart-waybar
================================================
#!/bin/bash

omarchy-restart-app waybar


================================================
FILE: bin/omarchy-restart-wifi
================================================
#!/bin/bash

# Unblock and restart the Wi-Fi service.

echo -e "Unblocking wifi...\n"
rfkill unblock wifi
rfkill list wifi


================================================
FILE: bin/omarchy-restart-xcompose
================================================
#!/bin/bash

# Restart the XCompose input method service (fcitx5) to apply new compose key settings.

omarchy-restart-app fcitx5 --disable notificationitem


================================================
FILE: bin/omarchy-setup-dns
================================================
#!/bin/bash

lock_dns_to_resolved() {
  for file in /etc/systemd/network/*.network; do
    [[ -f $file ]] || continue
    if ! grep -q "^\[DHCPv4\]" "$file"; then continue; fi

    if ! sed -n '/^\[DHCPv4\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then
      sudo sed -i '/^\[DHCPv4\]/a UseDNS=no' "$file"
    fi

    if grep -q "^\[IPv6AcceptRA\]" "$file" && ! sed -n '/^\[IPv6AcceptRA\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then
      sudo sed -i '/^\[IPv6AcceptRA\]/a UseDNS=no' "$file"
    fi
  done
}

unlock_dns_to_dhcp() {
  for file in /etc/systemd/network/*.network; do
    [[ -f $file ]] || continue
    sudo sed -i '/^\[DHCPv4\]/{n;/^UseDNS=no$/d}' "$file"
    sudo sed -i '/^\[IPv6AcceptRA\]/{n;/^UseDNS=no$/d}' "$file"
  done
}

if [[ -z $1 ]]; then
  dns=$(gum choose --height 6 --header "Select DNS provider" Cloudflare Google DHCP Custom)
else
  dns=$1
fi

case "$dns" in
Cloudflare)
  sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF'
[Resolve]
DNS=1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com
FallbackDNS=9.9.9.9 149.112.112.112
DNSOverTLS=opportunistic
EOF
  lock_dns_to_resolved
  ;;

Google)
  sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF'
[Resolve]
DNS=8.8.8.8#dns.google 8.8.4.4#dns.google
FallbackDNS=9.9.9.9 149.112.112.112
DNSOverTLS=opportunistic
EOF
  lock_dns_to_resolved
  ;;

DHCP)
  sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF'
[Resolve]
DNSOverTLS=no
EOF
  unlock_dns_to_dhcp
  ;;

Custom)
  echo "Enter your DNS servers (space-separated, e.g. '192.168.1.1 1.1.1.1'):"
  read -r dns_servers

  if [[ -z $dns_servers ]]; then
    echo "Error: No DNS servers provided."
    exit 1
  fi

  sudo tee /etc/systemd/resolved.conf >/dev/null <<EOF
[Resolve]
DNS=$dns_servers
FallbackDNS=9.9.9.9 149.112.112.112
EOF
  lock_dns_to_resolved
  ;;
esac

sudo systemctl restart systemd-networkd systemd-resolved


================================================
FILE: bin/omarchy-setup-fido2
================================================
#!/bin/bash

set -e

GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

print_success() {
  echo -e "${GREEN}$1${NC}"
}

print_error() {
  echo -e "${RED}$1${NC}"
}

print_info() {
  echo -e "${YELLOW}$1${NC}"
}

check_fido2_hardware() {
  tokens=$(fido2-token -L 2>/dev/null)
  if [[ -z $tokens ]]; then
    print_error "\nNo FIDO2 device detected. Please plug it in (you may need to unlock it as well)."
    return 1
  fi
  return 0
}

setup_pam_config() {
  # Configure sudo
  if ! grep -q pam_u2f.so /etc/pam.d/sudo; then
    print_info "Configuring sudo for FIDO2 authentication..."
    sudo sed -i '1i auth    sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/sudo
  fi

  # Configure polkit
  if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then
    print_info "Configuring polkit for FIDO2 authentication..."
    sudo sed -i '1i auth      sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/polkit-1
  elif [[ ! -f /etc/pam.d/polkit-1 ]]; then
    print_info "Creating polkit configuration with FIDO2 authentication..."
    sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
auth      sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
auth      required pam_unix.so

account   required pam_unix.so
password  required pam_unix.so
session   required pam_unix.so
EOF
  fi
}

remove_pam_config() {
  # Remove from sudo
  if grep -q pam_u2f.so /etc/pam.d/sudo; then
    print_info "Removing FIDO2 authentication from sudo..."
    sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/sudo
  fi

  # Remove from polkit
  if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_u2f.so' /etc/pam.d/polkit-1; then
    print_info "Removing FIDO2 authentication from polkit..."
    sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/polkit-1
  fi
}

if [[ "--remove" == $1 ]]; then
  print_success "Removing FIDO2 device from authentication.\n"

  # Remove PAM configuration
  remove_pam_config

  # Remove FIDO2 configuration
  if [[ -d /etc/fido2 ]]; then
    print_info "Removing FIDO2 configuration..."
    sudo rm -rf /etc/fido2
  fi

  # Uninstall packages
  print_info "Removing FIDO2 packages..."
  sudo pacman -Rns --noconfirm libfido2 pam-u2f

  print_success "FIDO2 authentication has been completely removed."
else
  print_success "Setting up FIDO2 device for authentication.\n"

  # Install required packages
  print_info "Installing required packages..."
  omarchy-pkg-add libfido2 pam-u2f

  if ! check_fido2_hardware; then
    exit 1
  fi

  # Create the pamu2fcfg file
  if [[ ! -f /etc/fido2/fido2 ]]; then
    sudo mkdir -p /etc/fido2
    print_success "\nLet's setup your device by confirming on the device now."
    print_info "Touch your FIDO2 key when it lights up...\n"

    if pamu2fcfg >/tmp/fido2; then
      sudo mv /tmp/fido2 /etc/fido2/fido2
      print_success "FIDO2 device registered successfully!"
    else
      print_error "\nFIDO2 registration failed. Please try again."
      exit 1
    fi
  else
    print_info "FIDO2 device already registered."
  fi

  # Configure PAM
  setup_pam_config

  # Test with sudo
  print_info "\nTesting FIDO2 authentication with sudo..."
  print_info "Touch your FIDO2 key when prompted.\n"

  if sudo echo "FIDO2 authentication test successful"; then
    print_success "\nPerfect! FIDO2 authentication is now configured."
    print_info "You can use your FIDO2 key for sudo and polkit authentication."
  else
    print_error "\nVerification failed. You may want to check your configuration."
  fi
fi


================================================
FILE: bin/omarchy-setup-fingerprint
================================================
#!/bin/bash

set -e

GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

print_success() {
  echo -e "${GREEN}$1${NC}"
}

print_error() {
  echo -e "${RED}$1${NC}"
}

print_info() {
  echo -e "${YELLOW}$1${NC}"
}

check_fingerprint_hardware() {
  # Get fingerprint devices for the user
  devices=$(fprintd-list "$USER" 2>/dev/null)

  # Exit if no devices found
  if [[ -z $devices ]]; then
    print_error "\nNo fingerprint sensor detected."
    return 1
  fi
  return 0
}

setup_pam_config() {
  # Configure sudo
  if ! grep -q pam_fprintd.so /etc/pam.d/sudo; then
    print_info "Configuring sudo for fingerprint authentication..."
    sudo sed -i '1i auth    sufficient pam_fprintd.so' /etc/pam.d/sudo
  fi

  # Configure polkit
  if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_fprintd.so' /etc/pam.d/polkit-1; then
    print_info "Configuring polkit for fingerprint authentication..."
    sudo sed -i '1i auth      sufficient pam_fprintd.so' /etc/pam.d/polkit-1
  elif [[ ! -f /etc/pam.d/polkit-1 ]]; then
    print_info "Creating polkit configuration with fingerprint authentication..."
    sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
auth      sufficient pam_fprintd.so
auth      required pam_unix.so

account   required pam_unix.so
password  required pam_unix.so
session   required pam_unix.so
EOF
  fi
}

add_hyprlock_fingerprint_icon() {
  print_info "Adding fingerprint icon to hyprlock placeholder text..."
  sed -i 's/placeholder_text = .*/placeholder_text = <span> Enter Password 󰈷 <\/span>/' ~/.config/hypr/hyprlock.conf
  sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = true/' ~/.config/hypr/hyprlock.conf
}

remove_hyprlock_fingerprint_icon() {
  print_info "Removing fingerprint icon from hyprlock placeholder text..."
  sed -i 's/placeholder_text = .*/placeholder_text = Enter Password/' ~/.config/hypr/hyprlock.conf
  sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf
}

remove_pam_config() {
  # Remove from sudo
  if grep -q pam_fprintd.so /etc/pam.d/sudo; then
    print_info "Removing fingerprint authentication from sudo..."
    sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/sudo
  fi

  # Remove from polkit
  if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then
    print_info "Removing fingerprint authentication from polkit..."
    sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/polkit-1
  fi
}

if [[ "--remove" == $1 ]]; then
  print_success "Removing fingerprint scanner from authentication.\n"

  # Remove PAM configuration
  remove_pam_config

  # Remove fingerprint icon from hyprlock placeholder text
  remove_hyprlock_fingerprint_icon

  # Uninstall packages
  print_info "Removing fingerprint packages..."
  sudo pacman -Rns --noconfirm fprintd

  print_success "Fingerprint authentication has been completely removed."
else
  print_success "Setting up fingerprint scanner for authentication.\n"

  # Install required packages
  print_info "Installing required packages..."
  omarchy-pkg-add fprintd usbutils

  if ! check_fingerprint_hardware; then
    exit 1
  fi

  # Configure PAM
  setup_pam_config

  # Add fingerprint icon to hyprlock placeholder text
  add_hyprlock_fingerprint_icon

  # Enroll first fingerprint
  print_success "\nLet's setup your right index finger as the first fingerprint."
  print_info "Keep moving the finger around on sensor until the process completes.\n"

  if sudo fprintd-enroll "$USER"; then
    print_success "\nFingerprint enrolled successfully!"

    # Verify
    print_info "\nNow let's verify that it's working correctly.\n"
    if fprintd-verify; then
      print_success "\nPerfect! Fingerprint authentication is now configured."
      print_info "You can use your fingerprint for sudo, polkit, and lock screen (Super + Escape)."
    else
      print_error "\nVerification failed. You may want to try enrolling again."
    fi
  else
    print_error "\nEnrollment failed. Please try again."
    exit 1
  fi
fi


================================================
FILE: bin/omarchy-setup-makima
================================================
#!/bin/bash

# Setup makima - key remapping service for remapping Copilot key to Omarchy Menu

CONFIG_FILE="$HOME/.config/makima/AT Translated Set 2 keyboard.toml"

if [[ ! -f $CONFIG_FILE ]]; then
  omarchy-pkg-add makima-bin

  mkdir -p "$HOME/.config/makima"
  cp "$OMARCHY_PATH/default/makima/AT Translated Set 2 keyboard.toml" "$CONFIG_FILE"

  sudo mkdir -p /etc/systemd/system/makima.service.d
  sudo tee /etc/systemd/system/makima.service.d/override.conf >/dev/null <<EOF
[Service]
User=$USER
Environment="MAKIMA_CONFIG=/home/$USER/.config/makima"
EOF

  sudo systemctl daemon-reload
  sudo systemctl enable --now makima 2>/dev/null || true
fi


================================================
FILE: bin/omarchy-show-done
================================================
#!/bin/bash

# Display a "Done!" message with a spinner and wait for user to press any key.
# Used by various install scripts to indicate completion.

echo
gum spin --spinner "globe" --title "Done! Press any key to close..." -- bash -c 'read -n 1 -s'


================================================
FILE: bin/omarchy-show-logo
================================================
#!/bin/bash

# Display the Omarchy logo in the terminal using green color.
# Used by various presentation scripts to show branding.

clear
echo -e "\033[32m"
cat <~/.local/share/omarchy/logo.txt
echo -e "\033[0m"
echo


================================================
FILE: bin/omarchy-snapshot
================================================
#!/bin/bash

set -e

COMMAND="$1"
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}

if [[ -z $COMMAND ]]; then
  echo "Usage: omarchy-snapshot <create|restore>" >&2
  exit 1
fi

if ! command -v snapper &>/dev/null; then
  exit 127 # omarchy-update can use this to just ignore if snapper is not available
fi

case "$COMMAND" in
create)
  DESC="$(omarchy-version)"

  echo -e "\e[32mCreate system snapshot\e[0m"

  # Get existing snapper config names from CSV output
  mapfile -t CONFIGS < <(sudo snapper --csvout list-configs | awk -F, 'NR>1 {print $1}')

  for config in "${CONFIGS[@]}"; do
    sudo snapper -c "$config" create -c number -d "$DESC"
  done
  echo
  ;;
restore)
  sudo limine-snapper-restore
  ;;
esac


================================================
FILE: bin/omarchy-state
================================================
#!/bin/bash

# Manage persistent state files for Omarchy toggles and settings.
# Usage: omarchy-state <set|clear> <state-name-or-pattern>
# Used to track whether features like suspend, idle lock, etc are enabled or disabled.

STATE_DIR="$HOME/.local/state/omarchy"
mkdir -p "$STATE_DIR"

COMMAND="$1"
STATE_NAME="$2"

if [[ -z $COMMAND ]]; then
  echo "Usage: omarchy-state <set|clear> <state-name-or-pattern>"
  exit 1
fi

if [[ -z $STATE_NAME ]]; then
  echo "Usage: omarchy-state $COMMAND <state-name>"
  exit 1
fi

case "$COMMAND" in
set) touch "$STATE_DIR/$STATE_NAME" ;;
clear) find "$STATE_DIR" -maxdepth 1 -type f -name "$STATE_NAME" -delete ;;
esac


================================================
FILE: bin/omarchy-sudo-keepalive
================================================
#!/bin/bash

# Prompt for sudo once and keep the credential alive in the background.
# Source this script so the trap applies to the calling shell:
#   source omarchy-sudo-keepalive

sudo -v
while true; do sudo -n true; sleep 60; done 2>/dev/null &
SUDO_KEEPALIVE_PID=$!
trap "kill $SUDO_KEEPALIVE_PID 2>/dev/null" EXIT


================================================
FILE: bin/omarchy-sudo-passwordless-toggle
================================================
#!/bin/bash

# Toggle passwordless sudo for the current user.
# First run: enables passwordless sudo for 15 minutes (after confirmation).
# Second run: disables it early.

NOPASSWD_FILE="/etc/sudoers.d/99-omarchy-nopasswd-${USER}"
TIMER_NAME="omarchy-nopasswd-expire-${USER}"

# Safety: if the file exists but the timer doesn't (e.g. after reboot), clean up
if sudo test -f "$NOPASSWD_FILE" && ! systemctl is-active "${TIMER_NAME}.timer" &>/dev/null; then
  sudo rm "$NOPASSWD_FILE"
fi

# Check for the file directly — sudo -n can stay cached or be granted by other rules
if sudo test -f "$NOPASSWD_FILE"; then
  sudo rm "$NOPASSWD_FILE"
  sudo systemctl stop "${TIMER_NAME}.timer" 2>/dev/null
  echo "Passwordless sudo has been DISABLED. Sudo will require a password again."
else
  echo ""
  echo "⚠️  WARNING: This will allow ANY process running as your user to"
  echo "execute ANY command as root WITHOUT a password for 15 minutes."
  echo ""
  echo "This is useful for AI agents that need to run sudo commands,"
  echo "but it significantly weakens the security of your system."
  echo "Anyone or anything with access to your user account gets full root."
  echo ""
  echo "Passwordless sudo will automatically disable after 15 minutes."
  echo "Run this command again to disable it early."
  echo ""

  if gum confirm "Enable passwordless sudo for 15 minutes? This is a significant security risk!"; then
    echo "${USER} ALL=(ALL) NOPASSWD: ALL" | sudo tee "$NOPASSWD_FILE" > /dev/null
    sudo chmod 440 "$NOPASSWD_FILE"
    sudo systemd-run --on-active=15m --timer-property=AccuracySec=1s --unit="$TIMER_NAME" \
      rm "$NOPASSWD_FILE"
    echo "Passwordless sudo has been ENABLED. It will automatically disable in 15 minutes."
    echo "Note: if you restart before then, run omarchy-sudo-passwordless-toggle again to disable it."
  else
    echo "Aborted. No changes made."
  fi
fi


================================================
FILE: bin/omarchy-sudo-reset
================================================
#!/bin/bash

# Reset the sudo lockout/faillock for the current user.
# This clears any failed authentication attempts that may have locked the user out.

# Resetting sudo lockout for user
su -c "faillock --reset --user $USER"


================================================
FILE: bin/omarchy-swayosd-brightness
================================================
#!/bin/bash

# Display brightness level using SwayOSD on the current monitor.
# Usage: omarchy-swayosd-brightness <percent>

percent="$1"

progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
[[ $progress == "0.00" ]] && progress="0.01"

swayosd-client \
  --monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \
  --custom-icon display-brightness \
  --custom-progress "$progress" \
  --custom-progress-text "${percent}%"


================================================
FILE: bin/omarchy-swayosd-kbd-brightness
================================================
#!/bin/bash

# Display keyboard brightness level using SwayOSD on the current monitor.
# Usage: omarchy-swayosd-kbd-brightness <percent>

percent="$1"

progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
[[ $progress == "0.00" ]] && progress="0.01"

swayosd-client \
  --monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \
  --custom-icon keyboard-brightness \
  --custom-progress "$progress" \
  --custom-progress-text "${percent}%"


================================================
FILE: bin/omarchy-system-logout
================================================
#!/bin/bash

# Logout command that first closes all application windows (thus giving them a chance to save state),
# then stops the session, returning to the SDDM login screen.

# Schedule the session stop after closing windows (detached from terminal)
nohup bash -c "sleep 2 && uwsm stop" >/dev/null 2>&1 &

# Now close all windows
omarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly


================================================
FILE: bin/omarchy-system-reboot
================================================
#!/bin/bash

# Reboot command that first closes all application windows (thus giving them a chance to save state).
# This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly.

omarchy-state clear re*-required

# Schedule the reboot to happen after closing windows (detached from terminal)
nohup bash -c "sleep 2 && systemctl reboot --no-wall" >/dev/null 2>&1 &

# Now close all windows
omarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly


================================================
FILE: bin/omarchy-system-shutdown
================================================
#!/bin/bash

# Shutdown command that first closes all application windows (thus giving them a chance to save state).
# This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly.

omarchy-state clear re*-required

# Schedule the shutdown to happen after closing windows (detached from terminal)
nohup bash -c "sleep 2 && systemctl poweroff --no-wall" >/dev/null 2>&1 &

# Now close all windows
omarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly


================================================
FILE: bin/omarchy-theme-bg-install
================================================
#!/bin/bash

CURRENT_THEME_NAME=$(cat "$HOME/.config/omarchy/current/theme.name")
THEME_USER_BACKGROUNDS="$HOME/.config/omarchy/backgrounds/$CURRENT_THEME_NAME"

mkdir -p "$THEME_USER_BACKGROUNDS"
nautilus "$THEME_USER_BACKGROUNDS"


================================================
FILE: bin/omarchy-theme-bg-next
================================================
#!/bin/bash

# Cycles through the background images available

THEME_NAME=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null)
THEME_BACKGROUNDS_PATH="$HOME/.config/omarchy/current/theme/backgrounds/"
USER_BACKGROUNDS_PATH="$HOME/.config/omarchy/backgrounds/$THEME_NAME/"
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"

mapfile -d '' -t BACKGROUNDS < <(find -L "$USER_BACKGROUNDS_PATH" "$THEME_BACKGROUNDS_PATH" -maxdepth 1 -type f -print0 2>/dev/null | sort -z)
TOTAL=${#BACKGROUNDS[@]}

if (( TOTAL == 0 )); then
  notify-send "No background was found for theme" -t 2000
  pkill -x swaybg
  setsid uwsm-app -- swaybg --color '#000000' >/dev/null 2>&1 &
else
  # Get current background from symlink
  if [[ -L $CURRENT_BACKGROUND_LINK ]]; then
    CURRENT_BACKGROUND=$(readlink "$CURRENT_BACKGROUND_LINK")
  else
    # Default to first background if no symlink exists
    CURRENT_BACKGROUND=""
  fi

  # Find current background index
  INDEX=-1
  for i in "${!BACKGROUNDS[@]}"; do
    if [[ ${BACKGROUNDS[$i]} == $CURRENT_BACKGROUND ]]; then
      INDEX=$i
      break
    fi
  done

  # Get next background (wrap around)
  if (( INDEX == -1 )); then
    # Use the first background when no match was found
    NEW_BACKGROUND="${BACKGROUNDS[0]}"
  else
    NEXT_INDEX=$(((INDEX + 1) % TOTAL))
    NEW_BACKGROUND="${BACKGROUNDS[$NEXT_INDEX]}"
  fi

  # Set new background symlink
  ln -nsf "$NEW_BACKGROUND" "$CURRENT_BACKGROUND_LINK"

  # Relaunch swaybg
  pkill -x swaybg
  setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 &
fi


================================================
FILE: bin/omarchy-theme-bg-set
================================================
#!/bin/bash

# Sets the specified image as the current background

if [[ -z $1 ]]; then
  echo "Usage: omarchy-theme-bg-set <path-to-image>" >&2
  exit 1
fi

BACKGROUND="$1"
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"

# Create symlink to the new background
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"

# Kill existing swaybg and start new one
pkill -x swaybg
setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 &


================================================
FILE: bin/omarchy-theme-current
================================================
#!/bin/bash

THEME_NAME_PATH="$HOME/.config/omarchy/current/theme.name"

if [[ -f $THEME_NAME_PATH ]]; then
  cat $THEME_NAME_PATH | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g'
else
  echo "Unknown"
fi


================================================
FILE: bin/omarchy-theme-install
================================================
#!/bin/bash

# omarchy-theme-install: Install a new theme from a git repo for Omarchy
# Usage: omarchy-theme-install <git-repo-url>

if [[ -z $1 ]]; then
  echo -e "\e[32mSee https://manuals.omamix.org/2/the-omarchy-manual/90/extra-themes\n\e[0m"
  REPO_URL=$(gum input --placeholder="Git repo URL for theme" --header="")
else
  REPO_URL="$1"
fi

if [[ -z $REPO_URL ]]; then
  exit 1
fi

THEMES_DIR="$HOME/.config/omarchy/themes"
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^omarchy-//; s/-theme$//')
THEME_PATH="$THEMES_DIR/$THEME_NAME"

# Remove existing theme if present
if [[ -d $THEME_PATH ]]; then
  rm -rf "$THEME_PATH"
fi

# Clone the repo directly to ~/.config/omarchy/themes
if ! git clone "$REPO_URL" "$THEME_PATH"; then
  echo "Error: Failed to clone theme repo."
  exit 1
fi

# Apply the new theme with omarchy-theme-set
omarchy-theme-set $THEME_NAME


================================================
FILE: bin/omarchy-theme-list
================================================
#!/bin/bash

{
  find ~/.config/omarchy/themes/ -mindepth 1 -maxdepth 1 \( -type d -o -type l \) -printf '%f\n'
  find "$OMARCHY_PATH/themes/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'
} | sort -u | while read -r name; do
  echo "$name" | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g'
done


================================================
FILE: bin/omarchy-theme-refresh
================================================
#!/bin/bash

# Refresh the current theme from its templates.

THEME_NAME_PATH="$HOME/.config/omarchy/current/theme.name"

if [[ -f $THEME_NAME_PATH ]]; then
  omarchy-theme-set "$(cat $THEME_NAME_PATH)"
fi


================================================
FILE: bin/omarchy-theme-remove
================================================
#!/bin/bash

# omarchy-theme-remove: Remove a theme from Omarchy by name
# Usage: omarchy-theme-remove <theme-name>

if [[ -z $1 ]]; then
  mapfile -t extra_themes < <(find ~/.config/omarchy/themes -mindepth 1 -maxdepth 1 -type d ! -xtype l -printf '%f\n')

  if (( ${#extra_themes[@]} > 0 )); then
    THEME_NAME=$(printf '%s\n' "${extra_themes[@]}" | sort | gum choose --header="Remove extra theme")
  else
    echo "No extra themes installed."
    exit 1
  fi
else
  THEME_NAME="$1"
fi

THEMES_DIR="$HOME/.config/omarchy/themes"
CURRENT_DIR="$HOME/.config/omarchy/current"
THEME_PATH="$THEMES_DIR/$THEME_NAME"

# Ensure a theme was set
if [[ -z $THEME_NAME ]]; then
  exit 1
fi

# Check if theme exists before attempting removal
if [[ ! -d $THEME_PATH ]]; then
  echo "Error: Theme '$THEME_NAME' not found."
  exit 1
fi

# Now remove the theme directory for THEME_NAME
rm -rf "$THEME_PATH"


================================================
FILE: bin/omarchy-theme-set
================================================
#!/bin/bash

if [[ -z $1 ]]; then
  echo "Usage: omarchy-theme-set <theme-name>"
  exit 1
fi

CURRENT_THEME_PATH="$HOME/.config/omarchy/current/theme"
NEXT_THEME_PATH="$HOME/.config/omarchy/current/next-theme"
USER_THEMES_PATH="$HOME/.config/omarchy/themes"
OMARCHY_THEMES_PATH="$OMARCHY_PATH/themes"

THEME_NAME=$(echo "$1" | sed -E 's/<[^>]+>//g' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')

if [[ ! -d $OMARCHY_THEMES_PATH/$THEME_NAME ]] && [[ ! -d $USER_THEMES_PATH/$THEME_NAME ]]; then
  echo "Theme '$THEME_NAME' does not exist"
  exit 1
fi

# Setup clean next theme directory (for atomic theme config swapping)
rm -rf "$NEXT_THEME_PATH"
mkdir -p "$NEXT_THEME_PATH"

# Copy official theme first, then overlay user customizations on top
cp -r "$OMARCHY_THEMES_PATH/$THEME_NAME/"* "$NEXT_THEME_PATH/" 2>/dev/null
cp -r "$USER_THEMES_PATH/$THEME_NAME/"* "$NEXT_THEME_PATH/" 2>/dev/null

# Generate dynamic configs
omarchy-theme-set-templates

# Swap next theme in as current
rm -rf "$CURRENT_THEME_PATH"
mv "$NEXT_THEME_PATH" "$CURRENT_THEME_PATH"

# Store theme name for reference
echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name"

# Change background with theme
omarchy-theme-bg-next

# Restart components to apply new theme
if pgrep -x waybar >/dev/null; then
  omarchy-restart-waybar
fi
omarchy-restart-swayosd
omarchy-restart-terminal
omarchy-restart-hyprctl
omarchy-restart-btop
omarchy-restart-opencode
omarchy-restart-mako

# Change app-specific themes
omarchy-theme-set-gnome
omarchy-theme-set-browser
omarchy-theme-set-vscode
omarchy-theme-set-obsidian
omarchy-theme-set-keyboard

# Call hook on theme set
omarchy-hook theme-set "$THEME_NAME"


================================================
FILE: bin/omarchy-theme-set-browser
================================================
#!/bin/bash

CHROMIUM_THEME=~/.config/omarchy/current/theme/chromium.theme

if omarchy-cmd-present chromium || omarchy-cmd-present brave; then
  if [[ -f $CHROMIUM_THEME ]]; then
    THEME_RGB_COLOR=$(<$CHROMIUM_THEME)
    THEME_HEX_COLOR=$(printf '#%02x%02x%02x' ${THEME_RGB_COLOR//,/ })
  else
    # Use a default, neutral grey if theme doesn't have a color
    THEME_RGB_COLOR="28,32,39"
    THEME_HEX_COLOR="#1c2027"
  fi

  if omarchy-cmd-present chromium; then
    echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\"}" | tee "/etc/chromium/policies/managed/color.json" >/dev/null
    chromium --refresh-platform-policy --no-startup-window >/dev/null
  fi

  if omarchy-cmd-present brave; then
    echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\"}" | tee "/etc/brave/policies/managed/color.json" >/dev/null
    brave --refresh-platform-policy --no-startup-window >/dev/null
  fi
fi


================================================
FILE: bin/omarchy-theme-set-gnome
================================================
#!/bin/bash

# Change gnome modes
if [[ -f ~/.config/omarchy/current/theme/light.mode ]]; then
  gsettings set org.gnome.desktop.interface color-scheme "prefer-light"
  gsettings set org.gnome.desktop.interface gtk-theme "Adwaita"
else
  gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"
  gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
fi

# Change gnome icon theme color
GNOME_ICONS_THEME=~/.config/omarchy/current/theme/icons.theme
if [[ -f $GNOME_ICONS_THEME ]]; then
  gsettings set org.gnome.desktop.interface icon-theme "$(<$GNOME_ICONS_THEME)"
else
  gsettings set org.gnome.desktop.interface icon-theme "Yaru-blue"
fi


================================================
FILE: bin/omarchy-theme-set-keyboard
================================================
#!/bin/bash

omarchy-theme-set-keyboard-asus-rog
omarchy-theme-set-keyboard-f16


================================================
FILE: bin/omarchy-theme-set-keyboard-asus-rog
================================================
#!/bin/bash

ASUSCTL_THEME=~/.config/omarchy/current/theme/keyboard.rgb

if omarchy-cmd-present asusctl; then
  asusctl aura effect static -c $(sed 's/^#//' $ASUSCTL_THEME)
fi


================================================
FILE: bin/omarchy-theme-set-keyboard-f16
================================================
#!/bin/bash

FRAMEWORK16_THEME=~/.config/omarchy/current/theme/keyboard.rgb

if omarchy-cmd-present qmk_hid && [[ -f $FRAMEWORK16_THEME ]]; then
  hex=$(cat "$FRAMEWORK16_THEME")
  hex="${hex#\#}"

  # Convert hex to QMK HSV (0-255 scale) using Python's colorsys
  read -r h s <<< $(python3 -c "
import colorsys
r, g, b = int('$hex'[:2],16)/255, int('$hex'[2:4],16)/255, int('$hex'[4:6],16)/255
h, s, v = colorsys.rgb_to_hsv(r, g, b)
print(int(h * 255), int(s * 255))
")

  qmk_hid via --rgb-effect 1 2>/dev/null
  qmk_hid via --rgb-hue "$h" 2>/dev/null
  qmk_hid via --rgb-saturation "$s" 2>/dev/null
  qmk_hid via --rgb-brightness 100 2>/dev/null
  qmk_hid via --save 2>/dev/null
fi


================================================
FILE: bin/omarchy-theme-set-obsidian
================================================
#!/bin/bash

# Sync Omarchy theme to all Obsidian vaults

CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"

[[ -f $CURRENT_THEME_DIR/obsidian.css ]] || exit 0

jq -r '.vaults | values[].path' ~/.config/obsidian/obsidian.json 2>/dev/null | while read -r vault_path; do
  [[ -d $vault_path/.obsidian ]] || continue

  theme_dir="$vault_path/.obsidian/themes/Omarchy"
  mkdir -p "$theme_dir"

  [[ -f $theme_dir/manifest.json ]] || cat >"$theme_dir/manifest.json" <<'EOF'
{
  "name": "Omarchy",
  "version": "1.0.0",
  "minAppVersion": "0.16.0",
  "description": "Automatically syncs with your current Omarchy system theme colors and fonts",
  "author": "Omarchy",
  "authorUrl": "https://omarchy.org"
}
EOF

  cp "$CURRENT_THEME_DIR/obsidian.css" "$theme_dir/theme.css"
done


================================================
FILE: bin/omarchy-theme-set-templates
================================================
#!/bin/bash

TEMPLATES_DIR="$OMARCHY_PATH/default/themed"
USER_TEMPLATES_DIR="$HOME/.config/omarchy/themed"
NEXT_THEME_DIR="$HOME/.config/omarchy/current/next-theme"
COLORS_FILE="$NEXT_THEME_DIR/colors.toml"

# Convert hex color to decimal RGB (e.g., "#1e1e2e" -> "30,30,46")
hex_to_rgb() {
  local hex="${1#\#}"
  printf "%d,%d,%d" "0x${hex:0:2}" "0x${hex:2:2}" "0x${hex:4:2}"
}

# Only generate dynamic templates for themes with a colors.toml definition
if [[ -f $COLORS_FILE ]]; then
  sed_script=$(mktemp)

  while IFS='=' read -r key value; do
    key="${key//[\"\' ]/}"                # strip quotes and spaces from key
    [[ $key && $key != \#* ]] || continue # skip empty lines and comments
    value="${value#*[\"\']}"
    value="${value%%[\"\']*}" # extract value between quotes (ignores inline comments)

    printf 's|{{ %s }}|%s|g\n' "$key" "$value"            # {{ key }} -> value
    printf 's|{{ %s_strip }}|%s|g\n' "$key" "${value#\#}" # {{ key_strip }} -> value without leading #
    if [[ $value =~ ^# ]]; then
      rgb=$(hex_to_rgb "$value")
      echo "s|{{ ${key}_rgb }}|${rgb}|g"
    fi
  done <"$COLORS_FILE" >"$sed_script"

  shopt -s nullglob

  # Process user templates first, then built-in templates (user overrides built-in)
  for tpl in "$USER_TEMPLATES_DIR"/*.tpl "$TEMPLATES_DIR"/*.tpl; do
    filename=$(basename "$tpl" .tpl)
    output_path="$NEXT_THEME_DIR/$filename"

    # Don't overwrite configs already exists in the output directory (copied from theme specific folder)
    if [[ ! -f $output_path ]]; then
      sed -f "$sed_script" "$tpl" >"$output_path"
    fi
  done

  rm "$sed_script"
fi


================================================
FILE: bin/omarchy-theme-set-vscode
================================================
#!/bin/bash

# Sync Omarchy theme to VS Code, VSCodium, and Cursor

VS_CODE_THEME="$HOME/.config/omarchy/current/theme/vscode.json"

set_theme() {
  local editor_cmd="$1"
  local settings_path="$2"
  local skip_flag="$3"

  omarchy-cmd-present "$editor_cmd" && [[ ! -f $skip_flag ]] || return 0

  if [[ -f $VS_CODE_THEME ]]; then
    theme_name=$(jq -r '.name' "$VS_CODE_THEME")
    extension=$(jq -r '.extension' "$VS_CODE_THEME")

    if [[ -n $extension ]] && ! "$editor_cmd" --list-extensions | grep -Fxq "$extension"; then
      "$editor_cmd" --install-extension "$extension" >/dev/null
    fi

    mkdir -p "$(dirname "$settings_path")"
    [[ -f $settings_path ]] || printf '{\n}\n' >"$settings_path"

    if ! grep -q '"workbench.colorTheme"' "$settings_path"; then
      sed -i --follow-symlinks -E '0,/\{/{s/\{/{\ "workbench.colorTheme": "",/}' "$settings_path"
    fi

    sed -i --follow-symlinks -E \
      "s/(\"workbench.colorTheme\"[[:space:]]*:[[:space:]]*\")[^\"]*(\")/\1$theme_name\2/" \
      "$settings_path"
  elif [[ -f $settings_path ]]; then
    sed -i --follow-symlinks -E 's/\"workbench\.colorTheme\"[[:space:]]*:[^,}]*,?//' "$settings_path"
  fi
}

set_theme "code" "$HOME/.config/Code/User/settings.json" "$HOME/.local/state/omarchy/toggles/skip-vscode-theme-changes"
set_theme "codium" "$HOME/.config/VSCodium/User/settings.json" "$HOME/.local/state/omarchy/toggles/skip-codium-theme-changes"
set_theme "cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.local/state/omarchy/toggles/skip-cursor-theme-changes"


================================================
FILE: bin/omarchy-theme-update
================================================
#!/bin/bash

for dir in ~/.config/omarchy/themes/*/; do
  if [[ -d $dir ]] && [[ ! -L ${dir%/} ]] && [[ -d $dir/.git ]]; then
    echo "Updating: $(basename "$dir")"
    git -C "$dir" pull
  fi
done


================================================
FILE: bin/omarchy-toggle-hybrid-gpu
================================================
#!/bin/bash

# Toggle dedicated vs integrated GPU mode via supergfxd (for hybrid gpu laptops, like Asus G14).
# Requires reboot to take effect.

# Ensure supergfxctl has been installed
if omarchy-cmd-missing supergfxctl; then
  omarchy-pkg-add supergfxctl

  # Create config before starting service to prevent hang on first boot
  sudo tee /etc/supergfxd.conf >/dev/null <<'CONF'
{
  "mode": "Hybrid",
  "vfio_enable": true,
  "vfio_save": false,
  "always_reboot": false,
  "no_logind": false,
  "logout_timeout_s": 180,
  "hotplug_type": "None"
}
CONF

  sudo systemctl enable --now supergfxd
fi

gpu_mode=$(supergfxctl -g)

case "$gpu_mode" in
"Integrated")
  if gum confirm "Enable dedicated GPU and reboot?"; then
    # Switch to hybrid mode
    sudo sed -i "s/\"mode\": \".*\"/\"mode\": \"Hybrid\"/" /etc/supergfxd.conf

    # Let hybrid mode be the default after system sleep
    sudo rm -rf /usr/lib/systemd/system-sleep/force-igpu

    # Remove the startup delay override (not needed for Hybrid mode)
    sudo rm -rf /etc/systemd/system/supergfxd.service.d/delay-start.conf

    omarchy-system-reboot
  fi
  ;;
"Hybrid")
  if gum confirm "Use only integrated GPU and reboot?"; then
    # Switch to integrated mode and ensure vfio is enabled (needed for sleep/wake trick)
    sudo sed -i "s/\"mode\": \".*\"/\"mode\": \"Integrated\"/" /etc/supergfxd.conf
    sudo sed -i 's/"vfio_enable": false/"vfio_enable": true/' /etc/supergfxd.conf

    # Force igpu mode after system sleep (or dgpu could get activated)
    sudo mkdir -p /usr/lib/systemd/system-sleep
    sudo cp -p $OMARCHY_PATH/default/systemd/system-sleep/force-igpu /usr/lib/systemd/system-sleep/

    # Delay supergfxd startup to avoid race condition with display manager
    # that can cause system freeze when booting in Integrated mode
    sudo mkdir -p /etc/systemd/system/supergfxd.service.d
    sudo cp -p $OMARCHY_PATH/default/systemd/system/supergfxd.service.d/delay-start.conf /etc/systemd/system/supergfxd.service.d/

    omarchy-system-reboot
  fi
  ;;
*)
  echo "Hybrid GPU not found or in unknown mode."
  exit 1
  ;;
esac


================================================
FILE: bin/omarchy-toggle-idle
================================================
#!/bin/bash

if pgrep -x hypridle >/dev/null; then
  pkill -x hypridle
  notify-send "󱫖    Stop locking computer when idle"
else
  uwsm-app -- hypridle >/dev/null 2>&1 &
  notify-send "󱫖    Now locking computer when idle"
fi

pkill -RTMIN+9 waybar


================================================
FILE: bin/omarchy-toggle-nightlight
================================================
#!/bin/bash

# Default temperature values
ON_TEMP=4000
OFF_TEMP=6000

# Ensure hyprsunset is running
if ! pgrep -x hyprsunset; then
  setsid uwsm-app -- hyprsunset &
  sleep 1 # Give it time to register
fi

# Query the current temperature
CURRENT_TEMP=$(hyprctl hyprsunset temperature 2>/dev/null | grep -oE '[0-9]+')

restart_nightlighted_waybar() {
  if grep -q "custom/nightlight" ~/.config/waybar/config.jsonc; then
    omarchy-restart-waybar # restart waybar in case user has waybar module for hyprsunset
  fi
}

if [[ $CURRENT_TEMP == $OFF_TEMP ]]; then
  hyprctl hyprsunset temperature $ON_TEMP
  notify-send "  Nightlight screen temperature"
  restart_nightlighted_waybar
else
  hyprctl hyprsunset temperature $OFF_TEMP
  notify-send "   Daylight screen temperature"
  restart_nightlighted_waybar
fi


================================================
FILE: bin/omarchy-toggle-notification-silencing
================================================
#!/bin/bash

makoctl mode -t do-not-disturb

if makoctl mode | grep -q 'do-not-disturb'; then
  notify-send "󰂛    Silenced notifications"
else
  notify-send "󰂚    Enabled notifications"
fi

pkill -RTMIN+10 waybar


================================================
FILE: bin/omarchy-toggle-screensaver
================================================
#!/bin/bash

STATE_FILE=~/.local/state/omarchy/toggles/screensaver-off

if [[ -f $STATE_FILE ]]; then
  rm -f $STATE_FILE
  notify-send "󱄄   Screensaver enabled"
else
  mkdir -p "$(dirname $STATE_FILE)"
  touch $STATE_FILE
  notify-send "󱄄   Screensaver disabled"
fi


================================================
FILE: bin/omarchy-toggle-suspend
================================================
#!/bin/bash

STATE_FILE=~/.local/state/omarchy/toggles/suspend-off

if [[ -f $STATE_FILE ]]; then
  rm -f $STATE_FILE
  notify-send "󰒲   Suspend now available in system menu"
else
  mkdir -p "$(dirname $STATE_FILE)"
  touch $STATE_FILE
  notify-send "󰒲   Suspend removed from system menu"
fi


================================================
FILE: bin/omarchy-toggle-waybar
================================================
#!/bin/bash

if pgrep -x waybar >/dev/null; then
  pkill -x waybar
else
  uwsm-app -- waybar >/dev/null 2>&1 &
fi


================================================
FILE: bin/omarchy-tui-install
================================================
#!/bin/bash

set -e

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!)")
else
  APP_NAME="$1"
  APP_EXEC="$2"
  WINDOW_STYLE="$3"
  ICON_URL="$4"
fi

if [[ -z $APP_NAME || -z $APP_EXEC || -z $ICON_URL ]]; then
  echo "You must set app name, app command, and icon URL!"
  exit 1
fi

ICON_DIR="$HOME/.local/share/applications/icons"
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"

if [[ ! $ICON_URL =~ ^https?:// ]] && [[ -f $ICON_URL ]]; then
  ICON_PATH="$ICON_URL"
else
  ICON_PATH="$ICON_DIR/$APP_NAME.png"
  mkdir -p "$ICON_DIR"
  if ! curl -sL -o "$ICON_PATH" "$ICON_URL"; then
    echo "Error: Failed to download icon."
    exit 1
  fi
fi

if [[ $WINDOW_STYLE == "float" ]]; then
  APP_CLASS="TUI.float"
else
  APP_CLASS="TUI.tile"
fi

cat >"$DESKTOP_FILE" <<EOF
[Desktop Entry]
Version=1.0
Name=$APP_NAME
Comment=$APP_NAME
Exec=xdg-terminal-exec --app-id=$APP_CLASS -e $APP_EXEC
Terminal=false
Type=Application
Icon=$ICON_PATH
StartupNotify=true
EOF

chmod +x "$DESKTOP_FILE"

if (( $# != 4 )); then
  echo -e "You can now find $APP_NAME using the app launcher (SUPER + SPACE)\n"
fi


================================================
FILE: bin/omarchy-tui-remove
================================================
#!/bin/bash

set -e

ICON_DIR="$HOME/.local/share/applications/icons"
DESKTOP_DIR="$HOME/.local/share/applications/"

if (( $# == 0 )); then
  # Find all TUIs
  while IFS= read -r -d '' file; do
    if grep -qE '^Exec=.*(\$TERMINAL|xdg-terminal-exec).*-e' "$file"; then
      TUIS+=("$(basename "${file%.desktop}")")
    fi
  done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0)

  if ((${#TUIS[@]})); then
    IFS=$'\n' SORTED_TUIS=($(sort <<<"${TUIS[*]}"))
    unset IFS
    APP_NAMES_STRING=$(gum choose --no-limit --header "Select TUI to remove..." --selected-prefix="✗ " "${SORTED_TUIS[@]}")
    # Convert newline-separated string to array
    APP_NAMES=()
    while IFS= read -r line; do
      [[ -n $line ]] && APP_NAMES+=("$line")
    done <<< "$APP_NAMES_STRING"
  else
    echo "No TUIs to remove."
    exit 1
  fi
else
  # Use array to preserve spaces in app names
  APP_NAMES=("$@")
fi

if (( ${#APP_NAMES[@]} == 0 )); then
  echo "You must provide TUI names."
  exit 1
fi

for APP_NAME in "${APP_NAMES[@]}"; do
  rm -f "$DESKTOP_DIR/$APP_NAME.desktop"
  rm -f "$ICON_DIR/$APP_NAME.png"
  echo "Removed $APP_NAME"
done


================================================
FILE: bin/omarchy-tui-remove-all
================================================
#!/bin/bash

# Remove all TUIs installed via omarchy-tui-install.
# Identifies TUIs by their Exec pattern (xdg-terminal-exec --app-id=TUI.).

set -e

APP_DIR="${1:-$HOME/.local/share/applications}"
ICON_DIR="$HOME/.local/share/applications/icons"

echo "Scanning for TUIs in $APP_DIR..."

tui_desktop_files=()
while IFS= read -r -d '' file; do
  if grep -q "Exec=xdg-terminal-exec --app-id=TUI\." "$file" 2>/dev/null; then
    tui_desktop_files+=("$file")
  fi
done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null)

if (( ${#tui_desktop_files[@]} == 0 )); then
  echo "No TUIs found."
  exit 0
fi

for file in "${tui_desktop_files[@]}"; do
  app_name=$(basename "$file" .desktop)
  echo "Removing TUI: $app_name"
  rm -f "$file"
  rm -f "$ICON_DIR/$app_name.png"
done

if command -v update-desktop-database &>/dev/null; then
  update-desktop-database "$APP_DIR" &>/dev/null || true
fi

echo "TUIs removed successfully."


================================================
FILE: bin/omarchy-tz-select
================================================
#!/bin/bash

timezone=$(timedatectl list-timezones | gum filter --height 20 --header "Set timezone") || exit 1
sudo timedatectl set-timezone "$timezone"
echo "Timezone is now set to $timezone"
omarchy-restart-waybar


================================================
FILE: bin/omarchy-update
================================================
#!/bin/bash

set -e

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
  omarchy-snapshot create || (($? == 127))
  omarchy-update-git
  omarchy-update-perform
fi


================================================
FILE: bin/omarchy-update-analyze-logs
================================================
#!/bin/bash

update_log="/tmp/omarchy-update.log"

# Check for initramfs generation failure
if grep -q "Updating linux initcpios" "$update_log"; then
  if ! grep -q "Initcpio image generation successful" "$update_log"; then
    echo -e '\e[31mError: Initramfs generation may have failed. Review logs before restart.\e[0m'
    echo
  fi
fi


================================================
FILE: bin/omarchy-update-aur-pkgs
================================================
#!/bin/bash

# Update AUR packages if any are installed
if pacman -Qem >/dev/null; then
  if omarchy-pkg-aur-accessible; then
    echo -e "\e[32m\nUpdate AUR packages\e[0m"
    yay -Sua --noconfirm --cleanafter --ignore gcc14,gcc14-libs
    echo
  else
    echo -e "\e[31m\nAUR is unavailable (so skipping updates)\e[0m"
    echo
  fi
fi


================================================
FILE: bin/omarchy-update-available
================================================
#!/bin/bash

# Get remote tag
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

# 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)"
  exit 0
else
  echo "Omarchy is up to date ($current_tag)"
  exit 1
fi


================================================
FILE: bin/omarchy-update-available-reset
================================================
#!/bin/bash

# Ensure Waybar icon offering the available update is removed
pkill -RTMIN+7 waybar
exit 0


================================================
FILE: bin/omarchy-update-branch
================================================
#!/bin/bash

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


================================================
FILE: bin/omarchy-update-confirm
================================================
#!/bin/bash

gum style --border normal --border-foreground 6 --padding "1 2" \
  "Ready to update?" \
  "" \
  "• You cannot stop the update once you start!" \
  "• Make sure you're connected to power or have a full battery" \
  "" \
  "What's new: https://github.com/basecamp/omarchy/releases"

echo

if ! gum confirm "Continue with update?"; then
  echo "Update cancelled"
  exit 1
fi


================================================
FILE: bin/omarchy-update-firmware
================================================
#!/bin/bash

set -e
echo -e "\e[32mUpdate Firmware\e[0m"

if omarchy-cmd-missing fwupdmgr; then
  omarchy-pkg-add fwupd
fi

fwupdmgr refresh --force
sudo fwupdmgr update


================================================
FILE: bin/omarchy-update-git
================================================
#!/bin/bash

set -e

echo -e "\e[32mUpdate Omarchy\e[0m"

omarchy-update-time

git -C $OMARCHY_PATH pull --autostash
git -C $OMARCHY_PATH --no-pager diff --check || git -C $OMARCHY_PATH reset --merge


================================================
FILE: bin/omarchy-update-keyring
================================================
#!/bin/bash

# Ensure we have the omarchy-keyring and it's populated
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

  # This is generally not a good idea, but this is a special case because we're going to be updating
  # the full set of packages in omarchy-update-system-pkgs right after this (and it needs latest keyring)!
  sudo pacman -Sy
  omarchy-pkg-add omarchy-keyring

  sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571
fi

# Ensure we have the latest archlinux-keyring, maintainer keys might have changed
echo -e "\e[32m\nUpdate Arch signing keys\e[0m"
sudo pacman -Sy --noconfirm archlinux-keyring >/dev/null


================================================
FILE: bin/omarchy-update-orphan-pkgs
================================================
#!/bin/bash

orphans=$(pacman -Qtdq || true)
if [[ -n $orphans ]]; then
  echo -e "\e[32m\nRemove orphan system packages\e[0m"
  for pkg in $orphans; do
    sudo pacman -Rs --noconfirm "$pkg" || true
  done
  echo
fi


================================================
FILE: bin/omarchy-update-perform
================================================
#!/bin/bash

set -e

# Ensure screensaver/sleep doesn't set in during updates
hyprctl dispatch tagwindow +noidle &>/dev/null || true

# Capture update logs (CLICOLOR_FORCE keeps gum styled when stdout is piped through tee)
export CLICOLOR_FORCE=1
exec > >(tee "/tmp/omarchy-update.log") 2>&1

# Perform all update steps
omarchy-update-keyring
omarchy-update-available-reset
omarchy-update-system-pkgs
omarchy-migrate
omarchy-update-aur-pkgs
omarchy-update-orphan-pkgs
omarchy-hook post-update

omarchy-update-analyze-logs

omarchy-update-restart

# Re-enable screensaver/sleep after updates
hyprctl dispatch tagwindow -- -noidle &>/dev/null || true


================================================
FILE: bin/omarchy-update-restart
================================================
#!/bin/bash

echo

if [[ ! -d /usr/lib/modules/$(uname -r) ]]; then
  gum confirm "Linux kernel has been updated. Reboot?" && omarchy-system-reboot
elif [[ -f $HOME/.local/state/omarchy/reboot-required ]]; then
  gum confirm "Updates require reboot. Ready?" && omarchy-system-reboot
fi

running_hyprland=$(readlink /proc/$(pgrep -x Hyprland)/exe 2>/dev/null)
if [[ $running_hyprland == *"(deleted)"* ]]; then
  gum confirm "Hyprland has been updated. Reboot?" && omarchy-system-reboot
fi

for file in "$HOME"/.local/state/omarchy/restart-*-required; do
  if [[ -f $file ]]; then
    filename=$(basename "$file")
    service=$(echo "$filename" | sed 's/restart-\(.*\)-required/\1/')
    echo "Restarting $service"
    omarchy-state clear "$filename"
    omarchy-restart-"$service"
  fi
done


================================================
FILE: bin/omarchy-update-system-pkgs
================================================
#!/bin/bash

set -e

echo -e "\e[32m\nUpdate system packages\e[0m"
sudo pacman -Syyu --noconfirm


================================================
FILE: bin/omarchy-update-time
================================================
#!/bin/bash

echo "Updating time..."
sudo systemctl restart systemd-timesyncd


================================================
FILE: bin/omarchy-update-without-idle
================================================
#!/bin/bash

# No-op now that omarchy-update-perform is responsible for idle management.
# But this file can't be removed since it was referenced in old omarchy-update files,
# which would fail if this file is missing.


================================================
FILE: bin/omarchy-upload-log
================================================
#!/bin/bash

# Upload logs to 0x0.st

LOG_TYPE="${1:-install}"
TEMP_LOG="/tmp/upload-log.txt"
SYSTEM_INFO="/tmp/system-info.txt"

# Get system information if fastfetch is available
if command -v fastfetch >/dev/null 2>&1; then
  {
    echo "========================================="
    echo "SYSTEM INFORMATION"
    echo "========================================="
    # Use fastfetch with no logo to get clean output
    fastfetch --logo none --pipe 2>/dev/null || echo "Failed to get system info"
    echo ""
    echo "========================================="
    echo "LOG CONTENT"
    echo "========================================="
    echo ""
  } >"$SYSTEM_INFO"
else
  # Fallback to basic info if fastfetch isn't available
  {
    echo "========================================="
    echo "SYSTEM INFORMATION"
    echo "========================================="
    echo "Hostname: $(hostname)"
    echo "Kernel: $(uname -r)"
    echo "Date: $(date)"
    echo ""
    echo "========================================="
    echo "LOG CONTENT"
    echo "========================================="
    echo ""
  } >"$SYSTEM_INFO"
fi

case "$LOG_TYPE" in
install)
  ARCHINSTALL_LOG="/var/log/archinstall/install.log"
  OMARCHY_LOG="/var/log/omarchy-install.log"

  # Combine system info with logs
  cat "$SYSTEM_INFO" >"$TEMP_LOG"
  cat $ARCHINSTALL_LOG $OMARCHY_LOG >>"$TEMP_LOG" 2>/dev/null

  if [[ ! -s $TEMP_LOG ]]; then
    echo "Error: No install logs found"
    exit 1
  fi

  echo "Uploading installation log to 0x0.st..."
  ;;

this-boot)
  # Combine system info with boot logs
  cat "$SYSTEM_INFO" >"$TEMP_LOG"
  journalctl -b 0 >>"$TEMP_LOG" 2>/dev/null

  if [[ ! -s $TEMP_LOG ]]; then
    echo "Error: No logs found for current boot"
    exit 1
  fi

  echo "Uploading current boot logs to 0x0.st..."
  ;;

last-boot)
  # Combine system info with previous boot logs
  cat "$SYSTEM_INFO" >"$TEMP_LOG"
  journalctl -b -1 >>"$TEMP_LOG" 2>/dev/null

  if [[ ! -s $TEMP_LOG ]]; then
    echo "Error: No logs found for previous boot"
    exit 1
  fi

  echo "Uploading previous boot logs to 0x0.st..."
  ;;

installed|system-info)
  # System info plus all installed packages
  cat "$SYSTEM_INFO" >"$TEMP_LOG"
  {
    echo ""
    echo "========================================="
    echo "INSTALLED PACKAGES (pacman -Q)"
    echo "========================================="
    pacman -Q 2>/dev/null || echo "Failed to get package list"
  } >>"$TEMP_LOG"

  if [[ ! -s $TEMP_LOG ]]; then
    echo "Error: Failed to gather system information"
    exit 1
  fi

  echo "Uploading system information to 0x0.st..."
  ;;

*)
  echo "Usage: $0 [install|this-boot|last-boot|installed|system-info]"
  echo "  install      - Upload installation logs (default)"
  echo "  this-boot    - Upload logs from current boot"
  echo "  last-boot    - Upload logs from previous boot"
  echo "  installed    - Upload system info and installed packages"
  exit 1
  ;;
esac

echo ""

URL=$(curl -sF "file=@$TEMP_LOG" -Fexpires=24 https://0x0.st)

if (( $? == 0 )) && [[ -n $URL ]]; then
  echo "✓ Log uploaded successfully!"
  echo "Share this URL:"
  echo ""
  echo "  $URL"
  echo ""
  echo "This link will expire in 24 hours."
else
  echo "Error: Failed to upload log file"
  exit 1
fi


================================================
FILE: bin/omarchy-version
===========
Download .txt
gitextract_zabo41o_/

├── .editorconfig
├── .github/
│   └── ISSUE_TEMPLATE/
│       ├── bug.yml
│       └── config.yml
├── AGENTS.md
├── LICENSE
├── README.md
├── applications/
│   ├── Alacritty.desktop
│   ├── hidden/
│   │   ├── avahi-discover.desktop
│   │   ├── bssh.desktop
│   │   ├── btop.desktop
│   │   ├── bvnc.desktop
│   │   ├── cmake-gui.desktop
│   │   ├── cups.desktop
│   │   ├── dropbox.desktop
│   │   ├── electron34.desktop
│   │   ├── electron36.desktop
│   │   ├── electron37.desktop
│   │   ├── fcitx5-configtool.desktop
│   │   ├── fcitx5-wayland-launcher.desktop
│   │   ├── java-java-openjdk.desktop
│   │   ├── jconsole-java-openjdk.desktop
│   │   ├── jshell-java-openjdk.desktop
│   │   ├── kbd-layout-viewer5.desktop
│   │   ├── kcm_fcitx5.desktop
│   │   ├── kcm_kaccounts.desktop
│   │   ├── kvantummanager.desktop
│   │   ├── limine-snapper-restore.desktop
│   │   ├── org.fcitx.Fcitx5.desktop
│   │   ├── org.fcitx.fcitx5-config-qt.desktop
│   │   ├── org.fcitx.fcitx5-migrator.desktop
│   │   ├── org.fcitx.fcitx5-qt5-gui-wrapper.desktop
│   │   ├── org.fcitx.fcitx5-qt6-gui-wrapper.desktop
│   │   ├── qv4l2.desktop
│   │   ├── qvidcap.desktop
│   │   ├── uuctl.desktop
│   │   ├── wiremix.desktop
│   │   ├── xgps.desktop
│   │   └── xgpsspeed.desktop
│   ├── imv.desktop
│   ├── mpv.desktop
│   └── typora.desktop
├── bin/
│   ├── omarchy-battery-capacity
│   ├── omarchy-battery-monitor
│   ├── omarchy-battery-present
│   ├── omarchy-battery-remaining
│   ├── omarchy-battery-remaining-time
│   ├── omarchy-battery-status
│   ├── omarchy-branch-set
│   ├── omarchy-brightness-display
│   ├── omarchy-brightness-display-apple
│   ├── omarchy-brightness-keyboard
│   ├── omarchy-channel-set
│   ├── omarchy-cmd-audio-switch
│   ├── omarchy-cmd-first-run
│   ├── omarchy-cmd-missing
│   ├── omarchy-cmd-present
│   ├── omarchy-cmd-screenrecord
│   ├── omarchy-cmd-screensaver
│   ├── omarchy-cmd-screenshot
│   ├── omarchy-cmd-share
│   ├── omarchy-cmd-terminal-cwd
│   ├── omarchy-config-direct-boot
│   ├── omarchy-debug
│   ├── omarchy-dev-add-migration
│   ├── omarchy-drive-info
│   ├── omarchy-drive-select
│   ├── omarchy-drive-set-password
│   ├── omarchy-font-current
│   ├── omarchy-font-list
│   ├── omarchy-font-set
│   ├── omarchy-hibernation-available
│   ├── omarchy-hibernation-remove
│   ├── omarchy-hibernation-setup
│   ├── omarchy-hook
│   ├── omarchy-hw-asus-rog
│   ├── omarchy-hw-framework16
│   ├── omarchy-hw-intel
│   ├── omarchy-hw-surface
│   ├── omarchy-hyprland-monitor-scaling-cycle
│   ├── omarchy-hyprland-window-close-all
│   ├── omarchy-hyprland-window-gaps-toggle
│   ├── omarchy-hyprland-window-pop
│   ├── omarchy-hyprland-window-single-square-aspect-toggle
│   ├── omarchy-hyprland-workspace-layout-toggle
│   ├── omarchy-install-chromium-google-account
│   ├── omarchy-install-dev-env
│   ├── omarchy-install-docker-dbs
│   ├── omarchy-install-dropbox
│   ├── omarchy-install-geforce-now
│   ├── omarchy-install-nordvpn
│   ├── omarchy-install-steam
│   ├── omarchy-install-tailscale
│   ├── omarchy-install-terminal
│   ├── omarchy-install-vscode
│   ├── omarchy-install-xbox-controllers
│   ├── omarchy-launch-about
│   ├── omarchy-launch-audio
│   ├── omarchy-launch-bluetooth
│   ├── omarchy-launch-browser
│   ├── omarchy-launch-editor
│   ├── omarchy-launch-floating-terminal-with-presentation
│   ├── omarchy-launch-or-focus
│   ├── omarchy-launch-or-focus-tui
│   ├── omarchy-launch-or-focus-webapp
│   ├── omarchy-launch-screensaver
│   ├── omarchy-launch-tui
│   ├── omarchy-launch-walker
│   ├── omarchy-launch-webapp
│   ├── omarchy-launch-wifi
│   ├── omarchy-lock-screen
│   ├── omarchy-menu
│   ├── omarchy-menu-keybindings
│   ├── omarchy-migrate
│   ├── omarchy-notification-dismiss
│   ├── omarchy-npx-install
│   ├── omarchy-pkg-add
│   ├── omarchy-pkg-aur-accessible
│   ├── omarchy-pkg-aur-add
│   ├── omarchy-pkg-aur-install
│   ├── omarchy-pkg-drop
│   ├── omarchy-pkg-install
│   ├── omarchy-pkg-missing
│   ├── omarchy-pkg-present
│   ├── omarchy-pkg-remove
│   ├── omarchy-powerprofiles-list
│   ├── omarchy-refresh-applications
│   ├── omarchy-refresh-chromium
│   ├── omarchy-refresh-config
│   ├── omarchy-refresh-fastfetch
│   ├── omarchy-refresh-hypridle
│   ├── omarchy-refresh-hyprland
│   ├── omarchy-refresh-hyprlock
│   ├── omarchy-refresh-hyprsunset
│   ├── omarchy-refresh-limine
│   ├── omarchy-refresh-pacman
│   ├── omarchy-refresh-plymouth
│   ├── omarchy-refresh-sddm
│   ├── omarchy-refresh-swayosd
│   ├── omarchy-refresh-tmux
│   ├── omarchy-refresh-walker
│   ├── omarchy-refresh-waybar
│   ├── omarchy-reinstall
│   ├── omarchy-reinstall-configs
│   ├── omarchy-reinstall-git
│   ├── omarchy-reinstall-pkgs
│   ├── omarchy-remove-dev-env
│   ├── omarchy-remove-preinstalls
│   ├── omarchy-restart-app
│   ├── omarchy-restart-bluetooth
│   ├── omarchy-restart-btop
│   ├── omarchy-restart-hyprctl
│   ├── omarchy-restart-hypridle
│   ├── omarchy-restart-hyprsunset
│   ├── omarchy-restart-makima
│   ├── omarchy-restart-mako
│   ├── omarchy-restart-opencode
│   ├── omarchy-restart-pipewire
│   ├── omarchy-restart-swayosd
│   ├── omarchy-restart-terminal
│   ├── omarchy-restart-tmux
│   ├── omarchy-restart-walker
│   ├── omarchy-restart-waybar
│   ├── omarchy-restart-wifi
│   ├── omarchy-restart-xcompose
│   ├── omarchy-setup-dns
│   ├── omarchy-setup-fido2
│   ├── omarchy-setup-fingerprint
│   ├── omarchy-setup-makima
│   ├── omarchy-show-done
│   ├── omarchy-show-logo
│   ├── omarchy-snapshot
│   ├── omarchy-state
│   ├── omarchy-sudo-keepalive
│   ├── omarchy-sudo-passwordless-toggle
│   ├── omarchy-sudo-reset
│   ├── omarchy-swayosd-brightness
│   ├── omarchy-swayosd-kbd-brightness
│   ├── omarchy-system-logout
│   ├── omarchy-system-reboot
│   ├── omarchy-system-shutdown
│   ├── omarchy-theme-bg-install
│   ├── omarchy-theme-bg-next
│   ├── omarchy-theme-bg-set
│   ├── omarchy-theme-current
│   ├── omarchy-theme-install
│   ├── omarchy-theme-list
│   ├── omarchy-theme-refresh
│   ├── omarchy-theme-remove
│   ├── omarchy-theme-set
│   ├── omarchy-theme-set-browser
│   ├── omarchy-theme-set-gnome
│   ├── omarchy-theme-set-keyboard
│   ├── omarchy-theme-set-keyboard-asus-rog
│   ├── omarchy-theme-set-keyboard-f16
│   ├── omarchy-theme-set-obsidian
│   ├── omarchy-theme-set-templates
│   ├── omarchy-theme-set-vscode
│   ├── omarchy-theme-update
│   ├── omarchy-toggle-hybrid-gpu
│   ├── omarchy-toggle-idle
│   ├── omarchy-toggle-nightlight
│   ├── omarchy-toggle-notification-silencing
│   ├── omarchy-toggle-screensaver
│   ├── omarchy-toggle-suspend
│   ├── omarchy-toggle-waybar
│   ├── omarchy-tui-install
│   ├── omarchy-tui-remove
│   ├── omarchy-tui-remove-all
│   ├── omarchy-tz-select
│   ├── omarchy-update
│   ├── omarchy-update-analyze-logs
│   ├── omarchy-update-aur-pkgs
│   ├── omarchy-update-available
│   ├── omarchy-update-available-reset
│   ├── omarchy-update-branch
│   ├── omarchy-update-confirm
│   ├── omarchy-update-firmware
│   ├── omarchy-update-git
│   ├── omarchy-update-keyring
│   ├── omarchy-update-orphan-pkgs
│   ├── omarchy-update-perform
│   ├── omarchy-update-restart
│   ├── omarchy-update-system-pkgs
│   ├── omarchy-update-time
│   ├── omarchy-update-without-idle
│   ├── omarchy-upload-log
│   ├── omarchy-version
│   ├── omarchy-version-branch
│   ├── omarchy-version-channel
│   ├── omarchy-version-pkgs
│   ├── omarchy-voxtype-config
│   ├── omarchy-voxtype-install
│   ├── omarchy-voxtype-model
│   ├── omarchy-voxtype-remove
│   ├── omarchy-voxtype-status
│   ├── omarchy-webapp-handler-hey
│   ├── omarchy-webapp-handler-zoom
│   ├── omarchy-webapp-install
│   ├── omarchy-webapp-remove
│   ├── omarchy-webapp-remove-all
│   ├── omarchy-wifi-powersave
│   └── omarchy-windows-vm
├── boot.sh
├── config/
│   ├── Typora/
│   │   └── themes/
│   │       ├── ia_typora.css
│   │       └── ia_typora_night.css
│   ├── alacritty/
│   │   └── alacritty.toml
│   ├── brave-flags.conf
│   ├── btop/
│   │   └── btop.conf
│   ├── chromium/
│   │   └── Default/
│   │       └── Preferences
│   ├── chromium-flags.conf
│   ├── elephant/
│   │   ├── calc.toml
│   │   ├── desktopapplications.toml
│   │   └── symbols.toml
│   ├── environment.d/
│   │   └── fcitx.conf
│   ├── fastfetch/
│   │   └── config.jsonc
│   ├── fcitx5/
│   │   └── conf/
│   │       ├── clipboard.conf
│   │       └── xcb.conf
│   ├── fontconfig/
│   │   └── fonts.conf
│   ├── ghostty/
│   │   └── config
│   ├── git/
│   │   └── config
│   ├── hypr/
│   │   ├── autostart.conf
│   │   ├── bindings.conf
│   │   ├── hypridle.conf
│   │   ├── hyprland.conf
│   │   ├── hyprlock.conf
│   │   ├── hyprsunset.conf
│   │   ├── input.conf
│   │   ├── looknfeel.conf
│   │   ├── monitors.conf
│   │   └── xdph.conf
│   ├── hyprland-preview-share-picker/
│   │   └── config.yaml
│   ├── imv/
│   │   └── config
│   ├── kitty/
│   │   └── kitty.conf
│   ├── lazygit/
│   │   └── config.yml
│   ├── omarchy/
│   │   ├── extensions/
│   │   │   └── menu.sh
│   │   ├── hooks/
│   │   │   ├── battery-low.sample
│   │   │   ├── font-set.sample
│   │   │   ├── post-update.sample
│   │   │   └── theme-set.sample
│   │   └── themed/
│   │       └── alacritty.toml.tpl.sample
│   ├── opencode/
│   │   └── opencode.json
│   ├── starship.toml
│   ├── swayosd/
│   │   ├── config.toml
│   │   └── style.css
│   ├── systemd/
│   │   └── user/
│   │       ├── omarchy-battery-monitor.service
│   │       └── omarchy-battery-monitor.timer
│   ├── tmux/
│   │   └── tmux.conf
│   ├── uwsm/
│   │   ├── default
│   │   └── env
│   ├── walker/
│   │   └── config.toml
│   ├── waybar/
│   │   ├── config.jsonc
│   │   └── style.css
│   ├── wiremix/
│   │   └── wiremix.toml
│   ├── xdg-terminals.list
│   └── xournalpp/
│       └── settings.xml
├── default/
│   ├── alacritty/
│   │   └── screensaver.toml
│   ├── bash/
│   │   ├── aliases
│   │   ├── envs
│   │   ├── fns/
│   │   │   ├── compression
│   │   │   ├── drives
│   │   │   ├── ssh-port-forwarding
│   │   │   ├── tmux
│   │   │   ├── transcoding
│   │   │   └── worktrees
│   │   ├── functions
│   │   ├── init
│   │   ├── inputrc
│   │   ├── rc
│   │   └── shell
│   ├── bashrc
│   ├── chromium/
│   │   └── extensions/
│   │       └── copy-url/
│   │           ├── background.js
│   │           └── manifest.json
│   ├── elephant/
│   │   ├── omarchy_background_selector.lua
│   │   └── omarchy_themes.lua
│   ├── ghostty/
│   │   └── screensaver
│   ├── gpg/
│   │   └── dirmngr.conf
│   ├── hypr/
│   │   ├── apps/
│   │   │   ├── 1password.conf
│   │   │   ├── bitwarden.conf
│   │   │   ├── browser.conf
│   │   │   ├── davinci-resolve.conf
│   │   │   ├── geforce.conf
│   │   │   ├── hyprshot.conf
│   │   │   ├── jetbrains.conf
│   │   │   ├── localsend.conf
│   │   │   ├── moonlight.conf
│   │   │   ├── pip.conf
│   │   │   ├── qemu.conf
│   │   │   ├── retroarch.conf
│   │   │   ├── steam.conf
│   │   │   ├── system.conf
│   │   │   ├── telegram.conf
│   │   │   ├── terminals.conf
│   │   │   ├── walker.conf
│   │   │   └── webcam-overlay.conf
│   │   ├── apps.conf
│   │   ├── autostart.conf
│   │   ├── bindings/
│   │   │   ├── clipboard.conf
│   │   │   ├── media.conf
│   │   │   ├── tiling-v2.conf
│   │   │   ├── tiling.conf
│   │   │   └── utilities.conf
│   │   ├── bindings.conf
│   │   ├── envs.conf
│   │   ├── input.conf
│   │   ├── looknfeel.conf
│   │   ├── plain-bindings.conf
│   │   └── windows.conf
│   ├── limine/
│   │   ├── default.conf
│   │   └── limine.conf
│   ├── makima/
│   │   └── AT Translated Set 2 keyboard.toml
│   ├── mako/
│   │   └── core.ini
│   ├── omarchy-skill/
│   │   └── SKILL.md
│   ├── pacman/
│   │   ├── mirrorlist-edge
│   │   ├── mirrorlist-rc
│   │   ├── mirrorlist-stable
│   │   ├── pacman-edge.conf
│   │   ├── pacman-rc.conf
│   │   └── pacman-stable.conf
│   ├── plymouth/
│   │   ├── omarchy.plymouth
│   │   └── omarchy.script
│   ├── sddm/
│   │   └── omarchy/
│   │       ├── Main.qml
│   │       ├── metadata.desktop
│   │       └── theme.conf
│   ├── systemd/
│   │   ├── faster-shutdown.conf
│   │   ├── system/
│   │   │   └── supergfxd.service.d/
│   │   │       └── delay-start.conf
│   │   ├── system-sleep/
│   │   │   ├── force-igpu
│   │   │   ├── keyboard-backlight
│   │   │   └── unmount-fuse
│   │   └── user@.service.d/
│   │       └── faster-shutdown.conf
│   ├── themed/
│   │   ├── alacritty.toml.tpl
│   │   ├── btop.theme.tpl
│   │   ├── chromium.theme.tpl
│   │   ├── ghostty.conf.tpl
│   │   ├── hyprland-preview-share-picker.css.tpl
│   │   ├── hyprland.conf.tpl
│   │   ├── hyprlock.conf.tpl
│   │   ├── keyboard.rgb.tpl
│   │   ├── kitty.conf.tpl
│   │   ├── mako.ini.tpl
│   │   ├── obsidian.css.tpl
│   │   ├── swayosd.css.tpl
│   │   ├── walker.css.tpl
│   │   └── waybar.css.tpl
│   ├── udev/
│   │   └── framework16-qmk-hid.rules
│   ├── voxtype/
│   │   └── config.toml
│   ├── walker/
│   │   ├── restart.conf
│   │   ├── themes/
│   │   │   └── omarchy-default/
│   │   │       ├── layout.xml
│   │   │       └── style.css
│   │   └── walker.desktop
│   ├── waybar/
│   │   └── indicators/
│   │       ├── idle.sh
│   │       ├── notification-silencing.sh
│   │       └── screen-recording.sh
│   ├── wireplumber/
│   │   └── wireplumber.conf.d/
│   │       └── alsa-soft-mixer.conf
│   └── xcompose
├── icon.txt
├── install/
│   ├── config/
│   │   ├── all.sh
│   │   ├── branding.sh
│   │   ├── config.sh
│   │   ├── detect-keyboard-layout.sh
│   │   ├── docker.sh
│   │   ├── fast-shutdown.sh
│   │   ├── fix-powerprofilesctl-shebang.sh
│   │   ├── git.sh
│   │   ├── gpg.sh
│   │   ├── hardware/
│   │   │   ├── bluetooth.sh
│   │   │   ├── fix-apple-spi-keyboard.sh
│   │   │   ├── fix-apple-suspend-nvme.sh
│   │   │   ├── fix-apple-t2.sh
│   │   │   ├── fix-asus-rog-audio-mixer.sh
│   │   │   ├── fix-asus-rog-mic.sh
│   │   │   ├── fix-bcm43xx.sh
│   │   │   ├── fix-dell-xps-audio.sh
│   │   │   ├── fix-dell-xps-haptic-touchpad.sh
│   │   │   ├── fix-f13-amd-audio-input.sh
│   │   │   ├── fix-fkeys.sh
│   │   │   ├── fix-intel-panther-lake-display.sh
│   │   │   ├── fix-surface-keyboard.sh
│   │   │   ├── fix-synaptic-touchpad.sh
│   │   │   ├── fix-tuxedo-backlight.sh
│   │   │   ├── fix-yt6801-ethernet-adapter.sh
│   │   │   ├── framework16-qmk-hid.sh
│   │   │   ├── ignore-power-button.sh
│   │   │   ├── intel-ipu7-camera.sh
│   │   │   ├── intel-thermald.sh
│   │   │   ├── intel.sh
│   │   │   ├── network.sh
│   │   │   ├── nvidia.sh
│   │   │   ├── printer.sh
│   │   │   ├── set-wireless-regdom.sh
│   │   │   ├── usb-autosuspend.sh
│   │   │   └── vulkan.sh
│   │   ├── increase-file-watchers.sh
│   │   ├── increase-lockout-limit.sh
│   │   ├── increase-sudo-tries.sh
│   │   ├── input-group.sh
│   │   ├── kernel-modules-hook.sh
│   │   ├── localdb.sh
│   │   ├── mimetypes.sh
│   │   ├── mise-work.sh
│   │   ├── omarchy-ai-skill.sh
│   │   ├── plocate-ac-only.sh
│   │   ├── powerprofilesctl-rules.sh
│   │   ├── remove-fcitx5-autostart.sh
│   │   ├── ssh-flakiness.sh
│   │   ├── sudoless-asdcontrol.sh
│   │   ├── theme.sh
│   │   ├── timezones.sh
│   │   ├── unmount-fuse.sh
│   │   ├── walker-elephant.sh
│   │   ├── wifi-powersave-rules.sh
│   │   └── xcompose.sh
│   ├── first-run/
│   │   ├── battery-monitor.sh
│   │   ├── cleanup-reboot-sudoers.sh
│   │   ├── dns-resolver.sh
│   │   ├── elephant.sh
│   │   ├── firewall.sh
│   │   ├── gnome-theme.sh
│   │   ├── welcome.sh
│   │   └── wifi.sh
│   ├── helpers/
│   │   ├── all.sh
│   │   ├── chroot.sh
│   │   ├── errors.sh
│   │   ├── logging.sh
│   │   └── presentation.sh
│   ├── login/
│   │   ├── all.sh
│   │   ├── default-keyring.sh
│   │   ├── limine-snapper.sh
│   │   ├── plymouth.sh
│   │   └── sddm.sh
│   ├── omarchy-base.packages
│   ├── omarchy-other.packages
│   ├── packaging/
│   │   ├── all.sh
│   │   ├── asus-rog.sh
│   │   ├── base.sh
│   │   ├── fonts.sh
│   │   ├── framework16.sh
│   │   ├── icons.sh
│   │   ├── npx.sh
│   │   ├── nvim.sh
│   │   ├── surface.sh
│   │   ├── tuis.sh
│   │   └── webapps.sh
│   ├── post-install/
│   │   ├── all.sh
│   │   ├── allow-reboot.sh
│   │   ├── finished.sh
│   │   ├── hibernation.sh
│   │   └── pacman.sh
│   └── preflight/
│       ├── all.sh
│       ├── begin.sh
│       ├── disable-mkinitcpio.sh
│       ├── first-run-mode.sh
│       ├── guard.sh
│       ├── migrations.sh
│       ├── pacman.sh
│       └── show-env.sh
├── install.sh
├── logo.txt
├── migrations/
│   ├── 1751134560.sh
│   ├── 1751134562.sh
│   ├── 1751134563.sh
│   ├── 1751134564.sh
│   ├── 1751134568.sh
│   ├── 1751135253.sh
│   ├── 1751510848.sh
│   ├── 1751667620.sh
│   ├── 1751669258.sh
│   ├── 1751672984.sh
│   ├── 1751679069.sh
│   ├── 1751821819.sh
│   ├── 1751887718.sh
│   ├── 1752081088.sh
│   ├── 1752082381.sh
│   ├── 1752091783.sh
│   ├── 1752104271.sh
│   ├── 1752168292.sh
│   ├── 1752188554.sh
│   ├── 1752292967.sh
│   ├── 1752535084.sh
│   ├── 1752535341.sh
│   ├── 1752543801.sh
│   ├── 1752643269.sh
│   ├── 1752678932.sh
│   ├── 1752725616.sh
│   ├── 1752793122.sh
│   ├── 1752797704.sh
│   ├── 1752874371.sh
│   ├── 1752896442.sh
│   ├── 1752897642.sh
│   ├── 1752955912.sh
│   ├── 1752981883.sh
│   ├── 1753138691.sh
│   ├── 1753224615.sh
│   ├── 1753495989.sh
│   ├── 1753689791.sh
│   ├── 1753908454.sh
│   ├── 1754047941.sh
│   ├── 1754109724.sh
│   ├── 1754215533.sh
│   ├── 1754221967.sh
│   ├── 1754228071.sh
│   ├── 1754331529.sh
│   ├── 1754332200.sh
│   ├── 1754389057.sh
│   ├── 1754390772.sh
│   ├── 1754509222.sh
│   ├── 1754514972.sh
│   ├── 1754566681.sh
│   ├── 1754668999.sh
│   ├── 1754856741.sh
│   ├── 1754860578.sh
│   ├── 1754984734.sh
│   ├── 1754996869.sh
│   ├── 1755109182.sh
│   ├── 1755139080.sh
│   ├── 1755208929.sh
│   ├── 1755340533.sh
│   ├── 1755436367.sh
│   ├── 1755455095.sh
│   ├── 1755459930.sh
│   ├── 1755494432.sh
│   ├── 1755507891.sh
│   ├── 1755795450.sh
│   ├── 1755865046.sh
│   ├── 1755867743.sh
│   ├── 1755870033.sh
│   ├── 1755904244.sh
│   ├── 1755920552.sh
│   ├── 1755930114.sh
│   ├── 1756060611.sh
│   ├── 1756115364.sh
│   ├── 1756153445.sh
│   ├── 1756203383.sh
│   ├── 1756205202.sh
│   ├── 1756300740.sh
│   ├── 1756360552.sh
│   ├── 1756371020.sh
│   ├── 1756410649.sh
│   ├── 1756411333.sh
│   ├── 1756411865.sh
│   ├── 1756491748.sh
│   ├── 1756494998.sh
│   ├── 1756507384.sh
│   ├── 1756556731.sh
│   ├── 1756629295.sh
│   ├── 1756642681.sh
│   ├── 1756650507.sh
│   ├── 1756911131.sh
│   ├── 1757021485.sh
│   ├── 1757147211.sh
│   ├── 1757279511.sh
│   ├── 1757361127.sh
│   ├── 1757361128.sh
│   ├── 1757435811.sh
│   ├── 1757435812.sh
│   ├── 1757483378.sh
│   ├── 1757511571.sh
│   ├── 1757515650.sh
│   ├── 1757535736.sh
│   ├── 1757783204.sh
│   ├── 1757861484.sh
│   ├── 1757866485.sh
│   ├── 1757877123.sh
│   ├── 1757877852.sh
│   ├── 1757879836.sh
│   ├── 1758019332.sh
│   ├── 1758051607.sh
│   ├── 1758104201.sh
│   ├── 1758107879.sh
│   ├── 1758111304.sh
│   ├── 1758142943.sh
│   ├── 1758436991.sh
│   ├── 1758455816.sh
│   ├── 1758487660_change_dm_to_sddm.sh
│   ├── 1758487662_move_to_custom_uki.sh
│   ├── 1758562032.sh
│   ├── 1758564460.sh
│   ├── 1759093827.sh
│   ├── 1759270604.sh
│   ├── 1759355846.sh
│   ├── 1759691413.sh
│   ├── 1759694076.sh
│   ├── 1759895423.sh
│   ├── 1759913695.sh
│   ├── 1760144906.sh
│   ├── 1760301290.sh
│   ├── 1760304963.sh
│   ├── 1760434895.sh
│   ├── 1760441237.sh
│   ├── 1760462260.sh
│   ├── 1760471009.sh
│   ├── 1760684828.sh
│   ├── 1760693222.sh
│   ├── 1760724934.sh
│   ├── 1760730253.sh
│   ├── 1760787158.sh
│   ├── 1761180745.sh
│   ├── 1761241493.sh
│   ├── 1761247569.sh
│   ├── 1761269603.sh
│   ├── 1761274806.sh
│   ├── 1761274980.sh
│   ├── 1761569743.sh
│   ├── 1761585764.sh
│   ├── 1761638377.sh
│   ├── 1761758552.sh
│   ├── 1761897226.sh
│   ├── 1762121828.sh
│   ├── 1762150269.sh
│   ├── 1762156000.sh
│   ├── 1762352101.sh
│   ├── 1762417304.sh
│   ├── 1762446739.sh
│   ├── 1762684663.sh
│   ├── 1762685081.sh
│   ├── 1762711005.sh
│   ├── 1762768186.sh
│   ├── 1762770442.sh
│   ├── 1762770815.sh
│   ├── 1762781907.sh
│   ├── 1762802472.sh
│   ├── 1762873545.sh
│   ├── 1763386443.sh
│   ├── 1763393133.sh
│   ├── 1763409182.sh
│   ├── 1763409505.sh
│   ├── 1763478660.sh
│   ├── 1763558828.sh
│   ├── 1763560161.sh
│   ├── 1763561396.sh
│   ├── 1763583093.sh
│   ├── 1763626772.sh
│   ├── 1763633307.sh
│   ├── 1763634099.sh
│   ├── 1763653692.sh
│   ├── 1763743755.sh
│   ├── 1763753641.sh
│   ├── 1764067068.sh
│   ├── 1764067963.sh
│   ├── 1764332115.sh
│   ├── 1764333665.sh
│   ├── 1764378788.sh
│   ├── 1765587218.sh
│   ├── 1765729055.sh
│   ├── 1765739892.sh
│   ├── 1765744321.sh
│   ├── 1765846739.sh
│   ├── 1765884267.sh
│   ├── 1766942230.sh
│   ├── 1767138576.sh
│   ├── 1767227973.sh
│   ├── 1767306902.sh
│   ├── 1767414310.sh
│   ├── 1767478141.sh
│   ├── 1767478687.sh
│   ├── 1767685679.sh
│   ├── 1767716691.sh
│   ├── 1767865784.sh
│   ├── 1768236764.sh
│   ├── 1768270644.sh
│   ├── 1768906440.sh
│   ├── 1768916735.sh
│   ├── 1769182209.sh
│   ├── 1769183359.sh
│   ├── 1769510847.sh
│   ├── 1769543550.sh
│   ├── 1769566732.sh
│   ├── 1769616857.sh
│   ├── 1769619823.sh
│   ├── 1769964367.sh
│   ├── 1770159912.sh
│   ├── 1770372978.sh
│   ├── 1770375655.sh
│   ├── 1770375817.sh
│   ├── 1770380577.sh
│   ├── 1770393078.sh
│   ├── 1770483021.sh
│   ├── 1770638893.sh
│   ├── 1770811646.sh
│   ├── 1771002522.sh
│   ├── 1771188969.sh
│   ├── 1771345870.sh
│   ├── 1771403119.sh
│   ├── 1771602477.sh
│   ├── 1771602647.sh
│   ├── 1771606080.sh
│   ├── 1771606249.sh
│   ├── 1771615907.sh
│   ├── 1771618300.sh
│   ├── 1771651931.sh
│   ├── 1771667323.sh
│   ├── 1771670389.sh
│   ├── 1771682500.sh
│   ├── 1771683168.sh
│   ├── 1771683296.sh
│   ├── 1771847961.sh
│   ├── 1772051864.sh
│   ├── 1772120972.sh
│   ├── 1772211023.sh
│   ├── 1772293693.sh
│   ├── 1772294096.sh
│   ├── 1772379119.sh
│   ├── 1772389838.sh
│   ├── 1772632144.sh
│   ├── 1772907198.sh
│   ├── 1772964511.sh
│   ├── 1772981555.sh
│   ├── 1772981757.sh
│   ├── 1772988614.sh
│   ├── 1772990935.sh
│   ├── 1773012889.sh
│   ├── 1773505447.sh
│   ├── 1773598247.sh
│   └── 1773599943.sh
├── themes/
│   ├── catppuccin/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   ├── vscode.json
│   │   └── waybar.css
│   ├── catppuccin-latte/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── light.mode
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── ethereal/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── everforest/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── flexoki-light/
│   │   ├── btop.theme
│   │   ├── chromium.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── light.mode
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── gruvbox/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── hackerman/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── kanagawa/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── hyprland.conf
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── lumon/
│   │   ├── btop.theme
│   │   ├── chromium.theme
│   │   ├── colors.toml
│   │   ├── hyprland.conf
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   ├── swayosd.css
│   │   └── waybar.css
│   ├── matte-black/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── miasma/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── nord/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── osaka-jade/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── ristretto/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── rose-pine/
│   │   ├── btop.theme
│   │   ├── chromium.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── light.mode
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── tokyo-night/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── keyboard.rgb
│   │   ├── neovim.lua
│   │   └── vscode.json
│   ├── vantablack/
│   │   ├── btop.theme
│   │   ├── colors.toml
│   │   ├── icons.theme
│   │   ├── neovim.lua
│   │   └── vscode.json
│   └── white/
│       ├── btop.theme
│       ├── colors.toml
│       ├── icons.theme
│       ├── light.mode
│       ├── neovim.lua
│       └── vscode.json
└── version
Condensed preview — 856 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (650K chars).
[
  {
    "path": ".editorconfig",
    "chars": 147,
    "preview": "root = true\n\n[*]\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\ntrim_trailing_whitespace = true\nend_of"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug.yml",
    "chars": 666,
    "preview": "name: Bug\ndescription: Report a validated bug -- NOT FOR SUPPORT REQUESTS\nlabels: [bug]\nbody:\n  - type: markdown\n    att"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 423,
    "preview": "blank_issues_enabled: false\ncontact_links:\n  - name: Suggestion\n    url: https://github.com/basecamp/omarchy/discussions"
  },
  {
    "path": "AGENTS.md",
    "chars": 2619,
    "preview": "# Style\n\n- Two spaces for indentation, no tabs\n- Use bash 5 conditionals: use `[[ ]]` for string/file tests and `(( ))` "
  },
  {
    "path": "LICENSE",
    "chars": 1063,
    "preview": "Copyright (c) David Heinemeier Hansson\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of "
  },
  {
    "path": "README.md",
    "chars": 228,
    "preview": "# Omarchy\n\nOmarchy is a beautiful, modern & opinionated Linux distribution by DHH.\n\nRead more at [omarchy.org](https://o"
  },
  {
    "path": "applications/Alacritty.desktop",
    "chars": 452,
    "preview": "[Desktop Entry]\nType=Application\nTryExec=alacritty\nExec=alacritty\nIcon=Alacritty\nTerminal=false\nCategories=System;Termin"
  },
  {
    "path": "applications/hidden/avahi-discover.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/bssh.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/btop.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/bvnc.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/cmake-gui.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/cups.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/dropbox.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/electron34.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/electron36.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/electron37.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/fcitx5-configtool.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/fcitx5-wayland-launcher.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/java-java-openjdk.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/jconsole-java-openjdk.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/jshell-java-openjdk.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/kbd-layout-viewer5.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/kcm_fcitx5.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/kcm_kaccounts.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/kvantummanager.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/limine-snapper-restore.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/org.fcitx.Fcitx5.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/org.fcitx.fcitx5-config-qt.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/org.fcitx.fcitx5-migrator.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/org.fcitx.fcitx5-qt5-gui-wrapper.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/org.fcitx.fcitx5-qt6-gui-wrapper.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/qv4l2.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/qvidcap.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/uuctl.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/wiremix.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/xgps.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/hidden/xgpsspeed.desktop",
    "chars": 28,
    "preview": "[Desktop Entry]\nHidden=true\n"
  },
  {
    "path": "applications/imv.desktop",
    "chars": 250,
    "preview": "[Desktop Entry]\nName=Image Viewer\nExec=imv %F\nIcon=imv\nType=Application\nMimeType=image/png;image/jpeg;image/jpg;image/gi"
  },
  {
    "path": "applications/mpv.desktop",
    "chars": 3521,
    "preview": "[Desktop Entry]\nType=Application\nName=Media Player\nName[ar]=مشغل وسائط mpv\nName[ca]=Reproductor multimèdia mpv\nName[cs]="
  },
  {
    "path": "applications/typora.desktop",
    "chars": 214,
    "preview": "[Desktop Entry]\nName=Typora\nGenericName=Markdown Editor\nExec=typora --enable-wayland-ime %U\nIcon=typora\nType=Application"
  },
  {
    "path": "bin/omarchy-battery-capacity",
    "chars": 277,
    "preview": "#!/bin/bash\n\n# Returns the battery full capacity in Wh (rounded to whole number).\n# Used by omarchy-battery-status for d"
  },
  {
    "path": "bin/omarchy-battery-monitor",
    "chars": 793,
    "preview": "#!/bin/bash\n\n# Designed to be run by systemd timer every 30 seconds and alerts if battery is low\n\nBATTERY_THRESHOLD=10\nN"
  },
  {
    "path": "bin/omarchy-battery-present",
    "chars": 304,
    "preview": "#!/bin/bash\n\n# Returns true if a battery is present on the system.\n# Used by the battery monitor and other battery-relat"
  },
  {
    "path": "bin/omarchy-battery-remaining",
    "chars": 230,
    "preview": "#!/bin/bash\n\n# Returns the battery percentage remaining as an integer.\n# Used by the battery monitor and the Ctrl + Shif"
  },
  {
    "path": "bin/omarchy-battery-remaining-time",
    "chars": 603,
    "preview": "#!/bin/bash\n\n# Returns the battery time remaining (to empty or full) in a compact format.\n\nbattery_info=$(upower -i $(up"
  },
  {
    "path": "bin/omarchy-battery-status",
    "chars": 863,
    "preview": "#!/bin/bash\n\n# Returns a formatted battery status string with percentage and power draw/charge.\n# Used by the battery no"
  },
  {
    "path": "bin/omarchy-branch-set",
    "chars": 362,
    "preview": "#!/bin/bash\n\n# Set the branch for Omarchy's git repository.\n\nif (($# == 0)); then\n  echo \"Usage: omarchy-branch-set [mas"
  },
  {
    "path": "bin/omarchy-brightness-display",
    "chars": 691,
    "preview": "#!/bin/bash\n\n# Adjust brightness on the most likely display device.\n# Usage: omarchy-brightness-display <step>\n\nstep=\"${"
  },
  {
    "path": "bin/omarchy-brightness-display-apple",
    "chars": 506,
    "preview": "#!/bin/bash\n\n# Adjust the brightness on Apple Studio Displays and Apple XDR Displays using asdcontrol.\n\nif (( $# == 0 ))"
  },
  {
    "path": "bin/omarchy-brightness-keyboard",
    "chars": 1318,
    "preview": "#!/bin/bash\n\n# Adjust keyboard backlight brightness using available steps.\n# Usage: omarchy-brightness-keyboard <up|down"
  },
  {
    "path": "bin/omarchy-channel-set",
    "chars": 1191,
    "preview": "#!/bin/bash\n\n# Set the Omarchy channel, which dictates what git branch and package repository is used.\n#\n# Stable uses t"
  },
  {
    "path": "bin/omarchy-cmd-audio-switch",
    "chars": 2527,
    "preview": "#!/bin/bash\n\n# Switch between audio outputs while preserving the mute status. By default mapped to Super + Mute.\n\nfocuse"
  },
  {
    "path": "bin/omarchy-cmd-first-run",
    "chars": 714,
    "preview": "#!/bin/bash\n\n# Finish the installation of Omarchy with items that can only be done after logging in.\n\nset -e\n\nFIRST_RUN_"
  },
  {
    "path": "bin/omarchy-cmd-missing",
    "chars": 194,
    "preview": "#!/bin/bash\n\n# Returns true if any of the commands passed in as arguments are missing on the system.\n\nfor cmd in \"$@\"; d"
  },
  {
    "path": "bin/omarchy-cmd-present",
    "chars": 167,
    "preview": "#!/bin/bash\n\n# Returns true if all the commands passed in as arguments exit on the system.\n\nfor cmd in \"$@\"; do\n  comman"
  },
  {
    "path": "bin/omarchy-cmd-screenrecord",
    "chars": 5598,
    "preview": "#!/bin/bash\n\n# Start and stop a screenrecording, which will be saved to ~/Videos by default.\n# Alternative location can "
  },
  {
    "path": "bin/omarchy-cmd-screensaver",
    "chars": 1032,
    "preview": "#!/bin/bash\n\n# Run the Omarchy screensaver using random effects from TTE.\n\nscreensaver_in_focus() {\n  hyprctl activewind"
  },
  {
    "path": "bin/omarchy-cmd-screenshot",
    "chars": 4019,
    "preview": "#!/bin/bash\n\n# Take a screenshot of the whole screen, a specific window, or a user-drawn region.\n# Saves to ~/Pictures b"
  },
  {
    "path": "bin/omarchy-cmd-share",
    "chars": 1333,
    "preview": "#!/bin/bash\n\n# Share clipboard, file, or folder using LocalSend. Bound to Super + Ctrl + S by default.\n\nif (($# == 0)); "
  },
  {
    "path": "bin/omarchy-cmd-terminal-cwd",
    "chars": 674,
    "preview": "#!/bin/bash\n\n# Returns the current working directory of the active terminal window,\n# so a new terminal window can be st"
  },
  {
    "path": "bin/omarchy-config-direct-boot",
    "chars": 1356,
    "preview": "#!/bin/bash\n\n# Add an EFI boot entry for the Omarchy UKI, allowing the system to boot directly\n# without a bootloader li"
  },
  {
    "path": "bin/omarchy-debug",
    "chars": 2215,
    "preview": "#!/bin/bash\n\n# Return exhaustive debugging information about the system to help diagnose problems.\n\nNO_SUDO=false\nPRINT_"
  },
  {
    "path": "bin/omarchy-dev-add-migration",
    "chars": 366,
    "preview": "#!/bin/bash\n\n# Creates a new Omarchy migration named after the unix timestamp of the last commit.\n# Only intended for Om"
  },
  {
    "path": "bin/omarchy-drive-info",
    "chars": 1355,
    "preview": "#!/bin/bash\n\n# Returns drive information about a given volumne, like /dev/nvme0, which is used by omarchy-drive-select.\n"
  },
  {
    "path": "bin/omarchy-drive-select",
    "chars": 542,
    "preview": "#!/bin/bash\n\n# Select a drive from a list with info that includes space and brand. Used by omarchy-drive-set-password.\n\n"
  },
  {
    "path": "bin/omarchy-drive-set-password",
    "chars": 625,
    "preview": "#!/bin/bash\n\n# Set a new encryption password for a drive selected.\n\nencrypted_drives=$(blkid -t TYPE=crypto_LUKS -o devi"
  },
  {
    "path": "bin/omarchy-font-current",
    "chars": 250,
    "preview": "#!/bin/bash\n\n# Returns the name of the current monospace font being used by extracting it from the Waybar stylesheet.\n# "
  },
  {
    "path": "bin/omarchy-font-list",
    "chars": 217,
    "preview": "#!/bin/bash\n\n# Returns a list of all the monospace fonts available on the system that can be set using omarchy-font-set."
  },
  {
    "path": "bin/omarchy-font-set",
    "chars": 1542,
    "preview": "#!/bin/bash\n\n# Set the system-wide monospace font that should be used by the terminal, hyprlock, waybar, swayosd, etc.\n#"
  },
  {
    "path": "bin/omarchy-hibernation-available",
    "chars": 447,
    "preview": "#!/bin/bash\n\n# Check if hibernation is supported\nif [[ ! -f /sys/power/image_size ]]; then\n  exit 1\nfi\n\n# Sum all swap s"
  },
  {
    "path": "bin/omarchy-hibernation-remove",
    "chars": 1623,
    "preview": "#!/bin/bash\n\n# Removes hibernation setup: disables swap, removes swapfile, removes fstab entry,\n# removes resume hook, a"
  },
  {
    "path": "bin/omarchy-hibernation-setup",
    "chars": 3667,
    "preview": "#!/bin/bash\n\n# Creates a swap file in the btrfs subvolume, adds the swap file to /etc/fstab,\n# adds a resume hook to mki"
  },
  {
    "path": "bin/omarchy-hook",
    "chars": 307,
    "preview": "#!/bin/bash\n\n# Run a named hook, like post-update (available in ~/.config/omarchy/hooks/post-update).\n\nset -e\n\nif (( $# "
  },
  {
    "path": "bin/omarchy-hw-asus-rog",
    "chars": 214,
    "preview": "#!/bin/bash\n\n# Detect whether the computer is an Asus ROG machine.\n\n[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) ="
  },
  {
    "path": "bin/omarchy-hw-framework16",
    "chars": 207,
    "preview": "#!/bin/bash\n\n# Detect whether the computer is a Framework Laptop 16.\n\n[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)"
  },
  {
    "path": "bin/omarchy-hw-intel",
    "chars": 162,
    "preview": "#!/bin/bash\n\n# Detect whether the computer has an Intel CPU.\n\n[[ $(grep -m1 \"vendor_id\" /proc/cpuinfo 2>/dev/null | cut "
  },
  {
    "path": "bin/omarchy-hw-surface",
    "chars": 222,
    "preview": "#!/bin/bash\n\n# Detect whether the computer is a Microsoft Surface device.\n\n[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/"
  },
  {
    "path": "bin/omarchy-hyprland-monitor-scaling-cycle",
    "chars": 890,
    "preview": "#!/bin/bash\n\n# Get the active monitor (the one with the cursor)\nMONITOR_INFO=$(hyprctl monitors -j | jq -r '.[] | select"
  },
  {
    "path": "bin/omarchy-hyprland-window-close-all",
    "chars": 196,
    "preview": "#!/bin/bash\n\n# Close all open windows\nhyprctl clients -j | \\\n  jq -r \".[].address\" | \\\n  xargs -I{} hyprctl dispatch clo"
  },
  {
    "path": "bin/omarchy-hyprland-window-gaps-toggle",
    "chars": 436,
    "preview": "#!/bin/bash\n\n# Toggles the window gaps globally between no gaps and the default 10/5/2.\n\ngaps=$(hyprctl getoption genera"
  },
  {
    "path": "bin/omarchy-hyprland-window-pop",
    "chars": 1480,
    "preview": "#!/bin/bash\n\n# Toggle to pop-out a tile to stay fixed on a display basis.\n\n# Usage:\n# omarchy-hyprland-window-pop [width"
  },
  {
    "path": "bin/omarchy-hyprland-window-single-square-aspect-toggle",
    "chars": 499,
    "preview": "#!/bin/bash\n\n# Check current single_window_aspect_ratio setting\nCURRENT_VALUE=$(hyprctl getoption \"layout:single_window_"
  },
  {
    "path": "bin/omarchy-hyprland-workspace-layout-toggle",
    "chars": 439,
    "preview": "#!/bin/bash\n\n# Toggle the layout on the current active workspace between dwindle and scrolling\n\nACTIVE_WORKSPACE=$(hyprc"
  },
  {
    "path": "bin/omarchy-install-chromium-google-account",
    "chars": 610,
    "preview": "#!/bin/bash\n\n# Allow Chromium to sign in to Google accounts by adding the correct\n# oauth client id and secret to ~/.con"
  },
  {
    "path": "bin/omarchy-install-dev-env",
    "chars": 3900,
    "preview": "#!/bin/bash\n\n# Install one of the supported development environments. Usually called via Install > Development > * in th"
  },
  {
    "path": "bin/omarchy-install-docker-dbs",
    "chars": 1598,
    "preview": "#!/bin/bash\n\n# Install one of the supported databases in a Docker container with the suitable development options.\n# Usu"
  },
  {
    "path": "bin/omarchy-install-dropbox",
    "chars": 376,
    "preview": "#!/bin/bash\n\n# Install and start the Dropbox service. Must then be authenticated via the web.\n\necho \"Installing all depe"
  },
  {
    "path": "bin/omarchy-install-geforce-now",
    "chars": 412,
    "preview": "#!/bin/bash\n\n# Install and launch Geforce Now.\n\nset -e\n\nomarchy-pkg-add flatpak\ncd /tmp\n\n# Download and run GeForce NOW\n"
  },
  {
    "path": "bin/omarchy-install-nordvpn",
    "chars": 432,
    "preview": "#!/bin/bash\n\n# Install the NordVPN service with optional GUI.\n\necho \"Installing NordVPN...\"\nomarchy-pkg-aur-add nordvpn-"
  },
  {
    "path": "bin/omarchy-install-steam",
    "chars": 237,
    "preview": "#!/bin/bash\n\n# Install and launch Steam after first letting the user pick the correct grahics card drivers.\n\nset -e\n\nech"
  },
  {
    "path": "bin/omarchy-install-tailscale",
    "chars": 381,
    "preview": "#!/bin/bash\n\n# Install the Tailscale mesh VPN service and a web app for the Tailscale Admin Console.\n\ncurl -fsSL https:/"
  },
  {
    "path": "bin/omarchy-install-terminal",
    "chars": 1048,
    "preview": "#!/bin/bash\n\n# Install one of the approved terminals and set it as the default for Omarchy (Super + Return etc).\n\nif (($"
  },
  {
    "path": "bin/omarchy-install-vscode",
    "chars": 883,
    "preview": "#!/bin/bash\n\n# Install VSCode and configure it to use the gnome-libsecret password store, not to update automatically, a"
  },
  {
    "path": "bin/omarchy-install-xbox-controllers",
    "chars": 571,
    "preview": "#!/bin/bash\n\n# Install support for using Xbox controllers with Steam/RetroArch/etc.\n\nset -e\n\n# Install xpadneo to ensure"
  },
  {
    "path": "bin/omarchy-launch-about",
    "chars": 159,
    "preview": "#!/bin/bash\n\n# Launch the fastfetch TUI that gives information about the current system.\n\nexec omarchy-launch-or-focus-t"
  },
  {
    "path": "bin/omarchy-launch-audio",
    "chars": 113,
    "preview": "#!/bin/bash\n\n# Launch the Omarchy audio controls TUI (provided by wiremix).\n\nomarchy-launch-or-focus-tui wiremix\n"
  },
  {
    "path": "bin/omarchy-launch-bluetooth",
    "chars": 218,
    "preview": "#!/bin/bash\n\n# Launch the Omarchy bluetooth controls TUI (provided by bluetui).\n# Also attempts to unblock bluetooth ser"
  },
  {
    "path": "bin/omarchy-launch-browser",
    "chars": 609,
    "preview": "#!/bin/bash\n\n# Launch the default browser as determined by xdg-settings.\n# Automatically converts --private into the cor"
  },
  {
    "path": "bin/omarchy-launch-editor",
    "chars": 421,
    "preview": "#!/bin/bash\n\n# Launch the default editor as determined by $EDITOR (set via ~/.config/uwsm/default) (or nvim if missing)."
  },
  {
    "path": "bin/omarchy-launch-floating-terminal-with-presentation",
    "chars": 396,
    "preview": "#!/bin/bash\n\n# Launch a floating terminal with the Omarchy logo presentation, then execute the command passed in, and fi"
  },
  {
    "path": "bin/omarchy-launch-or-focus",
    "chars": 715,
    "preview": "#!/bin/bash\n\n# Launch or focus on a given command identified by the passed in window-pattern.\n# Use by some default bind"
  },
  {
    "path": "bin/omarchy-launch-or-focus-tui",
    "chars": 329,
    "preview": "#!/bin/bash\n\n# Launch or focus on a given TUI identified by the passed in as the command.\n# Use by commands like omarchy"
  },
  {
    "path": "bin/omarchy-launch-or-focus-webapp",
    "chars": 457,
    "preview": "#!/bin/bash\n\n# Launch or focus on a given web app identified by the window-pattern.\n# Use by some default bindings, like"
  },
  {
    "path": "bin/omarchy-launch-screensaver",
    "chars": 1530,
    "preview": "#!/bin/bash\n\n# Launch the Omarchy screensaver in the default terminal on the system with the correct font configuration."
  },
  {
    "path": "bin/omarchy-launch-tui",
    "chars": 231,
    "preview": "#!/bin/bash\n\n# Launch the TUI command passed in as an argument in the default terminal with an org.omarchy.COMMAND app i"
  },
  {
    "path": "bin/omarchy-launch-walker",
    "chars": 477,
    "preview": "#!/bin/bash\n\n# Launch the Walker application launcher while ensuring that it's data provider (called elephant) is runnin"
  },
  {
    "path": "bin/omarchy-launch-webapp",
    "chars": 480,
    "preview": "#!/bin/bash\n\n# Launch the passed in URL as a web app in the default browser (or chromium if the default doesn't support "
  },
  {
    "path": "bin/omarchy-launch-wifi",
    "chars": 214,
    "preview": "#!/bin/bash\n\n# Launch the Omarchy wifi controls (provided by the Impala TUI).\n# Attempts to unblock the wifi service fir"
  },
  {
    "path": "bin/omarchy-lock-screen",
    "chars": 446,
    "preview": "#!/bin/bash\n\n# Locks the system using hyprlock, but not before ensuring 1password has also been locked, and the screensa"
  },
  {
    "path": "bin/omarchy-menu",
    "chars": 22528,
    "preview": "#!/bin/bash\n\n# Launch the Omarchy Menu or takes a parameter to jump straight to a submenu.\n\nexport PATH=\"$HOME/.local/sh"
  },
  {
    "path": "bin/omarchy-menu-keybindings",
    "chars": 7937,
    "preview": "#!/bin/bash\n\n# Display Hyprland keybindings defined in your configuration using walker for an interactive search menu.\n\n"
  },
  {
    "path": "bin/omarchy-migrate",
    "chars": 837,
    "preview": "#!/bin/bash\n\n# Run all pending migrations to bring the system in line with the installed version.\n\n# Where we store an e"
  },
  {
    "path": "bin/omarchy-notification-dismiss",
    "chars": 489,
    "preview": "#!/bin/bash\n\n# Dismiss a mako notification on the basis of its summary. Used by the first-run notifications to dismiss t"
  },
  {
    "path": "bin/omarchy-npx-install",
    "chars": 512,
    "preview": "#!/bin/bash\n\n# Install an npx wrapper for a given npm package.\n# Usage: omarchy-npx-install <package> [command-name]\n#\n#"
  },
  {
    "path": "bin/omarchy-pkg-add",
    "chars": 449,
    "preview": "#!/bin/bash\n\n# Add the named packages to the system if they're missing. Returns false if it couldn't be done.\n\nif omarch"
  },
  {
    "path": "bin/omarchy-pkg-aur-accessible",
    "chars": 310,
    "preview": "#!/bin/bash\n\n# Returns true if the AUR is up and available.\n# Used by omarchy-update-system-pkgs to ensure the AUR is av"
  },
  {
    "path": "bin/omarchy-pkg-aur-add",
    "chars": 454,
    "preview": "#!/bin/bash\n\n# Add the named packages to the system from the AUR if they're missing. Returns false if it couldn't be don"
  },
  {
    "path": "bin/omarchy-pkg-aur-install",
    "chars": 904,
    "preview": "#!/bin/bash\n\n# Show a fuzzy-finder TUI for picking new AUR packages to install.\n\nfzf_args=(\n  --multi\n  --preview 'yay -"
  },
  {
    "path": "bin/omarchy-pkg-drop",
    "chars": 213,
    "preview": "#!/bin/bash\n\n# Remove all the named packages from the system if they're installed (otherwise ignore).\n\nfor pkg in \"$@\"; "
  },
  {
    "path": "bin/omarchy-pkg-install",
    "chars": 751,
    "preview": "#!/bin/bash\n\n# Show a fuzzy-finder TUI for picking new Arch and OPR packages to install.\n\nfzf_args=(\n  --multi\n  --previ"
  },
  {
    "path": "bin/omarchy-pkg-missing",
    "chars": 210,
    "preview": "#!/bin/bash\n\n# Returns true if any of the named packages are missing from the system (or false if they're all there).\n\nf"
  },
  {
    "path": "bin/omarchy-pkg-present",
    "chars": 199,
    "preview": "#!/bin/bash\n\n# Returns true if all of the named packages are installed on the system (or false if any of them are missin"
  },
  {
    "path": "bin/omarchy-pkg-remove",
    "chars": 716,
    "preview": "#!/bin/bash\n\n# Show a fuzzy-finder TUI for picking packages installed on the system to be removed.\n\nfzf_args=(\n  --multi"
  },
  {
    "path": "bin/omarchy-powerprofiles-list",
    "chars": 248,
    "preview": "#!/bin/bash\n\n# Returns a list of all the available power profiles on the system.\n# Used by the Omarchy Menu under Setup "
  },
  {
    "path": "bin/omarchy-refresh-applications",
    "chars": 765,
    "preview": "#!/bin/bash\n\n# Ensure all default .desktop, web apps, and TUIs are installed.\n\n# Copy and sync icon files\nmkdir -p ~/.lo"
  },
  {
    "path": "bin/omarchy-refresh-chromium",
    "chars": 619,
    "preview": "#!/bin/bash\n\n# Refresh the ~/.config/chromium-flags.conf file from the Omarchy defaults.\n\nCONFIG_FILE=\"$HOME/.config/chr"
  },
  {
    "path": "bin/omarchy-refresh-config",
    "chars": 1440,
    "preview": "#!/bin/bash\n\n# Copies the named config from ~/.local/share/omarchy/config/X/Y/Z -> ~/.config/X/Y/Z.\n# If the config alre"
  },
  {
    "path": "bin/omarchy-refresh-fastfetch",
    "chars": 128,
    "preview": "#!/bin/bash\n\n# Overwrite the user config for fastfetch with the Omarchy default.\n\nomarchy-refresh-config fastfetch/confi"
  },
  {
    "path": "bin/omarchy-refresh-hypridle",
    "chars": 172,
    "preview": "#!/bin/bash\n\n# Overwrite the user config for hypridle with the Omarchy default and restart the service.\n\nomarchy-refresh"
  },
  {
    "path": "bin/omarchy-refresh-hyprland",
    "chars": 301,
    "preview": "#!/bin/bash\n\n# Overwrite all the user configs in ~/.config/hypr with the Omarchy defaults.\n\nomarchy-refresh-config hypr/"
  },
  {
    "path": "bin/omarchy-refresh-hyprlock",
    "chars": 123,
    "preview": "#!/bin/bash\n\n# Overwrite the user config for hyprlock with the Omarchy default.\n\nomarchy-refresh-config hypr/hyprlock.co"
  },
  {
    "path": "bin/omarchy-refresh-hyprsunset",
    "chars": 179,
    "preview": "#!/bin/bash\n\n# Overwrite the user config for hyprsunset with the Omarchy default and restart the service.\n#\nomarchy-refr"
  },
  {
    "path": "bin/omarchy-refresh-limine",
    "chars": 491,
    "preview": "#!/bin/bash\n\n# Overwrite the user config for the Limine bootloader and rebuild it.\n\nif [[ -f /boot/EFI/Linux/omarchy_lin"
  },
  {
    "path": "bin/omarchy-refresh-pacman",
    "chars": 917,
    "preview": "#!/bin/bash\n\n# Overwrite the package configuration for /etc/pacman with the Omarchy default of using its dedicated mirro"
  },
  {
    "path": "bin/omarchy-refresh-plymouth",
    "chars": 366,
    "preview": "#!/bin/bash\n\n# Overwrite the user config for the Plymouth drive decryption and boot sequence with the Omarchy default an"
  },
  {
    "path": "bin/omarchy-refresh-sddm",
    "chars": 172,
    "preview": "#!/bin/bash\n\n# Refresh the SDDM theme from default\n\nsudo rm -rf /usr/share/sddm/themes/omarchy\nsudo cp -r $OMARCHY_PATH/"
  },
  {
    "path": "bin/omarchy-refresh-swayosd",
    "chars": 274,
    "preview": "#!/bin/bash\n\n# Overwrite the user configs for swayosd (controls on-screen feedback for changing volume/songs etc) with t"
  },
  {
    "path": "bin/omarchy-refresh-tmux",
    "chars": 148,
    "preview": "#!/bin/bash\n\n# Overwrite the user tmux config with the Omarchy default and reload tmux.\n\nomarchy-refresh-config tmux/tmu"
  },
  {
    "path": "bin/omarchy-refresh-walker",
    "chars": 729,
    "preview": "#!/bin/bash\n\n# Overwrite the user configs for the Walker application launcher (which also powers the Omarchy Menu) and r"
  },
  {
    "path": "bin/omarchy-refresh-waybar",
    "chars": 224,
    "preview": "#!/bin/bash\n\n# Overwrite the user configs for the Waybar menu bar with the Omarchy defaults and restart the service.\n\nom"
  },
  {
    "path": "bin/omarchy-reinstall",
    "chars": 503,
    "preview": "#!/bin/bash\nset -e\n\n# Attempt to reinstall all default Omarchy packages and reset all the default configs.\n\necho -e \"Thi"
  },
  {
    "path": "bin/omarchy-reinstall-configs",
    "chars": 495,
    "preview": "#!/bin/bash\nset -e\n\n# Overwrite all user configs with the Omarchy defaults.\n\nif (( EUID == 0 )); then\n  echo \"Error: Thi"
  },
  {
    "path": "bin/omarchy-reinstall-git",
    "chars": 278,
    "preview": "#!/bin/bash\nset -e\n\n# Reinstall the Omarchy configuration directory from the git source.\n\ngit clone --depth=1 \"https://g"
  },
  {
    "path": "bin/omarchy-reinstall-pkgs",
    "chars": 471,
    "preview": "#!/bin/bash\nset -e\n\n# Reinstall all default Omarchy packages from the stable channel and downgrade any packages that are"
  },
  {
    "path": "bin/omarchy-remove-dev-env",
    "chars": 2513,
    "preview": "#!/bin/bash\n\n# Remove a development environment that was previously installed via omarchy-install-dev-env.\n# Usage: omar"
  },
  {
    "path": "bin/omarchy-remove-preinstalls",
    "chars": 847,
    "preview": "#!/bin/bash\n\n# Remove preinstalled Omarchy applications (web apps, TUIs, and selected packages).\n# This removes all web "
  },
  {
    "path": "bin/omarchy-restart-app",
    "chars": 203,
    "preview": "#!/bin/bash\n\n# Restart an application by killing it and relaunching via uwsm.\n# Usage: omarchy-restart-app <application-"
  },
  {
    "path": "bin/omarchy-restart-bluetooth",
    "chars": 142,
    "preview": "#!/bin/bash\n\n# Unblock and restart the bluetooth service.\n\necho -e \"Unblocking bluetooth...\\n\"\nrfkill unblock bluetooth\n"
  },
  {
    "path": "bin/omarchy-restart-btop",
    "chars": 101,
    "preview": "#!/bin/bash\n\n# Reload btop configuration (used by the Omarchy theme switching).\n\npkill -SIGUSR2 btop\n"
  },
  {
    "path": "bin/omarchy-restart-hyprctl",
    "chars": 111,
    "preview": "#!/bin/bash\n\n# Reload hyprland configuration (used by the Omarchy theme switching).\n\nhyprctl reload >/dev/null\n"
  },
  {
    "path": "bin/omarchy-restart-hypridle",
    "chars": 115,
    "preview": "#!/bin/bash\n\n# Restart the hypridle service (used for idle detection and auto-lock).\n\nomarchy-restart-app hypridle\n"
  },
  {
    "path": "bin/omarchy-restart-hyprsunset",
    "chars": 123,
    "preview": "#!/bin/bash\n\n# Restart the hyprsunset service (used for blue light filtering/night light).\n\nomarchy-restart-app hyprsuns"
  },
  {
    "path": "bin/omarchy-restart-makima",
    "chars": 127,
    "preview": "#!/bin/bash\n\n# Restart makima - key remapping service for remapping Copilot key to Omarchy Menu\n\nsudo systemctl restart "
  },
  {
    "path": "bin/omarchy-restart-mako",
    "chars": 96,
    "preview": "#!/bin/bash\n\n# Reload mako configuration (used by the Omarchy theme switching).\n\nmakoctl reload\n"
  },
  {
    "path": "bin/omarchy-restart-opencode",
    "chars": 154,
    "preview": "#!/bin/bash\n\n# Reload opencode configuration (used by the Omarchy theme switching).\n\nif pgrep -x opencode >/dev/null; th"
  },
  {
    "path": "bin/omarchy-restart-pipewire",
    "chars": 190,
    "preview": "#!/bin/bash\n\n# Restart the PipeWire audio service to fix audio issues or apply new configuration.\n\necho -e \"Restarting p"
  },
  {
    "path": "bin/omarchy-restart-swayosd",
    "chars": 48,
    "preview": "#!/bin/bash\n\nomarchy-restart-app swayosd-server\n"
  },
  {
    "path": "bin/omarchy-restart-terminal",
    "chars": 255,
    "preview": "#!/bin/bash\n\nif [[ -f ~/.config/alacritty/alacritty.toml ]]; then\n  touch ~/.config/alacritty/alacritty.toml\nfi\n\nif pgre"
  },
  {
    "path": "bin/omarchy-restart-tmux",
    "chars": 140,
    "preview": "#!/bin/bash\n\n# Restart tmux if running with the latest configuration\n\nif pgrep -x tmux; then\n  tmux source-file ~/.confi"
  },
  {
    "path": "bin/omarchy-restart-walker",
    "chars": 649,
    "preview": "#!/bin/bash\n\nrestart_services() {\n  if systemctl --user is-enabled elephant.service &>/dev/null; then\n    systemctl --us"
  },
  {
    "path": "bin/omarchy-restart-waybar",
    "chars": 40,
    "preview": "#!/bin/bash\n\nomarchy-restart-app waybar\n"
  },
  {
    "path": "bin/omarchy-restart-wifi",
    "chars": 123,
    "preview": "#!/bin/bash\n\n# Unblock and restart the Wi-Fi service.\n\necho -e \"Unblocking wifi...\\n\"\nrfkill unblock wifi\nrfkill list wi"
  },
  {
    "path": "bin/omarchy-restart-xcompose",
    "chars": 156,
    "preview": "#!/bin/bash\n\n# Restart the XCompose input method service (fcitx5) to apply new compose key settings.\n\nomarchy-restart-ap"
  },
  {
    "path": "bin/omarchy-setup-dns",
    "chars": 1864,
    "preview": "#!/bin/bash\n\nlock_dns_to_resolved() {\n  for file in /etc/systemd/network/*.network; do\n    [[ -f $file ]] || continue\n  "
  },
  {
    "path": "bin/omarchy-setup-fido2",
    "chars": 3521,
    "preview": "#!/bin/bash\n\nset -e\n\nGREEN='\\033[0;32m'\nRED='\\033[0;31m'\nYELLOW='\\033[1;33m'\nNC='\\033[0m' # No Color\n\nprint_success() {\n"
  },
  {
    "path": "bin/omarchy-setup-fingerprint",
    "chars": 4009,
    "preview": "#!/bin/bash\n\nset -e\n\nGREEN='\\033[0;32m'\nRED='\\033[0;31m'\nYELLOW='\\033[1;33m'\nNC='\\033[0m' # No Color\n\nprint_success() {\n"
  },
  {
    "path": "bin/omarchy-setup-makima",
    "chars": 652,
    "preview": "#!/bin/bash\n\n# Setup makima - key remapping service for remapping Copilot key to Omarchy Menu\n\nCONFIG_FILE=\"$HOME/.confi"
  },
  {
    "path": "bin/omarchy-show-done",
    "chars": 251,
    "preview": "#!/bin/bash\n\n# Display a \"Done!\" message with a spinner and wait for user to press any key.\n# Used by various install sc"
  },
  {
    "path": "bin/omarchy-show-logo",
    "chars": 218,
    "preview": "#!/bin/bash\n\n# Display the Omarchy logo in the terminal using green color.\n# Used by various presentation scripts to sho"
  },
  {
    "path": "bin/omarchy-snapshot",
    "chars": 725,
    "preview": "#!/bin/bash\n\nset -e\n\nCOMMAND=\"$1\"\nOMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}\n\nif [[ -z $COMMAND ]]; then\n "
  },
  {
    "path": "bin/omarchy-state",
    "chars": 658,
    "preview": "#!/bin/bash\n\n# Manage persistent state files for Omarchy toggles and settings.\n# Usage: omarchy-state <set|clear> <state"
  },
  {
    "path": "bin/omarchy-sudo-keepalive",
    "chars": 320,
    "preview": "#!/bin/bash\n\n# Prompt for sudo once and keep the credential alive in the background.\n# Source this script so the trap ap"
  },
  {
    "path": "bin/omarchy-sudo-passwordless-toggle",
    "chars": 1894,
    "preview": "#!/bin/bash\n\n# Toggle passwordless sudo for the current user.\n# First run: enables passwordless sudo for 15 minutes (aft"
  },
  {
    "path": "bin/omarchy-sudo-reset",
    "chars": 226,
    "preview": "#!/bin/bash\n\n# Reset the sudo lockout/faillock for the current user.\n# This clears any failed authentication attempts th"
  },
  {
    "path": "bin/omarchy-swayosd-brightness",
    "chars": 457,
    "preview": "#!/bin/bash\n\n# Display brightness level using SwayOSD on the current monitor.\n# Usage: omarchy-swayosd-brightness <perce"
  },
  {
    "path": "bin/omarchy-swayosd-kbd-brightness",
    "chars": 471,
    "preview": "#!/bin/bash\n\n# Display keyboard brightness level using SwayOSD on the current monitor.\n# Usage: omarchy-swayosd-kbd-brig"
  },
  {
    "path": "bin/omarchy-system-logout",
    "chars": 422,
    "preview": "#!/bin/bash\n\n# Logout command that first closes all application windows (thus giving them a chance to save state),\n# the"
  },
  {
    "path": "bin/omarchy-system-reboot",
    "chars": 516,
    "preview": "#!/bin/bash\n\n# Reboot command that first closes all application windows (thus giving them a chance to save state).\n# Thi"
  },
  {
    "path": "bin/omarchy-system-shutdown",
    "chars": 522,
    "preview": "#!/bin/bash\n\n# Shutdown command that first closes all application windows (thus giving them a chance to save state).\n# T"
  },
  {
    "path": "bin/omarchy-theme-bg-install",
    "chars": 232,
    "preview": "#!/bin/bash\n\nCURRENT_THEME_NAME=$(cat \"$HOME/.config/omarchy/current/theme.name\")\nTHEME_USER_BACKGROUNDS=\"$HOME/.config/"
  },
  {
    "path": "bin/omarchy-theme-bg-next",
    "chars": 1589,
    "preview": "#!/bin/bash\n\n# Cycles through the background images available\n\nTHEME_NAME=$(cat \"$HOME/.config/omarchy/current/theme.nam"
  },
  {
    "path": "bin/omarchy-theme-bg-set",
    "chars": 470,
    "preview": "#!/bin/bash\n\n# Sets the specified image as the current background\n\nif [[ -z $1 ]]; then\n  echo \"Usage: omarchy-theme-bg-"
  },
  {
    "path": "bin/omarchy-theme-current",
    "chars": 200,
    "preview": "#!/bin/bash\n\nTHEME_NAME_PATH=\"$HOME/.config/omarchy/current/theme.name\"\n\nif [[ -f $THEME_NAME_PATH ]]; then\n  cat $THEME"
  },
  {
    "path": "bin/omarchy-theme-install",
    "chars": 871,
    "preview": "#!/bin/bash\n\n# omarchy-theme-install: Install a new theme from a git repo for Omarchy\n# Usage: omarchy-theme-install <gi"
  },
  {
    "path": "bin/omarchy-theme-list",
    "chars": 291,
    "preview": "#!/bin/bash\n\n{\n  find ~/.config/omarchy/themes/ -mindepth 1 -maxdepth 1 \\( -type d -o -type l \\) -printf '%f\\n'\n  find \""
  },
  {
    "path": "bin/omarchy-theme-refresh",
    "chars": 206,
    "preview": "#!/bin/bash\n\n# Refresh the current theme from its templates.\n\nTHEME_NAME_PATH=\"$HOME/.config/omarchy/current/theme.name\""
  },
  {
    "path": "bin/omarchy-theme-remove",
    "chars": 893,
    "preview": "#!/bin/bash\n\n# omarchy-theme-remove: Remove a theme from Omarchy by name\n# Usage: omarchy-theme-remove <theme-name>\n\nif "
  },
  {
    "path": "bin/omarchy-theme-set",
    "chars": 1668,
    "preview": "#!/bin/bash\n\nif [[ -z $1 ]]; then\n  echo \"Usage: omarchy-theme-set <theme-name>\"\n  exit 1\nfi\n\nCURRENT_THEME_PATH=\"$HOME/"
  },
  {
    "path": "bin/omarchy-theme-set-browser",
    "chars": 888,
    "preview": "#!/bin/bash\n\nCHROMIUM_THEME=~/.config/omarchy/current/theme/chromium.theme\n\nif omarchy-cmd-present chromium || omarchy-c"
  },
  {
    "path": "bin/omarchy-theme-set-gnome",
    "chars": 666,
    "preview": "#!/bin/bash\n\n# Change gnome modes\nif [[ -f ~/.config/omarchy/current/theme/light.mode ]]; then\n  gsettings set org.gnome"
  },
  {
    "path": "bin/omarchy-theme-set-keyboard",
    "chars": 80,
    "preview": "#!/bin/bash\n\nomarchy-theme-set-keyboard-asus-rog\nomarchy-theme-set-keyboard-f16\n"
  },
  {
    "path": "bin/omarchy-theme-set-keyboard-asus-rog",
    "chars": 176,
    "preview": "#!/bin/bash\n\nASUSCTL_THEME=~/.config/omarchy/current/theme/keyboard.rgb\n\nif omarchy-cmd-present asusctl; then\n  asusctl "
  },
  {
    "path": "bin/omarchy-theme-set-keyboard-f16",
    "chars": 685,
    "preview": "#!/bin/bash\n\nFRAMEWORK16_THEME=~/.config/omarchy/current/theme/keyboard.rgb\n\nif omarchy-cmd-present qmk_hid && [[ -f $FR"
  },
  {
    "path": "bin/omarchy-theme-set-obsidian",
    "chars": 780,
    "preview": "#!/bin/bash\n\n# Sync Omarchy theme to all Obsidian vaults\n\nCURRENT_THEME_DIR=\"$HOME/.config/omarchy/current/theme\"\n\n[[ -f"
  },
  {
    "path": "bin/omarchy-theme-set-templates",
    "chars": 1635,
    "preview": "#!/bin/bash\n\nTEMPLATES_DIR=\"$OMARCHY_PATH/default/themed\"\nUSER_TEMPLATES_DIR=\"$HOME/.config/omarchy/themed\"\nNEXT_THEME_D"
  },
  {
    "path": "bin/omarchy-theme-set-vscode",
    "chars": 1548,
    "preview": "#!/bin/bash\n\n# Sync Omarchy theme to VS Code, VSCodium, and Cursor\n\nVS_CODE_THEME=\"$HOME/.config/omarchy/current/theme/v"
  },
  {
    "path": "bin/omarchy-theme-update",
    "chars": 199,
    "preview": "#!/bin/bash\n\nfor dir in ~/.config/omarchy/themes/*/; do\n  if [[ -d $dir ]] && [[ ! -L ${dir%/} ]] && [[ -d $dir/.git ]];"
  },
  {
    "path": "bin/omarchy-toggle-hybrid-gpu",
    "chars": 2105,
    "preview": "#!/bin/bash\n\n# Toggle dedicated vs integrated GPU mode via supergfxd (for hybrid gpu laptops, like Asus G14).\n# Requires"
  },
  {
    "path": "bin/omarchy-toggle-idle",
    "chars": 248,
    "preview": "#!/bin/bash\n\nif pgrep -x hypridle >/dev/null; then\n  pkill -x hypridle\n  notify-send \"󱫖    Stop locking computer when id"
  }
]

// ... and 656 more files (download for full content)

About this extraction

This page contains the full source code of the basecamp/omarchy GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 856 files (555.4 KB), approximately 192.3k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!