diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 0000000..dc59a8e --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,64 @@ +# Nomarchy - A NixOS-based distribution with Omarchy flavour - Agent Build Blueprint + +## System Architecture Overview +You are tasked with generating a NixOS-based Linux distribution monorepo that perfectly replicates the Omarchy Wayland workflow. The architecture relies on a strictly declarative Nix Flake setup, separated into System-level configurations (NixOS) and User-level configurations (Standalone Home Manager). + +The goal is to provide an upstream repository that users can import into their own downstream `flake.nix` files, allowing them to keep the core Omarchy aesthetic while maintaining their own custom packages and development environments. + +## Directory Structure +Generate the repository using the following exact structure: + +* `flake.nix` (Master entry point) +* `installer/install-nomarchy.sh` (Bash/Gum interactive installer) +* `installer/disko-ext4.nix` (Standard drive layout) +* `installer/disko-btrfs-luks.nix` (Encrypted snapshot layout) +* `modules/system/default.nix` (Core OS module) +* `modules/system/plymouth.nix` (Boot splash) +* `modules/system/sddm.nix` (Display manager logic) +* `modules/home/default.nix` (Core Nomarchy user environment) +* `modules/home/hyprland.nix` (Window manager) +* `modules/home/waybar.nix` (Status bar) +* `modules/home/walker.nix` (App launcher and menus) +* `modules/home/theme-switcher.nix` (State file and scripts) +* `themes/nomarchy-palettes.nix` (Base16 Nix-colors dictionaries) +* `hosts/live-iso.nix` (Bootable USB configuration) + +## Core Components & Logic + +### 1. The Master Flake (`flake.nix`) +* **Inputs required:** `nixpkgs` (unstable), `nixos-hardware`, `disko`, `home-manager`, `nix-colors`. +* **Outputs required:** * `nixosModules.system`: Points to `modules/system`. + * `nixosModules.home`: Points to `modules/home`. + * `nixosConfigurations.installerIso`: Generates a bootable ISO importing standard minimal CD modules, adding `git`, `gum`, and `disko` to system packages, and copying `install-nomarchy.sh` to `/etc/`. + +### 2. The Interactive Installer (`installer/install-nomarchy.sh`) +Write a Bash script utilizing `gum` for UI prompts. The flow must execute as follows: +1. **Hardware Detection:** Read `/sys/class/dmi/id/product_name` and map it to a generic or specific `nixos-hardware` flake module. +2. **Storage Setup:** Prompt user for target drive. Prompt to choose between "Standard Ext4" or "Encrypted BTRFS (LUKS2)". Execute the corresponding Disko `.nix` file. +3. **User Details:** Prompt for target username. +4. **Login Preferences:** Prompt to choose between "SDDM Auto-login" (default) or "Require Password". Generate `/mnt/etc/nixos/login-preference.nix` based on the choice. +5. **Hardware Config:** Run `nixos-generate-config` into `/mnt/etc/nixos/`. +6. **Handoff Flake Generation:** Write a new `/mnt/etc/nixos/flake.nix` that imports the upstream Nomarchy distribution, the hardware config, the login preference, and sets up the user account. +7. **Version Control:** Initialize a git repository in `/mnt/etc/nixos/`, add files, and make an initial commit. +8. **Execution:** Run `nixos-install --flake /mnt/etc/nixos#default --no-root-passwd`. + +### 3. Disko Configurations +* **Ext4:** Single EFI partition, single Ext4 root partition. +* **BTRFS+LUKS:** EFI partition, LUKS2 encrypted container holding a BTRFS filesystem. Subvolumes must include `@` (root), `@home` (user data), `@nix` (Nix store), and `@log` (logs). + +### 4. System Modules (`modules/system/`) +* **Boot:** Enable `systemd` initrd. Enable Plymouth with a custom Nomarchy theme derivation. Silence kernel logs completely (`quiet splash loglevel=3`). +* **Login:** Enable SDDM with Wayland support. Read the generated `login-preference.nix` to conditionally enable `autoLogin`. Enable Hyprland system-level dependencies. + +### 5. Home Manager & Theming (`modules/home/`) +* **Architecture:** Must remain standalone (not built into the system NixOS config). +* **Aliases:** Define `sys-update` (`sudo nixos-rebuild switch`) and `env-update` (`home-manager switch`) in `home.shellAliases`. +* **Theme Engine:** Import `nix-colors`. Read a local untracked/state variable file (`~/.config/home-manager/theme-state.nix`) to determine the active theme from `nomarchy-palettes.nix`. +* **Styling:** Inject `nix-colors` variables (e.g., `${config.colorScheme.palette.base00}`) into Hyprland borders, Waybar CSS, Alacritty colors, and Walker CSS. +* **Walker & Scripting:** Configure Walker to run as a service. Write a `pkgs.writeShellScriptBin` script called `nomarchy-theme-selector` that uses Walker in `dmenu` mode to select a theme, overwrites `theme-state.nix`, stages it in git, and runs `env-update` to hot-reload the UI. Map this script to `Super + Alt + Space` in Hyprland. + +## Execution Directives for Agent +1. Initialize the git repository. +2. Create the directory skeleton. +3. Generate the code for each file strictly adhering to declarative Nix principles, except for the installer script. +4. Ensure all Base16 variables used in Waybar and Walker CSS strings are properly escaped. diff --git a/README.md b/README.md index edaca9c..aaf8842 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,59 @@ # Nomarchy -NixOS based distribution with Omarchy flavour \ No newline at end of file +**Nomarchy** is a professional-grade NixOS-based distribution monorepo that replicates and enhances the Wayland workflow. It is built on a strictly declarative Nix Flake setup, providing a unified aesthetic and robust functionality while allowing users complete freedom to customize their environment. + +## 🚀 Key Features + +- **Purely Declarative:** Everything from system themes and fonts to wallpapers is managed via Nix. +- **Intelligent Hardware Detection:** The installer automatically identifies your hardware (CPU vendor, specific laptop models like XPS, Framework, T2 Mac) and applies optimized `nixos-hardware` profiles. +- **Modular Downstream Architecture:** Your personal customizations live in separate files (`system.nix`, `home.nix`), keeping the core "Nomarchy engine" clean and easily updatable. +- **Robust Scripting:** 150+ utility scripts are bundled with explicitly wrapped dependencies, ensuring they work regardless of your global system state. +- **Dynamic Theming:** Seamlessly switch between 20+ Base16 themes using `nomarchy-theme-selector` with automatic wallpaper and font synchronization. +- **CI/CD Ready:** Automated ISO building via GitHub Actions ensures a verified installer is always available. + +## 📦 Installation + +### 1. Build the Installer ISO +You can build the ISO locally using the provided script: +```bash +./bin/nomarchy-build-iso +``` +Alternatively, download the latest ISO from the "Actions" tab in this repository. + +### 2. Run the Installer +Once booted into the Live ISO, run the interactive installer: +```bash +/etc/install-nomarchy.sh +``` +The installer will guide you through hardware detection, disk partitioning (Ext4 or Encrypted BTRFS), and user setup. + +## 🛠️ Customization (Downstream) + +After installation, your configuration is located in `/etc/nixos/`. To customize your system without interfering with Nomarchy core: + +- **System-level:** Add NixOS modules or extra packages to `/etc/nixos/system.nix`. +- **User-level:** Add Home Manager modules or dotfiles to `/etc/nixos/home.nix`. + +To apply changes: +```bash +nomarchy-update +``` + +## 🔄 Updating + +To pull the latest Nomarchy improvements and update your system: +```bash +nomarchy-update +``` +This script will update flake inputs, rebuild your NixOS system, and switch your Home Manager environment. + +## 🎨 Controls + +- `Super + Alt + Space`: Theme Selector +- `Super + Ctrl + Space`: Font Selector +- `Super + Shift + Space`: Wallpaper Selector +- `Super + Return`: Terminal (Alacritty) +- `Super + Q`: Kill Active Window + +--- +*Built with ❤️ using NixOS, Hyprland, and Stylix.* diff --git a/applications/Alacritty.desktop b/applications/Alacritty.desktop new file mode 100644 index 0000000..f53c813 --- /dev/null +++ b/applications/Alacritty.desktop @@ -0,0 +1,21 @@ +[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 diff --git a/applications/hidden/avahi-discover.desktop b/applications/hidden/avahi-discover.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/avahi-discover.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/bssh.desktop b/applications/hidden/bssh.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/bssh.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/btop.desktop b/applications/hidden/btop.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/btop.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/bvnc.desktop b/applications/hidden/bvnc.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/bvnc.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/cmake-gui.desktop b/applications/hidden/cmake-gui.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/cmake-gui.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/cups.desktop b/applications/hidden/cups.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/cups.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/dropbox.desktop b/applications/hidden/dropbox.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/dropbox.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/electron34.desktop b/applications/hidden/electron34.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/electron34.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/electron36.desktop b/applications/hidden/electron36.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/electron36.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/electron37.desktop b/applications/hidden/electron37.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/electron37.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/fcitx5-configtool.desktop b/applications/hidden/fcitx5-configtool.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/fcitx5-configtool.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/fcitx5-wayland-launcher.desktop b/applications/hidden/fcitx5-wayland-launcher.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/fcitx5-wayland-launcher.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/java-java-openjdk.desktop b/applications/hidden/java-java-openjdk.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/java-java-openjdk.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/jconsole-java-openjdk.desktop b/applications/hidden/jconsole-java-openjdk.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/jconsole-java-openjdk.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/jshell-java-openjdk.desktop b/applications/hidden/jshell-java-openjdk.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/jshell-java-openjdk.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/kbd-layout-viewer5.desktop b/applications/hidden/kbd-layout-viewer5.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/kbd-layout-viewer5.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/kcm_fcitx5.desktop b/applications/hidden/kcm_fcitx5.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/kcm_fcitx5.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/kcm_kaccounts.desktop b/applications/hidden/kcm_kaccounts.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/kcm_kaccounts.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/kvantummanager.desktop b/applications/hidden/kvantummanager.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/kvantummanager.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/limine-snapper-restore.desktop b/applications/hidden/limine-snapper-restore.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/limine-snapper-restore.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/org.fcitx.Fcitx5.desktop b/applications/hidden/org.fcitx.Fcitx5.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/org.fcitx.Fcitx5.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/org.fcitx.fcitx5-config-qt.desktop b/applications/hidden/org.fcitx.fcitx5-config-qt.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/org.fcitx.fcitx5-config-qt.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/org.fcitx.fcitx5-migrator.desktop b/applications/hidden/org.fcitx.fcitx5-migrator.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/org.fcitx.fcitx5-migrator.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/org.fcitx.fcitx5-qt5-gui-wrapper.desktop b/applications/hidden/org.fcitx.fcitx5-qt5-gui-wrapper.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/org.fcitx.fcitx5-qt5-gui-wrapper.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/org.fcitx.fcitx5-qt6-gui-wrapper.desktop b/applications/hidden/org.fcitx.fcitx5-qt6-gui-wrapper.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/org.fcitx.fcitx5-qt6-gui-wrapper.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/qv4l2.desktop b/applications/hidden/qv4l2.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/qv4l2.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/qvidcap.desktop b/applications/hidden/qvidcap.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/qvidcap.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/uuctl.desktop b/applications/hidden/uuctl.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/uuctl.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/wiremix.desktop b/applications/hidden/wiremix.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/wiremix.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/xgps.desktop b/applications/hidden/xgps.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/xgps.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/xgpsspeed.desktop b/applications/hidden/xgpsspeed.desktop new file mode 100644 index 0000000..e1e3e17 --- /dev/null +++ b/applications/hidden/xgpsspeed.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/icons/Basecamp.png b/applications/icons/Basecamp.png new file mode 100644 index 0000000..3edec48 Binary files /dev/null and b/applications/icons/Basecamp.png differ diff --git a/applications/icons/ChatGPT.png b/applications/icons/ChatGPT.png new file mode 100644 index 0000000..9907eaf Binary files /dev/null and b/applications/icons/ChatGPT.png differ diff --git a/applications/icons/Discord.png b/applications/icons/Discord.png new file mode 100644 index 0000000..a82dbc6 Binary files /dev/null and b/applications/icons/Discord.png differ diff --git a/applications/icons/Disk Usage.png b/applications/icons/Disk Usage.png new file mode 100644 index 0000000..6cc55ba Binary files /dev/null and b/applications/icons/Disk Usage.png differ diff --git a/applications/icons/Docker.png b/applications/icons/Docker.png new file mode 100644 index 0000000..aeadd22 Binary files /dev/null and b/applications/icons/Docker.png differ diff --git a/applications/icons/Figma.png b/applications/icons/Figma.png new file mode 100644 index 0000000..62ffa90 Binary files /dev/null and b/applications/icons/Figma.png differ diff --git a/applications/icons/Fizzy.png b/applications/icons/Fizzy.png new file mode 100644 index 0000000..c68957e Binary files /dev/null and b/applications/icons/Fizzy.png differ diff --git a/applications/icons/GitHub.png b/applications/icons/GitHub.png new file mode 100644 index 0000000..5a4295c Binary files /dev/null and b/applications/icons/GitHub.png differ diff --git a/applications/icons/Google Contacts.png b/applications/icons/Google Contacts.png new file mode 100644 index 0000000..6d99dc8 Binary files /dev/null and b/applications/icons/Google Contacts.png differ diff --git a/applications/icons/Google Maps.png b/applications/icons/Google Maps.png new file mode 100644 index 0000000..f4fc834 Binary files /dev/null and b/applications/icons/Google Maps.png differ diff --git a/applications/icons/Google Messages.png b/applications/icons/Google Messages.png new file mode 100644 index 0000000..bc911a5 Binary files /dev/null and b/applications/icons/Google Messages.png differ diff --git a/applications/icons/Google Photos.png b/applications/icons/Google Photos.png new file mode 100644 index 0000000..8b8c642 Binary files /dev/null and b/applications/icons/Google Photos.png differ diff --git a/applications/icons/HEY.png b/applications/icons/HEY.png new file mode 100644 index 0000000..3ac92d9 Binary files /dev/null and b/applications/icons/HEY.png differ diff --git a/applications/icons/WhatsApp.png b/applications/icons/WhatsApp.png new file mode 100644 index 0000000..10ecdfb Binary files /dev/null and b/applications/icons/WhatsApp.png differ diff --git a/applications/icons/X.png b/applications/icons/X.png new file mode 100644 index 0000000..22fe698 Binary files /dev/null and b/applications/icons/X.png differ diff --git a/applications/icons/YouTube.png b/applications/icons/YouTube.png new file mode 100644 index 0000000..46ed4ca Binary files /dev/null and b/applications/icons/YouTube.png differ diff --git a/applications/icons/Zoom.png b/applications/icons/Zoom.png new file mode 100644 index 0000000..622db52 Binary files /dev/null and b/applications/icons/Zoom.png differ diff --git a/applications/icons/imv.png b/applications/icons/imv.png new file mode 100644 index 0000000..f9cac35 Binary files /dev/null and b/applications/icons/imv.png differ diff --git a/applications/icons/windows.png b/applications/icons/windows.png new file mode 100644 index 0000000..ce7b366 Binary files /dev/null and b/applications/icons/windows.png differ diff --git a/applications/imv.desktop b/applications/imv.desktop new file mode 100644 index 0000000..293afc8 --- /dev/null +++ b/applications/imv.desktop @@ -0,0 +1,8 @@ +[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; diff --git a/applications/mpv.desktop b/applications/mpv.desktop new file mode 100644 index 0000000..776e2c9 --- /dev/null +++ b/applications/mpv.desktop @@ -0,0 +1,51 @@ +[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;إم بي في;ام بي في;وسائط;مشغل;فيديو;مرئية;صوتي;تلفاز; diff --git a/applications/typora.desktop b/applications/typora.desktop new file mode 100644 index 0000000..c1af035 --- /dev/null +++ b/applications/typora.desktop @@ -0,0 +1,10 @@ +[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; + diff --git a/bin/nomarchy-battery-capacity b/bin/nomarchy-battery-capacity new file mode 100755 index 0000000..341daed --- /dev/null +++ b/bin/nomarchy-battery-capacity @@ -0,0 +1,11 @@ +#!/bin/bash + +# Returns the battery full capacity in Wh (rounded to whole number). +# Used by nomarchy-battery-status for displaying battery capacity. + +battery_info=$(upower -i $(upower -e | grep BAT)) + +echo "$battery_info" | awk '/energy-full:/ { + printf "%d", $2 + exit +}' diff --git a/bin/nomarchy-battery-monitor b/bin/nomarchy-battery-monitor new file mode 100755 index 0000000..a6907ba --- /dev/null +++ b/bin/nomarchy-battery-monitor @@ -0,0 +1,24 @@ +#!/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/nomarchy_battery_notified" +BATTERY_LEVEL=$(nomarchy-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 + nomarchy-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 diff --git a/bin/nomarchy-battery-present b/bin/nomarchy-battery-present new file mode 100755 index 0000000..2b052a7 --- /dev/null +++ b/bin/nomarchy-battery-present @@ -0,0 +1,13 @@ +#!/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 diff --git a/bin/nomarchy-battery-remaining b/bin/nomarchy-battery-remaining new file mode 100755 index 0000000..26ea718 --- /dev/null +++ b/bin/nomarchy-battery-remaining @@ -0,0 +1,9 @@ +#!/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 +}' diff --git a/bin/nomarchy-battery-remaining-time b/bin/nomarchy-battery-remaining-time new file mode 100755 index 0000000..906d2ab --- /dev/null +++ b/bin/nomarchy-battery-remaining-time @@ -0,0 +1,25 @@ +#!/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 +}' diff --git a/bin/nomarchy-battery-status b/bin/nomarchy-battery-status new file mode 100755 index 0000000..3674bd3 --- /dev/null +++ b/bin/nomarchy-battery-status @@ -0,0 +1,28 @@ +#!/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=$(nomarchy-battery-remaining-time) +capacity=$(nomarchy-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 diff --git a/bin/nomarchy-branch-set b/bin/nomarchy-branch-set new file mode 100755 index 0000000..9c053d1 --- /dev/null +++ b/bin/nomarchy-branch-set @@ -0,0 +1,17 @@ +#!/bin/bash + +# Set the branch for Nomarchy's git repository. + +if (($# == 0)); then + echo "Usage: nomarchy-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 diff --git a/bin/nomarchy-brightness-display b/bin/nomarchy-brightness-display new file mode 100755 index 0000000..1d04bfd --- /dev/null +++ b/bin/nomarchy-brightness-display @@ -0,0 +1,21 @@ +#!/bin/bash + +# Adjust brightness on the most likely display device. +# Usage: nomarchy-brightness-display + +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. +nomarchy-swayosd-brightness "$(brightnessctl -d "$device" -m | cut -d',' -f4 | tr -d '%')" diff --git a/bin/nomarchy-brightness-display-apple b/bin/nomarchy-brightness-display-apple new file mode 100755 index 0000000..f3a937d --- /dev/null +++ b/bin/nomarchy-brightness-display-apple @@ -0,0 +1,12 @@ +#!/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}')" + nomarchy-swayosd-brightness "$(( value * 100 / 60000 ))" +fi diff --git a/bin/nomarchy-brightness-keyboard b/bin/nomarchy-brightness-keyboard new file mode 100755 index 0000000..ded5590 --- /dev/null +++ b/bin/nomarchy-brightness-keyboard @@ -0,0 +1,42 @@ +#!/bin/bash + +# Adjust keyboard backlight brightness using available steps. +# Usage: nomarchy-brightness-keyboard + +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)) +nomarchy-swayosd-kbd-brightness "$percent" diff --git a/bin/nomarchy-build-iso b/bin/nomarchy-build-iso new file mode 100755 index 0000000..e411312 --- /dev/null +++ b/bin/nomarchy-build-iso @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Build the Nomarchy Installer ISO declaratively using the flake. + +echo "Building Nomarchy Installer ISO..." + +# The output will be a symlink named 'result' in the current directory +nix build .#nixosConfigurations.installerIso.config.system.build.isoImage + +if [ $? -eq 0 ]; then + ISO_PATH=$(readlink -f result/iso/*.iso) + echo "Success! ISO built at: $ISO_PATH" + echo "You can now burn this to a USB drive using 'dd' or 'etcher'." +else + echo "Error: ISO build failed." + exit 1 +fi diff --git a/bin/nomarchy-channel-set b/bin/nomarchy-channel-set new file mode 100755 index 0000000..5cf0dfe --- /dev/null +++ b/bin/nomarchy-channel-set @@ -0,0 +1,31 @@ +#!/bin/bash + +# Set the Nomarchy 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 Nomarchy developers +# and people with a lot of experience managing Linux systems. + +if (($# == 0)); then + echo "Usage: nomarchy-channel-set [stable|rc|edge|dev]" + exit 1 +else + channel="$1" +fi + +case "$channel" in +"stable") nomarchy-branch-set "master" && nomarchy-refresh-pacman "stable" ;; +"rc") nomarchy-branch-set "rc" && nomarchy-refresh-pacman "rc" ;; +"edge") nomarchy-branch-set "master" && nomarchy-refresh-pacman "edge" ;; +"dev") nomarchy-branch-set "dev" && nomarchy-refresh-pacman "edge" ;; +*) echo "Unknown channel: $channel"; exit 1; ;; +esac + +nomarchy-update -y diff --git a/bin/nomarchy-cmd-audio-switch b/bin/nomarchy-cmd-audio-switch new file mode 100755 index 0000000..1cb5108 --- /dev/null +++ b/bin/nomarchy-cmd-audio-switch @@ -0,0 +1,66 @@ +#!/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" diff --git a/bin/nomarchy-cmd-first-run b/bin/nomarchy-cmd-first-run new file mode 100755 index 0000000..a6b890c --- /dev/null +++ b/bin/nomarchy-cmd-first-run @@ -0,0 +1,22 @@ +#!/bin/bash + +# Finish the installation of Nomarchy with items that can only be done after logging in. + +set -e + +FIRST_RUN_MODE=~/.local/state/nomarchy/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 diff --git a/bin/nomarchy-cmd-missing b/bin/nomarchy-cmd-missing new file mode 100755 index 0000000..6f14ec2 --- /dev/null +++ b/bin/nomarchy-cmd-missing @@ -0,0 +1,11 @@ +#!/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 diff --git a/bin/nomarchy-cmd-present b/bin/nomarchy-cmd-present new file mode 100755 index 0000000..f1e96be --- /dev/null +++ b/bin/nomarchy-cmd-present @@ -0,0 +1,9 @@ +#!/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 diff --git a/bin/nomarchy-cmd-screenrecord b/bin/nomarchy-cmd-screenrecord new file mode 100755 index 0000000..7c84c70 --- /dev/null +++ b/bin/nomarchy-cmd-screenrecord @@ -0,0 +1,184 @@ +#!/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/nomarchy-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 diff --git a/bin/nomarchy-cmd-screensaver b/bin/nomarchy-cmd-screensaver new file mode 100755 index 0000000..81eee58 --- /dev/null +++ b/bin/nomarchy-cmd-screensaver @@ -0,0 +1,36 @@ +#!/bin/bash + +# Run the Nomarchy screensaver using random effects from TTE. + +screensaver_in_focus() { + hyprctl activewindow -j | jq -e '.class == "org.nomarchy.screensaver"' >/dev/null 2>&1 +} + +exit_screensaver() { + hyprctl keyword cursor:invisible false &>/dev/null || true + pkill -x tte 2>/dev/null + pkill -f org.nomarchy.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/nomarchy/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 diff --git a/bin/nomarchy-cmd-screenshot b/bin/nomarchy-cmd-screenshot new file mode 100755 index 0000000..16060e9 --- /dev/null +++ b/bin/nomarchy-cmd-screenshot @@ -0,0 +1,133 @@ +#!/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= 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 diff --git a/bin/nomarchy-cmd-share b/bin/nomarchy-cmd-share new file mode 100755 index 0000000..c830930 --- /dev/null +++ b/bin/nomarchy-cmd-share @@ -0,0 +1,46 @@ +#!/bin/bash + +# Share clipboard, file, or folder using LocalSend. Bound to Super + Ctrl + S by default. + +if (($# == 0)); then + echo "Usage: nomarchy-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 diff --git a/bin/nomarchy-cmd-terminal-cwd b/bin/nomarchy-cmd-terminal-cwd new file mode 100755 index 0000000..81fb91c --- /dev/null +++ b/bin/nomarchy-cmd-terminal-cwd @@ -0,0 +1,22 @@ +#!/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 diff --git a/bin/nomarchy-config-direct-boot b/bin/nomarchy-config-direct-boot new file mode 100755 index 0000000..92c8f5c --- /dev/null +++ b/bin/nomarchy-config-direct-boot @@ -0,0 +1,45 @@ +#!/bin/bash + +# Add an EFI boot entry for the Nomarchy 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 "nomarchy*.efi" -printf "%f\n" 2>/dev/null | head -1) + +if [[ -z $uki_file ]]; then + echo "Error: No Nomarchy 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 "Nomarchy" \ + --loader "\\EFI\\Linux\\$uki_file" +fi diff --git a/bin/nomarchy-debug b/bin/nomarchy-debug new file mode 100755 index 0000000..57a4e4c --- /dev/null +++ b/bin/nomarchy-debug @@ -0,0 +1,95 @@ +#!/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: nomarchy-debug [--no-sudo] [--print]" + exit 1 + ;; + esac +done + +LOG_FILE="/tmp/nomarchy-debug.log" + +if [[ $NO_SUDO = "true" ]]; then + DMESG_OUTPUT="(skipped - --no-sudo flag used)" +else + DMESG_OUTPUT="$(sudo dmesg)" +fi + +cat > "$LOG_FILE" </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" "./nomarchy-debug.log" + echo "✓ Log saved to $(pwd)/nomarchy-debug.log" + ;; +esac diff --git a/bin/nomarchy-dev-add-migration b/bin/nomarchy-dev-add-migration new file mode 100755 index 0000000..7780cbb --- /dev/null +++ b/bin/nomarchy-dev-add-migration @@ -0,0 +1,14 @@ +#!/bin/bash + +# Creates a new Nomarchy migration named after the unix timestamp of the last commit. +# Only intended for Nomarchy developers. + +cd ~/.local/share/nomarchy +migration_file="$HOME/.local/share/nomarchy/migrations/$(git log -1 --format=%cd --date=unix).sh" +touch $migration_file + +if [[ $1 != "--no-edit" ]]; then + nvim $migration_file +fi + +echo $migration_file diff --git a/bin/nomarchy-drive-info b/bin/nomarchy-drive-info new file mode 100755 index 0000000..35c4056 --- /dev/null +++ b/bin/nomarchy-drive-info @@ -0,0 +1,49 @@ +#!/bin/bash + +# Returns drive information about a given volumne, like /dev/nvme0, which is used by nomarchy-drive-select. + +if (($# == 0)); then + echo "Usage: nomarchy-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" diff --git a/bin/nomarchy-drive-select b/bin/nomarchy-drive-select new file mode 100755 index 0000000..20ac635 --- /dev/null +++ b/bin/nomarchy-drive-select @@ -0,0 +1,18 @@ +#!/bin/bash + +# Select a drive from a list with info that includes space and brand. Used by nomarchy-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+="$(nomarchy-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}' diff --git a/bin/nomarchy-drive-set-password b/bin/nomarchy-drive-set-password new file mode 100755 index 0000000..350d6a5 --- /dev/null +++ b/bin/nomarchy-drive-set-password @@ -0,0 +1,23 @@ +#!/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 <<" +fi diff --git a/bin/nomarchy-haptic-touchpad b/bin/nomarchy-haptic-touchpad new file mode 100755 index 0000000..f800f0d --- /dev/null +++ b/bin/nomarchy-haptic-touchpad @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 + +"""Haptic feedback daemon for Synaptics touchpads with Manual Trigger. + +Monitors touchpad button press events and sends haptic pulses via HID +feature reports. Required because the kernel's HID haptic subsystem only +supports Auto Trigger with waveform enumeration, not the simpler Manual +Trigger protocol used by these Synaptics touchpads. +""" + +import fcntl, glob, os, struct, sys + +VENDOR = "06CB" +PRODUCT = "D01A" +REPORT_ID = 0x37 +INTENSITY = 40 # 0-100 + +# input_event: struct timeval (16 bytes on 64-bit) + type(H) + code(H) + value(i) +EVENT_FORMAT = "llHHi" +EVENT_SIZE = struct.calcsize(EVENT_FORMAT) +EV_KEY = 0x01 +BTN_LEFT = 272 +BTN_RIGHT = 273 +BTN_MIDDLE = 274 + +# ioctl: HIDIOCSFEATURE(len) = _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len) +def HIDIOCSFEATURE(length): + return 0xC0000000 | (length << 16) | (ord("H") << 8) | 0x06 + + +def find_hidraw(): + for path in sorted(glob.glob("/sys/class/hidraw/hidraw*")): + uevent = os.path.join(path, "device", "uevent") + try: + with open(uevent) as f: + content = f.read().upper() + if f"0000{VENDOR}" in content and f"0000{PRODUCT}" in content: + return os.path.join("/dev", os.path.basename(path)) + except OSError: + continue + return None + + +def find_touchpad_event(): + for path in sorted(glob.glob("/sys/class/input/event*/device/name")): + try: + with open(path) as f: + name = f.read().strip().upper() + if VENDOR in name and PRODUCT in name and "TOUCHPAD" in name: + event = path.split("/")[-3] + return os.path.join("/dev/input", event) + except OSError: + continue + return None + + +def main(): + hidraw = find_hidraw() + if not hidraw: + print("No Synaptics haptic touchpad hidraw device found", file=sys.stderr) + sys.exit(1) + + event = find_touchpad_event() + if not event: + print("No Synaptics haptic touchpad input device found", file=sys.stderr) + sys.exit(1) + + print(f"Haptic touchpad: hidraw={hidraw} input={event} intensity={INTENSITY}", flush=True) + + haptic_report = struct.pack("BB", REPORT_ID, INTENSITY) + ioctl_req = HIDIOCSFEATURE(len(haptic_report)) + + hidraw_fd = os.open(hidraw, os.O_RDWR) + event_fd = os.open(event, os.O_RDONLY) + + try: + while True: + data = os.read(event_fd, EVENT_SIZE) + if len(data) < EVENT_SIZE: + continue + _, _, ev_type, code, value = struct.unpack(EVENT_FORMAT, data) + if ev_type == EV_KEY and code in (BTN_LEFT, BTN_RIGHT, BTN_MIDDLE) and value == 1: + try: + fcntl.ioctl(hidraw_fd, ioctl_req, haptic_report) + except OSError: + pass + except KeyboardInterrupt: + pass + finally: + os.close(event_fd) + os.close(hidraw_fd) + + +if __name__ == "__main__": + main() diff --git a/bin/nomarchy-hibernation-available b/bin/nomarchy-hibernation-available new file mode 100755 index 0000000..02740a5 --- /dev/null +++ b/bin/nomarchy-hibernation-available @@ -0,0 +1,18 @@ +#!/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/nomarchy_resume.conf ]]; then + exit 0 +else + exit 1 +fi diff --git a/bin/nomarchy-hibernation-remove b/bin/nomarchy-hibernation-remove new file mode 100755 index 0000000..3cb5127 --- /dev/null +++ b/bin/nomarchy-hibernation-remove @@ -0,0 +1,59 @@ +#!/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/nomarchy_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" diff --git a/bin/nomarchy-hibernation-setup b/bin/nomarchy-hibernation-setup new file mode 100755 index 0000000..8ba69d7 --- /dev/null +++ b/bin/nomarchy-hibernation-setup @@ -0,0 +1,102 @@ +#!/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/nomarchy_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 + nomarchy-system-reboot +fi diff --git a/bin/nomarchy-hook b/bin/nomarchy-hook new file mode 100755 index 0000000..7f4db73 --- /dev/null +++ b/bin/nomarchy-hook @@ -0,0 +1,18 @@ +#!/bin/bash + +# Run a named hook, like post-update (available in ~/.config/nomarchy/hooks/post-update). + +set -e + +if (( $# < 1 )); then + echo "Usage: nomarchy-hook [name] [args...]" + exit 1 +fi + +HOOK=$1 +HOOK_PATH="$HOME/.config/nomarchy/hooks/$1" +shift + +if [[ -f $HOOK_PATH ]]; then + bash "$HOOK_PATH" "$@" +fi diff --git a/bin/nomarchy-hw-asus-rog b/bin/nomarchy-hw-asus-rog new file mode 100755 index 0000000..6897d73 --- /dev/null +++ b/bin/nomarchy-hw-asus-rog @@ -0,0 +1,6 @@ +#!/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 diff --git a/bin/nomarchy-hw-framework16 b/bin/nomarchy-hw-framework16 new file mode 100755 index 0000000..5907e75 --- /dev/null +++ b/bin/nomarchy-hw-framework16 @@ -0,0 +1,6 @@ +#!/bin/bash + +# Detect whether the computer is a Framework Laptop 16. + +[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Framework" ]] && + nomarchy-hw-match "Laptop 16" diff --git a/bin/nomarchy-hw-intel b/bin/nomarchy-hw-intel new file mode 100755 index 0000000..2dc37c0 --- /dev/null +++ b/bin/nomarchy-hw-intel @@ -0,0 +1,5 @@ +#!/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" ]] diff --git a/bin/nomarchy-hw-intel-ptl b/bin/nomarchy-hw-intel-ptl new file mode 100755 index 0000000..9750bd3 --- /dev/null +++ b/bin/nomarchy-hw-intel-ptl @@ -0,0 +1,5 @@ +#!/bin/bash + +# Detect whether the computer has an Intel Panther Lake GPU. + +lspci | grep -iE 'vga|3d|display' | grep -qi 'panther lake' diff --git a/bin/nomarchy-hw-match b/bin/nomarchy-hw-match new file mode 100755 index 0000000..9ba6466 --- /dev/null +++ b/bin/nomarchy-hw-match @@ -0,0 +1,6 @@ +#!/bin/bash + +# Match against the computer's DMI product name (case-insensitive). +# Usage: nomarchy-hw-match "XPS" + +grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null diff --git a/bin/nomarchy-hw-surface b/bin/nomarchy-hw-surface new file mode 100755 index 0000000..4dbb185 --- /dev/null +++ b/bin/nomarchy-hw-surface @@ -0,0 +1,6 @@ +#!/bin/bash + +# Detect whether the computer is a Microsoft Surface device. + +[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] && + nomarchy-hw-match "Surface" diff --git a/bin/nomarchy-hw-vulkan b/bin/nomarchy-hw-vulkan new file mode 100755 index 0000000..8d473a2 --- /dev/null +++ b/bin/nomarchy-hw-vulkan @@ -0,0 +1,6 @@ +#!/bin/bash + +# Detect whether Vulkan is available. + +[[ -d /usr/share/vulkan/icd.d ]] && + find /usr/share/vulkan/icd.d -maxdepth 1 -name "*.json" -print -quit | grep -q . diff --git a/bin/nomarchy-hyprland-active-window-transparency-toggle b/bin/nomarchy-hyprland-active-window-transparency-toggle new file mode 100755 index 0000000..2412548 --- /dev/null +++ b/bin/nomarchy-hyprland-active-window-transparency-toggle @@ -0,0 +1,5 @@ +#!/bin/bash + +# Toggles transparency for the currently focused window. + +hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle diff --git a/bin/nomarchy-hyprland-monitor-scaling-cycle b/bin/nomarchy-hyprland-monitor-scaling-cycle new file mode 100755 index 0000000..a3b2424 --- /dev/null +++ b/bin/nomarchy-hyprland-monitor-scaling-cycle @@ -0,0 +1,24 @@ +#!/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 -u low "󰍹 Display scaling set to ${NEW_SCALE}x" diff --git a/bin/nomarchy-hyprland-window-close-all b/bin/nomarchy-hyprland-window-close-all new file mode 100755 index 0000000..e53fec6 --- /dev/null +++ b/bin/nomarchy-hyprland-window-close-all @@ -0,0 +1,9 @@ +#!/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 diff --git a/bin/nomarchy-hyprland-window-gaps-toggle b/bin/nomarchy-hyprland-window-gaps-toggle new file mode 100755 index 0000000..d2cf2ff --- /dev/null +++ b/bin/nomarchy-hyprland-window-gaps-toggle @@ -0,0 +1,15 @@ +#!/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 diff --git a/bin/nomarchy-hyprland-window-pop b/bin/nomarchy-hyprland-window-pop new file mode 100755 index 0000000..ef8126e --- /dev/null +++ b/bin/nomarchy-hyprland-window-pop @@ -0,0 +1,46 @@ +#!/bin/bash + +# Toggle to pop-out a tile to stay fixed on a display basis. + +# Usage: +# nomarchy-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 diff --git a/bin/nomarchy-hyprland-window-single-square-aspect-toggle b/bin/nomarchy-hyprland-window-single-square-aspect-toggle new file mode 100755 index 0000000..50ccdac --- /dev/null +++ b/bin/nomarchy-hyprland-window-single-square-aspect-toggle @@ -0,0 +1,13 @@ +#!/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 -u low " Disable single-window square aspect ratio" +else + hyprctl keyword layout:single_window_aspect_ratio "1 1" + notify-send -u low " Enable single-window square aspect" +fi diff --git a/bin/nomarchy-hyprland-workspace-layout-toggle b/bin/nomarchy-hyprland-workspace-layout-toggle new file mode 100755 index 0000000..189a469 --- /dev/null +++ b/bin/nomarchy-hyprland-workspace-layout-toggle @@ -0,0 +1,14 @@ +#!/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 -u low "󱂬 Workspace layout set to $NEW_LAYOUT" diff --git a/bin/nomarchy-install-chromium-google-account b/bin/nomarchy-install-chromium-google-account new file mode 100755 index 0000000..7149205 --- /dev/null +++ b/bin/nomarchy-install-chromium-google-account @@ -0,0 +1,16 @@ +#!/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 diff --git a/bin/nomarchy-install-dev-env b/bin/nomarchy-install-dev-env new file mode 100755 index 0000000..d9d2538 --- /dev/null +++ b/bin/nomarchy-install-dev-env @@ -0,0 +1,151 @@ +#!/bin/bash + +# Install one of the supported development environments. Usually called via Install > Development > * in the Nomarchy Menu. + +if [[ -z $1 ]]; then + echo "Usage: nomarchy-install-dev-env " >&2 + exit 1 +fi + +install_php() { + nomarchy-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" + nomarchy-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 + nomarchy-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" + nomarchy-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 diff --git a/bin/nomarchy-install-docker-dbs b/bin/nomarchy-install-docker-dbs new file mode 100755 index 0000000..2b57482 --- /dev/null +++ b/bin/nomarchy-install-docker-dbs @@ -0,0 +1,27 @@ +#!/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 Nomarchy 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 diff --git a/bin/nomarchy-install-dropbox b/bin/nomarchy-install-dropbox new file mode 100755 index 0000000..12fdc77 --- /dev/null +++ b/bin/nomarchy-install-dropbox @@ -0,0 +1,10 @@ +#!/bin/bash + +# Install and start the Dropbox service. Must then be authenticated via the web. + +echo "Installing all dependencies..." +nomarchy-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." diff --git a/bin/nomarchy-install-geforce-now b/bin/nomarchy-install-geforce-now new file mode 100755 index 0000000..b178ebc --- /dev/null +++ b/bin/nomarchy-install-geforce-now @@ -0,0 +1,17 @@ +#!/bin/bash + +# Install and launch Geforce Now. + +set -e + +nomarchy-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 nomarchy-launch-browser diff --git a/bin/nomarchy-install-nordvpn b/bin/nomarchy-install-nordvpn new file mode 100755 index 0000000..68bd0d6 --- /dev/null +++ b/bin/nomarchy-install-nordvpn @@ -0,0 +1,17 @@ +#!/bin/bash + +# Install the NordVPN service with optional GUI. + +echo "Installing NordVPN..." +nomarchy-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?" && nomarchy-system-reboot diff --git a/bin/nomarchy-install-steam b/bin/nomarchy-install-steam new file mode 100755 index 0000000..2d3b7cd --- /dev/null +++ b/bin/nomarchy-install-steam @@ -0,0 +1,9 @@ +#!/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 & diff --git a/bin/nomarchy-install-tailscale b/bin/nomarchy-install-tailscale new file mode 100755 index 0000000..80a994f --- /dev/null +++ b/bin/nomarchy-install-tailscale @@ -0,0 +1,10 @@ +#!/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 + +nomarchy-webapp-install "Tailscale" "https://login.tailscale.com/admin/machines" https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png diff --git a/bin/nomarchy-install-terminal b/bin/nomarchy-install-terminal new file mode 100755 index 0000000..545fa75 --- /dev/null +++ b/bin/nomarchy-install-terminal @@ -0,0 +1,39 @@ +#!/bin/bash + +# Install one of the approved terminals and set it as the default for Nomarchy (Super + Return etc). + +if (($# == 0)); then + echo "Usage: nomarchy-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 nomarchy-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 < ~/.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 Nomarchy theme to VSCode +nomarchy-theme-set-vscode + +setsid gtk-launch code diff --git a/bin/nomarchy-install-xbox-controllers b/bin/nomarchy-install-xbox-controllers new file mode 100755 index 0000000..8353504 --- /dev/null +++ b/bin/nomarchy-install-xbox-controllers @@ -0,0 +1,19 @@ +#!/bin/bash + +# Install support for using Xbox controllers with Steam/RetroArch/etc. + +set -e + +# Install xpadneo to ensure controllers work out of the box +nomarchy-pkg-add linux-headers +nomarchy-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 diff --git a/bin/nomarchy-launch-about b/bin/nomarchy-launch-about new file mode 100755 index 0000000..315906f --- /dev/null +++ b/bin/nomarchy-launch-about @@ -0,0 +1,5 @@ +#!/bin/bash + +# Launch the fastfetch TUI that gives information about the current system. + +exec nomarchy-launch-or-focus-tui "bash -c 'fastfetch; read -n 1 -s'" diff --git a/bin/nomarchy-launch-audio b/bin/nomarchy-launch-audio new file mode 100755 index 0000000..6df6e25 --- /dev/null +++ b/bin/nomarchy-launch-audio @@ -0,0 +1,5 @@ +#!/bin/bash + +# Launch the Nomarchy audio controls TUI (provided by wiremix). + +nomarchy-launch-or-focus-tui wiremix diff --git a/bin/nomarchy-launch-bluetooth b/bin/nomarchy-launch-bluetooth new file mode 100755 index 0000000..cbe34b7 --- /dev/null +++ b/bin/nomarchy-launch-bluetooth @@ -0,0 +1,7 @@ +#!/bin/bash + +# Launch the Nomarchy bluetooth controls TUI (provided by bluetui). +# Also attempts to unblock bluetooth service if rfkill had blocked it. + +rfkill unblock bluetooth +exec nomarchy-launch-or-focus-tui bluetui diff --git a/bin/nomarchy-launch-browser b/bin/nomarchy-launch-browser new file mode 100755 index 0000000..b4b3e28 --- /dev/null +++ b/bin/nomarchy-launch-browser @@ -0,0 +1,17 @@ +#!/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}" diff --git a/bin/nomarchy-launch-editor b/bin/nomarchy-launch-editor new file mode 100755 index 0000000..d12dee2 --- /dev/null +++ b/bin/nomarchy-launch-editor @@ -0,0 +1,15 @@ +#!/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. + +nomarchy-cmd-present "$EDITOR" || EDITOR=nvim + +case "$EDITOR" in +nvim | vim | nano | micro | hx | helix | fresh) + exec nomarchy-launch-tui "$EDITOR" "$@" + ;; +*) + exec setsid uwsm-app -- "$EDITOR" "$@" + ;; +esac diff --git a/bin/nomarchy-launch-floating-terminal-with-presentation b/bin/nomarchy-launch-floating-terminal-with-presentation new file mode 100755 index 0000000..ef4acf6 --- /dev/null +++ b/bin/nomarchy-launch-floating-terminal-with-presentation @@ -0,0 +1,7 @@ +#!/bin/bash + +# Launch a floating terminal with the Nomarchy logo presentation, then execute the command passed in, and finally end with the nomarchy-show-done presentation. +# Used by actions such as Update System. + +cmd="$*" +exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.nomarchy.terminal --title=Nomarchy -e bash -c "nomarchy-show-logo; $cmd; if (( \$? != 130 )); then nomarchy-show-done; fi" diff --git a/bin/nomarchy-launch-or-focus b/bin/nomarchy-launch-or-focus new file mode 100755 index 0000000..477e0c3 --- /dev/null +++ b/bin/nomarchy-launch-or-focus @@ -0,0 +1,19 @@ +#!/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: nomarchy-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 diff --git a/bin/nomarchy-launch-or-focus-tui b/bin/nomarchy-launch-or-focus-tui new file mode 100755 index 0000000..a387124 --- /dev/null +++ b/bin/nomarchy-launch-or-focus-tui @@ -0,0 +1,9 @@ +#!/bin/bash + +# Launch or focus on a given TUI identified by the passed in as the command. +# Use by commands like nomarchy-launch-wifi to ensure there is only one wifi configuration screen open. + +APP_ID="org.nomarchy.$(basename "$1")" +LAUNCH_COMMAND="nomarchy-launch-tui $@" + +exec nomarchy-launch-or-focus "$APP_ID" "$LAUNCH_COMMAND" diff --git a/bin/nomarchy-launch-or-focus-webapp b/bin/nomarchy-launch-or-focus-webapp new file mode 100755 index 0000000..809cc21 --- /dev/null +++ b/bin/nomarchy-launch-or-focus-webapp @@ -0,0 +1,15 @@ +#!/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: nomarchy-launch-or-focus-webapp [window-pattern] [url-and-flags...]" + exit 1 +fi + +WINDOW_PATTERN="$1" +shift +LAUNCH_COMMAND="nomarchy-launch-webapp $@" + +exec nomarchy-launch-or-focus "$WINDOW_PATTERN" "$LAUNCH_COMMAND" diff --git a/bin/nomarchy-launch-screensaver b/bin/nomarchy-launch-screensaver new file mode 100755 index 0000000..1ccf302 --- /dev/null +++ b/bin/nomarchy-launch-screensaver @@ -0,0 +1,54 @@ +#!/bin/bash + +# Launch the Nomarchy 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.nomarchy.screensaver && exit 0 + +# Allow screensaver to be turned off but also force started +if [[ -f ~/.local/state/nomarchy/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.nomarchy.screensaver \ + --config-file ~/.local/share/nomarchy/default/alacritty/screensaver.toml \ + -e nomarchy-cmd-screensaver + ;; + *ghostty*) + hyprctl dispatch exec -- \ + ghostty --class=org.nomarchy.screensaver \ + --config-file=~/.local/share/nomarchy/default/ghostty/screensaver \ + --font-size=18 \ + -e nomarchy-cmd-screensaver + ;; + *kitty*) + hyprctl dispatch exec -- \ + kitty --class=org.nomarchy.screensaver \ + --override font_size=18 \ + --override window_padding_width=0 \ + -e nomarchy-cmd-screensaver + ;; + *) + notify-send -u low "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty" + ;; + esac +done + +hyprctl dispatch focusmonitor $focused diff --git a/bin/nomarchy-launch-tui b/bin/nomarchy-launch-tui new file mode 100755 index 0000000..300ac68 --- /dev/null +++ b/bin/nomarchy-launch-tui @@ -0,0 +1,5 @@ +#!/bin/bash + +# Launch the TUI command passed in as an argument in the default terminal with an org.nomarchy.COMMAND app id for styling. + +exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.nomarchy.$(basename $1) -e "$1" "${@:2}" diff --git a/bin/nomarchy-launch-walker b/bin/nomarchy-launch-walker new file mode 100755 index 0000000..8b239f1 --- /dev/null +++ b/bin/nomarchy-launch-walker @@ -0,0 +1,15 @@ +#!/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 "$@" diff --git a/bin/nomarchy-launch-webapp b/bin/nomarchy-launch-webapp new file mode 100755 index 0000000..607ef6c --- /dev/null +++ b/bin/nomarchy-launch-webapp @@ -0,0 +1,12 @@ +#!/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}" diff --git a/bin/nomarchy-launch-wifi b/bin/nomarchy-launch-wifi new file mode 100755 index 0000000..fda2297 --- /dev/null +++ b/bin/nomarchy-launch-wifi @@ -0,0 +1,7 @@ +#!/bin/bash + +# Launch the Nomarchy wifi controls (provided by the Impala TUI). +# Attempts to unblock the wifi service first in case it should be been blocked. + +rfkill unblock wifi +nomarchy-launch-or-focus-tui impala diff --git a/bin/nomarchy-lock-screen b/bin/nomarchy-lock-screen new file mode 100755 index 0000000..7af7ea3 --- /dev/null +++ b/bin/nomarchy-lock-screen @@ -0,0 +1,17 @@ +#!/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.nomarchy.screensaver diff --git a/bin/nomarchy-menu b/bin/nomarchy-menu new file mode 100755 index 0000000..fc03aef --- /dev/null +++ b/bin/nomarchy-menu @@ -0,0 +1,633 @@ +#!/bin/bash + +# Launch the Nomarchy Menu or takes a parameter to jump straight to a submenu. + +export PATH="$HOME/.local/share/nomarchy/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" | nomarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 630 -p "$prompt…" "${args[@]}" 2>/dev/null +} + +terminal() { + xdg-terminal-exec --app-id=org.nomarchy.terminal "$@" +} + +present_terminal() { + nomarchy-launch-floating-terminal-with-presentation $1 +} + +open_in_editor() { + notify-send -u low "Editing config file" "$1" + nomarchy-launch-editor "$1" +} + +install() { + present_terminal "echo 'Installing $1...'; nomarchy-pkg-add $2" +} + +install_and_launch() { + present_terminal "echo 'Installing $1...'; nomarchy-pkg-add $2 && setsid gtk-launch $3" +} + +install_font() { + present_terminal "echo 'Installing $1...'; nomarchy-pkg-add $2 && sleep 2 && nomarchy-font-set '$3'" +} + +install_terminal() { + present_terminal "nomarchy-install-terminal $1" +} + +aur_install() { + present_terminal "echo 'Installing $1 from AUR...'; nomarchy-pkg-aur-add $2" +} + +aur_install_and_launch() { + present_terminal "echo 'Installing $1 from AUR...'; nomarchy-pkg-aur-add $2 && setsid gtk-launch $3" +} + +show_learn_menu() { + case $(menu "Learn" " Keybindings\n Nomarchy\n Hyprland\n󰣇 Arch\n Neovim\n󱆃 Bash") in + *Keybindings*) nomarchy-menu-keybindings ;; + *Nomarchy*) nomarchy-launch-webapp "https://learn.omacom.io/2/the-nomarchy-manual" ;; + *Hyprland*) nomarchy-launch-webapp "https://wiki.hypr.land/" ;; + *Arch*) nomarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;; + *Bash*) nomarchy-launch-webapp "https://devhints.io/bash" ;; + *Neovim*) nomarchy-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*) nomarchy-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() { + nomarchy-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") nomarchy-cmd-screenrecord ;; + *"With desktop audio") nomarchy-cmd-screenrecord --with-desktop-audio ;; + *"With desktop + microphone audio") nomarchy-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 + } + nomarchy-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*) nomarchy-cmd-share clipboard ;; + *File*) terminal bash -c "nomarchy-cmd-share file" ;; + *Folder*) terminal bash -c "nomarchy-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*) nomarchy-toggle-screensaver ;; + *Nightlight*) nomarchy-toggle-nightlight ;; + *Idle*) nomarchy-toggle-idle ;; + *Bar*) nomarchy-toggle-waybar ;; + *Layout*) nomarchy-hyprland-workspace-layout-toggle ;; + *Ratio*) nomarchy-hyprland-window-single-square-aspect-toggle ;; + *Gaps*) nomarchy-hyprland-window-gaps-toggle ;; + *Scaling*) nomarchy-hyprland-monitor-scaling-cycle ;; + *) back_to show_trigger_menu ;; + esac +} + +show_hardware_menu() { + case $(menu "Toggle" " Hybrid GPU") in + *"Hybrid GPU"*) present_terminal nomarchy-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/nomarchy/branding/screensaver.txt ;; + *About*) open_in_editor ~/.config/nomarchy/branding/about.txt ;; + *) show_main_menu ;; + esac +} + +show_theme_menu() { + nomarchy-launch-walker -m menus:nomarchythemes --width 800 --minheight 400 +} + +show_background_menu() { + nomarchy-launch-walker -m menus:nomarchyBackgroundSelector --width 800 --minheight 400 +} + +show_font_menu() { + theme=$(menu "Font" "$(nomarchy-font-list)" "--width 350" "$(nomarchy-font-current)") + if [[ $theme == "CNCLD" || -z $theme ]]; then + back_to show_style_menu + else + nomarchy-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*) nomarchy-launch-audio ;; + *Wifi*) nomarchy-launch-wifi ;; + *Bluetooth*) nomarchy-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*) nomarchy-setup-makima && open_in_editor "$HOME/.config/makima/AT Translated Set 2 keyboard.toml" && nomarchy-restart-makima ;; + *DNS*) present_terminal nomarchy-setup-dns ;; + *Security*) show_setup_security_menu ;; + *Config*) show_setup_config_menu ;; + *) show_main_menu ;; + esac +} + +show_setup_power_menu() { + profile=$(menu "Power Profile" "$(nomarchy-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 nomarchy-setup-fingerprint ;; + *Fido2*) present_terminal nomarchy-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 && nomarchy-restart-hypridle ;; + *Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;; + *Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && nomarchy-restart-hyprsunset ;; + *Swayosd*) open_in_editor ~/.config/swayosd/config.toml && nomarchy-restart-swayosd ;; + *Walker*) open_in_editor ~/.config/walker/config.toml && nomarchy-restart-walker ;; + *Waybar*) open_in_editor ~/.config/waybar/config.jsonc && nomarchy-restart-waybar ;; + *XCompose*) open_in_editor ~/.XCompose && nomarchy-restart-xcompose ;; + *) show_setup_menu ;; + esac +} + +show_setup_system_menu() { + local options="" + + if [[ -f ~/.local/state/nomarchy/toggles/suspend-off ]]; then + options="$options󰒲 Enable Suspend" + else + options="$options󰒲 Disable Suspend" + fi + + if nomarchy-hibernation-available; then + options="$options\n󰤁 Disable Hibernate" + else + options="$options\n󰤁 Enable Hibernate" + fi + + case $(menu "System" "$options") in + *Suspend*) nomarchy-toggle-suspend ;; + *"Enable Hibernate"*) present_terminal nomarchy-hibernation-setup ;; + *"Disable Hibernate"*) present_terminal nomarchy-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 nomarchy-pkg-install ;; + *AUR*) terminal nomarchy-pkg-aur-install ;; + *Web*) present_terminal nomarchy-webapp-install ;; + *TUI*) present_terminal nomarchy-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 "nomarchy-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 nomarchy-install-dropbox ;; + *Tailscale*) present_terminal nomarchy-install-tailscale ;; + *NordVPN*) present_terminal nomarchy-install-nordvpn ;; + *Bitwarden*) install_and_launch "Bitwarden" "bitwarden bitwarden-cli" "bitwarden" ;; + *Chromium*) present_terminal nomarchy-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 nomarchy-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 nomarchy-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 nomarchy-install-steam ;; + *GeForce*) present_terminal nomarchy-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 nomarchy-install-xbox-controllers ;; + *) show_install_menu ;; + esac +} + +show_install_style_menu() { + case $(menu "Install" "󰸌 Theme\n Background\n Font") in + *Theme*) present_terminal nomarchy-theme-install ;; + *Background*) nomarchy-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 "nomarchy-install-dev-env ruby" ;; + *Docker*) present_terminal nomarchy-install-docker-dbs ;; + *JavaScript*) show_install_javascript_menu ;; + *Go*) present_terminal "nomarchy-install-dev-env go" ;; + *PHP*) show_install_php_menu ;; + *Python*) present_terminal "nomarchy-install-dev-env python" ;; + *Elixir*) show_install_elixir_menu ;; + *Zig*) present_terminal "nomarchy-install-dev-env zig" ;; + *Rust*) present_terminal "nomarchy-install-dev-env rust" ;; + *Java*) present_terminal "nomarchy-install-dev-env java" ;; + *NET*) present_terminal "nomarchy-install-dev-env dotnet" ;; + *OCaml*) present_terminal "nomarchy-install-dev-env ocaml" ;; + *Clojure*) present_terminal "nomarchy-install-dev-env clojure" ;; + *Scala*) present_terminal "nomarchy-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 "nomarchy-install-dev-env node" ;; + *Bun*) present_terminal "nomarchy-install-dev-env bun" ;; + *Deno*) present_terminal "nomarchy-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 "nomarchy-install-dev-env php" ;; + *Laravel*) present_terminal "nomarchy-install-dev-env laravel" ;; + *Symfony*) present_terminal "nomarchy-install-dev-env symfony" ;; + *) show_install_development_menu ;; + esac +} + +show_install_elixir_menu() { + case $(menu "Install" " Elixir\n Phoenix") in + *Elixir*) present_terminal "nomarchy-install-dev-env elixir" ;; + *Phoenix*) present_terminal "nomarchy-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 nomarchy-pkg-remove ;; + *Web*) present_terminal nomarchy-webapp-remove ;; + *TUI*) present_terminal nomarchy-tui-remove ;; + *Development*) show_remove_development_menu ;; + *Preinstalls*) present_terminal nomarchy-remove-preinstalls ;; + *Dictation*) present_terminal nomarchy-voxtype-remove ;; + *Theme*) present_terminal nomarchy-theme-remove ;; + *Windows*) present_terminal "nomarchy-windows-vm remove" ;; + *Fingerprint*) present_terminal "nomarchy-setup-fingerprint --remove" ;; + *Fido2*) present_terminal "nomarchy-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 "nomarchy-remove-dev-env ruby" ;; + *JavaScript*) show_remove_javascript_menu ;; + *Go*) present_terminal "nomarchy-remove-dev-env go" ;; + *PHP*) show_remove_php_menu ;; + *Python*) present_terminal "nomarchy-remove-dev-env python" ;; + *Elixir*) show_remove_elixir_menu ;; + *Zig*) present_terminal "nomarchy-remove-dev-env zig" ;; + *Rust*) present_terminal "nomarchy-remove-dev-env rust" ;; + *Java*) present_terminal "nomarchy-remove-dev-env java" ;; + *NET*) present_terminal "nomarchy-remove-dev-env dotnet" ;; + *OCaml*) present_terminal "nomarchy-remove-dev-env ocaml" ;; + *Clojure*) present_terminal "nomarchy-remove-dev-env clojure" ;; + *Scala*) present_terminal "nomarchy-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 "nomarchy-remove-dev-env node" ;; + *Bun*) present_terminal "nomarchy-remove-dev-env bun" ;; + *Deno*) present_terminal "nomarchy-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 "nomarchy-remove-dev-env php" ;; + *Laravel*) present_terminal "nomarchy-remove-dev-env laravel" ;; + *Symfony*) present_terminal "nomarchy-remove-dev-env symfony" ;; + *) show_remove_development_menu ;; + esac +} + +show_remove_elixir_menu() { + case $(menu "Remove" " Elixir\n Phoenix") in + *Elixir*) present_terminal "nomarchy-remove-dev-env elixir" ;; + *Phoenix*) present_terminal "nomarchy-remove-dev-env phoenix" ;; + *) show_remove_development_menu ;; + esac +} + +show_update_menu() { + case $(menu "Update" "  Nomarchy\n󰔫 Channel\n Config\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in + *Nomarchy*) present_terminal nomarchy-update ;; + *Channel*) show_update_channel_menu ;; + *Config*) show_update_config_menu ;; + *Themes*) present_terminal nomarchy-theme-update ;; + *Process*) show_update_process_menu ;; + *Hardware*) show_update_hardware_menu ;; + *Firmware*) present_terminal nomarchy-update-firmware ;; + *Timezone*) present_terminal nomarchy-tz-select ;; + *Time*) present_terminal nomarchy-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 "nomarchy-channel-set stable" ;; + *RC*) present_terminal "nomarchy-channel-set rc" ;; + *Edge*) present_terminal "nomarchy-channel-set edge" ;; + *Dev*) present_terminal "nomarchy-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*) nomarchy-restart-hypridle ;; + *Hyprsunset*) nomarchy-restart-hyprsunset ;; + *Swayosd*) nomarchy-restart-swayosd ;; + *Walker*) nomarchy-restart-walker ;; + *Waybar*) nomarchy-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 nomarchy-refresh-hyprland ;; + *Hypridle*) present_terminal nomarchy-refresh-hypridle ;; + *Hyprlock*) present_terminal nomarchy-refresh-hyprlock ;; + *Hyprsunset*) present_terminal nomarchy-refresh-hyprsunset ;; + *Plymouth*) present_terminal nomarchy-refresh-plymouth ;; + *Swayosd*) present_terminal nomarchy-refresh-swayosd ;; + *Tmux*) present_terminal nomarchy-refresh-tmux ;; + *Walker*) present_terminal nomarchy-refresh-walker ;; + *Waybar*) present_terminal nomarchy-refresh-waybar ;; + *) show_update_menu ;; + esac +} + +show_update_hardware_menu() { + case $(menu "Restart" " Audio\n󱚾 Wi-Fi\n󰂯 Bluetooth") in + *Audio*) present_terminal nomarchy-restart-pipewire ;; + *Wi-Fi*) present_terminal nomarchy-restart-wifi ;; + *Bluetooth*) present_terminal nomarchy-restart-bluetooth ;; + *) show_update_menu ;; + esac +} + +show_update_password_menu() { + case $(menu "Update Password" " Drive Encryption\n User") in + *Drive*) present_terminal nomarchy-drive-set-password ;; + *User*) present_terminal passwd ;; + *) show_update_menu ;; + esac +} + +show_about() { + nomarchy-launch-about +} + +show_system_menu() { + local options="󱄄 Screensaver\n Lock" + [[ ! -f ~/.local/state/nomarchy/toggles/suspend-off ]] && options="$options\n󰒲 Suspend" + nomarchy-hibernation-available && options="$options\n󰤁 Hibernate" + options="$options\n󰍃 Logout\n󰜉 Restart\n󰐥 Shutdown" + + case $(menu "System" "$options") in + *Screensaver*) nomarchy-launch-screensaver force ;; + *Lock*) nomarchy-lock-screen ;; + *Suspend*) systemctl suspend ;; + *Hibernate*) systemctl hibernate ;; + *Logout*) nomarchy-system-logout ;; + *Restart*) nomarchy-system-reboot ;; + *Shutdown*) nomarchy-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/nomarchy/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 diff --git a/bin/nomarchy-menu-keybindings b/bin/nomarchy-menu-keybindings new file mode 100755 index 0000000..dc9564a --- /dev/null +++ b/bin/nomarchy-menu-keybindings @@ -0,0 +1,247 @@ +#!/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 Nomarchy 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/nomarchy/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(/&/, "\\&", action); + gsub(//, "\\>", action); + gsub(/"/, "\\"", action); + gsub(/'"'"'/, "\\'", 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, /Nomarchy 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 "priorityline" + 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 diff --git a/bin/nomarchy-migrate b/bin/nomarchy-migrate new file mode 100755 index 0000000..5111bc7 --- /dev/null +++ b/bin/nomarchy-migrate @@ -0,0 +1,29 @@ +#!/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/nomarchy/migrations" +mkdir -p "$STATE_DIR" + +# Skipped migrations are tracked separately +mkdir -p "$STATE_DIR/skipped" + +# Run any pending migrations +for file in ~/.local/share/nomarchy/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 diff --git a/bin/nomarchy-notification-dismiss b/bin/nomarchy-notification-dismiss new file mode 100755 index 0000000..4d2e11f --- /dev/null +++ b/bin/nomarchy-notification-dismiss @@ -0,0 +1,15 @@ +#!/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: nomarchy-notification-dismiss " + 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 diff --git a/bin/nomarchy-npx-install b/bin/nomarchy-npx-install new file mode 100755 index 0000000..729e9a4 --- /dev/null +++ b/bin/nomarchy-npx-install @@ -0,0 +1,24 @@ +#!/bin/bash + +# Install an npx wrapper for a given npm package. +# Usage: nomarchy-npx-install [command-name] +# +# If command-name is omitted, it defaults to the package name. +# Example: nomarchy-npx-install opencode-ai opencode + +if [[ -z $1 ]]; then + echo "Usage: nomarchy-npx-install [command-name]" + exit 1 +fi + +package=$1 +command=${2:-$1} + +mkdir -p "$HOME/.local/bin" + +cat > "$HOME/.local/bin/$command" </dev/null; then + echo -e "\033[31mError: Package '$pkg' did not install\033[0m" >&2 + exit 1 + fi +done + +exit 0 diff --git a/bin/nomarchy-pkg-aur-accessible b/bin/nomarchy-pkg-aur-accessible new file mode 100755 index 0000000..315a8ac --- /dev/null +++ b/bin/nomarchy-pkg-aur-accessible @@ -0,0 +1,7 @@ +#!/bin/bash + +# Returns true if the AUR is up and available. +# Used by nomarchy-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 "nomarchy-update" \ + "https://aur.archlinux.org/rpc/?v=5&type=info&arg=base" >/dev/null diff --git a/bin/nomarchy-pkg-aur-add b/bin/nomarchy-pkg-aur-add new file mode 100755 index 0000000..53ed426 --- /dev/null +++ b/bin/nomarchy-pkg-aur-add @@ -0,0 +1,17 @@ +#!/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 nomarchy-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 diff --git a/bin/nomarchy-pkg-aur-install b/bin/nomarchy-pkg-aur-install new file mode 100755 index 0000000..f1638c6 --- /dev/null +++ b/bin/nomarchy-pkg-aur-install @@ -0,0 +1,28 @@ +#!/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 nomarchy-sudo-keepalive + + echo "$pkg_names" | sed 's/^/aur\//' | tr '\n' ' ' | xargs yay -S --noconfirm + sudo updatedb + nomarchy-show-done +fi diff --git a/bin/nomarchy-pkg-drop b/bin/nomarchy-pkg-drop new file mode 100755 index 0000000..125c9c9 --- /dev/null +++ b/bin/nomarchy-pkg-drop @@ -0,0 +1,9 @@ +#!/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 diff --git a/bin/nomarchy-pkg-install b/bin/nomarchy-pkg-install new file mode 100755 index 0000000..46e986b --- /dev/null +++ b/bin/nomarchy-pkg-install @@ -0,0 +1,25 @@ +#!/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 nomarchy-sudo-keepalive + + # Convert newline-separated selections to space-separated for pacman + echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm + nomarchy-show-done +fi diff --git a/bin/nomarchy-pkg-missing b/bin/nomarchy-pkg-missing new file mode 100755 index 0000000..c2bab7a --- /dev/null +++ b/bin/nomarchy-pkg-missing @@ -0,0 +1,11 @@ +#!/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 diff --git a/bin/nomarchy-pkg-present b/bin/nomarchy-pkg-present new file mode 100755 index 0000000..03a5d9a --- /dev/null +++ b/bin/nomarchy-pkg-present @@ -0,0 +1,9 @@ +#!/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 diff --git a/bin/nomarchy-pkg-remove b/bin/nomarchy-pkg-remove new file mode 100755 index 0000000..51f439f --- /dev/null +++ b/bin/nomarchy-pkg-remove @@ -0,0 +1,23 @@ +#!/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 + nomarchy-show-done +fi diff --git a/bin/nomarchy-powerprofiles-list b/bin/nomarchy-powerprofiles-list new file mode 100755 index 0000000..27083c3 --- /dev/null +++ b/bin/nomarchy-powerprofiles-list @@ -0,0 +1,8 @@ +#!/bin/bash + +# Returns a list of all the available power profiles on the system. +# Used by the Nomarchy Menu under Setup > Power Profile. + +powerprofilesctl list | + awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }' | + tac diff --git a/bin/nomarchy-refresh-applications b/bin/nomarchy-refresh-applications new file mode 100755 index 0000000..85da437 --- /dev/null +++ b/bin/nomarchy-refresh-applications @@ -0,0 +1,20 @@ +#!/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/nomarchy/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/nomarchy/applications/*.desktop ~/.local/share/applications/ +cp ~/.local/share/nomarchy/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 diff --git a/bin/nomarchy-refresh-chromium b/bin/nomarchy-refresh-chromium new file mode 100755 index 0000000..0e5f656 --- /dev/null +++ b/bin/nomarchy-refresh-chromium @@ -0,0 +1,21 @@ +#!/bin/bash + +# Refresh the ~/.config/chromium-flags.conf file from the Nomarchy 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 +nomarchy-refresh-config chromium-flags.conf + +# Re-install Google accounts if previously configured +if [[ $INSTALL_GOOGLE_ACCOUNTS == "true" ]]; then + nomarchy-install-chromium-google-account +fi diff --git a/bin/nomarchy-refresh-config b/bin/nomarchy-refresh-config new file mode 100755 index 0000000..dd1a20b --- /dev/null +++ b/bin/nomarchy-refresh-config @@ -0,0 +1,42 @@ +#!/bin/bash + +# Copies the named config from ~/.local/share/nomarchy/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 </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 Nomarchy 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 diff --git a/bin/nomarchy-refresh-fastfetch b/bin/nomarchy-refresh-fastfetch new file mode 100755 index 0000000..ac397bb --- /dev/null +++ b/bin/nomarchy-refresh-fastfetch @@ -0,0 +1,5 @@ +#!/bin/bash + +# Overwrite the user config for fastfetch with the Nomarchy default. + +nomarchy-refresh-config fastfetch/config.jsonc diff --git a/bin/nomarchy-refresh-hypridle b/bin/nomarchy-refresh-hypridle new file mode 100755 index 0000000..97d21b0 --- /dev/null +++ b/bin/nomarchy-refresh-hypridle @@ -0,0 +1,6 @@ +#!/bin/bash + +# Overwrite the user config for hypridle with the Nomarchy default and restart the service. + +nomarchy-refresh-config hypr/hypridle.conf +nomarchy-restart-hypridle diff --git a/bin/nomarchy-refresh-hyprland b/bin/nomarchy-refresh-hyprland new file mode 100755 index 0000000..61c309e --- /dev/null +++ b/bin/nomarchy-refresh-hyprland @@ -0,0 +1,9 @@ +#!/bin/bash + +# Overwrite all the user configs in ~/.config/hypr with the Nomarchy defaults. + +nomarchy-refresh-config hypr/autostart.conf +nomarchy-refresh-config hypr/bindings.conf +nomarchy-refresh-config hypr/input.conf +nomarchy-refresh-config hypr/looknfeel.conf +nomarchy-refresh-config hypr/hyprland.conf diff --git a/bin/nomarchy-refresh-hyprlock b/bin/nomarchy-refresh-hyprlock new file mode 100755 index 0000000..72774d6 --- /dev/null +++ b/bin/nomarchy-refresh-hyprlock @@ -0,0 +1,5 @@ +#!/bin/bash + +# Overwrite the user config for hyprlock with the Nomarchy default. + +nomarchy-refresh-config hypr/hyprlock.conf diff --git a/bin/nomarchy-refresh-hyprsunset b/bin/nomarchy-refresh-hyprsunset new file mode 100755 index 0000000..5aea99e --- /dev/null +++ b/bin/nomarchy-refresh-hyprsunset @@ -0,0 +1,6 @@ +#!/bin/bash + +# Overwrite the user config for hyprsunset with the Nomarchy default and restart the service. +# +nomarchy-refresh-config hypr/hyprsunset.conf +nomarchy-restart-hyprsunset diff --git a/bin/nomarchy-refresh-limine b/bin/nomarchy-refresh-limine new file mode 100755 index 0000000..40d981b --- /dev/null +++ b/bin/nomarchy-refresh-limine @@ -0,0 +1,16 @@ +#!/bin/bash + +# Overwrite the user config for the Limine bootloader and rebuild it. + +if [[ -f /boot/EFI/Linux/nomarchy_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/nomarchy/default/limine/limine.conf /boot/limine.conf + +sudo limine-update +sudo limine-snapper-sync diff --git a/bin/nomarchy-refresh-pacman b/bin/nomarchy-refresh-pacman new file mode 100755 index 0000000..ef208aa --- /dev/null +++ b/bin/nomarchy-refresh-pacman @@ -0,0 +1,24 @@ +#!/bin/bash + +# Overwrite the package configuration for /etc/pacman with the Nomarchy default of using its dedicated mirrors and repositories, then update all packages. +# This is used after switching between Nomarchy 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 diff --git a/bin/nomarchy-refresh-plymouth b/bin/nomarchy-refresh-plymouth new file mode 100755 index 0000000..aaf38be --- /dev/null +++ b/bin/nomarchy-refresh-plymouth @@ -0,0 +1,12 @@ +#!/bin/bash + +# Overwrite the user config for the Plymouth drive decryption and boot sequence with the Nomarchy default and rebuild it. + +sudo cp ~/.local/share/nomarchy/default/plymouth/* /usr/share/plymouth/themes/nomarchy/ +sudo plymouth-set-default-theme nomarchy + +if command -v limine-mkinitcpio &>/dev/null; then + sudo limine-mkinitcpio +else + sudo mkinitcpio -P +fi diff --git a/bin/nomarchy-refresh-sddm b/bin/nomarchy-refresh-sddm new file mode 100755 index 0000000..2ffbf6b --- /dev/null +++ b/bin/nomarchy-refresh-sddm @@ -0,0 +1,6 @@ +#!/bin/bash + +# Refresh the SDDM theme from default + +sudo rm -rf /usr/share/sddm/themes/nomarchy +sudo cp -r $OMARCHY_PATH/default/sddm/nomarchy /usr/share/sddm/themes/nomarchy diff --git a/bin/nomarchy-refresh-swayosd b/bin/nomarchy-refresh-swayosd new file mode 100755 index 0000000..4236632 --- /dev/null +++ b/bin/nomarchy-refresh-swayosd @@ -0,0 +1,7 @@ +#!/bin/bash + +# Overwrite the user configs for swayosd (controls on-screen feedback for changing volume/songs etc) with the Nomarchy defaults and restart the service. + +nomarchy-refresh-config swayosd/config.toml +nomarchy-refresh-config swayosd/style.css +nomarchy-restart-swayosd diff --git a/bin/nomarchy-refresh-tmux b/bin/nomarchy-refresh-tmux new file mode 100755 index 0000000..50add9e --- /dev/null +++ b/bin/nomarchy-refresh-tmux @@ -0,0 +1,6 @@ +#!/bin/bash + +# Overwrite the user tmux config with the Nomarchy default and reload tmux. + +nomarchy-refresh-config tmux/tmux.conf +nomarchy-restart-tmux diff --git a/bin/nomarchy-refresh-walker b/bin/nomarchy-refresh-walker new file mode 100755 index 0000000..986dbf9 --- /dev/null +++ b/bin/nomarchy-refresh-walker @@ -0,0 +1,21 @@ +#!/bin/bash + +# Overwrite the user configs for the Walker application launcher (which also powers the Nomarchy 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 +nomarchy-refresh-config walker/config.toml +nomarchy-refresh-config elephant/calc.toml +nomarchy-refresh-config elephant/desktopapplications.toml + +# Restart service +nomarchy-restart-walker diff --git a/bin/nomarchy-refresh-waybar b/bin/nomarchy-refresh-waybar new file mode 100755 index 0000000..4518db2 --- /dev/null +++ b/bin/nomarchy-refresh-waybar @@ -0,0 +1,7 @@ +#!/bin/bash + +# Overwrite the user configs for the Waybar menu bar with the Nomarchy defaults and restart the service. + +nomarchy-refresh-config waybar/config.jsonc +nomarchy-refresh-config waybar/style.css +nomarchy-restart-waybar diff --git a/bin/nomarchy-reinstall b/bin/nomarchy-reinstall new file mode 100755 index 0000000..84f7a76 --- /dev/null +++ b/bin/nomarchy-reinstall @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +# Attempt to reinstall all default Nomarchy packages and reset all the default configs. + +echo -e "This will reinstall all the default Nomarchy 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 + nomarchy-reinstall-git + nomarchy-reinstall-pkgs + nomarchy-reinstall-configs + + gum confirm "System has been reinstalled. Reboot?" && nomarchy-system-reboot +fi diff --git a/bin/nomarchy-reinstall-configs b/bin/nomarchy-reinstall-configs new file mode 100755 index 0000000..a9adeca --- /dev/null +++ b/bin/nomarchy-reinstall-configs @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +# Overwrite all user configs with the Nomarchy defaults. + +if (( EUID == 0 )); then + echo "Error: This script should not be run as root" + exit 1 +fi + +echo "Resetting all Nomarchy configs" +cp -R ~/.local/share/nomarchy/config/* ~/.config/ +cp ~/.local/share/nomarchy/default/bashrc ~/.bashrc +echo '[[ -f ~/.bashrc ]] && . ~/.bashrc' | tee ~/.bash_profile >/dev/null + +$(bash $OMARCHY_PATH/install/config/theme.sh) + +nomarchy-refresh-limine +nomarchy-refresh-plymouth +nomarchy-nvim-setup diff --git a/bin/nomarchy-reinstall-git b/bin/nomarchy-reinstall-git new file mode 100755 index 0000000..360c70c --- /dev/null +++ b/bin/nomarchy-reinstall-git @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +# Reinstall the Nomarchy configuration directory from the git source. + +git clone --depth=1 "https://github.com/basecamp/nomarchy.git" ~/.local/share/nomarchy-new >/dev/null +mv $OMARCHY_PATH ~/.local/share/nomarchy-old +mv ~/.local/share/nomarchy-new $OMARCHY_PATH diff --git a/bin/nomarchy-reinstall-pkgs b/bin/nomarchy-reinstall-pkgs new file mode 100755 index 0000000..2508023 --- /dev/null +++ b/bin/nomarchy-reinstall-pkgs @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +# Reinstall all default Nomarchy packages from the stable channel and downgrade any packages that are too new. + +# Set the package repository to the stable mirrors +nomarchy-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/nomarchy-base.packages" | grep -v '^$') +sudo pacman -Syu --noconfirm --needed "${packages[@]}" diff --git a/bin/nomarchy-remove-dev-env b/bin/nomarchy-remove-dev-env new file mode 100755 index 0000000..453c748 --- /dev/null +++ b/bin/nomarchy-remove-dev-env @@ -0,0 +1,112 @@ +#!/bin/bash + +# Remove a development environment that was previously installed via nomarchy-install-dev-env. +# Usage: nomarchy-remove-dev-env + +if [[ -z $1 ]]; then + echo "Usage: nomarchy-remove-dev-env " >&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!" diff --git a/bin/nomarchy-remove-preinstalls b/bin/nomarchy-remove-preinstalls new file mode 100755 index 0000000..8819030 --- /dev/null +++ b/bin/nomarchy-remove-preinstalls @@ -0,0 +1,36 @@ +#!/bin/bash + +# Remove preinstalled Nomarchy 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 Nomarchy applications...\n" + + nomarchy-webapp-remove-all + nomarchy-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 + + # Remove npx stubs + rm -f ~/.local/bin/codex ~/.local/bin/gemini ~/.local/bin/copilot \ + ~/.local/bin/opencode ~/.local/bin/playwright-cli ~/.local/bin/pi + + nomarchy-pkg-drop \ + aether \ + typora \ + spotify \ + libreoffice-fresh \ + 1password-beta \ + 1password-cli \ + xournalpp \ + signal-desktop \ + pinta \ + obsidian \ + obs-studio \ + kdenlive \ + lazydocker \ + opencode \ + claude-code +fi diff --git a/bin/nomarchy-restart-app b/bin/nomarchy-restart-app new file mode 100755 index 0000000..53ba2d1 --- /dev/null +++ b/bin/nomarchy-restart-app @@ -0,0 +1,7 @@ +#!/bin/bash + +# Restart an application by killing it and relaunching via uwsm. +# Usage: nomarchy-restart-app [application-args...] + +pkill -x $1 +setsid uwsm-app -- "$@" >/dev/null 2>&1 & diff --git a/bin/nomarchy-restart-bluetooth b/bin/nomarchy-restart-bluetooth new file mode 100755 index 0000000..57530d1 --- /dev/null +++ b/bin/nomarchy-restart-bluetooth @@ -0,0 +1,7 @@ +#!/bin/bash + +# Unblock and restart the bluetooth service. + +echo -e "Unblocking bluetooth...\n" +rfkill unblock bluetooth +rfkill list bluetooth diff --git a/bin/nomarchy-restart-btop b/bin/nomarchy-restart-btop new file mode 100755 index 0000000..288a800 --- /dev/null +++ b/bin/nomarchy-restart-btop @@ -0,0 +1,5 @@ +#!/bin/bash + +# Reload btop configuration (used by the Nomarchy theme switching). + +pkill -SIGUSR2 btop diff --git a/bin/nomarchy-restart-hyprctl b/bin/nomarchy-restart-hyprctl new file mode 100755 index 0000000..92c9487 --- /dev/null +++ b/bin/nomarchy-restart-hyprctl @@ -0,0 +1,5 @@ +#!/bin/bash + +# Reload hyprland configuration (used by the Nomarchy theme switching). + +hyprctl reload >/dev/null diff --git a/bin/nomarchy-restart-hypridle b/bin/nomarchy-restart-hypridle new file mode 100755 index 0000000..e970cef --- /dev/null +++ b/bin/nomarchy-restart-hypridle @@ -0,0 +1,5 @@ +#!/bin/bash + +# Restart the hypridle service (used for idle detection and auto-lock). + +nomarchy-restart-app hypridle diff --git a/bin/nomarchy-restart-hyprsunset b/bin/nomarchy-restart-hyprsunset new file mode 100755 index 0000000..8defc66 --- /dev/null +++ b/bin/nomarchy-restart-hyprsunset @@ -0,0 +1,5 @@ +#!/bin/bash + +# Restart the hyprsunset service (used for blue light filtering/night light). + +nomarchy-restart-app hyprsunset diff --git a/bin/nomarchy-restart-makima b/bin/nomarchy-restart-makima new file mode 100755 index 0000000..f3f2e8c --- /dev/null +++ b/bin/nomarchy-restart-makima @@ -0,0 +1,5 @@ +#!/bin/bash + +# Restart makima - key remapping service for remapping Copilot key to Nomarchy Menu + +sudo systemctl restart makima diff --git a/bin/nomarchy-restart-mako b/bin/nomarchy-restart-mako new file mode 100755 index 0000000..a0633b1 --- /dev/null +++ b/bin/nomarchy-restart-mako @@ -0,0 +1,5 @@ +#!/bin/bash + +# Reload mako configuration (used by the Nomarchy theme switching). + +makoctl reload diff --git a/bin/nomarchy-restart-opencode b/bin/nomarchy-restart-opencode new file mode 100755 index 0000000..a674af2 --- /dev/null +++ b/bin/nomarchy-restart-opencode @@ -0,0 +1,7 @@ +#!/bin/bash + +# Reload opencode configuration (used by the Nomarchy theme switching). + +if pgrep -x opencode >/dev/null; then + killall -SIGUSR2 opencode +fi diff --git a/bin/nomarchy-restart-pipewire b/bin/nomarchy-restart-pipewire new file mode 100755 index 0000000..a222ad1 --- /dev/null +++ b/bin/nomarchy-restart-pipewire @@ -0,0 +1,6 @@ +#!/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 diff --git a/bin/nomarchy-restart-swayosd b/bin/nomarchy-restart-swayosd new file mode 100755 index 0000000..d87a477 --- /dev/null +++ b/bin/nomarchy-restart-swayosd @@ -0,0 +1,3 @@ +#!/bin/bash + +nomarchy-restart-app swayosd-server diff --git a/bin/nomarchy-restart-terminal b/bin/nomarchy-restart-terminal new file mode 100755 index 0000000..69ec8da --- /dev/null +++ b/bin/nomarchy-restart-terminal @@ -0,0 +1,13 @@ +#!/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 diff --git a/bin/nomarchy-restart-tmux b/bin/nomarchy-restart-tmux new file mode 100755 index 0000000..b1ce760 --- /dev/null +++ b/bin/nomarchy-restart-tmux @@ -0,0 +1,7 @@ +#!/bin/bash + +# Restart tmux if running with the latest configuration + +if pgrep -x tmux; then + tmux source-file ~/.config/tmux/tmux.conf +fi diff --git a/bin/nomarchy-restart-trackpad b/bin/nomarchy-restart-trackpad new file mode 100755 index 0000000..80bdfcf --- /dev/null +++ b/bin/nomarchy-restart-trackpad @@ -0,0 +1,8 @@ +#!/bin/bash + +# Reload the intel_quicki2c driver to fix a dead trackpad. +# The THC (Touch Host Controller) can fail to initialize interrupts +# during boot or after suspend, leaving the trackpad registered but +# not delivering events. + +sudo modprobe -r intel_quicki2c && sudo modprobe intel_quicki2c diff --git a/bin/nomarchy-restart-walker b/bin/nomarchy-restart-walker new file mode 100755 index 0000000..fb1a9ea --- /dev/null +++ b/bin/nomarchy-restart-walker @@ -0,0 +1,22 @@ +#!/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 diff --git a/bin/nomarchy-restart-waybar b/bin/nomarchy-restart-waybar new file mode 100755 index 0000000..832775c --- /dev/null +++ b/bin/nomarchy-restart-waybar @@ -0,0 +1,3 @@ +#!/bin/bash + +nomarchy-restart-app waybar diff --git a/bin/nomarchy-restart-wifi b/bin/nomarchy-restart-wifi new file mode 100755 index 0000000..5cf35dd --- /dev/null +++ b/bin/nomarchy-restart-wifi @@ -0,0 +1,7 @@ +#!/bin/bash + +# Unblock and restart the Wi-Fi service. + +echo -e "Unblocking wifi...\n" +rfkill unblock wifi +rfkill list wifi diff --git a/bin/nomarchy-restart-xcompose b/bin/nomarchy-restart-xcompose new file mode 100755 index 0000000..6797259 --- /dev/null +++ b/bin/nomarchy-restart-xcompose @@ -0,0 +1,5 @@ +#!/bin/bash + +# Restart the XCompose input method service (fcitx5) to apply new compose key settings. + +nomarchy-restart-app fcitx5 --disable notificationitem diff --git a/bin/nomarchy-setup-dns b/bin/nomarchy-setup-dns new file mode 100755 index 0000000..7a60b64 --- /dev/null +++ b/bin/nomarchy-setup-dns @@ -0,0 +1,79 @@ +#!/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 </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..." + nomarchy-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 diff --git a/bin/nomarchy-setup-fingerprint b/bin/nomarchy-setup-fingerprint new file mode 100755 index 0000000..4e37c46 --- /dev/null +++ b/bin/nomarchy-setup-fingerprint @@ -0,0 +1,134 @@ +#!/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 = 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..." + nomarchy-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 diff --git a/bin/nomarchy-setup-makima b/bin/nomarchy-setup-makima new file mode 100755 index 0000000..b480463 --- /dev/null +++ b/bin/nomarchy-setup-makima @@ -0,0 +1,22 @@ +#!/bin/bash + +# Setup makima - key remapping service for remapping Copilot key to Nomarchy Menu + +CONFIG_FILE="$HOME/.config/makima/AT Translated Set 2 keyboard.toml" + +if [[ ! -f $CONFIG_FILE ]]; then + nomarchy-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 </dev/null || true +fi diff --git a/bin/nomarchy-show-done b/bin/nomarchy-show-done new file mode 100755 index 0000000..36f5aec --- /dev/null +++ b/bin/nomarchy-show-done @@ -0,0 +1,7 @@ +#!/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' diff --git a/bin/nomarchy-show-logo b/bin/nomarchy-show-logo new file mode 100755 index 0000000..c2346ab --- /dev/null +++ b/bin/nomarchy-show-logo @@ -0,0 +1,10 @@ +#!/bin/bash + +# Display the Nomarchy logo in the terminal using green color. +# Used by various presentation scripts to show branding. + +clear +echo -e "\033[32m" +cat <~/.local/share/nomarchy/logo.txt +echo -e "\033[0m" +echo diff --git a/bin/nomarchy-snapshot b/bin/nomarchy-snapshot new file mode 100755 index 0000000..1f1c63f --- /dev/null +++ b/bin/nomarchy-snapshot @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e + +COMMAND="$1" +OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/nomarchy} + +if [[ -z $COMMAND ]]; then + echo "Usage: nomarchy-snapshot " >&2 + exit 1 +fi + +if ! command -v snapper &>/dev/null; then + exit 127 # nomarchy-update can use this to just ignore if snapper is not available +fi + +case "$COMMAND" in +create) + DESC="$(nomarchy-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 diff --git a/bin/nomarchy-state b/bin/nomarchy-state new file mode 100755 index 0000000..7cfcc87 --- /dev/null +++ b/bin/nomarchy-state @@ -0,0 +1,26 @@ +#!/bin/bash + +# Manage persistent state files for Nomarchy toggles and settings. +# Usage: nomarchy-state +# Used to track whether features like suspend, idle lock, etc are enabled or disabled. + +STATE_DIR="$HOME/.local/state/nomarchy" +mkdir -p "$STATE_DIR" + +COMMAND="$1" +STATE_NAME="$2" + +if [[ -z $COMMAND ]]; then + echo "Usage: nomarchy-state " + exit 1 +fi + +if [[ -z $STATE_NAME ]]; then + echo "Usage: nomarchy-state $COMMAND " + 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 diff --git a/bin/nomarchy-sudo-keepalive b/bin/nomarchy-sudo-keepalive new file mode 100755 index 0000000..3b9da33 --- /dev/null +++ b/bin/nomarchy-sudo-keepalive @@ -0,0 +1,10 @@ +#!/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 nomarchy-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 diff --git a/bin/nomarchy-sudo-passwordless-toggle b/bin/nomarchy-sudo-passwordless-toggle new file mode 100755 index 0000000..1752453 --- /dev/null +++ b/bin/nomarchy-sudo-passwordless-toggle @@ -0,0 +1,43 @@ +#!/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-nomarchy-nopasswd-${USER}" +TIMER_NAME="nomarchy-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 nomarchy-sudo-passwordless-toggle again to disable it." + else + echo "Aborted. No changes made." + fi +fi diff --git a/bin/nomarchy-sudo-reset b/bin/nomarchy-sudo-reset new file mode 100755 index 0000000..2c56846 --- /dev/null +++ b/bin/nomarchy-sudo-reset @@ -0,0 +1,7 @@ +#!/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" diff --git a/bin/nomarchy-swayosd-brightness b/bin/nomarchy-swayosd-brightness new file mode 100755 index 0000000..416f3be --- /dev/null +++ b/bin/nomarchy-swayosd-brightness @@ -0,0 +1,15 @@ +#!/bin/bash + +# Display brightness level using SwayOSD on the current monitor. +# Usage: nomarchy-swayosd-brightness + +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}%" diff --git a/bin/nomarchy-swayosd-kbd-brightness b/bin/nomarchy-swayosd-kbd-brightness new file mode 100755 index 0000000..ccdc784 --- /dev/null +++ b/bin/nomarchy-swayosd-kbd-brightness @@ -0,0 +1,15 @@ +#!/bin/bash + +# Display keyboard brightness level using SwayOSD on the current monitor. +# Usage: nomarchy-swayosd-kbd-brightness + +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}%" diff --git a/bin/nomarchy-system-logout b/bin/nomarchy-system-logout new file mode 100755 index 0000000..c881800 --- /dev/null +++ b/bin/nomarchy-system-logout @@ -0,0 +1,11 @@ +#!/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 +nomarchy-hyprland-window-close-all +sleep 1 # Allow apps like Chrome to shutdown correctly diff --git a/bin/nomarchy-system-reboot b/bin/nomarchy-system-reboot new file mode 100755 index 0000000..4ff7c0d --- /dev/null +++ b/bin/nomarchy-system-reboot @@ -0,0 +1,13 @@ +#!/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. + +nomarchy-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 +nomarchy-hyprland-window-close-all +sleep 1 # Allow apps like Chrome to shutdown correctly diff --git a/bin/nomarchy-system-shutdown b/bin/nomarchy-system-shutdown new file mode 100755 index 0000000..6c7442a --- /dev/null +++ b/bin/nomarchy-system-shutdown @@ -0,0 +1,13 @@ +#!/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. + +nomarchy-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 +nomarchy-hyprland-window-close-all +sleep 1 # Allow apps like Chrome to shutdown correctly diff --git a/bin/nomarchy-test-installer b/bin/nomarchy-test-installer new file mode 100755 index 0000000..dbec788 --- /dev/null +++ b/bin/nomarchy-test-installer @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Build and run the Nomarchy Installer VM for testing. + +echo "Building Nomarchy Installer VM..." +nix build .#nixosConfigurations.installerVm.config.system.build.vm + +if [ $? -eq 0 ]; then + echo "Success! Launching Installer VM..." + ./result/bin/run-nomarchy-installer-vm +else + echo "Error: VM build failed." + exit 1 +fi diff --git a/bin/nomarchy-test-vm b/bin/nomarchy-test-vm new file mode 100755 index 0000000..32acb69 --- /dev/null +++ b/bin/nomarchy-test-vm @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Build and run the Nomarchy VM (installed environment) for testing. + +echo "Building Nomarchy VM (Installed Environment)..." +echo "Note: To test the INSTALLER, run 'nomarchy-test-installer' instead." +nix build .#nixosConfigurations.vm.config.system.build.vm + +if [ $? -eq 0 ]; then + echo "Success! Launching VM..." + ./result/bin/run-nomarchy-vm +else + echo "Error: VM build failed." + exit 1 +fi diff --git a/bin/nomarchy-theme-bg-install b/bin/nomarchy-theme-bg-install new file mode 100755 index 0000000..db3e4b9 --- /dev/null +++ b/bin/nomarchy-theme-bg-install @@ -0,0 +1,7 @@ +#!/bin/bash + +CURRENT_THEME_NAME=$(cat "$HOME/.config/nomarchy/current/theme.name") +THEME_USER_BACKGROUNDS="$HOME/.config/nomarchy/backgrounds/$CURRENT_THEME_NAME" + +mkdir -p "$THEME_USER_BACKGROUNDS" +nautilus "$THEME_USER_BACKGROUNDS" diff --git a/bin/nomarchy-theme-bg-next b/bin/nomarchy-theme-bg-next new file mode 100755 index 0000000..8f08aca --- /dev/null +++ b/bin/nomarchy-theme-bg-next @@ -0,0 +1,50 @@ +#!/bin/bash + +# Cycles through the background images available + +THEME_NAME=$(cat "$HOME/.config/nomarchy/current/theme.name" 2>/dev/null) +THEME_BACKGROUNDS_PATH="$HOME/.config/nomarchy/current/theme/backgrounds/" +USER_BACKGROUNDS_PATH="$HOME/.config/nomarchy/backgrounds/$THEME_NAME/" +CURRENT_BACKGROUND_LINK="$HOME/.config/nomarchy/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 diff --git a/bin/nomarchy-theme-bg-set b/bin/nomarchy-theme-bg-set new file mode 100755 index 0000000..26e3c44 --- /dev/null +++ b/bin/nomarchy-theme-bg-set @@ -0,0 +1,18 @@ +#!/bin/bash + +# Sets the specified image as the current background + +if [[ -z $1 ]]; then + echo "Usage: nomarchy-theme-bg-set " >&2 + exit 1 +fi + +BACKGROUND="$1" +CURRENT_BACKGROUND_LINK="$HOME/.config/nomarchy/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 & diff --git a/bin/nomarchy-theme-current b/bin/nomarchy-theme-current new file mode 100755 index 0000000..2007b41 --- /dev/null +++ b/bin/nomarchy-theme-current @@ -0,0 +1,9 @@ +#!/bin/bash + +THEME_NAME_PATH="$HOME/.config/nomarchy/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 diff --git a/bin/nomarchy-theme-install b/bin/nomarchy-theme-install new file mode 100755 index 0000000..0916391 --- /dev/null +++ b/bin/nomarchy-theme-install @@ -0,0 +1,33 @@ +#!/bin/bash + +# nomarchy-theme-install: Install a new theme from a git repo for Nomarchy +# Usage: nomarchy-theme-install + +if [[ -z $1 ]]; then + echo -e "\e[32mSee https://manuals.omamix.org/2/the-nomarchy-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/nomarchy/themes" +THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^nomarchy-//; 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/nomarchy/themes +if ! git clone "$REPO_URL" "$THEME_PATH"; then + echo "Error: Failed to clone theme repo." + exit 1 +fi + +# Apply the new theme with nomarchy-theme-set +nomarchy-theme-set $THEME_NAME diff --git a/bin/nomarchy-theme-list b/bin/nomarchy-theme-list new file mode 100755 index 0000000..2e96dad --- /dev/null +++ b/bin/nomarchy-theme-list @@ -0,0 +1,8 @@ +#!/bin/bash + +{ + find ~/.config/nomarchy/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 diff --git a/bin/nomarchy-theme-refresh b/bin/nomarchy-theme-refresh new file mode 100755 index 0000000..a3dc806 --- /dev/null +++ b/bin/nomarchy-theme-refresh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Refresh the current theme from its templates. + +THEME_NAME_PATH="$HOME/.config/nomarchy/current/theme.name" + +if [[ -f $THEME_NAME_PATH ]]; then + nomarchy-theme-set "$(cat $THEME_NAME_PATH)" +fi diff --git a/bin/nomarchy-theme-remove b/bin/nomarchy-theme-remove new file mode 100755 index 0000000..7b058c4 --- /dev/null +++ b/bin/nomarchy-theme-remove @@ -0,0 +1,35 @@ +#!/bin/bash + +# nomarchy-theme-remove: Remove a theme from Nomarchy by name +# Usage: nomarchy-theme-remove + +if [[ -z $1 ]]; then + mapfile -t extra_themes < <(find ~/.config/nomarchy/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/nomarchy/themes" +CURRENT_DIR="$HOME/.config/nomarchy/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" diff --git a/bin/nomarchy-theme-set b/bin/nomarchy-theme-set new file mode 100755 index 0000000..08cf13e --- /dev/null +++ b/bin/nomarchy-theme-set @@ -0,0 +1,60 @@ +#!/bin/bash + +if [[ -z $1 ]]; then + echo "Usage: nomarchy-theme-set " + exit 1 +fi + +CURRENT_THEME_PATH="$HOME/.config/nomarchy/current/theme" +NEXT_THEME_PATH="$HOME/.config/nomarchy/current/next-theme" +USER_THEMES_PATH="$HOME/.config/nomarchy/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 +nomarchy-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/nomarchy/current/theme.name" + +# Change background with theme +nomarchy-theme-bg-next + +# Restart components to apply new theme +if pgrep -x waybar >/dev/null; then + nomarchy-restart-waybar +fi +nomarchy-restart-swayosd +nomarchy-restart-terminal +nomarchy-restart-hyprctl +nomarchy-restart-btop +nomarchy-restart-opencode +nomarchy-restart-mako + +# Change app-specific themes +nomarchy-theme-set-gnome +nomarchy-theme-set-browser +nomarchy-theme-set-vscode +nomarchy-theme-set-obsidian +nomarchy-theme-set-keyboard + +# Call hook on theme set +nomarchy-hook theme-set "$THEME_NAME" diff --git a/bin/nomarchy-theme-set-browser b/bin/nomarchy-theme-set-browser new file mode 100755 index 0000000..f29916b --- /dev/null +++ b/bin/nomarchy-theme-set-browser @@ -0,0 +1,24 @@ +#!/bin/bash + +CHROMIUM_THEME=~/.config/nomarchy/current/theme/chromium.theme + +if nomarchy-cmd-present chromium || nomarchy-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 nomarchy-cmd-present chromium; then + echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/chromium/policies/managed/color.json" >/dev/null + chromium --refresh-platform-policy --no-startup-window >/dev/null + fi + + if nomarchy-cmd-present brave; then + echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/brave/policies/managed/color.json" >/dev/null + brave --refresh-platform-policy --no-startup-window >/dev/null + fi +fi diff --git a/bin/nomarchy-theme-set-gnome b/bin/nomarchy-theme-set-gnome new file mode 100755 index 0000000..9ead915 --- /dev/null +++ b/bin/nomarchy-theme-set-gnome @@ -0,0 +1,18 @@ +#!/bin/bash + +# Change gnome modes +if [[ -f ~/.config/nomarchy/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/nomarchy/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 diff --git a/bin/nomarchy-theme-set-keyboard b/bin/nomarchy-theme-set-keyboard new file mode 100755 index 0000000..24b939e --- /dev/null +++ b/bin/nomarchy-theme-set-keyboard @@ -0,0 +1,4 @@ +#!/bin/bash + +nomarchy-theme-set-keyboard-asus-rog +nomarchy-theme-set-keyboard-f16 diff --git a/bin/nomarchy-theme-set-keyboard-asus-rog b/bin/nomarchy-theme-set-keyboard-asus-rog new file mode 100755 index 0000000..a705674 --- /dev/null +++ b/bin/nomarchy-theme-set-keyboard-asus-rog @@ -0,0 +1,7 @@ +#!/bin/bash + +ASUSCTL_THEME=~/.config/nomarchy/current/theme/keyboard.rgb + +if nomarchy-cmd-present asusctl; then + asusctl aura effect static -c $(sed 's/^#//' $ASUSCTL_THEME) +fi diff --git a/bin/nomarchy-theme-set-keyboard-f16 b/bin/nomarchy-theme-set-keyboard-f16 new file mode 100755 index 0000000..66a0f12 --- /dev/null +++ b/bin/nomarchy-theme-set-keyboard-f16 @@ -0,0 +1,22 @@ +#!/bin/bash + +FRAMEWORK16_THEME=~/.config/nomarchy/current/theme/keyboard.rgb + +if nomarchy-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 diff --git a/bin/nomarchy-theme-set-obsidian b/bin/nomarchy-theme-set-obsidian new file mode 100755 index 0000000..e24fd8d --- /dev/null +++ b/bin/nomarchy-theme-set-obsidian @@ -0,0 +1,27 @@ +#!/bin/bash + +# Sync Nomarchy theme to all Obsidian vaults + +CURRENT_THEME_DIR="$HOME/.config/nomarchy/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/Nomarchy" + mkdir -p "$theme_dir" + + [[ -f $theme_dir/manifest.json ]] || cat >"$theme_dir/manifest.json" <<'EOF' +{ + "name": "Nomarchy", + "version": "1.0.0", + "minAppVersion": "0.16.0", + "description": "Automatically syncs with your current Nomarchy system theme colors and fonts", + "author": "Nomarchy", + "authorUrl": "https://nomarchy.org" +} +EOF + + cp "$CURRENT_THEME_DIR/obsidian.css" "$theme_dir/theme.css" +done diff --git a/bin/nomarchy-theme-set-templates b/bin/nomarchy-theme-set-templates new file mode 100755 index 0000000..d68c720 --- /dev/null +++ b/bin/nomarchy-theme-set-templates @@ -0,0 +1,46 @@ +#!/bin/bash + +TEMPLATES_DIR="$OMARCHY_PATH/default/themed" +USER_TEMPLATES_DIR="$HOME/.config/nomarchy/themed" +NEXT_THEME_DIR="$HOME/.config/nomarchy/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 diff --git a/bin/nomarchy-theme-set-vscode b/bin/nomarchy-theme-set-vscode new file mode 100755 index 0000000..8d06f5d --- /dev/null +++ b/bin/nomarchy-theme-set-vscode @@ -0,0 +1,40 @@ +#!/bin/bash + +# Sync Nomarchy theme to VS Code, VSCodium, and Cursor + +VS_CODE_THEME="$HOME/.config/nomarchy/current/theme/vscode.json" + +set_theme() { + local editor_cmd="$1" + local settings_path="$2" + local skip_flag="$3" + + nomarchy-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/nomarchy/toggles/skip-vscode-theme-changes" +set_theme "code-insiders" "$HOME/.config/Code - Insiders/User/settings.json" "$HOME/.local/state/nomarchy/toggles/skip-vscode-insiders-theme-changes" +set_theme "codium" "$HOME/.config/VSCodium/User/settings.json" "$HOME/.local/state/nomarchy/toggles/skip-codium-theme-changes" +set_theme "cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.local/state/nomarchy/toggles/skip-cursor-theme-changes" diff --git a/bin/nomarchy-theme-update b/bin/nomarchy-theme-update new file mode 100755 index 0000000..af49ea0 --- /dev/null +++ b/bin/nomarchy-theme-update @@ -0,0 +1,8 @@ +#!/bin/bash + +for dir in ~/.config/nomarchy/themes/*/; do + if [[ -d $dir ]] && [[ ! -L ${dir%/} ]] && [[ -d $dir/.git ]]; then + echo "Updating: $(basename "$dir")" + git -C "$dir" pull + fi +done diff --git a/bin/nomarchy-toggle-hybrid-gpu b/bin/nomarchy-toggle-hybrid-gpu new file mode 100755 index 0000000..2781f99 --- /dev/null +++ b/bin/nomarchy-toggle-hybrid-gpu @@ -0,0 +1,65 @@ +#!/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 nomarchy-cmd-missing supergfxctl; then + nomarchy-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 + + nomarchy-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/ + + nomarchy-system-reboot + fi + ;; +*) + echo "Hybrid GPU not found or in unknown mode." + exit 1 + ;; +esac diff --git a/bin/nomarchy-toggle-idle b/bin/nomarchy-toggle-idle new file mode 100755 index 0000000..a80eec4 --- /dev/null +++ b/bin/nomarchy-toggle-idle @@ -0,0 +1,11 @@ +#!/bin/bash + +if pgrep -x hypridle >/dev/null; then + pkill -x hypridle + notify-send -u low "󱫖 Stop locking computer when idle" +else + uwsm-app -- hypridle >/dev/null 2>&1 & + notify-send -u low "󱫖 Now locking computer when idle" +fi + +pkill -RTMIN+9 waybar diff --git a/bin/nomarchy-toggle-nightlight b/bin/nomarchy-toggle-nightlight new file mode 100755 index 0000000..bb0d134 --- /dev/null +++ b/bin/nomarchy-toggle-nightlight @@ -0,0 +1,30 @@ +#!/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 + nomarchy-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 -u low " Nightlight screen temperature" + restart_nightlighted_waybar +else + hyprctl hyprsunset temperature $OFF_TEMP + notify-send -u low " Daylight screen temperature" + restart_nightlighted_waybar +fi diff --git a/bin/nomarchy-toggle-notification-silencing b/bin/nomarchy-toggle-notification-silencing new file mode 100755 index 0000000..15ee7b5 --- /dev/null +++ b/bin/nomarchy-toggle-notification-silencing @@ -0,0 +1,11 @@ +#!/bin/bash + +makoctl mode -t do-not-disturb + +if makoctl mode | grep -q 'do-not-disturb'; then + notify-send -u low "󰂛 Silenced notifications" +else + notify-send -u low "󰂚 Enabled notifications" +fi + +pkill -RTMIN+10 waybar diff --git a/bin/nomarchy-toggle-screensaver b/bin/nomarchy-toggle-screensaver new file mode 100755 index 0000000..b9f90fb --- /dev/null +++ b/bin/nomarchy-toggle-screensaver @@ -0,0 +1,12 @@ +#!/bin/bash + +STATE_FILE=~/.local/state/nomarchy/toggles/screensaver-off + +if [[ -f $STATE_FILE ]]; then + rm -f $STATE_FILE + notify-send -u low "󱄄 Screensaver enabled" +else + mkdir -p "$(dirname $STATE_FILE)" + touch $STATE_FILE + notify-send -u low "󱄄 Screensaver disabled" +fi diff --git a/bin/nomarchy-toggle-suspend b/bin/nomarchy-toggle-suspend new file mode 100755 index 0000000..871e1ea --- /dev/null +++ b/bin/nomarchy-toggle-suspend @@ -0,0 +1,12 @@ +#!/bin/bash + +STATE_FILE=~/.local/state/nomarchy/toggles/suspend-off + +if [[ -f $STATE_FILE ]]; then + rm -f $STATE_FILE + notify-send -u low "󰒲 Suspend now available in system menu" +else + mkdir -p "$(dirname $STATE_FILE)" + touch $STATE_FILE + notify-send -u low "󰒲 Suspend removed from system menu" +fi diff --git a/bin/nomarchy-toggle-waybar b/bin/nomarchy-toggle-waybar new file mode 100755 index 0000000..7138782 --- /dev/null +++ b/bin/nomarchy-toggle-waybar @@ -0,0 +1,7 @@ +#!/bin/bash + +if pgrep -x waybar >/dev/null; then + pkill -x waybar +else + uwsm-app -- waybar >/dev/null 2>&1 & +fi diff --git a/bin/nomarchy-tui-install b/bin/nomarchy-tui-install new file mode 100755 index 0000000..2d6397a --- /dev/null +++ b/bin/nomarchy-tui-install @@ -0,0 +1,59 @@ +#!/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" </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." diff --git a/bin/nomarchy-tz-select b/bin/nomarchy-tz-select new file mode 100755 index 0000000..5fff725 --- /dev/null +++ b/bin/nomarchy-tz-select @@ -0,0 +1,6 @@ +#!/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" +nomarchy-restart-waybar diff --git a/bin/nomarchy-update b/bin/nomarchy-update new file mode 100755 index 0000000..cf0ce1b --- /dev/null +++ b/bin/nomarchy-update @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Nomarchy Update Script +# 1. Updates the flake inputs in /etc/nixos +# 2. Applies system-wide NixOS changes +# 3. Applies user-level Home Manager changes + +set -e + +REPO_DIR="/etc/nixos" + +if [ ! -d "$REPO_DIR" ]; then + echo "Error: $REPO_DIR not found. Are you running on a Nomarchy system?" + exit 1 +fi + +echo "--- Starting Nomarchy Update ---" + +# 1. Update Flake Lock +echo "Updating flake inputs..." +sudo nix --extra-experimental-features "nix-command flakes" flake update --flake "$REPO_DIR" + +# 2. Rebuild System +echo "Applying system-level updates..." +sudo nixos-rebuild switch --flake "$REPO_DIR#default" + +# 3. Rebuild Home Environment +echo "Applying user-level updates..." +home-manager switch --flake "$REPO_DIR#default" --impure + +# 4. Commit changes if it's a git repo +if [ -d "$REPO_DIR/.git" ]; then + echo "Committing update to local history..." + sudo git -C "$REPO_DIR" add flake.lock + sudo git -C "$REPO_DIR" commit -m "chore: update system (flake.lock)" || echo "No lockfile changes to commit." +fi + +echo "--- Nomarchy Update Complete ---" diff --git a/bin/nomarchy-update-analyze-logs b/bin/nomarchy-update-analyze-logs new file mode 100755 index 0000000..1a5d3bf --- /dev/null +++ b/bin/nomarchy-update-analyze-logs @@ -0,0 +1,11 @@ +#!/bin/bash + +update_log="/tmp/nomarchy-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 diff --git a/bin/nomarchy-update-aur-pkgs b/bin/nomarchy-update-aur-pkgs new file mode 100755 index 0000000..84266c0 --- /dev/null +++ b/bin/nomarchy-update-aur-pkgs @@ -0,0 +1,13 @@ +#!/bin/bash + +# Update AUR packages if any are installed +if pacman -Qem >/dev/null; then + if nomarchy-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 diff --git a/bin/nomarchy-update-available b/bin/nomarchy-update-available new file mode 100755 index 0000000..6d675ca --- /dev/null +++ b/bin/nomarchy-update-available @@ -0,0 +1,23 @@ +#!/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 "Nomarchy update available ($latest_tag)" + exit 0 +else + echo "Nomarchy is up to date ($current_tag)" + exit 1 +fi diff --git a/bin/nomarchy-update-available-reset b/bin/nomarchy-update-available-reset new file mode 100755 index 0000000..2f136cb --- /dev/null +++ b/bin/nomarchy-update-available-reset @@ -0,0 +1,5 @@ +#!/bin/bash + +# Ensure Waybar icon offering the available update is removed +pkill -RTMIN+7 waybar +exit 0 diff --git a/bin/nomarchy-update-branch b/bin/nomarchy-update-branch new file mode 100755 index 0000000..9096d84 --- /dev/null +++ b/bin/nomarchy-update-branch @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e + +if (($# == 0)); then + echo "Usage: nomarchy-update-branch [master|dev]" + exit 1 +fi + +branch="$1" + +# Snapshot before switching branch +nomarchy-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 +nomarchy-update-perform diff --git a/bin/nomarchy-update-confirm b/bin/nomarchy-update-confirm new file mode 100755 index 0000000..b3905b4 --- /dev/null +++ b/bin/nomarchy-update-confirm @@ -0,0 +1,16 @@ +#!/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/nomarchy/releases" + +echo + +if ! gum confirm "Continue with update?"; then + echo "Update cancelled" + exit 1 +fi diff --git a/bin/nomarchy-update-firmware b/bin/nomarchy-update-firmware new file mode 100755 index 0000000..9fb0fb1 --- /dev/null +++ b/bin/nomarchy-update-firmware @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e +echo -e "\e[32mUpdate Firmware\e[0m" + +if nomarchy-cmd-missing fwupdmgr; then + nomarchy-pkg-add fwupd +fi + +fwupdmgr refresh --force +sudo fwupdmgr update diff --git a/bin/nomarchy-update-git b/bin/nomarchy-update-git new file mode 100755 index 0000000..e1db1c0 --- /dev/null +++ b/bin/nomarchy-update-git @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +echo -e "\e[32mUpdate Nomarchy\e[0m" + +nomarchy-update-time + +git -C $OMARCHY_PATH pull --autostash +git -C $OMARCHY_PATH --no-pager diff --check || git -C $OMARCHY_PATH reset --merge diff --git a/bin/nomarchy-update-keyring b/bin/nomarchy-update-keyring new file mode 100755 index 0000000..beb3116 --- /dev/null +++ b/bin/nomarchy-update-keyring @@ -0,0 +1,18 @@ +#!/bin/bash + +# Ensure we have the nomarchy-keyring and it's populated +if nomarchy-pkg-missing nomarchy-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 nomarchy-update-system-pkgs right after this (and it needs latest keyring)! + sudo pacman -Sy + nomarchy-pkg-add nomarchy-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 diff --git a/bin/nomarchy-update-orphan-pkgs b/bin/nomarchy-update-orphan-pkgs new file mode 100755 index 0000000..3d7a351 --- /dev/null +++ b/bin/nomarchy-update-orphan-pkgs @@ -0,0 +1,10 @@ +#!/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 diff --git a/bin/nomarchy-update-perform b/bin/nomarchy-update-perform new file mode 100755 index 0000000..a28d9d3 --- /dev/null +++ b/bin/nomarchy-update-perform @@ -0,0 +1,26 @@ +#!/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/nomarchy-update.log") 2>&1 + +# Perform all update steps +nomarchy-update-keyring +nomarchy-update-available-reset +nomarchy-update-system-pkgs +nomarchy-migrate +nomarchy-update-aur-pkgs +nomarchy-update-orphan-pkgs +nomarchy-hook post-update + +nomarchy-update-analyze-logs + +nomarchy-update-restart + +# Re-enable screensaver/sleep after updates +hyprctl dispatch tagwindow -- -noidle &>/dev/null || true diff --git a/bin/nomarchy-update-restart b/bin/nomarchy-update-restart new file mode 100755 index 0000000..280d197 --- /dev/null +++ b/bin/nomarchy-update-restart @@ -0,0 +1,24 @@ +#!/bin/bash + +echo + +if [[ ! -d /usr/lib/modules/$(uname -r) ]]; then + gum confirm "Linux kernel has been updated. Reboot?" && nomarchy-system-reboot +elif [[ -f $HOME/.local/state/nomarchy/reboot-required ]]; then + gum confirm "Updates require reboot. Ready?" && nomarchy-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?" && nomarchy-system-reboot +fi + +for file in "$HOME"/.local/state/nomarchy/restart-*-required; do + if [[ -f $file ]]; then + filename=$(basename "$file") + service=$(echo "$filename" | sed 's/restart-\(.*\)-required/\1/') + echo "Restarting $service" + nomarchy-state clear "$filename" + nomarchy-restart-"$service" + fi +done diff --git a/bin/nomarchy-update-system-pkgs b/bin/nomarchy-update-system-pkgs new file mode 100755 index 0000000..36a7841 --- /dev/null +++ b/bin/nomarchy-update-system-pkgs @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +echo -e "\e[32m\nUpdate system packages\e[0m" +sudo pacman -Syyu --noconfirm diff --git a/bin/nomarchy-update-time b/bin/nomarchy-update-time new file mode 100755 index 0000000..14fc8b6 --- /dev/null +++ b/bin/nomarchy-update-time @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Updating time..." +sudo systemctl restart systemd-timesyncd diff --git a/bin/nomarchy-update-without-idle b/bin/nomarchy-update-without-idle new file mode 100755 index 0000000..fddc73b --- /dev/null +++ b/bin/nomarchy-update-without-idle @@ -0,0 +1,5 @@ +#!/bin/bash + +# No-op now that nomarchy-update-perform is responsible for idle management. +# But this file can't be removed since it was referenced in old nomarchy-update files, +# which would fail if this file is missing. diff --git a/bin/nomarchy-upload-log b/bin/nomarchy-upload-log new file mode 100755 index 0000000..d1853c4 --- /dev/null +++ b/bin/nomarchy-upload-log @@ -0,0 +1,126 @@ +#!/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/nomarchy-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 diff --git a/bin/nomarchy-version b/bin/nomarchy-version new file mode 100755 index 0000000..5ddc823 --- /dev/null +++ b/bin/nomarchy-version @@ -0,0 +1,2 @@ +#!/bin/bash +cat $OMARCHY_PATH/version diff --git a/bin/nomarchy-version-branch b/bin/nomarchy-version-branch new file mode 100755 index 0000000..43281d9 --- /dev/null +++ b/bin/nomarchy-version-branch @@ -0,0 +1,3 @@ +#!/bin/bash + +echo $(git -C "$OMARCHY_PATH" rev-parse --abbrev-ref HEAD) diff --git a/bin/nomarchy-version-channel b/bin/nomarchy-version-channel new file mode 100755 index 0000000..e542acc --- /dev/null +++ b/bin/nomarchy-version-channel @@ -0,0 +1,27 @@ +#!/bin/bash + +if grep -q "https://stable-mirror.nomarchy.org/" /etc/pacman.d/mirrorlist; then + mirror="stable" +elif grep -q "https://rc-mirror.nomarchy.org/" /etc/pacman.d/mirrorlist; then + mirror="rc" +elif grep -q "https://mirror.nomarchy.org/" /etc/pacman.d/mirrorlist; then + mirror="edge" +else + mirror="unknown" +fi + +if grep -q "https://pkgs.nomarchy.org/stable/" /etc/pacman.conf; then + pkgs="stable" +elif grep -q "https://pkgs.nomarchy.org/edge/" /etc/pacman.conf; then + pkgs="edge" +elif grep -q "https://pkgs.nomarchy.org/rc/" /etc/pacman.conf; then + pkgs="rc" +else + pkgs="unknown" +fi + +if [[ $mirror == $pkgs ]]; then + echo $mirror +else + echo "$mirror / $pkgs" +fi diff --git a/bin/nomarchy-version-pkgs b/bin/nomarchy-version-pkgs new file mode 100755 index 0000000..bc63811 --- /dev/null +++ b/bin/nomarchy-version-pkgs @@ -0,0 +1,3 @@ +#!/bin/bash + +date -d "$(grep upgraded /var/log/pacman.log | tail -1 | sed -E 's/\[([^]]+)\].*/\1/')" "+%A, %B %d %Y at %H:%M" diff --git a/bin/nomarchy-voxtype-config b/bin/nomarchy-voxtype-config new file mode 100755 index 0000000..27b641f --- /dev/null +++ b/bin/nomarchy-voxtype-config @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +# Used by Voxtype waybar module to open config on right click + +exec nomarchy-launch-editor ~/.config/voxtype/config.toml diff --git a/bin/nomarchy-voxtype-install b/bin/nomarchy-voxtype-install new file mode 100755 index 0000000..467b45b --- /dev/null +++ b/bin/nomarchy-voxtype-install @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +# Install voxtype and configure it for use. + +if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then + nomarchy-pkg-add wtype voxtype-bin + + # Setup voxtype + mkdir -p ~/.config/voxtype + cp $OMARCHY_PATH/default/voxtype/config.toml ~/.config/voxtype/ + + voxtype setup --download --no-post-install + if nomarchy-hw-vulkan; then + voxtype setup gpu --enable || true + fi + voxtype setup systemd + + nomarchy-restart-waybar + notify-send " Voxtype Dictation Ready" "Press Super + Ctrl + X to toggle dictation.\nEdit ~/.config/voxtype/config.toml for options." -t 10000 +fi diff --git a/bin/nomarchy-voxtype-model b/bin/nomarchy-voxtype-model new file mode 100755 index 0000000..bd2d5ce --- /dev/null +++ b/bin/nomarchy-voxtype-model @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +nomarchy-launch-floating-terminal-with-presentation "voxtype setup model" +nomarchy-restart-waybar diff --git a/bin/nomarchy-voxtype-remove b/bin/nomarchy-voxtype-remove new file mode 100755 index 0000000..8eb49ca --- /dev/null +++ b/bin/nomarchy-voxtype-remove @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +# Remove voxtype and its configurations. + +if nomarchy-cmd-present voxtype; then + echo "Uninstall Voxtype to remove dictation." + + # Remove services + systemctl --user stop voxtype.service 2>/dev/null || true + rm -f ~/.config/systemd/user/voxtype* + systemctl --user daemon-reload + + # Remove packages and configs + nomarchy-pkg-drop wtype voxtype-bin + rm -rf ~/.config/voxtype + rm -rf ~/.local/share/voxtype +else + echo "Voxtype was not installed." +fi diff --git a/bin/nomarchy-voxtype-status b/bin/nomarchy-voxtype-status new file mode 100755 index 0000000..03d7e1d --- /dev/null +++ b/bin/nomarchy-voxtype-status @@ -0,0 +1,9 @@ +#!/bin/bash + +if nomarchy-cmd-present voxtype; then + voxtype status --follow --extended --format json | while read -r line; do + echo "$line" | jq -c '. + {alt: .class}' + done +else + echo '{"alt": "", "tooltip": ""}' +fi diff --git a/bin/nomarchy-webapp-handler-hey b/bin/nomarchy-webapp-handler-hey new file mode 100755 index 0000000..f050d36 --- /dev/null +++ b/bin/nomarchy-webapp-handler-hey @@ -0,0 +1,11 @@ +#!/bin/bash +url="$1" +web_url="https://app.hey.com" + +# Handle mailto: URLs +if [[ $url =~ ^mailto: ]]; then + email=$(echo "$url" | sed 's/mailto://') + web_url="https://app.hey.com/messages/new?to=$email" +fi + +exec nomarchy-launch-webapp "$web_url" diff --git a/bin/nomarchy-webapp-handler-zoom b/bin/nomarchy-webapp-handler-zoom new file mode 100755 index 0000000..82aafe9 --- /dev/null +++ b/bin/nomarchy-webapp-handler-zoom @@ -0,0 +1,20 @@ +#!/bin/bash + +url="$1" +web_url="https://app.zoom.us/wc/home" + +if [[ $url =~ ^zoom(mtg|us):// ]]; then + confno=$(echo "$url" | sed -n 's/.*[?&]confno=\([^&]*\).*/\1/p') + + if [[ -n $confno ]]; then + pwd=$(echo "$url" | sed -n 's/.*[?&]pwd=\([^&]*\).*/\1/p') + + if [[ -n $pwd ]]; then + web_url="https://app.zoom.us/wc/join/$confno?pwd=$pwd" + else + web_url="https://app.zoom.us/wc/join/$confno" + fi + fi +fi + +exec nomarchy-launch-webapp "$web_url" diff --git a/bin/nomarchy-webapp-install b/bin/nomarchy-webapp-install new file mode 100755 index 0000000..1d3e7b8 --- /dev/null +++ b/bin/nomarchy-webapp-install @@ -0,0 +1,89 @@ +#!/bin/bash + +set -e + +ICON_DIR="$HOME/.local/share/applications/icons" + +if (( $# < 3 )); then + echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m" + APP_NAME=$(gum input --prompt "Name> " --placeholder "My favorite web app") + APP_URL=$(gum input --prompt "URL> " --placeholder "https://example.com") + if [[ ! $APP_URL =~ ^[a-zA-Z][a-zA-Z0-9+.-]*: ]]; then + APP_URL="https://$APP_URL" + fi + + # Try to fetch favicon automatically first. + FAVICON_URL="https://www.google.com/s2/favicons?domain=${APP_URL}&sz=128" + mkdir -p "$ICON_DIR" + if curl -fsSL -o "$ICON_DIR/$APP_NAME.png" "$FAVICON_URL" && [[ -s $ICON_DIR/$APP_NAME.png ]]; then + ICON_REF="$APP_NAME.png" + else + ICON_REF=$(gum input --prompt "Icon URL> " --placeholder "Could not fetch favicon automatically. Enter PNG icon URL (see https://dashboardicons.com)") + fi + + CUSTOM_EXEC="" + MIME_TYPES="" + INTERACTIVE_MODE=true +else + APP_NAME="$1" + APP_URL="$2" + if [[ ! $APP_URL =~ ^[a-zA-Z][a-zA-Z0-9+.-]*: ]]; then + APP_URL="https://$APP_URL" + fi + ICON_REF="$3" + CUSTOM_EXEC="$4" # Optional custom exec command + MIME_TYPES="$5" # Optional mime types + INTERACTIVE_MODE=false +fi + +# Ensure valid execution +if [[ -z $APP_NAME || -z $APP_URL ]]; then + echo "You must set app name and app URL!" + exit 1 +fi + +# Resolve icon from URL or from a local icon name. +mkdir -p "$ICON_DIR" + +if [[ -z $ICON_REF ]]; then + ICON_REF="https://www.google.com/s2/favicons?domain=${APP_URL}&sz=128" +fi + +if [[ $ICON_REF =~ ^https?:// ]]; then + ICON_PATH="$ICON_DIR/$APP_NAME.png" + if ! curl -fsSL -o "$ICON_PATH" "$ICON_REF" || [[ ! -s $ICON_PATH ]]; then + echo "Error: Failed to download icon." + exit 1 + fi +else + ICON_PATH="$ICON_DIR/$ICON_REF" +fi + +# Use custom exec if provided, otherwise default behavior +EXEC_COMMAND="${CUSTOM_EXEC:-nomarchy-launch-webapp $APP_URL}" + +# Create application .desktop file +DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" + +cat >"$DESKTOP_FILE" <>"$DESKTOP_FILE" +fi + +chmod +x "$DESKTOP_FILE" + +if [[ $INTERACTIVE_MODE == "true" ]]; then + echo -e "You can now find $APP_NAME using the app launcher (SUPER + SPACE)\n" +fi diff --git a/bin/nomarchy-webapp-remove b/bin/nomarchy-webapp-remove new file mode 100755 index 0000000..b927abc --- /dev/null +++ b/bin/nomarchy-webapp-remove @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +ICON_DIR="$HOME/.local/share/applications/icons" +DESKTOP_DIR="$HOME/.local/share/applications/" + +if (( $# == 0 )); then + # Find all web apps + while IFS= read -r -d '' file; do + if grep -q '^Exec=.*\(nomarchy-launch-webapp\|nomarchy-webapp-handler\).*' "$file"; then + WEB_APPS+=("$(basename "${file%.desktop}")") + fi + done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0) + + if ((${#WEB_APPS[@]})); then + IFS=$'\n' SORTED_WEB_APPS=($(sort <<<"${WEB_APPS[*]}")) + unset IFS + APP_NAMES_STRING=$(gum choose --no-limit --header "Select web app to remove..." --selected-prefix="✗ " "${SORTED_WEB_APPS[@]}") + # 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 web apps 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 select at least one web app to remove." + 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 diff --git a/bin/nomarchy-webapp-remove-all b/bin/nomarchy-webapp-remove-all new file mode 100755 index 0000000..80b5c50 --- /dev/null +++ b/bin/nomarchy-webapp-remove-all @@ -0,0 +1,36 @@ +#!/bin/bash + +# Remove all web apps installed via nomarchy-webapp-install. +# Identifies web apps by their Exec pattern (nomarchy-launch-webapp or nomarchy-webapp-handler). + +set -e + +APP_DIR="${1:-$HOME/.local/share/applications}" +ICON_DIR="$HOME/.local/share/applications/icons" + +echo "Scanning for web apps in $APP_DIR..." + +webapp_desktop_files=() +while IFS= read -r -d '' file; do + if grep -q "Exec=nomarchy-launch-webapp\|Exec=nomarchy-webapp-handler" "$file" 2>/dev/null; then + webapp_desktop_files+=("$file") + fi +done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null) + +if (( ${#webapp_desktop_files[@]} == 0 )); then + echo "No web apps found." + exit 0 +fi + +for file in "${webapp_desktop_files[@]}"; do + app_name=$(basename "$file" .desktop) + echo "Removing web app: $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 "Web apps removed successfully." diff --git a/bin/nomarchy-welcome b/bin/nomarchy-welcome new file mode 100755 index 0000000..74b5bd9 --- /dev/null +++ b/bin/nomarchy-welcome @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +FLAG_FILE="$HOME/.config/nomarchy/.first-run-done" + +if [ -f "$FLAG_FILE" ]; then + exit 0 +fi + +# Ensure we have a terminal for the wizard +if [ -z "$TERMINAL_WIZARD" ]; then + export TERMINAL_WIZARD=1 + alacritty -e "$0" + exit 0 +fi + +gum style \ + --foreground 212 --border-foreground 212 --border double \ + --align center --width 50 --margin "1 2" --padding "2 4" \ + "Nomarchy" "The NixOS Distribution with Omarchy Flavour" + +echo "Welcome! Let's personalize your new system." +echo "" + +# 1. Select initial theme +echo "Step 1: Choose your starting theme" +nomarchy-theme-selector + +# 2. Select initial font +echo "Step 2: Choose your preferred font" +nomarchy-font-selector + +# 3. Setup Local Repo (Crucial for env-update to work) +echo "" +echo "Nomarchy relies on a local git repository for declarative updates." +if [ ! -d "/etc/nixos/.git" ]; then + echo "Warning: /etc/nixos is not a git repository. Declarative updates might fail." + if gum confirm "Would you like to initialize /etc/nixos as a git repo?"; then + sudo git -C /etc/nixos init + sudo git -C /etc/nixos add . + sudo git -C /etc/nixos commit -m "Initial Nomarchy System Commit" + fi +fi + +# 4. Success +mkdir -p "$(dirname "$FLAG_FILE")" +touch "$FLAG_FILE" + +gum style --foreground 82 "Setup complete! Enjoy your Nomarchy experience." +sleep 3 diff --git a/bin/nomarchy-wifi-powersave b/bin/nomarchy-wifi-powersave new file mode 100755 index 0000000..9e1c5bb --- /dev/null +++ b/bin/nomarchy-wifi-powersave @@ -0,0 +1,5 @@ +#!/bin/bash +for iface in /sys/class/net/*/wireless; do + iface="$(basename "$(dirname "$iface")")" + iw dev "$iface" set power_save "$1" 2>/dev/null +done diff --git a/bin/nomarchy-windows-vm b/bin/nomarchy-windows-vm new file mode 100755 index 0000000..3548789 --- /dev/null +++ b/bin/nomarchy-windows-vm @@ -0,0 +1,448 @@ +#!/bin/bash +COMPOSE_FILE="$HOME/.config/windows/docker-compose.yml" + +check_prerequisites() { + local DISK_SIZE_GB=${1:-64} + local REQUIRED_SPACE=$((DISK_SIZE_GB + 10)) # Add 10GB for Windows ISO and overhead + + # Check for KVM support + if [[ ! -e /dev/kvm ]]; then + gum style \ + --border normal \ + --padding "1 2" \ + --margin "1" \ + "❌ KVM virtualization not available!" \ + "" \ + "Please enable virtualization in BIOS or run:" \ + " sudo modprobe kvm-intel # for Intel CPUs" \ + " sudo modprobe kvm-amd # for AMD CPUs" + exit 1 + fi + + # Check disk space + AVAILABLE_SPACE=$(df "$HOME" | awk 'NR==2 {print int($4/1024/1024)}') + if (( AVAILABLE_SPACE < REQUIRED_SPACE )); then + echo "❌ Insufficient disk space!" + echo " Available: ${AVAILABLE_SPACE}GB" + echo " Required: ${REQUIRED_SPACE}GB (${DISK_SIZE_GB}GB disk + 10GB for Windows image)" + exit 1 + fi +} + +install_windows() { + # Set up trap to handle Ctrl+C + trap "echo ''; echo 'Installation cancelled by user'; exit 1" INT + + check_prerequisites + + nomarchy-pkg-add freerdp openbsd-netcat gum + + mkdir -p "$HOME/.windows" + mkdir -p "$HOME/.config/windows" + mkdir -p "$HOME/.local/share/applications/icons" + + # Install Windows VM icon and desktop file + if [[ -f $OMARCHY_PATH/applications/icons/windows.png ]]; then + cp "$OMARCHY_PATH/applications/icons/windows.png" "$HOME/.local/share/applications/icons/windows.png" + fi + + cat << EOF | tee "$HOME/.local/share/applications/windows-vm.desktop" > /dev/null +[Desktop Entry] +Name=Windows +Comment=Start Windows VM via Docker and connect with RDP +Exec=uwsm app -- nomarchy-windows-vm launch +Icon=$HOME/.local/share/applications/icons/windows.png +Terminal=false +Type=Application +Categories=System;Virtualization; +EOF + + # Get system resources + TOTAL_RAM=$(free -h | awk 'NR==2 {print $2}') + TOTAL_RAM_GB=$(awk 'NR==1 {printf "%d", $2/1024/1024}' /proc/meminfo) + TOTAL_CORES=$(nproc) + + echo "" + echo "System Resources Detected:" + echo " Total RAM: $TOTAL_RAM" + echo " Total CPU Cores: $TOTAL_CORES" + echo "" + + RAM_OPTIONS="" + for size in 2 4 8 16 32 64; do + if (( size <= TOTAL_RAM_GB )); then + RAM_OPTIONS="$RAM_OPTIONS ${size}G" + fi + done + + SELECTED_RAM=$(echo $RAM_OPTIONS | tr ' ' '\n' | gum choose --selected="4G" --header="How much RAM would you like to allocate to Windows VM?") + + # Check if user cancelled + if [[ -z $SELECTED_RAM ]]; then + echo "Installation cancelled by user" + exit 1 + fi + + SELECTED_CORES=$(gum input --placeholder="Number of CPU cores (1-$TOTAL_CORES)" --value="2" --header="How many CPU cores would you like to allocate to Windows VM?" --char-limit=2) + + # Check if user cancelled (Ctrl+C in gum input returns empty string) + if [[ -z $SELECTED_CORES ]]; then + echo "Installation cancelled by user" + exit 1 + fi + + if ! [[ $SELECTED_CORES =~ ^[0-9]+$ ]] || (( SELECTED_CORES < 1 )) || (( SELECTED_CORES > TOTAL_CORES )); then + echo "Invalid input. Using default: 2 cores" + SELECTED_CORES=2 + fi + + AVAILABLE_SPACE=$(df "$HOME" | awk 'NR==2 {print int($4/1024/1024)}') + MAX_DISK_GB=$((AVAILABLE_SPACE - 10)) # Leave 10GB for Windows image + + # Check if we have enough space for minimum + if (( MAX_DISK_GB < 32 )); then + echo "❌ Insufficient disk space for Windows VM!" + echo " Available: ${AVAILABLE_SPACE}GB" + echo " Minimum required: 42GB (32GB disk + 10GB for Windows image)" + exit 1 + fi + + DISK_OPTIONS="" + for size in 32 64 128 256 512; do + if (( size <= MAX_DISK_GB )); then + DISK_OPTIONS="$DISK_OPTIONS ${size}G" + fi + done + + # Default to 64G if available, otherwise 32G + DEFAULT_DISK="64G" + if ! echo "$DISK_OPTIONS" | grep -q "64G"; then + DEFAULT_DISK="32G" + fi + + SELECTED_DISK=$(echo $DISK_OPTIONS | tr ' ' '\n' | gum choose --selected="$DEFAULT_DISK" --header="How much disk space would you like to give Windows VM? (64GB+ recommended)") + + # Check if user cancelled + if [[ -z $SELECTED_DISK ]]; then + echo "Installation cancelled by user" + exit 1 + fi + + # Extract just the number for prerequisite check + DISK_SIZE_NUM=$(echo "$SELECTED_DISK" | sed 's/G//') + + # Re-check prerequisites with selected disk size + check_prerequisites "$DISK_SIZE_NUM" + + # Prompt for username and password + USERNAME=$(gum input --placeholder="Username (Press enter to use default: docker)" --header="Enter Windows username:") + if [[ -z $USERNAME ]]; then + USERNAME="docker" + fi + + PASSWORD=$(gum input --placeholder="Password (Press enter to use default: admin)" --password --header="Enter Windows password:") + if [[ -z $PASSWORD ]]; then + PASSWORD="admin" + PASSWORD_DISPLAY="(default)" + else + PASSWORD_DISPLAY="(user-defined)" + fi + + # Display configuration summary + gum style \ + --border normal \ + --padding "1 2" \ + --margin "1" \ + --align left \ + --bold \ + "Windows VM Configuration" \ + "" \ + "RAM: $SELECTED_RAM" \ + "CPU: $SELECTED_CORES cores" \ + "Disk: $SELECTED_DISK" \ + "Username: $USERNAME" \ + "Password: $PASSWORD_DISPLAY" + + # Ask for confirmation + echo "" + if ! gum confirm "Proceed with this configuration?"; then + echo "Installation cancelled by user" + exit 1 + fi + + mkdir -p $HOME/Windows + + # Create docker-compose.yml in user config directory + cat << EOF | tee "$COMPOSE_FILE" > /dev/null +services: + windows: + image: dockurr/windows + container_name: nomarchy-windows + environment: + VERSION: "11" + RAM_SIZE: "$SELECTED_RAM" + CPU_CORES: "$SELECTED_CORES" + DISK_SIZE: "$SELECTED_DISK" + USERNAME: "$USERNAME" + PASSWORD: "$PASSWORD" + TZ: "$(timedatectl show -p Timezone --value 2>/dev/null || echo UTC)" + ARGUMENTS: "-rtc base=localtime,clock=host,driftfix=slew" + devices: + - /dev/kvm + - /dev/net/tun + cap_add: + - NET_ADMIN + ports: + - 127.0.0.1:8006:8006 + - 127.0.0.1:3389:3389/tcp + - 127.0.0.1:3389:3389/udp + volumes: + - $HOME/.windows:/storage + - $HOME/Windows:/shared + restart: unless-stopped + stop_grace_period: 2m +EOF + + echo "" + echo "Starting Windows VM installation..." + echo "This will download a Windows 11 image (may take 10-15 minutes)." + echo "" + echo "Monitor installation progress at: http://127.0.0.1:8006" + echo "" + + # Start docker-compose with user's config + echo "Starting Windows VM with docker-compose..." + if ! docker-compose -f "$COMPOSE_FILE" up -d 2>&1; then + echo "❌ Failed to start Windows VM!" + echo " Common issues:" + echo " - Docker daemon not running: sudo systemctl start docker" + echo " - Port already in use: check if another VM is running" + echo " - Permission issues: make sure you're in the docker group" + exit 1 + fi + + echo "" + echo "Windows VM is starting up!" + echo "" + echo "Opening browser to monitor installation..." + + # Open browser to monitor installation + sleep 3 + xdg-open "http://127.0.0.1:8006" + + echo "" + echo "Installation is running in the background." + echo "You can monitor progress at: http://127.0.0.1:8006" + echo "" + echo "Once finished, launch 'Windows' via Super + Space" + echo "" + echo "To stop the VM: nomarchy-windows-vm stop" + echo "To change resources: ~/.config/windows/docker-compose.yml" + echo "" +} + +remove_windows() { + if ! gum confirm --default=false "Remove Windows VM and delete all associated data?"; then + echo "Removal cancelled by user" + exit 1 + fi + + echo "Removing Windows VM..." + + docker-compose -f "$COMPOSE_FILE" down 2>/dev/null || true + + docker rmi dockurr/windows 2>/dev/null || echo "Image already removed or not found" + + rm "$HOME/.local/share/applications/windows-vm.desktop" + rm -rf "$HOME/.config/windows" + rm -rf "$HOME/.windows" + + echo "" + echo "Windows VM removal completed!" +} + +launch_windows() { + KEEP_ALIVE=false + if [[ $1 = "--keep-alive" ]] || [[ $1 = "-k" ]]; then + KEEP_ALIVE=true + fi + + # Check if config exists + if [[ ! -f $COMPOSE_FILE ]]; then + echo "Windows VM not configured. Please run: nomarchy-windows-vm install" + exit 1 + fi + + # Extract credentials from compose file + WIN_USER=$(grep "USERNAME:" "$COMPOSE_FILE" | sed 's/.*USERNAME: "\(.*\)"/\1/') + WIN_PASS=$(grep "PASSWORD:" "$COMPOSE_FILE" | sed 's/.*PASSWORD: "\(.*\)"/\1/') + + # Use defaults if not found + [[ -z $WIN_USER ]] && WIN_USER="docker" + [[ -z $WIN_PASS ]] && WIN_PASS="admin" + + # Check if container is already running + CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' nomarchy-windows 2>/dev/null) + + if [[ $CONTAINER_STATUS != "running" ]]; then + echo "Starting Windows VM..." + + # Send desktop notification + notify-send " Starting Windows VM" " This can take 15-30 seconds" -t 15000 + + if ! docker-compose -f "$COMPOSE_FILE" up -d 2>&1; then + echo "❌ Failed to start Windows VM!" + echo " Try checking: nomarchy-windows-vm status" + echo " View logs: docker logs nomarchy-windows" + notify-send -u critical "Windows VM" "Failed to start Windows VM" + exit 1 + fi + + echo "Waiting for Windows VM to start..." + WAIT_COUNT=0 + until docker logs nomarchy-windows 2>&1 | grep -qi "windows started successfully"; do + sleep 2 + WAIT_COUNT=$((WAIT_COUNT + 1)) + if (( WAIT_COUNT > 60 )); then # 2 minutes timeout + echo "" + echo "❌ Timeout: Windows VM failed to start within 2 minutes" + echo " Check logs: docker logs nomarchy-windows" + exit 1 + fi + done + fi + + # Build the connection info + if [[ $KEEP_ALIVE = "true" ]]; then + LIFECYCLE="VM will keep running after RDP closes +To stop: nomarchy-windows-vm stop" + else + LIFECYCLE="VM will auto-stop when RDP closes" + fi + + gum style \ + --border normal \ + --padding "1 2" \ + --margin "1" \ + --align center \ + "Connecting to Windows VM" \ + "" \ + "$LIFECYCLE" + + # Detect display scale from Hyprland + HYPR_SCALE=$(hyprctl monitors -j | jq -r '.[] | select (.focused == true) | .scale') + SCALE_PERCENT=$(echo "$HYPR_SCALE" | awk '{print int($1 * 100)}') + + RDP_SCALE="" + if (( SCALE_PERCENT >= 170 )); then + RDP_SCALE="/scale:180" + elif (( SCALE_PERCENT >= 130 )); then + RDP_SCALE="/scale:140" + fi + # If scale is less than 130%, don't set any scale (use default 100) + + # Connect with RDP in fullscreen (auto-detects resolution) + xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /clipboard /cert:ignore /title:"Windows VM - Nomarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE + + # After RDP closes, stop the container unless --keep-alive was specified + if [[ $KEEP_ALIVE = "false" ]]; then + echo "" + echo "RDP session closed. Stopping Windows VM..." + docker-compose -f "$COMPOSE_FILE" down + echo "Windows VM stopped." + else + echo "" + echo "RDP session closed. Windows VM is still running." + echo "To stop it: nomarchy-windows-vm stop" + fi +} + +stop_windows() { + if [[ ! -f $COMPOSE_FILE ]]; then + echo "Windows VM not configured." + exit 1 + fi + + echo "Stopping Windows VM..." + docker-compose -f "$COMPOSE_FILE" down + echo "Windows VM stopped." +} + +status_windows() { + if [[ ! -f $COMPOSE_FILE ]]; then + echo "Windows VM not configured." + echo "To set up: nomarchy-windows-vm install" + exit 1 + fi + + CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' nomarchy-windows 2>/dev/null) + + if [[ -z $CONTAINER_STATUS ]]; then + echo "Windows VM container not found." + echo "To start: nomarchy-windows-vm launch" + elif [[ $CONTAINER_STATUS = "running" ]]; then + gum style \ + --border normal \ + --padding "1 2" \ + --margin "1" \ + --align left \ + "Windows VM Status: RUNNING" \ + "" \ + "Web interface: http://127.0.0.1:8006" \ + "RDP available: port 3389" \ + "" \ + "To connect: nomarchy-windows-vm launch" \ + "To stop: nomarchy-windows-vm stop" + else + echo "Windows VM is stopped (status: $CONTAINER_STATUS)" + echo "To start: nomarchy-windows-vm launch" + fi +} + +show_usage() { + echo "Usage: nomarchy-windows-vm [command] [options]" + echo "" + echo "Commands:" + echo " install Install and configure Windows VM" + echo " remove Remove Windows VM and optionally its data" + echo " launch [options] Start Windows VM (if needed) and connect via RDP" + echo " Options:" + echo " --keep-alive, -k Keep VM running after RDP closes" + echo " stop Stop the running Windows VM" + echo " status Show current VM status" + echo " help Show this help message" + echo "" + echo "Examples:" + echo " nomarchy-windows-vm install # Set up Windows VM for first time" + echo " nomarchy-windows-vm launch # Connect to VM (auto-stop on exit)" + echo " nomarchy-windows-vm launch -k # Connect to VM (keep running)" + echo " nomarchy-windows-vm stop # Shut down the VM" +} + +# Main command dispatcher +case "$1" in + install) + install_windows + ;; + remove) + remove_windows + ;; + launch|start) + launch_windows "$2" + ;; + stop|down) + stop_windows + ;; + status) + status_windows + ;; + help|--help|-h|"") + show_usage + ;; + *) + echo "Unknown command: $1" >&2 + echo "" >&2 + show_usage >&2 + exit 1 + ;; +esac diff --git a/config/Typora/themes/ia_typora.css b/config/Typora/themes/ia_typora.css new file mode 100644 index 0000000..231ca17 --- /dev/null +++ b/config/Typora/themes/ia_typora.css @@ -0,0 +1,309 @@ +:root { + --accent-color: #aeb1b5; /* #'s before H1-3 */ + --background-color: white; + --border-color: #ddd; + --code-bg-color: #f8f8f8; + --font-color: #42464c; + --header-color: #222324; + --link-color: #2077b2; + --control-text-color: #667176; + --side-bar-bg-color: #fafafa; + --body-font: "iA Writer Mono S"; + --border-radius: 2px; + --document-horizontal-margin: 80px; + --document-padding-x: 10ch; + --font-size: 20px; + --h1-fontsize: 20px; /* 1,5 rem = 24px */ + --h2-fontsize: 20px; /* 1,375 rem = 22px */ + --h3-fontsize: 20px; /* 1,25 rem = 20px */ + --h4-fontsize: 20px; /* 1,125 rem = 18px */ + --line-height: 1.8; + --main-content-margin: 0 auto; + --main-content-max-width: 85ch; + --monospace-font-size: 20px; + --monospace-font: "iA Writer Mono S"; + --monospace-line-height: 1.6; + --monospace: var(--monospace-font); /* Fixes source code mode */ + --nav-width: 200px; + --vertical-padding: 40px; +} + +/* Narrow layout styles */ +@media (max-width: 640px) { + :root { + --document-padding-x: 4ch; + } +} + +html { + font-size: var(--font-size); + background-color: var(--background-color); +} + +html, +body { + color: var(--font-color); + font-family: var(--body-font); + line-height: var(--line-height); +} + +#write { + /* size of writing area: */ + padding-left: var(--document-padding-x); + padding-right: var(--document-padding-x); + max-width: var(--main-content-max-width); + box-sizing: border-box; +} + +/** + * --------------------- + * Block Elements + */ + +/* yaml */ +pre.md-meta-block { + background-color: var(--background-color); + padding-bottom: .5rem; + color: var(--accent-color); + border-bottom: 2px solid var(--border-color); + font-family: var(--monospace-font); +} + +/* headings */ +h1, h2, h3 { + font-weight: bold; + color: var(--header-color); +} + +h1 { + margin-top: 1rem; + margin-bottom: 1rem; + font-size: var(--h1-fontsize); +} + +h1:not(:first-child) { + margin-top: 1rem; +} + +h2 { + margin-top: 1rem; + margin-bottom: 0rem; + font-size: var(--h2-fontsize); +} + +h3 { + margin-top: 1rem; + margin-bottom: 0rem; + font-size: var(--h3-fontsize); +} + +h4, h5, h6 { + color: var(--header-color); + margin-top: 1rem; + margin-bottom: 0rem; + font-size: 1rem; +} + +h4 { + font-size: var(--h4-fontsize); +} + +h6 { + color: var(--control-text-color); +} + +h1::before, +h2::before, +h3::before { + font-weight: 400; + text-align: right; + width: 5ch; + padding-right: 1ch; + margin-left: -5ch; + color: var(--accent-color); + display: inline-block; +} + +h1::before { + content: '#'; +} + +h2::before { + content: '##'; +} + +h3::before { + content: '###'; +} + +h1 tt, +h1 code { + font-size: inherit; +} +h2 tt, +h2 code { + font-size: inherit; +} +h3 tt, +h3 code { + font-size: inherit; +} +h4 tt, +h4 code { + font-size: inherit; +} +h5 tt, +h5 code { + font-size: inherit; +} +h6 tt, +h6 code { + font-size: inherit; +} + +/* table */ +table { + margin-top: 1rem; + margin-bottom: 1rem; +} + +table tr:nth-child(2n), +thead { + background-color: var(--side-bar-bg-color); +} + +td, +th { + border-style: solid; + border-color: var(--border-color); + border-width: 1px; + padding: .35rem .7rem +} + +li p { + margin: 0; +} + +.task-list { + padding-left: 0; +} + +.task-list-item { + padding-left: 1.5em; + margin-bottom: 0rem; +} + +#write input[type='checkbox'] { + margin-top: 5px; +} + +blockquote { + margin: 1rem 0; + padding-left: 2ch; + margin-left: .5ch; + position: relative; + overflow: hidden; + border-left: 2px solid var(--border-color); + color: var(--accent-color); +} + +/* horizontal line */ +hr { + border: none; + border-bottom: 2px solid var(--border-color); + margin-top: 1.4rem; + margin-bottom: 1.4rem; +} + +p { + margin: 2rem 0; +} + +/** + * Code Fences + * see http:/*support.typora.io/Code-Block-Styles + */ + +.cm-s-inner .CodeMirror-gutters { + background: var(--code-bg-color); +} + +.code-tooltip { + box-shadow: none; + border-radius: var(--border-radius); + background-color: var(--code-bg-color); + border-color: var(--border-color); + border-style: solid; + border-width: 1px; +} + +.code-tooltip input { + outline: none; + width: 20ch; +} + +.md-fences .code-tooltip { + bottom: -1.8rem; + padding: none; +} + +.md-fences.md-focus .cm-s-inner { + /* Remove bottom right border radius when tooltip is shown */ + border-bottom-right-radius: 0; +} + +/* code tooltip autocomplete list */ + +.autoComplt-hint { + background-color: transparent !important; + margin: 0 !important; + padding: 0.125rem 0.375rem !important; + color: var(--text-color) !important; + line-height: var(--line-height) !important; + height: 1.4rem !important; +} + +.autoComplt-hint-selected { + background-color: var(--link-color) !important; + color: var(--background-color) !important; +} + +/* basic styles */ + +.md-fences, +code, +tt { + border: 1px solid var(--border-color); + background-color: var(--code-bg-color); + font-family: var(--monospace-font); + font-size: var(--monospace-font-size); + border-radius: .25rem; + padding: 0 .125rem; + line-height: var(--monospace-line-height); +} + +.md-fences { + margin-bottom: 18px; + margin-top: 15px; + padding: 0.2em 1em; + padding-top: 8px; + padding-bottom: 6px; +} + +a { + color: var(--link-color); +} + + +/** + * Control UI (optional) + */ + +.outline-item:hover { + color: var(--header-color); +} + +#write div.md-toc-tooltip { + background-color: var(--background-color); +} + diff --git a/config/Typora/themes/ia_typora_night.css b/config/Typora/themes/ia_typora_night.css new file mode 100644 index 0000000..d783d20 --- /dev/null +++ b/config/Typora/themes/ia_typora_night.css @@ -0,0 +1,95 @@ +@import 'night/codeblock.dark.css'; +@import 'night/mermaid.dark.css'; +@import 'night/sourcemode.dark.css'; +@import 'ia_typora.css'; + +:root { + --accented-background-color: #1e1e1e; + --light-header-color: #dbdbdb; /* H1-H3 */ + --select-text-bg-color: #186a9a; + --accent-color: #4f525a; + --background-color: #101010; + --font-color: #bbbcbc; + --header-color: #bebebe; /* H4-H6 */ + --border-color: #232629; + --link-color: #5584aa; + --code-bg-color: #1c1a1a; + --hover-bg-color: #050505; + --control-text-color: var(--font-color); + --side-bar-bg-color: var(--accented-background-color); + --control-text-hover-color: var(--header-color); + --item-hover-text-color: var(--header-color); + --item-hover-bg-color: var(--hover-bg-color); + --bg-color: var(--background-color); + --text-color: var(--font-color); + --meta-content-color: var(--accent-color); + --md-char-color: var(--accent-color); + --window-border: 1px solid rgba(0,0,0,.07); + --active-file-bg-color: var(--hover-bg-color); +} + +.outline-item:hover { + background-color: var(--hover-bg-color); +} + +#write { + cursor: -webkit-image-set(url("night/cursor.png") 1x, url("night/cursor@2x.png") 2x) 8 8, auto; +} + +h1, +h2, +h3 { + color: var(--light-header-color); +} + +mark { + background: #b8b80a +} + +table tr:nth-child(2n), +thead { + background-color: #141313; +} + +sup.md-footnote { + background-color: var(--code-bg-color); + color: var(--font-color); +} + +/* right click menu */ +.context-menu { + background-color: #141313; +} + +.context-menu.dropdown-menu .divider { + background-color: #232629; +} + +/* focus mode */ +.on-focus-mode .md-end-block:not(.md-focus):not(.md-focus-container) * { + color: #4f525a !important; +} + +.on-focus-mode .md-end-block:not(.md-focus) img, +.on-focus-mode .md-task-list-item:not(.md-focus-container)>input { + opacity: #4f525a !important; +} + +.on-focus-mode li[cid]:not(.md-focus-container){ + color: #4f525a; +} + +.on-focus-mode .md-fences.md-focus .CodeMirror-code>*:not(.CodeMirror-activeline) *, +.on-focus-mode .CodeMirror.cm-s-inner:not(.CodeMirror-focused) * { + color: #4f525a !important; +} + +.on-focus-mode .md-focus, +.on-focus-mode .md-focus-container { + color: var(--light-header-color); +} + +.on-focus-mode #typora-source .CodeMirror-code>*:not(.CodeMirror-activeline) * { + color: #4f525a !important; +} + diff --git a/config/alacritty/alacritty.toml b/config/alacritty/alacritty.toml new file mode 100644 index 0000000..3ab3672 --- /dev/null +++ b/config/alacritty/alacritty.toml @@ -0,0 +1,25 @@ +general.import = [ "~/.config/nomarchy/current/theme/alacritty.toml" ] + +[env] +TERM = "xterm-256color" + +[terminal] +osc52 = "CopyPaste" + +[font] +normal = { family = "JetBrainsMono Nerd Font", style = "Regular" } +bold = { family = "JetBrainsMono Nerd Font", style = "Bold" } +italic = { family = "JetBrainsMono Nerd Font", style = "Italic" } +size = 9 + +[window] +padding.x = 14 +padding.y = 14 +decorations = "None" + +[keyboard] +bindings = [ +{ key = "Insert", mods = "Shift", action = "Paste" }, +{ key = "Insert", mods = "Control", action = "Copy" }, +{ key = "Return", mods = "Shift", chars = "\u001B\r" } +] diff --git a/config/brave-flags.conf b/config/brave-flags.conf new file mode 100644 index 0000000..8f63bee --- /dev/null +++ b/config/brave-flags.conf @@ -0,0 +1,4 @@ +--ozone-platform=wayland +--ozone-platform-hint=wayland +--enable-features=TouchpadOverscrollHistoryNavigation +--load-extension=~/.local/share/nomarchy/default/chromium/extensions/copy-url diff --git a/config/btop/btop.conf b/config/btop/btop.conf new file mode 100644 index 0000000..c150ea0 --- /dev/null +++ b/config/btop/btop.conf @@ -0,0 +1,246 @@ +#? Config file for btop + +#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. +#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" +color_theme = "current" + +#* If the theme set background should be shown, set to False if you want terminal background transparency. +theme_background = True + +#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. +truecolor = True + +#* Set to true to force tty mode regardless if a real tty has been detected or not. +#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. +force_tty = False + +#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. +#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. +#* Use whitespace " " as separator between different presets. +#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" +presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" + +#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. +#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. +vim_keys = True + +#* Rounded corners on boxes, is ignored if TTY mode is ON. +rounded_corners = True + +#* Default symbols to use for graph creation, "braille", "block" or "tty". +#* "braille" offers the highest resolution but might not be included in all fonts. +#* "block" has half the resolution of braille but uses more common characters. +#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. +#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. +graph_symbol = "braille" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_cpu = "default" + +# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty". +graph_symbol_gpu = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_mem = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_net = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_proc = "default" + +#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace. +shown_boxes = "cpu mem net proc" + +#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. +update_ms = 2000 + +#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", +#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. +proc_sorting = "cpu lazy" + +#* Reverse sorting order, True or False. +proc_reversed = False + +#* Show processes as a tree. +proc_tree = False + +#* Use the cpu graph colors in the process list. +proc_colors = True + +#* Use a darkening gradient in the process list. +proc_gradient = True + +#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. +proc_per_core = False + +#* Show process memory as bytes instead of percent. +proc_mem_bytes = True + +#* Show cpu graph for each process. +proc_cpu_graphs = True + +#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) +proc_info_smaps = False + +#* Show proc box on left side of screen instead of right. +proc_left = False + +#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). +proc_filter_kernel = False + +#* In tree-view, always accumulate child process resources in the parent process. +proc_aggregate = False + +#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_upper = "Auto" + +#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_lower = "Auto" + +#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off". +show_gpu_info = "Auto" + +#* Toggles if the lower CPU graph should be inverted. +cpu_invert_lower = True + +#* Set to True to completely disable the lower CPU graph. +cpu_single_graph = False + +#* Show cpu box at bottom of screen instead of top. +cpu_bottom = False + +#* Shows the system uptime in the CPU box. +show_uptime = True + +#* Show cpu temperature. +check_temp = True + +#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. +cpu_sensor = "Auto" + +#* Show temperatures for cpu cores also if check_temp is True and sensors has been found. +show_coretemp = True + +#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. +#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. +#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. +#* Example: "4:0 5:1 6:3" +cpu_core_map = "" + +#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". +temp_scale = "celsius" + +#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. +base_10_sizes = False + +#* Show CPU frequency. +show_cpu_freq = True + +#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. +#* Special formatting: /host = hostname | /user = username | /uptime = system uptime +clock_format = "%X" + +#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. +background_update = True + +#* Custom cpu model name, empty string to disable. +custom_cpu_name = "" + +#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". +#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user". +disks_filter = "" + +#* Show graphs instead of meters for memory values. +mem_graphs = True + +#* Show mem box below net box instead of above. +mem_below_net = False + +#* Count ZFS ARC in cached and available memory. +zfs_arc_cached = True + +#* If swap memory should be shown in memory box. +show_swap = True + +#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. +swap_disk = True + +#* If mem box should be split to also show disks info. +show_disks = True + +#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. +only_physical = True + +#* Read disks list from /etc/fstab. This also disables only_physical. +use_fstab = True + +#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) +zfs_hide_datasets = False + +#* Set to true to show available disk space for privileged users. +disk_free_priv = False + +#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. +show_io_stat = True + +#* Toggles io mode for disks, showing big graphs for disk read/write speeds. +io_mode = False + +#* Set to True to show combined read/write io graphs in io mode. +io_graph_combined = False + +#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". +#* Example: "/mnt/media:100 /:20 /boot:1". +io_graph_speeds = "" + +#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. +net_download = 100 + +net_upload = 100 + +#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. +net_auto = True + +#* Sync the auto scaling for download and upload to whichever currently has the highest scale. +net_sync = True + +#* Starts with the Network Interface specified here. +net_iface = "" + +#* Show battery stats in top right if battery is present. +show_battery = True + +#* Which battery to use if multiple are present. "Auto" for auto detection. +selected_battery = "Auto" + +#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". +#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. +log_level = "WARNING" + +#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. +nvml_measure_pcie_speeds = True + +#* Horizontally mirror the GPU graph. +gpu_mirror_graph = True + +#* Custom gpu0 model name, empty string to disable. +custom_gpu_name0 = "" + +#* Custom gpu1 model name, empty string to disable. +custom_gpu_name1 = "" + +#* Custom gpu2 model name, empty string to disable. +custom_gpu_name2 = "" + +#* Custom gpu3 model name, empty string to disable. +custom_gpu_name3 = "" + +#* Custom gpu4 model name, empty string to disable. +custom_gpu_name4 = "" + +#* Custom gpu5 model name, empty string to disable. +custom_gpu_name5 = "" + diff --git a/config/chromium-flags.conf b/config/chromium-flags.conf new file mode 100644 index 0000000..8f63bee --- /dev/null +++ b/config/chromium-flags.conf @@ -0,0 +1,4 @@ +--ozone-platform=wayland +--ozone-platform-hint=wayland +--enable-features=TouchpadOverscrollHistoryNavigation +--load-extension=~/.local/share/nomarchy/default/chromium/extensions/copy-url diff --git a/config/chromium/Default/Preferences b/config/chromium/Default/Preferences new file mode 100644 index 0000000..3b4bc82 --- /dev/null +++ b/config/chromium/Default/Preferences @@ -0,0 +1,15 @@ +{ + "extensions": { + "theme": { + "id": "", + "use_system": false, + "use_custom": false + } + }, + "browser": { + "theme": { + "color_scheme": 2, + "user_color": 2 + } + } +} diff --git a/config/elephant/calc.toml b/config/elephant/calc.toml new file mode 100644 index 0000000..95d00d1 --- /dev/null +++ b/config/elephant/calc.toml @@ -0,0 +1 @@ +async = false diff --git a/config/elephant/desktopapplications.toml b/config/elephant/desktopapplications.toml new file mode 100644 index 0000000..de17325 --- /dev/null +++ b/config/elephant/desktopapplications.toml @@ -0,0 +1,3 @@ +show_actions = false +only_search_title = true +history = false diff --git a/config/elephant/symbols.toml b/config/elephant/symbols.toml new file mode 100644 index 0000000..3144c15 --- /dev/null +++ b/config/elephant/symbols.toml @@ -0,0 +1 @@ +command = 'wl-copy && hyprctl dispatch sendshortcut "SHIFT, Insert,"' diff --git a/config/environment.d/fcitx.conf b/config/environment.d/fcitx.conf new file mode 100644 index 0000000..ecedbcc --- /dev/null +++ b/config/environment.d/fcitx.conf @@ -0,0 +1,4 @@ +INPUT_METHOD=fcitx +QT_IM_MODULE=fcitx +XMODIFIERS=@im=fcitx +SDL_IM_MODULE=fcitx diff --git a/config/fastfetch/config.jsonc b/config/fastfetch/config.jsonc new file mode 100644 index 0000000..c9276dd --- /dev/null +++ b/config/fastfetch/config.jsonc @@ -0,0 +1,156 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "file", + "source": "~/.config/nomarchy/branding/about.txt", + "color": { "1": "green" }, + "padding": { + "top": 2, + "right": 6, + "left": 2 + } + }, + "modules": [ + "break", + { + "type": "custom", + "format": "\u001b[90m┌──────────────────────Hardware──────────────────────┐" + }, + { + "type": "host", + "key": " PC", + "keyColor": "green" + }, + { + "type": "cpu", + "key": "│ ├", + "showPeCoreCount": true, + "keyColor": "green" + }, + { + "type": "gpu", + "key": "│ ├", + "detectionMethod": "pci", + "keyColor": "green" + }, + { + "type": "display", + "key": "│ ├󱄄", + "keyColor": "green" + }, + { + "type": "disk", + "key": "│ ├󰋊", + "keyColor": "green" + }, + { + "type": "memory", + "key": "│ ├", + "keyColor": "green" + }, + { + "type": "swap", + "key": "└ └󰓡 ", + "keyColor": "green" + }, + { + "type": "custom", + "format": "\u001b[90m└────────────────────────────────────────────────────┘" + }, + "break", + { + "type": "custom", + "format": "\u001b[90m┌──────────────────────Software──────────────────────┐" + }, + { + "type": "command", + "key": "\ue900 OS", + "keyColor": "blue", + "text": "version=$(nomarchy-version); echo \"Nomarchy $version\"" + }, + { + "type": "command", + "key": "│ ├󰘬", + "keyColor": "blue", + "text": "branch=$(nomarchy-version-branch); echo \"$branch\"" + }, + { + "type": "command", + "key": "│ ├󰔫", + "keyColor": "blue", + "text": "channel=$(nomarchy-version-channel); echo \"$channel\"" + }, + { + "type": "kernel", + "key": "│ ├", + "keyColor": "blue" + }, + { + "type": "wm", + "key": "│ ├", + "keyColor": "blue" + }, + { + "type": "de", + "key": " DE", + "keyColor": "blue" + }, + { + "type": "terminal", + "key": "│ ├", + "keyColor": "blue" + }, + { + "type": "packages", + "key": "│ ├󰏖", + "keyColor": "blue" + }, + { + "type": "wmtheme", + "key": "│ ├󰉼", + "keyColor": "blue" + }, + { + "type": "command", + "key": "│ ├󰸌", + "keyColor": "blue", + "text": "theme=$(nomarchy-theme-current); echo -e \"$theme \\e[38m●\\e[37m●\\e[36m●\\e[35m●\\e[34m●\\e[33m●\\e[32m●\\e[31m●\"" + }, + { + "type": "terminalfont", + "key": "└ └", + "keyColor": "blue" + }, + { + "type": "custom", + "format": "\u001b[90m└────────────────────────────────────────────────────┘" + }, + "break", + { + "type": "custom", + "format": "\u001b[90m┌────────────────Age / Uptime / Update───────────────┐" + }, + { + "type": "command", + "key": "󱦟 OS Age", + "keyColor": "magenta", + "text": "echo $(( ($(date +%s) - $(stat -c %W /)) / 86400 )) days" + }, + { + "type": "uptime", + "key": "󱫐 Uptime", + "keyColor": "magenta" + }, + { + "type": "command", + "key": " Update", + "keyColor": "magenta", + "text": "updated=$(nomarchy-version-pkgs); echo \"$updated\"" + }, + { + "type": "custom", + "format": "\u001b[90m└────────────────────────────────────────────────────┘" + }, + "break" + ] +} diff --git a/config/fcitx5/conf/clipboard.conf b/config/fcitx5/conf/clipboard.conf new file mode 100644 index 0000000..8aef5a8 --- /dev/null +++ b/config/fcitx5/conf/clipboard.conf @@ -0,0 +1,2 @@ +TriggerKey= +PastePrimaryKey= diff --git a/config/fcitx5/conf/xcb.conf b/config/fcitx5/conf/xcb.conf new file mode 100644 index 0000000..90f5316 --- /dev/null +++ b/config/fcitx5/conf/xcb.conf @@ -0,0 +1 @@ +Allow Overriding System XKB Settings=False diff --git a/config/fontconfig/fonts.conf b/config/fontconfig/fonts.conf new file mode 100644 index 0000000..2d87376 --- /dev/null +++ b/config/fontconfig/fonts.conf @@ -0,0 +1,79 @@ + + + + + + sans-serif + + + Liberation Sans + + + + + + serif + + + Liberation Serif + + + + + + monospace + + + JetBrainsMono Nerd Font + + + + + system-ui + + Liberation Sans + + + + + ui-monospace + + monospace + + + + + -apple-system + + Liberation Sans + + + + + BlinkMacSystemFont + + Liberation Sans + + + + + sans-serif + + Noto Color Emoji + + + + + serif + + Noto Color Emoji + + + + + monospace + + Noto Color Emoji + + + diff --git a/config/ghostty/config b/config/ghostty/config new file mode 100644 index 0000000..00b6856 --- /dev/null +++ b/config/ghostty/config @@ -0,0 +1,37 @@ +# Dynamic theme colors +config-file = ?"~/.config/nomarchy/current/theme/ghostty.conf" + +# Font +font-family = "JetBrainsMono Nerd Font" +font-style = Regular +font-size = 9 + +# Window +window-theme = ghostty +window-padding-x = 14 +window-padding-y = 14 +confirm-close-surface=false +resize-overlay = never +gtk-toolbar-style = flat + +# Cursor styling +cursor-style = "block" +cursor-style-blink = false + +# Cursor styling + SSH session terminfo +# (all shell integration options must be passed together) +shell-integration-features = no-cursor,ssh-env + +# Keyboard bindings +keybind = shift+insert=paste_from_clipboard +keybind = control+insert=copy_to_clipboard +keybind = super+control+shift+alt+arrow_down=resize_split:down,100 +keybind = super+control+shift+alt+arrow_up=resize_split:up,100 +keybind = super+control+shift+alt+arrow_left=resize_split:left,100 +keybind = super+control+shift+alt+arrow_right=resize_split:right,100 + +# Slowdown mouse scrolling +mouse-scroll-multiplier = 0.95 + +# Fix general slowness on hyprland (https://github.com/ghostty-org/ghostty/discussions/3224) +async-backend = epoll diff --git a/config/git/config b/config/git/config new file mode 100644 index 0000000..0f8e979 --- /dev/null +++ b/config/git/config @@ -0,0 +1,28 @@ +# See https://git-scm.com/docs/git-config + +[alias] + co = checkout + br = branch + ci = commit + st = status +[init] + defaultBranch = master +[pull] + rebase = true # Rebase (instead of merge) on pull +[push] + autoSetupRemote = true # Automatically set upstream branch on push +[diff] + algorithm = histogram # Clearer diffs on moved/edited lines + colorMoved = plain # Highlight moved blocks in diffs + mnemonicPrefix = true # More intuitive refs in diff output +[commit] + verbose = true # Include diff comment in commit message template +[column] + ui = auto # Output in columns when possible +[branch] + sort = -committerdate # Sort branches by most recent commit first +[tag] + sort = -version:refname # Sort version numbers as you would expect +[rerere] + enabled = true # Record and reuse conflict resolutions + autoupdate = true # Apply stored conflict resolutions automatically diff --git a/config/hypr/autostart.conf b/config/hypr/autostart.conf new file mode 100644 index 0000000..708b3a2 --- /dev/null +++ b/config/hypr/autostart.conf @@ -0,0 +1,2 @@ +# Extra autostart processes +# exec-once = uwsm-app -- my-service diff --git a/config/hypr/bindings.conf b/config/hypr/bindings.conf new file mode 100644 index 0000000..e5ea97d --- /dev/null +++ b/config/hypr/bindings.conf @@ -0,0 +1,34 @@ +# Application bindings +bindd = SUPER, RETURN, Terminal, exec, uwsm-app -- xdg-terminal-exec --dir="$(nomarchy-cmd-terminal-cwd)" +bindd = SUPER ALT, RETURN, Tmux, exec, uwsm-app -- xdg-terminal-exec --dir="$(nomarchy-cmd-terminal-cwd)" bash -c "tmux attach || tmux new -s Work" +bindd = SUPER SHIFT, RETURN, Browser, exec, nomarchy-launch-browser +bindd = SUPER SHIFT, F, File manager, exec, uwsm-app -- nautilus --new-window +bindd = SUPER ALT SHIFT, F, File manager (cwd), exec, uwsm-app -- nautilus --new-window "$(nomarchy-cmd-terminal-cwd)" +bindd = SUPER SHIFT, B, Browser, exec, nomarchy-launch-browser +bindd = SUPER SHIFT ALT, B, Browser (private), exec, nomarchy-launch-browser --private +bindd = SUPER SHIFT, M, Music, exec, nomarchy-launch-or-focus spotify +bindd = SUPER SHIFT, N, Editor, exec, nomarchy-launch-editor +bindd = SUPER SHIFT, D, Docker, exec, nomarchy-launch-tui lazydocker +bindd = SUPER SHIFT, G, Signal, exec, nomarchy-launch-or-focus ^signal$ "uwsm-app -- signal-desktop" +bindd = SUPER SHIFT, O, Obsidian, exec, nomarchy-launch-or-focus ^obsidian$ "uwsm-app -- obsidian -disable-gpu --enable-wayland-ime" +bindd = SUPER SHIFT, W, Typora, exec, uwsm-app -- typora --enable-wayland-ime +bindd = SUPER SHIFT, SLASH, Passwords, exec, uwsm-app -- 1password + +# If your web app url contains #, type it as ## to prevent hyprland treating it as a comment +bindd = SUPER SHIFT, A, ChatGPT, exec, nomarchy-launch-webapp "https://chatgpt.com" +bindd = SUPER SHIFT ALT, A, Grok, exec, nomarchy-launch-webapp "https://grok.com" +bindd = SUPER SHIFT, C, Calendar, exec, nomarchy-launch-webapp "https://app.hey.com/calendar/weeks/" +bindd = SUPER SHIFT, E, Email, exec, nomarchy-launch-webapp "https://app.hey.com" +bindd = SUPER SHIFT, Y, YouTube, exec, nomarchy-launch-webapp "https://youtube.com/" +bindd = SUPER SHIFT ALT, G, WhatsApp, exec, nomarchy-launch-or-focus-webapp WhatsApp "https://web.whatsapp.com/" +bindd = SUPER SHIFT CTRL, G, Google Messages, exec, nomarchy-launch-or-focus-webapp "Google Messages" "https://messages.google.com/web/conversations" +bindd = SUPER SHIFT, P, Google Photos, exec, nomarchy-launch-or-focus-webapp "Google Photos" "https://photos.google.com/" +bindd = SUPER SHIFT, X, X, exec, nomarchy-launch-webapp "https://x.com/" +bindd = SUPER SHIFT ALT, X, X Post, exec, nomarchy-launch-webapp "https://x.com/compose/post" + +# Add extra bindings +# bind = SUPER SHIFT, R, exec, alacritty -e ssh your-server + +# Overwrite existing bindings, like putting Nomarchy Menu on Super + Space +# unbind = SUPER, SPACE +# bindd = SUPER, SPACE, Nomarchy menu, exec, nomarchy-menu diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf new file mode 100644 index 0000000..7eac23d --- /dev/null +++ b/config/hypr/hypridle.conf @@ -0,0 +1,28 @@ +general { + lock_cmd = nomarchy-lock-screen # lock screen and 1password + before_sleep_cmd = loginctl lock-session # lock before suspend. + after_sleep_cmd = sleep 1 && hyprctl dispatch dpms on # delay for PAM readiness, then turn on display. + inhibit_sleep = 3 # wait until screen is locked +} + +listener { + timeout = 150 # 2.5min + on-timeout = pidof hyprlock || nomarchy-launch-screensaver # start screensaver (if we haven't locked already) +} + +listener { + timeout = 151 # 5min + on-timeout = loginctl lock-session # lock screen when timeout has passed +} + +listener { + timeout = 330 # 5.5min + on-timeout = brightnessctl -sd '*::kbd_backlight' set 0 # save state and turn off keyboard backlight + on-resume = brightnessctl -rd '*::kbd_backlight' # restore keyboard backlight +} + +listener { + timeout = 330 # 5.5min + on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed + on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected +} diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf new file mode 100644 index 0000000..af346d5 --- /dev/null +++ b/config/hypr/hyprland.conf @@ -0,0 +1,23 @@ +# Learn how to configure Hyprland: https://wiki.hyprland.org/Configuring/ + +# Use defaults Nomarchy defaults (but don't edit these directly!) +source = ~/.local/share/nomarchy/default/hypr/autostart.conf +source = ~/.local/share/nomarchy/default/hypr/bindings/media.conf +source = ~/.local/share/nomarchy/default/hypr/bindings/clipboard.conf +source = ~/.local/share/nomarchy/default/hypr/bindings/tiling-v2.conf +source = ~/.local/share/nomarchy/default/hypr/bindings/utilities.conf +source = ~/.local/share/nomarchy/default/hypr/envs.conf +source = ~/.local/share/nomarchy/default/hypr/looknfeel.conf +source = ~/.local/share/nomarchy/default/hypr/input.conf +source = ~/.local/share/nomarchy/default/hypr/windows.conf +source = ~/.config/nomarchy/current/theme/hyprland.conf + +# Change your own setup in these files (and overwrite any settings from defaults!) +source = ~/.config/hypr/monitors.conf +source = ~/.config/hypr/input.conf +source = ~/.config/hypr/bindings.conf +source = ~/.config/hypr/looknfeel.conf +source = ~/.config/hypr/autostart.conf + +# Add any other personal Hyprland configuration below +# windowrule = workspace 5, match:class qemu diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf new file mode 100644 index 0000000..8df0d28 --- /dev/null +++ b/config/hypr/hyprlock.conf @@ -0,0 +1,43 @@ +source = ~/.config/nomarchy/current/theme/hyprlock.conf + +general { + ignore_empty_input = true +} + +background { + monitor = + color = $color + path = ~/.config/nomarchy/current/background + blur_passes = 3 +} + +animations { + enabled = false +} + +input-field { + monitor = + size = 650, 100 + position = 0, 0 + halign = center + valign = center + + inner_color = $inner_color + outer_color = $outer_color + outline_thickness = 4 + + font_family = JetBrainsMono Nerd Font + font_color = $font_color + + placeholder_text = Enter Password + check_color = $check_color + fail_text = $FAIL ($ATTEMPTS) + + rounding = 0 + shadow_passes = 0 + fade_on_empty = false +} + +auth { + fingerprint:enabled = false +} diff --git a/config/hypr/hyprsunset.conf b/config/hypr/hyprsunset.conf new file mode 100644 index 0000000..c4d0f8d --- /dev/null +++ b/config/hypr/hyprsunset.conf @@ -0,0 +1,14 @@ +# Makes hyprsunset do nothing to the screen by default +# Without this, the default applies some tint to the monitor +profile { + time = 07:00 + identity = true +} + +# To enable auto switch to nightlight, set in your .config/hypr/autostart: +# exec-once = uwsm app -- hyprsunset +# and use the following: +# profile { +# time = 20:00 +# temperature = 4000 +# } diff --git a/config/hypr/input.conf b/config/hypr/input.conf new file mode 100644 index 0000000..5639f2c --- /dev/null +++ b/config/hypr/input.conf @@ -0,0 +1,53 @@ +# Control your input devices +# See https://wiki.hypr.land/Configuring/Variables/#input +input { + # Use multiple keyboard layouts and switch between them with Left Alt + Right Alt + # kb_layout = us,dk,eu + + # Use a specific keyboard variant if needed (e.g. intl for international keyboards) + # kb_variant = intl + + kb_options = compose:caps # ,grp:alts_toggle + + # Change speed of keyboard repeat + repeat_rate = 40 + repeat_delay = 600 + + # Start with numlock on by default + numlock_by_default = true + + # Increase sensitivity for mouse/trackpad (default: 0) + # sensitivity = 0.35 + + # Turn off mouse acceleration (default: false) + # force_no_accel = true + + touchpad { + # Use natural (inverse) scrolling + # natural_scroll = true + + # Use two-finger clicks for right-click instead of lower-right corner + # clickfinger_behavior = true + + # Control the speed of your scrolling + scroll_factor = 0.4 + + # Enable the touchpad while typing + # disable_while_typing = false + + # Left-click-and-drag with three fingers + # drag_3fg = 1 + } +} + +# Scroll nicely in the terminal +windowrule = match:class (Alacritty|kitty), scroll_touchpad 1.5 +windowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2 + +# Enable touchpad gestures for changing workspaces +# See https://wiki.hyprland.org/Configuring/Gestures/ +# gesture = 3, horizontal, workspace + +# Enable touchpad gestures for moving focus (helpful on scrolling layout) +# gesture = 3, left, dispatcher, movefocus, l +# gesture = 3, right, dispatcher, movefocus, r diff --git a/config/hypr/looknfeel.conf b/config/hypr/looknfeel.conf new file mode 100644 index 0000000..6f020b1 --- /dev/null +++ b/config/hypr/looknfeel.conf @@ -0,0 +1,34 @@ +# Change the default Nomarchy look'n'feel + +# https://wiki.hyprland.org/Configuring/Variables/#general +general { + # No gaps between windows or borders + # gaps_in = 0 + # gaps_out = 0 + # border_size = 0 + + # Change to niri-like side-scrolling layout + # layout = scrolling +} + +# https://wiki.hyprland.org/Configuring/Variables/#decoration +decoration { + # Use round window corners + # rounding = 8 + + # Dim unfocused windows (0.0 = no dim, 1.0 = fully dimmed) + # dim_inactive = true + # dim_strength = 0.15 +} + +# https://wiki.hyprland.org/Configuring/Variables/#animations +animations { + # Disable all animations + # enabled = no +} + +# https://wiki.hypr.land/Configuring/Variables/#layout +layout { + # Avoid overly wide single-window layouts on wide screens + # single_window_aspect_ratio = 1 1 +} diff --git a/config/hypr/monitors.conf b/config/hypr/monitors.conf new file mode 100644 index 0000000..557c7ff --- /dev/null +++ b/config/hypr/monitors.conf @@ -0,0 +1,23 @@ +# See https://wiki.hyprland.org/Configuring/Monitors/ +# List current monitors and resolutions possible: hyprctl monitors +# Format: monitor = [port], resolution, position, scale + +# Optimized for retina-class 2x displays, like 13" 2.8K, 27" 5K, 32" 6K. +env = GDK_SCALE,2 +monitor=,preferred,auto,auto + +# Good compromise for 27" or 32" 4K monitors (but fractional!) +# env = GDK_SCALE,1.75 +# monitor=,preferred,auto,1.6 + +# Straight 1x setup for low-resolution displays like 1080p or 1440p +# Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440 +# env = GDK_SCALE,1 +# monitor=,preferred,auto,1 + +# Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°) +# monitor = DP-2, preferred, auto, 1, transform, 1 + +# Example for Framework 13 w/ 6K XDR Apple display +# monitor = DP-5, 6016x3384@60, auto, 2 +# monitor = eDP-1, 2880x1920@120, auto, 2 diff --git a/config/hypr/xdph.conf b/config/hypr/xdph.conf new file mode 100644 index 0000000..63b66be --- /dev/null +++ b/config/hypr/xdph.conf @@ -0,0 +1,4 @@ +screencopy { + allow_token_by_default = true + custom_picker_binary = hyprland-preview-share-picker +} diff --git a/config/hyprland-preview-share-picker/config.yaml b/config/hyprland-preview-share-picker/config.yaml new file mode 100644 index 0000000..9a1e51b --- /dev/null +++ b/config/hyprland-preview-share-picker/config.yaml @@ -0,0 +1,71 @@ +# paths to stylesheets on the filesystem which should be applied to the application +# +# relative paths are resolved relative to the location of the config file +stylesheets: ["../nomarchy/current/theme/hyprland-preview-share-picker.css"] +# default page selected when the picker is opened +default_page: outputs + +window: + # height of the application window + height: 500 + # width of the application window + width: 1000 + +image: + # size to which the images should be internally resized to reduce the memory footprint + resize_size: 500 + # target size of the longer side of the image widget + widget_size: 150 + +classes: + # css classname of the window + window: window + # css classname of the card containing an image and a label + image_card: card + # css classname of the card containing an image and a label when the image is still being loaded + image_card_loading: card-loading + # css classname of the image inside the card + image: image + # css classname of the label inside the card + image_label: image-label + # css classname of the notebook containing all pages + notebook: notebook + # css classname of a label of the notebook + tab_label: tab-label + # css classname of a notebook page (e.g. windows container) + notebook_page: page + # css classname of the region selection button + region_button: region-button + # css classname of the button containing the session restore checkbox and label + restore_button: restore-button + +windows: + # minimum amount of image cards per row on the windows page + min_per_row: 3 + # maximum amount of image cards per row on the windows page + max_per_row: 999 + # number of clicks needed to select a window + clicks: 1 + # spacing in pixels between the window cards + spacing: 12 + +outputs: + # number of clicks needed to select an output + clicks: 1 + # spacing in pixels between the outputs in the layout + # note: the spacing is applied from both sides (the gap is `spacing * 2`) + spacing: 6 + # show the label with the output name + show_label: false + # size the output cards respectively to their scaling + respect_output_scaling: true + +region: + # command to run for region selection + # the output needs to be in the @,,, (e.g. DP-3@2789,436,756,576) format + command: slurp -f '%o@%x,%y,%w,%h' + +# hide the token restore checkbox and use the default value instead +hide_token_restore: true +# enable debug logs by default +debug: false diff --git a/config/imv/config b/config/imv/config new file mode 100644 index 0000000..4649324 --- /dev/null +++ b/config/imv/config @@ -0,0 +1,13 @@ +[binds] + +# Print the current image file + = exec lp "$imv_current_file" + +# Delete the current image and quit the viewer + = exec rm "$imv_current_file"; quit + +# Delete the current image and move to the next one + = exec rm "$imv_current_file"; close + +# Rotate the currently open image by 90 degrees + = exec mogrify -rotate 90 "$imv_current_file" diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf new file mode 100644 index 0000000..d303609 --- /dev/null +++ b/config/kitty/kitty.conf @@ -0,0 +1,30 @@ +include ~/.config/nomarchy/current/theme/kitty.conf + +# Font +font_family JetBrainsMono Nerd Font +bold_italic_font auto +font_size 9.0 + +# Window +window_padding_width 14 +hide_window_decorations yes +confirm_os_window_close 0 + +# Keybindings +map ctrl+insert copy_to_clipboard +map shift+insert paste_from_clipboard + +# Allow remote access +allow_remote_control yes + +# Aesthetics +cursor_shape block +cursor_blink_interval 0 +shell_integration no-cursor +enable_audio_bell no + +# Minimal Tab bar styling +tab_bar_edge bottom +tab_bar_style powerline +tab_powerline_style slanted +tab_title_template {title}{' :{}:'.format(num_windows) if num_windows > 1 else ''} diff --git a/config/lazygit/config.yml b/config/lazygit/config.yml new file mode 100644 index 0000000..e69de29 diff --git a/config/nomarchy.ttf b/config/nomarchy.ttf new file mode 100644 index 0000000..151bdfd Binary files /dev/null and b/config/nomarchy.ttf differ diff --git a/config/nomarchy/extensions/menu.sh b/config/nomarchy/extensions/menu.sh new file mode 100644 index 0000000..652dd7e --- /dev/null +++ b/config/nomarchy/extensions/menu.sh @@ -0,0 +1,20 @@ +# Overwrite parts of the nomarchy-menu with user-specific submenus. +# See $OMARCHY_PATH/bin/nomarchy-menu for functions that can be overwritten. +# +# WARNING: Overwritten functions will obviously not be updated when Nnomarchy changes. +# +# Example of minimal system menu: +# +# show_system_menu() { +# case $(menu "System" " Lock\n󰐥 Shutdown") in +# *Lock*) nomarchy-lock-screen ;; +# *Shutdown*) nomarchy-system-shutdown ;; +# *) back_to show_main_menu ;; +# esac +# } +# +# Example of overriding just the about menu action: (Using zsh instead of bash (default)) +# +# show_about() { +# exec nomarchy-launch-or-focus-tui "zsh -c 'fastfetch; read -k 1'" +# } diff --git a/config/nomarchy/hooks/battery-low.sample b/config/nomarchy/hooks/battery-low.sample new file mode 100644 index 0000000..c1c1296 --- /dev/null +++ b/config/nomarchy/hooks/battery-low.sample @@ -0,0 +1,10 @@ +#!/bin/bash + +# This hook is called with the current battery percentage when the low battery +# notification is sent. To put it into use, remove .sample from the name. + +SOUND_FILE="/usr/share/sounds/freedesktop/stereo/dialog-warning.oga" + +if nomarchy-cmd-present mpv && [[ -f $SOUND_FILE ]]; then + mpv --no-video "$SOUND_FILE" >/dev/null 2>&1 +fi diff --git a/config/nomarchy/hooks/font-set.sample b/config/nomarchy/hooks/font-set.sample new file mode 100644 index 0000000..3f0109a --- /dev/null +++ b/config/nomarchy/hooks/font-set.sample @@ -0,0 +1,7 @@ +#!/bin/bash + +# This hook is called with the snake-cased name of the font that has just been set. +# To put it into use, remove .sample from the name. + +# Example: Show the name of the theme that was just set. +# notify-send -u low "New font" "Your new font is $1" diff --git a/config/nomarchy/hooks/post-update.sample b/config/nomarchy/hooks/post-update.sample new file mode 100644 index 0000000..8db142f --- /dev/null +++ b/config/nomarchy/hooks/post-update.sample @@ -0,0 +1,7 @@ +#!/bin/bash + +# This hook is called after an Nnomarchy system update has been performed. +# To put it into use, remove .sample from the name. + +# Example: Show notification after the system has been updated. +# notify-send -u low "Update Performed" "Your system is now up to date" diff --git a/config/nomarchy/hooks/theme-set.sample b/config/nomarchy/hooks/theme-set.sample new file mode 100644 index 0000000..2d13287 --- /dev/null +++ b/config/nomarchy/hooks/theme-set.sample @@ -0,0 +1,7 @@ +#!/bin/bash + +# This hook is called with the snake-cased name of the theme that has just been set. +# To put it into use, remove .sample from the name. + +# Example: Show the name of the theme that was just set. +# notify-send -u low "New theme" "Your new theme is $1" diff --git a/config/nomarchy/themed/alacritty.toml.tpl.sample b/config/nomarchy/themed/alacritty.toml.tpl.sample new file mode 100644 index 0000000..cc6ab23 --- /dev/null +++ b/config/nomarchy/themed/alacritty.toml.tpl.sample @@ -0,0 +1,86 @@ +# Nnomarchy User Template Example: Alacritty +# +# This is a sample template file demonstrating how to create custom themed +# configurations. Templates use placeholder variables that get replaced with +# your current theme's colors when you switch themes. +# +# HOW TO USE: +# 1. Rename this file to: alacritty.toml.tpl (remove the .sample extension) +# 2. Customize it as needed +# 3. Change your theme to apply the template +# +# User templates in ~/.config/nomarchy/themed/ take priority over the built-in +# templates in the Nnomarchy default/themed/ directory. This lets you override +# any built-in template or create templates for applications not included +# by default. +# +# AVAILABLE VARIABLES: +# {{ background }} - Main background color (e.g., "#1a1b26") +# {{ foreground }} - Main foreground/text color +# {{ cursor }} - Cursor color +# {{ accent }} - Theme accent color +# {{ selection_background }} - Selection highlight background +# {{ selection_foreground }} - Selection highlight foreground +# +# {{ color0 }} through {{ color15 }} - Standard 16-color terminal palette +# color0-7: Normal colors (black, red, green, yellow, blue, magenta, cyan, white) +# color8-15: Bright variants +# +# VARIABLE MODIFIERS: +# {{ variable_strip }} - Hex color without the # prefix (e.g., "1a1b26") +# {{ variable_rgb }} - Decimal RGB values (e.g., "26,27,38") +# +# Example using modifiers: +# background = "{{ background }}" -> background = "#1a1b26" +# background = "{{ background_strip }}" -> background = "1a1b26" +# background = "rgb({{ background_rgb }})" -> background = "rgb(26,27,38)" +# +# --------------------------------------------------------------------------- + +[colors.primary] +background = "{{ background }}" +foreground = "{{ foreground }}" + +[colors.cursor] +text = "{{ background }}" +cursor = "{{ cursor }}" + +[colors.vi_mode_cursor] +text = "{{ background }}" +cursor = "{{ cursor }}" + +[colors.search.matches] +foreground = "{{ background }}" +background = "{{ color3 }}" + +[colors.search.focused_match] +foreground = "{{ background }}" +background = "{{ color1 }}" + +[colors.footer_bar] +foreground = "{{ background }}" +background = "{{ foreground }}" + +[colors.selection] +text = "{{ selection_foreground }}" +background = "{{ selection_background }}" + +[colors.normal] +black = "{{ color0 }}" +red = "{{ color1 }}" +green = "{{ color2 }}" +yellow = "{{ color3 }}" +blue = "{{ color4 }}" +magenta = "{{ color5 }}" +cyan = "{{ color6 }}" +white = "{{ color7 }}" + +[colors.bright] +black = "{{ color8 }}" +red = "{{ color9 }}" +green = "{{ color10 }}" +yellow = "{{ color11 }}" +blue = "{{ color12 }}" +magenta = "{{ color13 }}" +cyan = "{{ color14 }}" +white = "{{ color15 }}" diff --git a/config/opencode/opencode.json b/config/opencode/opencode.json new file mode 100644 index 0000000..4fbe31f --- /dev/null +++ b/config/opencode/opencode.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://opencode.ai/config.json", + "theme": "system", + "autoupdate": false +} diff --git a/config/starship.toml b/config/starship.toml new file mode 100644 index 0000000..36f15d1 --- /dev/null +++ b/config/starship.toml @@ -0,0 +1,32 @@ +add_newline = true +command_timeout = 200 +format = "[$directory$git_branch$git_status]($style)$character" + +[character] +error_symbol = "[✗](bold cyan)" +success_symbol = "[❯](bold cyan)" + +[directory] +truncation_length = 2 +truncation_symbol = "…/" +repo_root_style = "bold cyan" +repo_root_format = "[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) " + +[git_branch] +format = "[$branch]($style) " +style = "italic cyan" + +[git_status] +format = '[$all_status]($style)' +style = "cyan" +ahead = "⇡${count} " +diverged = "⇕⇡${ahead_count}⇣${behind_count} " +behind = "⇣${count} " +conflicted = " " +up_to_date = " " +untracked = "? " +modified = " " +stashed = "" +staged = "" +renamed = "" +deleted = "" diff --git a/config/swayosd/config.toml b/config/swayosd/config.toml new file mode 100644 index 0000000..759cbe1 --- /dev/null +++ b/config/swayosd/config.toml @@ -0,0 +1,4 @@ +[server] +show_percentage = true +max_volume = 100 +style = "~/.config/swayosd/style.css" diff --git a/config/swayosd/style.css b/config/swayosd/style.css new file mode 100644 index 0000000..e066560 --- /dev/null +++ b/config/swayosd/style.css @@ -0,0 +1,28 @@ +@import "../nomarchy/current/theme/swayosd.css"; + +window { + border-radius: 0; + opacity: 0.97; + border: 2px solid @border-color; + + background-color: @background-color; +} + +label { + font-family: 'JetBrainsMono Nerd Font'; + font-size: 11pt; + + color: @label; +} + +image { + color: @image; +} + +progressbar { + border-radius: 0; +} + +progress { + background-color: @progress; +} diff --git a/config/systemd/user/nomarchy-battery-monitor.service b/config/systemd/user/nomarchy-battery-monitor.service new file mode 100644 index 0000000..51857af --- /dev/null +++ b/config/systemd/user/nomarchy-battery-monitor.service @@ -0,0 +1,9 @@ +[Unit] +Description=Nomarchy Battery Monitor Check +After=graphical-session.target + +[Service] +Type=oneshot +ExecStart=%h/.local/share/nomarchy/bin/nomarchy-battery-monitor +Environment=DISPLAY=:0 +LogLevelMax=warning diff --git a/config/systemd/user/nomarchy-battery-monitor.timer b/config/systemd/user/nomarchy-battery-monitor.timer new file mode 100644 index 0000000..4d91409 --- /dev/null +++ b/config/systemd/user/nomarchy-battery-monitor.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Nomarchy Battery Monitor Timer +Requires=nomarchy-battery-monitor.service + +[Timer] +OnBootSec=1min +OnUnitActiveSec=30sec +AccuracySec=10sec + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf new file mode 100644 index 0000000..083abb6 --- /dev/null +++ b/config/tmux/tmux.conf @@ -0,0 +1,94 @@ +# Prefix +set -g prefix C-Space +set -g prefix2 C-b +bind C-Space send-prefix + +# Reload config +bind q source-file ~/.config/tmux/tmux.conf \; display "Configuration reloaded" + +# Vi mode for copy +setw -g mode-keys vi +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send -X copy-selection-and-cancel + +# Pane Controls +bind h split-window -v -c "#{pane_current_path}" +bind v split-window -h -c "#{pane_current_path}" +bind x kill-pane + +bind -n C-M-Left select-pane -L +bind -n C-M-Right select-pane -R +bind -n C-M-Up select-pane -U +bind -n C-M-Down select-pane -D + +bind -n C-M-S-Left resize-pane -L 5 +bind -n C-M-S-Down resize-pane -D 5 +bind -n C-M-S-Up resize-pane -U 5 +bind -n C-M-S-Right resize-pane -R 5 + +# Window navigation +bind r command-prompt -I "#W" "rename-window -- '%%'" +bind c new-window -c "#{pane_current_path}" +bind k kill-window + +bind -n M-1 select-window -t 1 +bind -n M-2 select-window -t 2 +bind -n M-3 select-window -t 3 +bind -n M-4 select-window -t 4 +bind -n M-5 select-window -t 5 +bind -n M-6 select-window -t 6 +bind -n M-7 select-window -t 7 +bind -n M-8 select-window -t 8 +bind -n M-9 select-window -t 9 + +bind -n M-Left select-window -t -1 +bind -n M-Right select-window -t +1 +bind -n M-S-Left swap-window -t -1 \; select-window -t -1 +bind -n M-S-Right swap-window -t +1 \; select-window -t +1 + +# Session controls +bind R command-prompt -I "#S" "rename-session -- '%%'" +bind C new-session -c "#{pane_current_path}" +bind K kill-session +bind P switch-client -p +bind N switch-client -n + +bind -n M-Up switch-client -p +bind -n M-Down switch-client -n + +# General +set -g default-terminal "tmux-256color" +set -ag terminal-overrides ",*:RGB" +set -g mouse on +set -g base-index 1 +setw -g pane-base-index 1 +set -g renumber-windows on +set -g history-limit 50000 +set -g escape-time 0 +set -g focus-events on +set -g set-clipboard on +set -g allow-passthrough on +setw -g aggressive-resize on +set -g detach-on-destroy off + +# Status bar +set -g status-position top +set -g status-interval 5 +set -g status-left-length 30 +set -g status-right-length 50 +set -g window-status-separator "" +set -gw automatic-rename on +set -gw automatic-rename-format '#{b:pane_current_path}' + +# Theme +set -g status-style "bg=default,fg=default" +set -g status-left "#[fg=black,bg=blue,bold] #S #[bg=default] " +set -g status-right "#[fg=blue]#{?pane_in_mode,COPY ,}#{?client_prefix,PREFIX ,}#{?window_zoomed_flag,ZOOM ,}#[fg=brightblack]#h " +set -g window-status-format "#[fg=brightblack] #I:#W " +set -g window-status-current-format "#[fg=blue,bold] #I:#W " +set -g pane-border-style "fg=brightblack" +set -g pane-active-border-style "fg=blue" +set -g message-style "bg=default,fg=blue" +set -g message-command-style "bg=default,fg=blue" +set -g mode-style "bg=blue,fg=black" +setw -g clock-mode-colour blue diff --git a/config/uwsm/default b/config/uwsm/default new file mode 100644 index 0000000..946fbe5 --- /dev/null +++ b/config/uwsm/default @@ -0,0 +1,13 @@ +# Changes require a restart to take effect. + +# Install other terminals via Install > Terminal +export TERMINAL=xdg-terminal-exec + +# Use code for VSCode +export EDITOR=nvim + +# Use a custom directory for screenshots (remember to make the directory!) +# export OMARCHY_SCREENSHOT_DIR="$HOME/Pictures/Screenshots" + +# Use a custom directory for screenrecordings (remember to make the directory!) +# export OMARCHY_SCREENRECORD_DIR="$HOME/Videos/Screencasts" diff --git a/config/uwsm/env b/config/uwsm/env new file mode 100644 index 0000000..ff7f463 --- /dev/null +++ b/config/uwsm/env @@ -0,0 +1,11 @@ +# Changes require a restart to take effect. + +# Ensure Nomarchy bins are in the path +export OMARCHY_PATH=$HOME/.local/share/nomarchy +export PATH=$OMARCHY_PATH/bin:$PATH:$HOME/.local/bin + +# Set default terminal and editor +source ~/.config/uwsm/default + +# Activate mise if present on the system +nomarchy-cmd-present mise && eval "$(mise activate bash --shims)" diff --git a/config/walker/config.toml b/config/walker/config.toml new file mode 100644 index 0000000..ebbb8e6 --- /dev/null +++ b/config/walker/config.toml @@ -0,0 +1,49 @@ +force_keyboard_focus = true # forces keyboard forcus to stay in Walker +selection_wrap = true # wrap list if at bottom or top +theme = "nomarchy-default" # theme to use +additional_theme_location = "~/.local/share/nomarchy/default/walker/themes/" +hide_action_hints = true # globally hide the action hints + +[placeholders] +"default" = { input = " Search...", list = "No Results" } # placeholders for input and empty list, key is the providers name, so f.e. "desktopapplications" or "menus:other" + +[keybinds] +quick_activate = [] + +[columns] +symbols = 1 # providers to be queried by default + +[providers] +max_results = 256 # 256 should be enough for everyone +default = [ + "desktopapplications", + "websearch", +] + +[[providers.prefixes]] +prefix = "/" +provider = "providerlist" + +[[providers.prefixes]] +prefix = "." +provider = "files" + +[[providers.prefixes]] +prefix = ":" +provider = "symbols" + +[[providers.prefixes]] +prefix = "=" +provider = "calc" + +[[providers.prefixes]] +prefix = "@" +provider = "websearch" + +[[providers.prefixes]] +prefix = "$" +provider = "clipboard" + +[[emergencies]] +text = "Restart Walker" +command = "nomarchy-restart-walker" diff --git a/config/waybar/config.jsonc b/config/waybar/config.jsonc new file mode 100644 index 0000000..a9f79ad --- /dev/null +++ b/config/waybar/config.jsonc @@ -0,0 +1,174 @@ +{ + "reload_style_on_change": true, + "layer": "top", + "position": "top", + "spacing": 0, + "height": 26, + "modules-left": ["custom/nomarchy", "hyprland/workspaces"], + "modules-center": ["clock", "custom/update", "custom/voxtype", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"], + "modules-right": [ + "group/tray-expander", + "bluetooth", + "network", + "pulseaudio", + "cpu", + "battery" + ], + "hyprland/workspaces": { + "on-click": "activate", + "format": "{icon}", + "format-icons": { + "default": "", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "0", + "active": "󱓻" + }, + "persistent-workspaces": { + "1": [], + "2": [], + "3": [], + "4": [], + "5": [] + } + }, + "custom/nomarchy": { + "format": "\ue900", + "on-click": "nomarchy-menu", + "on-click-right": "xdg-terminal-exec", + "tooltip-format": "Nomarchy Menu\n\nSuper + Alt + Space" + }, + "custom/update": { + "format": "", + "exec": "nomarchy-update-available", + "on-click": "nomarchy-launch-floating-terminal-with-presentation nomarchy-update", + "tooltip-format": "Nomarchy update available", + "signal": 7, + "interval": 21600 + }, + + "cpu": { + "interval": 5, + "format": "󰍛", + "on-click": "nomarchy-launch-or-focus-tui btop", + "on-click-right": "alacritty" + }, + "clock": { + "format": "{:L%A %H:%M}", + "format-alt": "{:L%d %B W%V %Y}", + "tooltip": false, + "on-click-right": "nomarchy-launch-floating-terminal-with-presentation nomarchy-tz-select" + }, + "network": { + "format-icons": ["󰤯", "󰤟", "󰤢", "󰤥", "󰤨"], + "format": "{icon}", + "format-wifi": "{icon}", + "format-ethernet": "󰀂", + "format-disconnected": "󰤮", + "tooltip-format-wifi": "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}", + "tooltip-format-ethernet": "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}", + "tooltip-format-disconnected": "Disconnected", + "interval": 3, + "spacing": 1, + "on-click": "nomarchy-launch-wifi" + }, + "battery": { + "format": "{capacity}% {icon}", + "format-discharging": "{icon}", + "format-charging": "{icon}", + "format-plugged": "", + "format-icons": { + "charging": ["󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"], + "default": ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"] + }, + "format-full": "󰂅", + "tooltip-format-discharging": "{power:>1.0f}W↓ {capacity}%", + "tooltip-format-charging": "{power:>1.0f}W↑ {capacity}%", + "interval": 5, + "on-click": "nomarchy-menu power", + "states": { + "warning": 20, + "critical": 10 + } + }, + "bluetooth": { + "format": "", + "format-off": "󰂲", + "format-disabled": "󰂲", + "format-connected": "󰂱", + "format-no-controller": "", + "tooltip-format": "Devices connected: {num_connections}", + "on-click": "nomarchy-launch-bluetooth" + }, + "pulseaudio": { + "format": "{icon}", + "on-click": "nomarchy-launch-audio", + "on-click-right": "pamixer -t", + "tooltip-format": "Playing at {volume}%", + "scroll-step": 5, + "format-muted": "", + "format-icons": { + "headphone": "", + "headset": "", + "default": ["", "", ""] + } + }, + "group/tray-expander": { + "orientation": "inherit", + "drawer": { + "transition-duration": 600, + "children-class": "tray-group-item" + }, + "modules": ["custom/expand-icon", "tray"] + }, + "custom/expand-icon": { + "format": "", + "tooltip": false, + "on-scroll-up": "", + "on-scroll-down": "", + "on-scroll-left": "", + "on-scroll-right": "" + }, + "custom/screenrecording-indicator": { + "on-click": "nomarchy-cmd-screenrecord", + "exec": "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh", + "signal": 8, + "return-type": "json" + }, + "custom/idle-indicator": { + "on-click": "nomarchy-toggle-idle", + "exec": "$OMARCHY_PATH/default/waybar/indicators/idle.sh", + "signal": 9, + "return-type": "json" + }, + "custom/notification-silencing-indicator": { + "on-click": "nomarchy-toggle-notification-silencing", + "exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh", + "signal": 10, + "return-type": "json" + }, + "custom/voxtype": { + "exec": "nomarchy-voxtype-status", + "return-type": "json", + "format": "{icon}", + "format-icons": { + "idle": "", + "recording": "󰍬", + "transcribing": "󰔟" + }, + "tooltip": true, + "on-click-right": "nomarchy-voxtype-config", + "on-click": "nomarchy-voxtype-model" + }, + "tray": { + "icon-size": 12, + "spacing": 17 + } +} diff --git a/config/waybar/style.css b/config/waybar/style.css new file mode 100644 index 0000000..2638ca5 --- /dev/null +++ b/config/waybar/style.css @@ -0,0 +1,100 @@ +@import "../nomarchy/current/theme/waybar.css"; + +* { + background-color: @background; + color: @foreground; + + border: none; + border-radius: 0; + min-height: 0; + font-family: 'JetBrainsMono Nerd Font'; + font-size: 12px; +} + +.modules-left { + margin-left: 8px; +} + +.modules-right { + margin-right: 8px; +} + +#workspaces button { + all: initial; + padding: 0 6px; + margin: 0 1.5px; + min-width: 9px; +} + +#workspaces button.empty { + opacity: 0.5; +} + +#cpu, +#battery, +#pulseaudio, +#custom-nomarchy, +#custom-update { + min-width: 12px; + margin: 0 7.5px; +} + +#tray { + margin-right: 16px; +} + +#bluetooth { + margin-right: 17px; +} + +#network { + margin-right: 13px; +} + +#custom-expand-icon { + margin-right: 18px; +} + +tooltip { + padding: 2px; +} + +#custom-update { + font-size: 10px; +} + +#clock { + margin-left: 8.75px; +} + +.hidden { + opacity: 0; +} + +#custom-screenrecording-indicator, +#custom-idle-indicator, +#custom-notification-silencing-indicator { + min-width: 12px; + margin-left: 5px; + margin-right: 0; + font-size: 10px; + padding-bottom: 1px; +} + +#custom-screenrecording-indicator.active { + color: #a55555; +} + +#custom-idle-indicator.active, +#custom-notification-silencing-indicator.active { + color: #a55555; +} + +#custom-voxtype { + min-width: 12px; + margin: 0 0 0 7.5px; +} + +#custom-voxtype.recording { + color: #a55555; +} diff --git a/config/wiremix/wiremix.toml b/config/wiremix/wiremix.toml new file mode 100644 index 0000000..07f9747 --- /dev/null +++ b/config/wiremix/wiremix.toml @@ -0,0 +1,5 @@ +# overwrites default wiremix configuration +# defaults: https://github.com/tsowell/wiremix/blob/main/wiremix.toml + +[char_sets.default] +default_device = "⮞" diff --git a/config/xdg-terminals.list b/config/xdg-terminals.list new file mode 100644 index 0000000..0821cf0 --- /dev/null +++ b/config/xdg-terminals.list @@ -0,0 +1,3 @@ +# Terminal emulator preference order for xdg-terminal-exec +# The first found and valid terminal will be used +Alacritty.desktop diff --git a/config/xournalpp/settings.xml b/config/xournalpp/settings.xml new file mode 100644 index 0000000..5f98a90 --- /dev/null +++ b/config/xournalpp/settings.xml @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f8a6049 --- /dev/null +++ b/flake.nix @@ -0,0 +1,128 @@ +{ + description = "Nomarchy - A NixOS-based distribution with Omarchy flavour"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-colors.url = "github:misterio77/nix-colors"; + stylix.url = "github:danth/stylix"; + walker.url = "github:abenz1267/walker"; + }; + + outputs = { self, nixpkgs, nixos-hardware, disko, home-manager, nix-colors, stylix, walker, ... } @ inputs: { + nixosModules = { + system = import ./modules/system; + home = import ./modules/home; + }; + + nixosConfigurations = { + installerIso = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" + ./hosts/live-iso.nix + { + system.stateVersion = "24.11"; + home-manager.extraSpecialArgs = { inherit inputs; }; + } + ]; + }; + + installerVm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/live-iso.nix + { + system.stateVersion = "24.11"; + networking.hostName = "nomarchy-installer"; + + # VM specific settings to start in terminal + virtualisation.vmVariant = { + virtualisation.memorySize = 2048; + virtualisation.cores = 2; + virtualisation.graphics = true; + }; + + # Use a dummy hardware config + fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; + boot.loader.grub.device = "/dev/vda"; + + # Setup a user that automatically logs in to console + users.users.nixos = { + isNormalUser = true; + extraGroups = [ "wheel" "video" ]; + initialPassword = "nixos"; + }; + + services.getty.autologinUser = "nixos"; + + # Optionally, start the installer immediately + environment.interactiveShellInit = '' + if [[ "$(tty)" == "/dev/tty1" ]]; then + echo "Welcome to the Nomarchy Installer Test VM!" + echo "To start the installer, run: sudo /etc/install-nomarchy.sh" + fi + ''; + } + ]; + }; + + vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./modules/system + ./modules/system/hardware.nix + home-manager.nixosModules.home-manager + { + system.stateVersion = "24.11"; + networking.hostName = "nomarchy"; + home-manager.extraSpecialArgs = { inherit inputs; }; + # VM specific settings + virtualisation.vmVariant = { + virtualisation.memorySize = 2048; + virtualisation.cores = 2; + virtualisation.graphics = true; + }; + + # Use a dummy hardware config for VM + fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; + boot.loader.grub.device = "/dev/vda"; + + # Setup default user for testing + users.users.nomarchy = { + isNormalUser = true; + extraGroups = [ "wheel" "video" ]; + initialPassword = "nixos"; + }; + + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "nomarchy"; + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.nomarchy = { + imports = [ ./modules/home ]; + home.username = "nomarchy"; + home.homeDirectory = "/home/nomarchy"; + home.stateVersion = "24.11"; + }; + } + ]; + }; + }; + }; +} diff --git a/hosts/live-iso.nix b/hosts/live-iso.nix new file mode 100644 index 0000000..e5d1481 --- /dev/null +++ b/hosts/live-iso.nix @@ -0,0 +1,22 @@ +{ config, pkgs, inputs, ... }: + +{ + environment.systemPackages = with pkgs; [ + git + gum + inputs.disko.packages.${pkgs.system}.disko + ]; + + environment.etc."install-nomarchy.sh" = { + source = ../installer/install-nomarchy.sh; + mode = "0755"; + }; + + environment.etc."disko-ext4.nix" = { + source = ../installer/disko-ext4.nix; + }; + + environment.etc."disko-btrfs-luks.nix" = { + source = ../installer/disko-btrfs-luks.nix; + }; +} diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..09da500 Binary files /dev/null and b/icon.png differ diff --git a/icon.txt b/icon.txt new file mode 100644 index 0000000..bf3ea8f --- /dev/null +++ b/icon.txt @@ -0,0 +1,26 @@ +██████████████████████████████████████████████████████ +██████████████████████████████████████████████████████ +████ ████ ████ +████ ████ ████ +████ █████████████████████ ████████ ████ +████ █████████████████████ ████████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████████████ ████ ████ +████████████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ████ ████ ████ +████ ██████████████████████████████████████ ████ +████ ██████████████████████████████████████ ████ +████ ████ ████ +████ ████ ████ +█████████████████████████████ ████████████████████ +█████████████████████████████ ████████████████████ diff --git a/installer/disko-btrfs-luks.nix b/installer/disko-btrfs-luks.nix new file mode 100644 index 0000000..b132839 --- /dev/null +++ b/installer/disko-btrfs-luks.nix @@ -0,0 +1,58 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "@TARGET_DRIVE@"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + settings.allowDiscards = true; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "@" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "@log" = { + mountpoint = "/var/log"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/installer/disko-ext4.nix b/installer/disko-ext4.nix new file mode 100644 index 0000000..33ed287 --- /dev/null +++ b/installer/disko-ext4.nix @@ -0,0 +1,36 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "@TARGET_DRIVE@"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/installer/install-nomarchy.sh b/installer/install-nomarchy.sh new file mode 100644 index 0000000..209ed22 --- /dev/null +++ b/installer/install-nomarchy.sh @@ -0,0 +1,218 @@ +#!/usr/bin/env bash +set -e + +echo "Welcome to the Nomarchy - A NixOS-based distribution with Omarchy flavour Installer" + +# 1. Hardware Detection & Mapping +PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null || echo "Unknown") +BOARD_NAME=$(cat /sys/class/dmi/id/board_name 2>/dev/null || echo "Unknown") +CPU_VENDOR=$(lscpu | grep "Vendor ID" | awk '{print $3}') +echo "Detected hardware: $PRODUCT_NAME ($BOARD_NAME)" +echo "Detected CPU: $CPU_VENDOR" + +HARDWARE_MODULES="" +NOMARCHY_HW_OPTS="" + +# Add generic CPU optimizations +if [[ "$CPU_VENDOR" == "AuthenticAMD" ]]; then + HARDWARE_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-amd" +elif [[ "$CPU_VENDOR" == "GenuineIntel" ]]; then + HARDWARE_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-intel" +fi + +# Comprehensive Hardware Selection +echo "Searching for optimized hardware profiles..." + +echo "Select your hardware vendor/category:" +VENDOR=$(gum choose --header "Select Vendor" \ + "acer" "apple" "asus" "dell" "framework" "google" "hp" "lenovo" "microsoft" "msi" "purism" "samsung" "starlabs" "system76" "toshiba" "None/Generic") + +if [ "$VENDOR" != "None/Generic" ]; then + echo "Select specific model for $VENDOR:" + case $VENDOR in + dell) + MODEL=$(gum choose "xps-13-9300" "xps-13-9310" "xps-13-9343" "xps-13-9360" "xps-13-9370" "xps-13-9380" "xps-15-7590" "xps-15-9500" "xps-15-9510" "xps-15-9550" "precision-5510" "precision-5530") + HARDWARE_MODULES="$HARDWARE_MODULES\n inputs.nixos-hardware.nixosModules.dell-$MODEL" + [[ "$MODEL" == *"xps"* ]] && NOMARCHY_HW_OPTS="nomarchy.hardware.isXPS = true;" + ;; + lenovo) + MODEL=$(gum choose "thinkpad-x1-carbon-gen7" "thinkpad-x1-carbon-gen8" "thinkpad-x1-carbon-gen9" "thinkpad-x1-carbon-gen10" "thinkpad-x1-extreme" "thinkpad-t480" "thinkpad-t490" "thinkpad-t14-amd" "thinkpad-t14-intel" "thinkpad-p1-gen3") + HARDWARE_MODULES="$HARDWARE_MODULES\n inputs.nixos-hardware.nixosModules.lenovo-$MODEL" + ;; + framework) + MODEL=$(gum choose "13-7040-amd" "13-intel-12th-gen" "13-intel-13th-gen" "16-7040-amd") + HARDWARE_MODULES="$HARDWARE_MODULES\n inputs.nixos-hardware.nixosModules.framework-$MODEL" + NOMARCHY_HW_OPTS="nomarchy.hardware.isFramework = true;" + ;; + microsoft) + MODEL=$(gum choose "surface-pro-7" "surface-pro-8" "surface-pro-9" "surface-laptop-3" "surface-laptop-4") + HARDWARE_MODULES="$HARDWARE_MODULES\n inputs.nixos-hardware.nixosModules.microsoft-$MODEL" + ;; + apple) + MODEL=$(gum choose "macbook-pro-12-1" "macbook-air-6-2" "t2") + if [ "$MODEL" == "t2" ]; then + NOMARCHY_HW_OPTS="nomarchy.hardware.isT2Mac = true;" + else + HARDWARE_MODULES="$HARDWARE_MODULES\n inputs.nixos-hardware.nixosModules.apple-$MODEL" + fi + ;; + *) + echo "Enter the nixos-hardware module path (e.g. inputs.nixos-hardware.nixosModules.common-cpu-amd):" + INPUT_MOD=$(gum input --placeholder "inputs.nixos-hardware.nixosModules.xxx") + HARDWARE_MODULES="$HARDWARE_MODULES\n $INPUT_MOD" + ;; + esac +fi + +# 2. Storage Setup +echo "Select the target drive for installation:" +DRIVES=$(lsblk -d -n -p -o NAME,SIZE | grep -v loop) +TARGET_DRIVE=$(echo "$DRIVES" | gum choose | awk '{print $1}') +if [ -z "$TARGET_DRIVE" ]; then + echo "No drive selected. Exiting." + exit 1 +fi + +echo "Select the partition layout:" +LAYOUT=$(gum choose "Standard Ext4" "Encrypted BTRFS (LUKS2)") +if [ "$LAYOUT" = "Standard Ext4" ]; then + DISKO_NIX="/etc/disko-ext4.nix" +else + DISKO_NIX="/etc/disko-btrfs-luks.nix" +fi + +TMP_DISKO=$(mktemp --suffix=.nix) +sed "s|@TARGET_DRIVE@|$TARGET_DRIVE|g" "$DISKO_NIX" > "$TMP_DISKO" +sudo disko --mode disko "$TMP_DISKO" + +# 3. User Details +USERNAME=$(gum input --placeholder "Enter target username") +if [ -z "$USERNAME" ]; then + echo "No username entered. Exiting." + exit 1 +fi + +# 4. Login Preferences +echo "Select login preference:" +LOGIN_PREF=$(gum choose "SDDM Auto-login" "Require Password") + +# Generate /mnt/etc/nixos/login-preference.nix +mkdir -p /mnt/etc/nixos/ +cat < /mnt/etc/nixos/login-preference.nix +{ + services.displayManager.autoLogin.enable = $(if [ "$LOGIN_PREF" = "SDDM Auto-login" ]; then echo "true"; else echo "false"; fi); + services.displayManager.autoLogin.user = "$USERNAME"; +} +EOF + +# Generate /mnt/etc/nixos/hardware-selection.nix +cat < /mnt/etc/nixos/hardware-selection.nix +{ inputs, ... }: +{ + imports = [ + $(echo "$HARDWARE_MODULES") + ]; + + $NOMARCHY_HW_OPTS +} +EOF + +# 5. Hardware Config +nixos-generate-config --root /mnt + +# 6. Modular Downstream Scaffolding +mkdir -p /mnt/etc/nixos/ + +# Create system.nix (User System Customization) +cat < /mnt/etc/nixos/system.nix +{ pkgs, ... }: +{ + # Add your personal system-level NixOS modules here. + # Example: agenix.nixosModules.default + + environment.systemPackages = with pkgs; [ + # Add extra system-wide packages here + ]; +} +EOF + +# Create home.nix (User Home Customization) +cat < /mnt/etc/nixos/home.nix +{ pkgs, ... }: +{ + # Add your personal Home Manager modules here. + + home.packages = with pkgs; [ + # Add extra user-level packages here + ]; +} +EOF + +# Create the Master Flake +cat < /mnt/etc/nixos/flake.nix +{ + description = "My Nomarchy - Downstream Configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nomarchy.url = "github:yourusername/nomarchy"; # UPDATE THIS to point to your repo + + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # EXAMPLE: Add agenix for secrets + # agenix.url = "github:ryantm/agenix"; + }; + + outputs = { self, nixpkgs, nomarchy, home-manager, ... }@inputs: { + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + # 1. Hardware + ./hardware-configuration.nix + ./hardware-selection.nix + + # 2. Login & Preferences + ./login-preference.nix + + # 3. Upstream Nomarchy Core + nomarchy.nixosModules.system + + # 4. User System Customization + ./system.nix + + # 5. Home Manager Integration + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.$USERNAME = { + imports = [ + nomarchy.nixosModules.home + ./home.nix + ]; + home.username = "$USERNAME"; + home.homeDirectory = "/home/$USERNAME"; + home.stateVersion = "24.05"; + }; + } + ]; + }; + }; +} +EOF + +# 7. Version Control +cd /mnt/etc/nixos/ +git init +git add . +git config user.name "Nomarchy Installer" +git config user.email "installer@nomarchy" +git commit -m "Initial Nomarchy generation" + +# 8. Execution +nixos-install --flake /mnt/etc/nixos#default --no-root-passwd diff --git a/modules/home/configs.nix b/modules/home/configs.nix new file mode 100644 index 0000000..714b8aa --- /dev/null +++ b/modules/home/configs.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ + xdg.configFile = { + "alacritty".source = ../../config/alacritty; + "btop".source = ../../config/btop; + "chromium".source = ../../config/chromium; + "fastfetch".source = ../../config/fastfetch; + "kitty".source = ../../config/kitty; + "swayosd".source = ../../config/swayosd; + "xdg-terminals.list".source = ../../config/xdg-terminals.list; + }; +} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..1e955c9 --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,35 @@ +{ config, pkgs, inputs, lib, ... }: + +let + palettes = import ../../themes/nomarchy-palettes.nix; + # Reads the state file. If it doesn't exist, defaults to dracula. + stateFile = "${config.home.homeDirectory}/.config/home-manager/theme-state.nix"; + activeThemeName = if builtins.pathExists stateFile then + lib.removeSuffix "\n" (builtins.readFile stateFile) + else "dracula"; +in +{ + imports = [ + inputs.nix-colors.homeManagerModules.default + inputs.walker.homeManagerModules.default + ./fonts.nix + ./stylix.nix + ./hyprland.nix + ./waybar.nix + ./walker.nix + ./theme-switcher.nix + ./scripts.nix + ./configs.nix + ]; + + colorScheme = palettes.${activeThemeName} or palettes.dracula; + + home.packages = with pkgs; [ + alacritty + ]; + + home.shellAliases = { + sys-update = "sudo nixos-rebuild switch --flake /etc/nixos#default"; + env-update = "home-manager switch --flake /etc/nixos#default --impure"; + }; +} diff --git a/modules/home/fonts.nix b/modules/home/fonts.nix new file mode 100644 index 0000000..6609fb6 --- /dev/null +++ b/modules/home/fonts.nix @@ -0,0 +1,17 @@ +{ config, pkgs, lib, ... }: + +let + stateFile = "${config.home.homeDirectory}/.config/home-manager/font-state.nix"; + activeFont = if builtins.pathExists stateFile then + lib.removeSuffix "\n" (builtins.readFile stateFile) + else "JetBrainsMono Nerd Font"; +in +{ + options.nomarchy.fonts = { + monospace = lib.mkOption { + type = lib.types.str; + default = activeFont; + description = "Monospace font for the system"; + }; + }; +} diff --git a/modules/home/hyprland.nix b/modules/home/hyprland.nix new file mode 100644 index 0000000..d71ccec --- /dev/null +++ b/modules/home/hyprland.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: + +let + wallpaperStateFile = "${config.home.homeDirectory}/.config/home-manager/wallpaper-state.nix"; + activeWallpaper = if builtins.pathExists wallpaperStateFile then + lib.removeSuffix "\n" (builtins.readFile wallpaperStateFile) + else ""; +in +{ + wayland.windowManager.hyprland = { + enable = true; + settings = { + "general" = { + "col.active_border" = "rgb(${config.colorScheme.palette.base0E})"; + "col.inactive_border" = "rgb(${config.colorScheme.palette.base03})"; + }; + "exec-once" = [ + "swww init && swww fill ${activeWallpaper}" + "nomarchy-welcome" + ]; + "bind" = [ + "SUPER ALT, Space, exec, nomarchy-theme-selector" + "SUPER CTRL, Space, exec, nomarchy-font-selector" + "SUPER SHIFT, Space, exec, nomarchy-wallpaper-selector" + "SUPER, Return, exec, alacritty" + "SUPER, Q, killactive," + "SUPER, M, exit," + ]; + }; + }; +} diff --git a/modules/home/scripts.nix b/modules/home/scripts.nix new file mode 100644 index 0000000..3fd4a91 --- /dev/null +++ b/modules/home/scripts.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: + +let + # Core dependencies needed by most Nomarchy scripts + nomarchy-deps = with pkgs; [ + gum + hyprland + procps + libnotify + coreutils + gnused + gnugrep + pciutils + findutils + jq + swww + xmlstarlet + # Add any others commonly used in bin/ + ]; + + nomarchy-scripts = pkgs.stdenv.mkDerivation { + pname = "nomarchy-scripts"; + version = "1.0.0"; + src = ../../bin; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin + cp -r * $out/bin/ + + # Wrap every script to ensure dependencies are in PATH + find $out/bin -type f -exec wrapProgram {} \ + --prefix PATH : ${lib.makeBinPath nomarchy-deps} \; + ''; + }; +in +{ + home.packages = [ nomarchy-scripts ]; +} diff --git a/modules/home/stylix.nix b/modules/home/stylix.nix new file mode 100644 index 0000000..68c9bf4 --- /dev/null +++ b/modules/home/stylix.nix @@ -0,0 +1,72 @@ +{ config, pkgs, inputs, lib, ... }: + +let + # Re-use our state-based logic + palettes = import ../../themes/nomarchy-palettes.nix; + + themeStateFile = "${config.home.homeDirectory}/.config/home-manager/theme-state.nix"; + activeThemeName = if builtins.pathExists themeStateFile then + lib.removeSuffix "\n" (builtins.readFile themeStateFile) + else "dracula"; + + wallpaperStateFile = "${config.home.homeDirectory}/.config/home-manager/wallpaper-state.nix"; + activeWallpaper = if builtins.pathExists wallpaperStateFile then + lib.removeSuffix "\n" (builtins.readFile wallpaperStateFile) + else "${../../themes/catppuccin/backgrounds/1-totoro.png}"; # Fallback + + # Map nix-colors palette to a format Stylix expects (attrset of hex strings) + currentPalette = (palettes.${activeThemeName} or palettes.dracula).palette; +in +{ + imports = [ inputs.stylix.homeModules.stylix ]; + + stylix = { + enable = true; + image = activeWallpaper; + base16Scheme = currentPalette; + + # Force dark/light mode based on theme name if possible, or just default to dark + polarity = if lib.strings.hasInfix "light" activeThemeName then "light" else "dark"; + + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + size = 24; + }; + + fonts = { + monospace = { + package = pkgs.nerd-fonts.jetbrains-mono; + name = config.nomarchy.fonts.monospace; + }; + sansSerif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans"; + }; + serif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Serif"; + }; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + }; + sizes = { + applications = 11; + terminal = 11; + desktop = 11; + popups = 11; + }; + }; + + # Enable theming for specific targets + targets = { + hyprland.enable = false; # We keep our custom hyprland config for borders/rules + waybar.enable = false; # We keep our custom waybar CSS + alacritty.enable = true; + kitty.enable = true; + gtk.enable = true; + gnome.enable = true; + }; + }; +} diff --git a/modules/home/theme-switcher.nix b/modules/home/theme-switcher.nix new file mode 100644 index 0000000..360eaef --- /dev/null +++ b/modules/home/theme-switcher.nix @@ -0,0 +1,67 @@ +{ config, pkgs, ... }: + +let + palettes = import ../../themes/nomarchy-palettes.nix; + themeNames = builtins.attrNames palettes; + themeList = builtins.concatStringsSep "\\n" themeNames; + + nomarchy-theme-selector = pkgs.writeShellScriptBin "nomarchy-theme-selector" '' + STATE_DIR="$HOME/.config/home-manager" + THEME_STATE_FILE="$STATE_DIR/theme-state.nix" + WALLPAPER_STATE_FILE="$STATE_DIR/wallpaper-state.nix" + THEMES_DIR="/etc/nixos/themes" # This depends on where the repo is cloned + + mkdir -p "$STATE_DIR" + + SELECTED_THEME=$(echo -e "${themeList}" | walker --dmenu) + + if [ -n "$SELECTED_THEME" ]; then + echo "$SELECTED_THEME" > "$THEME_STATE_FILE" + + # Try to find a background for this theme + BG_DIR="$THEMES_DIR/$SELECTED_THEME/backgrounds" + if [ -d "$BG_DIR" ]; then + BG=$(ls "$BG_DIR" | head -n 1) + if [ -n "$BG" ]; then + echo "$BG_DIR/$BG" > "$WALLPAPER_STATE_FILE" + fi + fi + + env-update + fi + ''; + nomarchy-font-selector = pkgs.writeShellScriptBin "nomarchy-font-selector" '' + STATE_DIR="$HOME/.config/home-manager" + STATE_FILE="$STATE_DIR/font-state.nix" + + mkdir -p "$STATE_DIR" + + # Simple list of common nerd fonts, could be expanded + FONTS="JetBrainsMono Nerd Font\nRobotoMono Nerd Font\nFiraCode Nerd Font\nUbuntuMono Nerd Font" + SELECTED_FONT=$(echo -e "$FONTS" | walker --dmenu) + + if [ -n "$SELECTED_FONT" ]; then + echo "$SELECTED_FONT" > "$STATE_FILE" + env-update + fi + ''; + nomarchy-wallpaper-selector = pkgs.writeShellScriptBin "nomarchy-wallpaper-selector" '' + STATE_DIR="$HOME/.config/home-manager" + WALLPAPER_STATE_FILE="$STATE_DIR/wallpaper-state.nix" + THEMES_DIR="/etc/nixos/themes" + + mkdir -p "$STATE_DIR" + + # List all images in all themes backgrounds + WALLPAPERS=$(find "$THEMES_DIR" -type f \( -name "*.jpg" -o -name "*.png" \)) + SELECTED_WP=$(echo -e "$WALLPAPERS" | walker --dmenu) + + if [ -n "$SELECTED_WP" ]; then + echo "$SELECTED_WP" > "$WALLPAPER_STATE_FILE" + env-update + fi + ''; +in +{ + home.packages = [ nomarchy-theme-selector nomarchy-font-selector nomarchy-wallpaper-selector ]; +} diff --git a/modules/home/walker.nix b/modules/home/walker.nix new file mode 100644 index 0000000..57ccc37 --- /dev/null +++ b/modules/home/walker.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + programs.walker = { + enable = true; + runAsService = true; + config = { + theme = "nomarchy"; + ui = { + anchors = { + top = true; + }; + }; + }; + themes."nomarchy" = { + style = '' + * { + color: #${config.colorScheme.palette.base05}; + } + #window { + background-color: #${config.colorScheme.palette.base00}; + } + .item.active { + background-color: #${config.colorScheme.palette.base03}; + color: #${config.colorScheme.palette.base0B}; + } + ''; + }; + }; +} diff --git a/modules/home/waybar.nix b/modules/home/waybar.nix new file mode 100644 index 0000000..802a73b --- /dev/null +++ b/modules/home/waybar.nix @@ -0,0 +1,82 @@ +{ config, pkgs, ... }: + +{ + programs.waybar = { + enable = true; + style = '' + * { + background-color: #${config.colorScheme.palette.base00}; + color: #${config.colorScheme.palette.base05}; + border: none; + border-radius: 0; + min-height: 0; + font-family: '${config.nomarchy.fonts.monospace}'; + font-size: 12px; + } + + .modules-left { margin-left: 8px; } + .modules-right { margin-right: 8px; } + + #workspaces button { + all: initial; + padding: 0 6px; + margin: 0 1.5px; + min-width: 9px; + color: #${config.colorScheme.palette.base04}; + } + + #workspaces button.focused, #workspaces button.active { + color: #${config.colorScheme.palette.base0B}; + } + + #workspaces button.empty { opacity: 0.5; } + + #cpu, #battery, #pulseaudio, #custom-nomarchy, #custom-update { + min-width: 12px; + margin: 0 7.5px; + } + + #tray { margin-right: 16px; } + #bluetooth { margin-right: 17px; } + ''; + settings = [{ + layer = "top"; + position = "top"; + height = 26; + spacing = 0; + modules-left = [ "custom/nomarchy" "hyprland/workspaces" ]; + modules-center = [ "clock" "custom/update" "custom/voxtype" "custom/screenrecording-indicator" "custom/idle-indicator" "custom/notification-silencing-indicator" ]; + modules-right = [ "group/tray-expander" "bluetooth" "network" "pulseaudio" "cpu" "battery" ]; + "custom/nomarchy" = { + format = "\ue900"; + on-click = "nomarchy-menu"; + on-click-right = "xdg-terminal-exec"; + tooltip-format = "Nomarchy Menu\n\nSuper + Alt + Space"; + }; + "hyprland/workspaces" = { + on-click = "activate"; + format = "{icon}"; + format-icons = { + default = ""; + active = "󱓻"; + }; + }; + "clock" = { + format = "{:%H:%M}"; + }; + "battery" = { + format = "{icon} {capacity}%"; + format-icons = ["" "" "" "" ""]; + }; + "pulseaudio" = { + format = "{icon} {volume}%"; + format-icons = ["" "" ""]; + }; + "network" = { + format-wifi = " {essid}"; + format-ethernet = "󰈀 {ipaddr}"; + format-disconnected = "⚠ Disconnected"; + }; + }]; + }; +} diff --git a/modules/system/default.nix b/modules/system/default.nix new file mode 100644 index 0000000..7d4b99f --- /dev/null +++ b/modules/system/default.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./plymouth.nix + ./sddm.nix + ./hardware.nix + ]; +} diff --git a/modules/system/hardware.nix b/modules/system/hardware.nix new file mode 100644 index 0000000..9db0e29 --- /dev/null +++ b/modules/system/hardware.nix @@ -0,0 +1,50 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.nomarchy.hardware; +in +{ + options.nomarchy.hardware = { + isXPS = mkEnableOption "Dell XPS specific hardware fixes"; + isT2Mac = mkEnableOption "Apple T2 MacBook specific hardware fixes"; + isFramework = mkEnableOption "Framework laptop specific hardware fixes"; + hasIPU7Camera = mkEnableOption "Intel IPU7 camera support"; + }; + + config = mkMerge [ + (mkIf cfg.isXPS { + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="pci", KERNEL=="0000:00:19.0", ATTR{power/control}="on" + ACTION=="add", SUBSYSTEM=="platform", KERNEL=="i2c_designware.0", ATTR{power/control}="on" + ''; + + systemd.services.nomarchy-haptic-touchpad = { + description = "Dell XPS haptic touchpad feedback"; + after = [ "systemd-udev-settle.service" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${config.home-manager.users.${config.services.displayManager.autoLogin.user}.home.homeDirectory}/.nix-profile/bin/nomarchy-haptic-touchpad"; + Restart = "on-failure"; + RestartSec = "2"; + }; + }; + }) + + (mkIf cfg.isFramework { + services.udev.extraRules = '' + # Framework 16 QMK HID + SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0012", MODE="0666", GROUP="users" + ''; + }) + + (mkIf cfg.isT2Mac { + boot.kernelParams = [ "intel_iommu=on" "iommu=pt" "pcie_ports=compat" ]; + boot.kernelModules = [ "apple-bce" ]; + boot.extraModprobeConfig = '' + options brcmfmac feature_disable=0x82000 + ''; + }) + ]; +} diff --git a/modules/system/plymouth.nix b/modules/system/plymouth.nix new file mode 100644 index 0000000..f73a2bf --- /dev/null +++ b/modules/system/plymouth.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + boot.initrd.systemd.enable = true; + boot.plymouth = { + enable = true; + }; + + boot.kernelParams = [ "quiet" "splash" "loglevel=3" ]; +} diff --git a/modules/system/sddm.nix b/modules/system/sddm.nix new file mode 100644 index 0000000..9dd9c0c --- /dev/null +++ b/modules/system/sddm.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ... }: + +{ + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + # Enable Hyprland system-level dependencies + programs.hyprland.enable = true; +} diff --git a/themes/catppuccin-latte/backgrounds/1-color-fade.png b/themes/catppuccin-latte/backgrounds/1-color-fade.png new file mode 100644 index 0000000..ee0cd94 Binary files /dev/null and b/themes/catppuccin-latte/backgrounds/1-color-fade.png differ diff --git a/themes/catppuccin-latte/btop.theme b/themes/catppuccin-latte/btop.theme new file mode 100644 index 0000000..87ed181 --- /dev/null +++ b/themes/catppuccin-latte/btop.theme @@ -0,0 +1,84 @@ +# https://github.com/catppuccin/btop/blob/main/themes/catppuccin_latte.theme +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#eff1f5" + +# Main text color +theme[main_fg]="#4c4f69" + +# Title color for boxes +theme[title]="#4c4f69" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#1e66f5" + +# Background color of selected item in processes box +theme[selected_bg]="#bcc0cc" + +# Foreground color of selected item in processes box +theme[selected_fg]="#1e66f5" + +# Color of inactive/disabled text +theme[inactive_fg]="#8c8fa1" + +# Color of text appearing on top of graphs, i.e uptime and current network graph scaling +theme[graph_text]="#dc8a78" + +# Background color of the percentage meters +theme[meter_bg]="#bcc0cc" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#dc8a78" + +# CPU, Memory, Network, Proc box outline colors +theme[cpu_box]="#8839ef" #Mauve +theme[mem_box]="#40a02b" #Green +theme[net_box]="#e64553" #Maroon +theme[proc_box]="#1e66f5" #Blue + +# Box divider line and small boxes line color +theme[div_line]="#9ca0b0" + +# Temperature graph color (Green -> Yellow -> Red) +theme[temp_start]="#40a02b" +theme[temp_mid]="#df8e1d" +theme[temp_end]="#d20f39" + +# CPU graph colors (Teal -> Lavender) +theme[cpu_start]="#179299" +theme[cpu_mid]="#209fb5" +theme[cpu_end]="#7287fd" + +# Mem/Disk free meter (Mauve -> Lavender -> Blue) +theme[free_start]="#8839ef" +theme[free_mid]="#7287fd" +theme[free_end]="#1e66f5" + +# Mem/Disk cached meter (Sapphire -> Lavender) +theme[cached_start]="#209fb5" +theme[cached_mid]="#1e66f5" +theme[cached_end]="#7287fd" + +# Mem/Disk available meter (Peach -> Red) +theme[available_start]="#fe640b" +theme[available_mid]="#e64553" +theme[available_end]="#d20f39" + +# Mem/Disk used meter (Green -> Sky) +theme[used_start]="#40a02b" +theme[used_mid]="#179299" +theme[used_end]="#04a5e5" + +# Download graph colors (Peach -> Red) +theme[download_start]="#fe640b" +theme[download_mid]="#e64553" +theme[download_end]="#d20f39" + +# Upload graph colors (Green -> Sky) +theme[upload_start]="#40a02b" +theme[upload_mid]="#179299" +theme[upload_end]="#04a5e5" + +# Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) +theme[process_start]="#209fb5" +theme[process_mid]="#7287fd" +theme[process_end]="#8839ef" diff --git a/themes/catppuccin-latte/colors.toml b/themes/catppuccin-latte/colors.toml new file mode 100644 index 0000000..87c37d4 --- /dev/null +++ b/themes/catppuccin-latte/colors.toml @@ -0,0 +1,23 @@ +accent = "#1e66f5" +cursor = "#dc8a78" +foreground = "#4c4f69" +background = "#eff1f5" +selection_foreground = "#eff1f5" +selection_background = "#dc8a78" + +color0 = "#bcc0cc" +color1 = "#d20f39" +color2 = "#40a02b" +color3 = "#df8e1d" +color4 = "#1e66f5" +color5 = "#ea76cb" +color6 = "#179299" +color7 = "#5c5f77" +color8 = "#acb0be" +color9 = "#d20f39" +color10 = "#40a02b" +color11 = "#df8e1d" +color12 = "#1e66f5" +color13 = "#ea76cb" +color14 = "#179299" +color15 = "#6c6f85" diff --git a/themes/catppuccin-latte/icons.theme b/themes/catppuccin-latte/icons.theme new file mode 100644 index 0000000..6ce2f14 --- /dev/null +++ b/themes/catppuccin-latte/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/catppuccin-latte/light.mode b/themes/catppuccin-latte/light.mode new file mode 100644 index 0000000..66bb2d0 --- /dev/null +++ b/themes/catppuccin-latte/light.mode @@ -0,0 +1 @@ +# This will set "prefer-light" and use "Adwaita" as the theme diff --git a/themes/catppuccin-latte/neovim.lua b/themes/catppuccin-latte/neovim.lua new file mode 100644 index 0000000..53eaf45 --- /dev/null +++ b/themes/catppuccin-latte/neovim.lua @@ -0,0 +1,16 @@ +return { + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + opts = { + flavour = "latte", + }, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin-latte", + }, + }, +} diff --git a/themes/catppuccin-latte/preview.png b/themes/catppuccin-latte/preview.png new file mode 100644 index 0000000..d3ef70e Binary files /dev/null and b/themes/catppuccin-latte/preview.png differ diff --git a/themes/catppuccin-latte/vscode.json b/themes/catppuccin-latte/vscode.json new file mode 100644 index 0000000..98d1113 --- /dev/null +++ b/themes/catppuccin-latte/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Catppuccin Latte", + "extension": "catppuccin.catppuccin-vsc" +} diff --git a/themes/catppuccin/backgrounds/1-totoro.png b/themes/catppuccin/backgrounds/1-totoro.png new file mode 100644 index 0000000..5fbcebc Binary files /dev/null and b/themes/catppuccin/backgrounds/1-totoro.png differ diff --git a/themes/catppuccin/backgrounds/2-waves.png b/themes/catppuccin/backgrounds/2-waves.png new file mode 100644 index 0000000..a0b5325 Binary files /dev/null and b/themes/catppuccin/backgrounds/2-waves.png differ diff --git a/themes/catppuccin/backgrounds/3-blue-eye.png b/themes/catppuccin/backgrounds/3-blue-eye.png new file mode 100644 index 0000000..30b5963 Binary files /dev/null and b/themes/catppuccin/backgrounds/3-blue-eye.png differ diff --git a/themes/catppuccin/btop.theme b/themes/catppuccin/btop.theme new file mode 100644 index 0000000..f0395b3 --- /dev/null +++ b/themes/catppuccin/btop.theme @@ -0,0 +1,83 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#1E1E2E" + +# Main text color +theme[main_fg]="#c6d0f5" + +# Title color for boxes +theme[title]="#c6d0f5" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#8caaee" + +# Background color of selected item in processes box +theme[selected_bg]="#51576d" + +# Foreground color of selected item in processes box +theme[selected_fg]="#8caaee" + +# Color of inactive/disabled text +theme[inactive_fg]="#838ba7" + +# Color of text appearing on top of graphs, i.e uptime and current network graph scaling +theme[graph_text]="#f2d5cf" + +# Background color of the percentage meters +theme[meter_bg]="#51576d" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#f2d5cf" + +# CPU, Memory, Network, Proc box outline colors +theme[cpu_box]="#ca9ee6" #Mauve +theme[mem_box]="#a6d189" #Green +theme[net_box]="#ea999c" #Maroon +theme[proc_box]="#8caaee" #Blue + +# Box divider line and small boxes line color +theme[div_line]="#737994" + +# Temperature graph color (Green -> Yellow -> Red) +theme[temp_start]="#a6d189" +theme[temp_mid]="#e5c890" +theme[temp_end]="#e78284" + +# CPU graph colors (Teal -> Lavender) +theme[cpu_start]="#81c8be" +theme[cpu_mid]="#85c1dc" +theme[cpu_end]="#babbf1" + +# Mem/Disk free meter (Mauve -> Lavender -> Blue) +theme[free_start]="#ca9ee6" +theme[free_mid]="#babbf1" +theme[free_end]="#8caaee" + +# Mem/Disk cached meter (Sapphire -> Lavender) +theme[cached_start]="#85c1dc" +theme[cached_mid]="#8caaee" +theme[cached_end]="#babbf1" + +# Mem/Disk available meter (Peach -> Red) +theme[available_start]="#ef9f76" +theme[available_mid]="#ea999c" +theme[available_end]="#e78284" + +# Mem/Disk used meter (Green -> Sky) +theme[used_start]="#a6d189" +theme[used_mid]="#81c8be" +theme[used_end]="#99d1db" + +# Download graph colors (Peach -> Red) +theme[download_start]="#ef9f76" +theme[download_mid]="#ea999c" +theme[download_end]="#e78284" + +# Upload graph colors (Green -> Sky) +theme[upload_start]="#a6d189" +theme[upload_mid]="#81c8be" +theme[upload_end]="#99d1db" + +# Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) +theme[process_start]="#85c1dc" +theme[process_mid]="#babbf1" +theme[process_end]="#ca9ee6" diff --git a/themes/catppuccin/colors.toml b/themes/catppuccin/colors.toml new file mode 100644 index 0000000..6943ef1 --- /dev/null +++ b/themes/catppuccin/colors.toml @@ -0,0 +1,23 @@ +accent = "#89b4fa" +cursor = "#f5e0dc" +foreground = "#cdd6f4" +background = "#1e1e2e" +selection_foreground = "#1e1e2e" +selection_background = "#f5e0dc" + +color0 = "#45475a" +color1 = "#f38ba8" +color2 = "#a6e3a1" +color3 = "#f9e2af" +color4 = "#89b4fa" +color5 = "#f5c2e7" +color6 = "#94e2d5" +color7 = "#bac2de" +color8 = "#585b70" +color9 = "#f38ba8" +color10 = "#a6e3a1" +color11 = "#f9e2af" +color12 = "#89b4fa" +color13 = "#f5c2e7" +color14 = "#94e2d5" +color15 = "#a6adc8" diff --git a/themes/catppuccin/icons.theme b/themes/catppuccin/icons.theme new file mode 100644 index 0000000..24a4551 --- /dev/null +++ b/themes/catppuccin/icons.theme @@ -0,0 +1 @@ +Yaru-purple diff --git a/themes/catppuccin/neovim.lua b/themes/catppuccin/neovim.lua new file mode 100644 index 0000000..a868387 --- /dev/null +++ b/themes/catppuccin/neovim.lua @@ -0,0 +1,13 @@ +return { + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin", + }, + }, +} diff --git a/themes/catppuccin/preview.png b/themes/catppuccin/preview.png new file mode 100644 index 0000000..cf75f13 Binary files /dev/null and b/themes/catppuccin/preview.png differ diff --git a/themes/catppuccin/vscode.json b/themes/catppuccin/vscode.json new file mode 100644 index 0000000..a94d2cf --- /dev/null +++ b/themes/catppuccin/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Catppuccin Mocha", + "extension": "catppuccin.catppuccin-vsc" +} diff --git a/themes/catppuccin/waybar.css b/themes/catppuccin/waybar.css new file mode 100644 index 0000000..bf35a40 --- /dev/null +++ b/themes/catppuccin/waybar.css @@ -0,0 +1,2 @@ +@define-color foreground #cdd6f4; +@define-color background #181824; diff --git a/themes/ethereal/backgrounds/1-cosmic.jpg b/themes/ethereal/backgrounds/1-cosmic.jpg new file mode 100644 index 0000000..e5c1463 Binary files /dev/null and b/themes/ethereal/backgrounds/1-cosmic.jpg differ diff --git a/themes/ethereal/backgrounds/2-meadow.jpg b/themes/ethereal/backgrounds/2-meadow.jpg new file mode 100644 index 0000000..95fdafb Binary files /dev/null and b/themes/ethereal/backgrounds/2-meadow.jpg differ diff --git a/themes/ethereal/btop.theme b/themes/ethereal/btop.theme new file mode 100644 index 0000000..135da3d --- /dev/null +++ b/themes/ethereal/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#060B1E" + +# Main text color +theme[main_fg]="#ffcead" + +# Title color for boxes +theme[title]="#c89dc1" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#a3bfd1" + +# Background color of selected item in processes box +theme[selected_bg]="#6d7db6" + +# Foreground color of selected item in processes box +theme[selected_fg]="#ffcead" + +# Color of inactive/disabled text +theme[inactive_fg]="#6d7db6" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#c89dc1" + +# Box outline and divider line color +theme[cpu_box]="#92a593" +theme[mem_box]="#92a593" +theme[net_box]="#92a593" +theme[proc_box]="#92a593" +theme[div_line]="#6d7db6" + +# Gradient for all meters and graphs +theme[temp_start]="#a3bfd1" +theme[temp_mid]="#7d82d9" +theme[temp_end]="#92a593" + + +theme[cpu_start]="#a3bfd1" +theme[cpu_mid]="#7d82d9" +theme[cpu_end]="#92a593" + + +theme[free_start]="#7d82d9" +theme[free_mid]="#E9BB4F" +theme[free_end]="#E9BB4F" + + +theme[cached_start]="#E9BB4F" +theme[cached_mid]="#E9BB4F" +theme[cached_end]="#E9BB4F" + + +theme[available_start]="#a3bfd1" +theme[available_mid]="#a3bfd1" +theme[available_end]="#a3bfd1" + + +theme[used_start]="#92a593" +theme[used_mid]="#92a593" +theme[used_end]="#92a593" + + +theme[download_start]="#E9BB4F" +theme[download_mid]="#a3bfd1" +theme[download_end]="#7d82d9" + + +theme[upload_start]="#E9BB4F" +theme[upload_mid]="#a3bfd1" +theme[upload_end]="#7d82d9" \ No newline at end of file diff --git a/themes/ethereal/colors.toml b/themes/ethereal/colors.toml new file mode 100644 index 0000000..75cedec --- /dev/null +++ b/themes/ethereal/colors.toml @@ -0,0 +1,23 @@ +accent = "#7d82d9" +cursor = "#ffcead" +foreground = "#ffcead" +background = "#060B1E" +selection_foreground = "#060B1E" +selection_background = "#ffcead" + +color0 = "#060B1E" +color1 = "#ED5B5A" +color2 = "#92a593" +color3 = "#E9BB4F" +color4 = "#7d82d9" +color5 = "#c89dc1" +color6 = "#a3bfd1" +color7 = "#F99957" +color8 = "#6d7db6" +color9 = "#faaaa9" +color10 = "#c4cfc4" +color11 = "#f7dc9c" +color12 = "#c2c4f0" +color13 = "#ead7e7" +color14 = "#dfeaf0" +color15 = "#ffcead" diff --git a/themes/ethereal/icons.theme b/themes/ethereal/icons.theme new file mode 100644 index 0000000..6ce2f14 --- /dev/null +++ b/themes/ethereal/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/ethereal/neovim.lua b/themes/ethereal/neovim.lua new file mode 100644 index 0000000..885bece --- /dev/null +++ b/themes/ethereal/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "bjarneo/ethereal.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "ethereal", + }, + }, +} diff --git a/themes/ethereal/preview.png b/themes/ethereal/preview.png new file mode 100644 index 0000000..b9b413c Binary files /dev/null and b/themes/ethereal/preview.png differ diff --git a/themes/ethereal/vscode.json b/themes/ethereal/vscode.json new file mode 100644 index 0000000..253a33d --- /dev/null +++ b/themes/ethereal/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Ethereal", + "extension": "Bjarne.ethereal-nomarchy" +} diff --git a/themes/everforest/backgrounds/1-tree-tops.jpg b/themes/everforest/backgrounds/1-tree-tops.jpg new file mode 100644 index 0000000..6d75259 Binary files /dev/null and b/themes/everforest/backgrounds/1-tree-tops.jpg differ diff --git a/themes/everforest/btop.theme b/themes/everforest/btop.theme new file mode 100644 index 0000000..2ad33bb --- /dev/null +++ b/themes/everforest/btop.theme @@ -0,0 +1,92 @@ +# All graphs and meters can be gradients +# For single color graphs leave "mid" and "end" variable empty. +# Use "start" and "end" variables for two color gradient +# Use "start", "mid" and "end" for three color gradient + +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#2d353b" + +# Main text color +theme[main_fg]="#d3c6aa" + +# Title color for boxes +theme[title]="#d3c6aa" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#e67e80" + +# Background color of selected items +theme[selected_bg]="#3d484d" + +# Foreground color of selected items +theme[selected_fg]="#dbbc7f" + +# Color of inactive/disabled text +theme[inactive_fg]="#2d353b" + +# Color of text appearing on top of graphs, i.e uptime and current network graph scaling +theme[graph_text]="#d3c6aa" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#a7c080" + +# Cpu box outline color +theme[cpu_box]="#3d484d" + +# Memory/disks box outline color +theme[mem_box]="#3d484d" + +# Net up/down box outline color +theme[net_box]="#3d484d" + +# Processes box outline color +theme[proc_box]="#3d484d" + +# Box divider line and small boxes line color +theme[div_line]="#3d484d" + +# Temperature graph colors +theme[temp_start]="#a7c080" +theme[temp_mid]="#dbbc7f" +theme[temp_end]="#f85552" + +# CPU graph colors +theme[cpu_start]="#a7c080" +theme[cpu_mid]="#dbbc7f" +theme[cpu_end]="#f85552" + +# Mem/Disk free meter +theme[free_start]="#f85552" +theme[free_mid]="#dbbc7f" +theme[free_end]="#a7c080" + +# Mem/Disk cached meter +theme[cached_start]="#7fbbb3" +theme[cached_mid]="#83c092" +theme[cached_end]="#a7c080" + +# Mem/Disk available meter +theme[available_start]="#f85552" +theme[available_mid]="#dbbc7f" +theme[available_end]="#a7c080" + +# Mem/Disk used meter +theme[used_start]="#a7c080" +theme[used_mid]="#dbbc7f" +theme[used_end]="#f85552" + +# Download graph colors +theme[download_start]="#a7c080" +theme[download_mid]="#83c092" +theme[download_end]="#7fbbb3" + +# Upload graph colors +theme[upload_start]="#dbbc7f" +theme[upload_mid]="#e69875" +theme[upload_end]="#e67e80" + +# Process box color gradient for threads, mem and cpu usage +theme[process_start]="#a7c080" +theme[process_mid]="#e67e80" +theme[process_end]="#f85552" + diff --git a/themes/everforest/colors.toml b/themes/everforest/colors.toml new file mode 100644 index 0000000..9aaeeb5 --- /dev/null +++ b/themes/everforest/colors.toml @@ -0,0 +1,23 @@ +accent = "#7fbbb3" +cursor = "#d3c6aa" +foreground = "#d3c6aa" +background = "#2d353b" +selection_foreground = "#2d353b" +selection_background = "#d3c6aa" + +color0 = "#475258" +color1 = "#e67e80" +color2 = "#a7c080" +color3 = "#dbbc7f" +color4 = "#7fbbb3" +color5 = "#d699b6" +color6 = "#83c092" +color7 = "#d3c6aa" +color8 = "#475258" +color9 = "#e67e80" +color10 = "#a7c080" +color11 = "#dbbc7f" +color12 = "#7fbbb3" +color13 = "#d699b6" +color14 = "#83c092" +color15 = "#d3c6aa" diff --git a/themes/everforest/icons.theme b/themes/everforest/icons.theme new file mode 100644 index 0000000..140e422 --- /dev/null +++ b/themes/everforest/icons.theme @@ -0,0 +1 @@ +Yaru-sage diff --git a/themes/everforest/neovim.lua b/themes/everforest/neovim.lua new file mode 100644 index 0000000..80551c7 --- /dev/null +++ b/themes/everforest/neovim.lua @@ -0,0 +1,10 @@ +return { + { "neanias/everforest-nvim" }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "everforest", + background = "soft", + }, + }, +} diff --git a/themes/everforest/preview.png b/themes/everforest/preview.png new file mode 100644 index 0000000..f328fa5 Binary files /dev/null and b/themes/everforest/preview.png differ diff --git a/themes/everforest/vscode.json b/themes/everforest/vscode.json new file mode 100644 index 0000000..02b107d --- /dev/null +++ b/themes/everforest/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Everforest Dark", + "extension": "sainnhe.everforest" +} diff --git a/themes/flexoki-light/backgrounds/1-orb.png b/themes/flexoki-light/backgrounds/1-orb.png new file mode 100644 index 0000000..a564a17 Binary files /dev/null and b/themes/flexoki-light/backgrounds/1-orb.png differ diff --git a/themes/flexoki-light/backgrounds/2-nomarchy.png b/themes/flexoki-light/backgrounds/2-nomarchy.png new file mode 100644 index 0000000..cc755b1 Binary files /dev/null and b/themes/flexoki-light/backgrounds/2-nomarchy.png differ diff --git a/themes/flexoki-light/btop.theme b/themes/flexoki-light/btop.theme new file mode 100644 index 0000000..0caf9c6 --- /dev/null +++ b/themes/flexoki-light/btop.theme @@ -0,0 +1,78 @@ +# Main bg +theme[main_bg]="#FFFCF0" + +# Main text color +theme[main_fg]="#100F0F" + +# Title color for boxes +theme[title]="#100F0F" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#205EA6" + +# Background color of selected item in processes box +theme[selected_bg]="#414868" + +# Foreground color of selected item in processes box +theme[selected_fg]="#100F0F" + +# Color of inactive/disabled text +theme[inactive_fg]="#6F6E69" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#205EA6" + +# Cpu box outline color +theme[cpu_box]="#6F6E69" + +# Memory/disks box outline color +theme[mem_box]="#6F6E69" + +# Net up/down box outline color +theme[net_box]="#6F6E69" + +# Processes box outline color +theme[proc_box]="#6F6E69" + +# Box divider line and small boxes line color +theme[div_line]="#6F6E69" + +# Temperature graph colors +theme[temp_start]="#66800B" +theme[temp_mid]="#BC5215" +theme[temp_end]="#AF3029" + +# CPU graph colors +theme[cpu_start]="#66800B" +theme[cpu_mid]="#BC5215" +theme[cpu_end]="#AF3029" + +# Mem/Disk free meter +theme[free_start]="#66800B" +theme[free_mid]="#BC5215" +theme[free_end]="#AF3029" + +# Mem/Disk cached meter +theme[cached_start]="#66800B" +theme[cached_mid]="#BC5215" +theme[cached_end]="#AF3029" + +# Mem/Disk available meter +theme[available_start]="#66800B" +theme[available_mid]="#BC5215" +theme[available_end]="#AF3029" + +# Mem/Disk used meter +theme[used_start]="#66800B" +theme[used_mid]="#BC5215" +theme[used_end]="#AF3029" + +# Download graph colors +theme[download_start]="#66800B" +theme[download_mid]="#BC5215" +theme[download_end]="#AF3029" + +# Upload graph colors +theme[upload_start]="#66800B" +theme[upload_mid]="#BC5215" +theme[upload_end]="#AF3029" diff --git a/themes/flexoki-light/chromium.theme b/themes/flexoki-light/chromium.theme new file mode 100644 index 0000000..31cd573 --- /dev/null +++ b/themes/flexoki-light/chromium.theme @@ -0,0 +1 @@ +242,240,229 \ No newline at end of file diff --git a/themes/flexoki-light/colors.toml b/themes/flexoki-light/colors.toml new file mode 100644 index 0000000..44af88c --- /dev/null +++ b/themes/flexoki-light/colors.toml @@ -0,0 +1,23 @@ +accent = "#205EA6" +cursor = "#100F0F" +foreground = "#100F0F" +background = "#FFFCF0" +selection_foreground = "#100F0F" +selection_background = "#CECDC3" + +color0 = "#100F0F" +color1 = "#D14D41" +color2 = "#879A39" +color3 = "#D0A215" +color4 = "#205EA6" +color5 = "#CE5D97" +color6 = "#3AA99F" +color7 = "#FFFCF0" +color8 = "#100F0F" +color9 = "#D14D41" +color10 = "#879A39" +color11 = "#D0A215" +color12 = "#4385BE" +color13 = "#CE5D97" +color14 = "#3AA99F" +color15 = "#FFFCF0" diff --git a/themes/flexoki-light/icons.theme b/themes/flexoki-light/icons.theme new file mode 100644 index 0000000..6ce2f14 --- /dev/null +++ b/themes/flexoki-light/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/flexoki-light/light.mode b/themes/flexoki-light/light.mode new file mode 100644 index 0000000..e65461b --- /dev/null +++ b/themes/flexoki-light/light.mode @@ -0,0 +1 @@ +# This will set "prefer-light" and use "Adwaita" as the theme \ No newline at end of file diff --git a/themes/flexoki-light/neovim.lua b/themes/flexoki-light/neovim.lua new file mode 100644 index 0000000..230c551 --- /dev/null +++ b/themes/flexoki-light/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "kepano/flexoki-neovim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "flexoki-light", + }, + }, +} diff --git a/themes/flexoki-light/preview.png b/themes/flexoki-light/preview.png new file mode 100644 index 0000000..3a350a2 Binary files /dev/null and b/themes/flexoki-light/preview.png differ diff --git a/themes/flexoki-light/vscode.json b/themes/flexoki-light/vscode.json new file mode 100644 index 0000000..00a2045 --- /dev/null +++ b/themes/flexoki-light/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "flexoki-light", + "extension": "shadesOfBuntu.flexoki-light" +} diff --git a/themes/gruvbox/backgrounds/1-the-backwater.jpg b/themes/gruvbox/backgrounds/1-the-backwater.jpg new file mode 100644 index 0000000..c9ff531 Binary files /dev/null and b/themes/gruvbox/backgrounds/1-the-backwater.jpg differ diff --git a/themes/gruvbox/backgrounds/2-flower-basket.jpg b/themes/gruvbox/backgrounds/2-flower-basket.jpg new file mode 100644 index 0000000..42af8d1 Binary files /dev/null and b/themes/gruvbox/backgrounds/2-flower-basket.jpg differ diff --git a/themes/gruvbox/backgrounds/3-village-square.jpg b/themes/gruvbox/backgrounds/3-village-square.jpg new file mode 100644 index 0000000..0ff0160 Binary files /dev/null and b/themes/gruvbox/backgrounds/3-village-square.jpg differ diff --git a/themes/gruvbox/backgrounds/4-idyllic-procession.jpg b/themes/gruvbox/backgrounds/4-idyllic-procession.jpg new file mode 100644 index 0000000..3742024 Binary files /dev/null and b/themes/gruvbox/backgrounds/4-idyllic-procession.jpg differ diff --git a/themes/gruvbox/backgrounds/5-leaves.jpg b/themes/gruvbox/backgrounds/5-leaves.jpg new file mode 100644 index 0000000..fd31869 Binary files /dev/null and b/themes/gruvbox/backgrounds/5-leaves.jpg differ diff --git a/themes/gruvbox/btop.theme b/themes/gruvbox/btop.theme new file mode 100644 index 0000000..0584954 --- /dev/null +++ b/themes/gruvbox/btop.theme @@ -0,0 +1,92 @@ +#Bashtop gruvbox (https://github.com/morhetz/gruvbox) theme +#by BachoSeven + +# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal: "#RRGGBB", "#BW" or "0-255 0-255 0-255" +# example for white: "#FFFFFF", "#ff" or "255 255 255". + +# All graphs and meters can be gradients +# For single color graphs leave "mid" and "end" variable empty. +# Use "start" and "end" variables for two color gradient +# Use "start", "mid" and "end" for three color gradient + +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#282828" + +# Main text color +theme[main_fg]="#a89984" + +# Title color for boxes +theme[title]="#ebdbb2" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#d79921" + +# Background color of selected items +theme[selected_bg]="#282828" + +# Foreground color of selected items +theme[selected_fg]="#fabd2f" + +# Color of inactive/disabled text +theme[inactive_fg]="#282828" + +# Color of text appearing on top of graphs, i.e uptime and current network graph scaling +theme[graph_text]="#585858" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#98971a" + +# Cpu box outline color +theme[cpu_box]="#a89984" + +# Memory/disks box outline color +theme[mem_box]="#a89984" + +# Net up/down box outline color +theme[net_box]="#a89984" + +# Processes box outline color +theme[proc_box]="#a89984" + +# Box divider line and small boxes line color +theme[div_line]="#a89984" + +# Temperature graph colors +theme[temp_start]="#458588" +theme[temp_mid]="#d3869b" +theme[temp_end]="#fb4394" + +# CPU graph colors +theme[cpu_start]="#b8bb26" +theme[cpu_mid]="#d79921" +theme[cpu_end]="#fb4934" + +# Mem/Disk free meter +theme[free_start]="#4e5900" +theme[free_mid]="" +theme[free_end]="#98971a" + +# Mem/Disk cached meter +theme[cached_start]="#458588" +theme[cached_mid]="" +theme[cached_end]="#83a598" + +# Mem/Disk available meter +theme[available_start]="#d79921" +theme[available_mid]="" +theme[available_end]="#fabd2f" + +# Mem/Disk used meter +theme[used_start]="#cc241d" +theme[used_mid]="" +theme[used_end]="#fb4934" + +# Download graph colors +theme[download_start]="#3d4070" +theme[download_mid]="#6c71c4" +theme[download_end]="#a3a8f7" + +# Upload graph colors +theme[upload_start]="#701c45" +theme[upload_mid]="#b16286" +theme[upload_end]="#d3869b" diff --git a/themes/gruvbox/colors.toml b/themes/gruvbox/colors.toml new file mode 100644 index 0000000..57847f0 --- /dev/null +++ b/themes/gruvbox/colors.toml @@ -0,0 +1,23 @@ +accent = "#7daea3" +cursor = "#bdae93" +foreground = "#d4be98" +background = "#282828" +selection_foreground = "#ebdbb2" +selection_background = "#d65d0e" + +color0 = "#3c3836" +color1 = "#ea6962" +color2 = "#a9b665" +color3 = "#d8a657" +color4 = "#7daea3" +color5 = "#d3869b" +color6 = "#89b482" +color7 = "#d4be98" +color8 = "#3c3836" +color9 = "#ea6962" +color10 = "#a9b665" +color11 = "#d8a657" +color12 = "#7daea3" +color13 = "#d3869b" +color14 = "#89b482" +color15 = "#d4be98" diff --git a/themes/gruvbox/icons.theme b/themes/gruvbox/icons.theme new file mode 100644 index 0000000..7bb20fc --- /dev/null +++ b/themes/gruvbox/icons.theme @@ -0,0 +1 @@ +Yaru-olive diff --git a/themes/gruvbox/neovim.lua b/themes/gruvbox/neovim.lua new file mode 100644 index 0000000..edaf0d5 --- /dev/null +++ b/themes/gruvbox/neovim.lua @@ -0,0 +1,9 @@ +return { + { "ellisonleao/gruvbox.nvim" }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, +} diff --git a/themes/gruvbox/preview.png b/themes/gruvbox/preview.png new file mode 100644 index 0000000..1287fa2 Binary files /dev/null and b/themes/gruvbox/preview.png differ diff --git a/themes/gruvbox/vscode.json b/themes/gruvbox/vscode.json new file mode 100644 index 0000000..e75a9b9 --- /dev/null +++ b/themes/gruvbox/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Gruvbox Dark Medium", + "extension": "jdinhlife.gruvbox" +} diff --git a/themes/hackerman/backgrounds/1-synth-scape.jpg b/themes/hackerman/backgrounds/1-synth-scape.jpg new file mode 100644 index 0000000..7a36f6a Binary files /dev/null and b/themes/hackerman/backgrounds/1-synth-scape.jpg differ diff --git a/themes/hackerman/backgrounds/2-geometric.jpg b/themes/hackerman/backgrounds/2-geometric.jpg new file mode 100644 index 0000000..a18aff8 Binary files /dev/null and b/themes/hackerman/backgrounds/2-geometric.jpg differ diff --git a/themes/hackerman/btop.theme b/themes/hackerman/btop.theme new file mode 100644 index 0000000..7609189 --- /dev/null +++ b/themes/hackerman/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#0B0C16" + +# Main text color +theme[main_fg]="#ddf7ff" + +# Title color for boxes +theme[title]="#86a7df" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#7cf8f7" + +# Background color of selected item in processes box +theme[selected_bg]="#6a6e95" + +# Foreground color of selected item in processes box +theme[selected_fg]="#ddf7ff" + +# Color of inactive/disabled text +theme[inactive_fg]="#6a6e95" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#86a7df" + +# Box outline and divider line color +theme[cpu_box]="#4fe88f" +theme[mem_box]="#4fe88f" +theme[net_box]="#4fe88f" +theme[proc_box]="#4fe88f" +theme[div_line]="#6a6e95" + +# Gradient for all meters and graphs +theme[temp_start]="#7cf8f7" +theme[temp_mid]="#829dd4" +theme[temp_end]="#4fe88f" + + +theme[cpu_start]="#7cf8f7" +theme[cpu_mid]="#829dd4" +theme[cpu_end]="#4fe88f" + + +theme[free_start]="#829dd4" +theme[free_mid]="#50f7d4" +theme[free_end]="#50f7d4" + + +theme[cached_start]="#50f7d4" +theme[cached_mid]="#50f7d4" +theme[cached_end]="#50f7d4" + + +theme[available_start]="#7cf8f7" +theme[available_mid]="#7cf8f7" +theme[available_end]="#7cf8f7" + + +theme[used_start]="#4fe88f" +theme[used_mid]="#4fe88f" +theme[used_end]="#4fe88f" + + +theme[download_start]="#50f7d4" +theme[download_mid]="#7cf8f7" +theme[download_end]="#829dd4" + + +theme[upload_start]="#50f7d4" +theme[upload_mid]="#7cf8f7" +theme[upload_end]="#829dd4" \ No newline at end of file diff --git a/themes/hackerman/colors.toml b/themes/hackerman/colors.toml new file mode 100644 index 0000000..56aec2a --- /dev/null +++ b/themes/hackerman/colors.toml @@ -0,0 +1,23 @@ +accent = "#82FB9C" +cursor = "#ddf7ff" +foreground = "#ddf7ff" +background = "#0B0C16" +selection_foreground = "#0B0C16" +selection_background = "#ddf7ff" + +color0 = "#0B0C16" +color1 = "#50f872" +color2 = "#4fe88f" +color3 = "#50f7d4" +color4 = "#829dd4" +color5 = "#86a7df" +color6 = "#7cf8f7" +color7 = "#85E1FB" +color8 = "#6a6e95" +color9 = "#85ff9d" +color10 = "#9cf7c2" +color11 = "#a4ffec" +color12 = "#c4d2ed" +color13 = "#cddbf4" +color14 = "#d1fffe" +color15 = "#ddf7ff" diff --git a/themes/hackerman/icons.theme b/themes/hackerman/icons.theme new file mode 100644 index 0000000..66be38a --- /dev/null +++ b/themes/hackerman/icons.theme @@ -0,0 +1 @@ +Yaru-blue \ No newline at end of file diff --git a/themes/hackerman/neovim.lua b/themes/hackerman/neovim.lua new file mode 100644 index 0000000..d4588f0 --- /dev/null +++ b/themes/hackerman/neovim.lua @@ -0,0 +1,13 @@ +return { + { + "bjarneo/hackerman.nvim", + dependencies = { "bjarneo/aether.nvim" }, -- Ensure aether is loaded first + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "hackerman", + }, + }, +} diff --git a/themes/hackerman/preview.png b/themes/hackerman/preview.png new file mode 100644 index 0000000..2d4c0c3 Binary files /dev/null and b/themes/hackerman/preview.png differ diff --git a/themes/hackerman/vscode.json b/themes/hackerman/vscode.json new file mode 100644 index 0000000..dc56bb1 --- /dev/null +++ b/themes/hackerman/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Hackerman", + "extension": "Bjarne.hackerman-nomarchy" +} diff --git a/themes/kanagawa/backgrounds/1-kanagawa.jpg b/themes/kanagawa/backgrounds/1-kanagawa.jpg new file mode 100644 index 0000000..197c48d Binary files /dev/null and b/themes/kanagawa/backgrounds/1-kanagawa.jpg differ diff --git a/themes/kanagawa/btop.theme b/themes/kanagawa/btop.theme new file mode 100644 index 0000000..5202748 --- /dev/null +++ b/themes/kanagawa/btop.theme @@ -0,0 +1,86 @@ +# Bashtop Kanagawa-wave (https://github.com/rebelot/kanagawa.nvim) theme +# By: philikarus + +# Main bg +theme[main_bg]="#1f1f28" + +# Main text color +theme[main_fg]="#dcd7ba" + +# Title color for boxes +theme[title]="#dcd7ba" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#C34043" + +# Background color of selected item in processes box +theme[selected_bg]="#223249" + +# Foreground color of selected item in processes box +theme[selected_fg]="#dca561" + +# Color of inactive/disabled text +theme[inactive_fg]="#727169" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#7aa89f" + +# Cpu box outline color +theme[cpu_box]="#727169" + +# Memory/disks box outline color +theme[mem_box]="#727169" + +# Net up/down box outline color +theme[net_box]="#727169" + +# Processes box outline color +theme[proc_box]="#727169" + +# Box divider line and small boxes line color +theme[div_line]="#727169" + +# Temperature graph colors +theme[temp_start]="#98BB6C" +theme[temp_mid]="#DCA561" +theme[temp_end]="#E82424" + +# CPU graph colors +theme[cpu_start]="#98BB6C" +theme[cpu_mid]="#DCA561" +theme[cpu_end]="#E82424" + +# Mem/Disk free meter +theme[free_start]="#E82424" +theme[free_mid]="#C34043" +theme[free_end]="#FF5D62" + +# Mem/Disk cached meter +theme[cached_start]="#C0A36E" +theme[cached_mid]="#DCA561" +theme[cached_end]="#FF9E3B" + +# Mem/Disk available meter +theme[available_start]="#938AA9" +theme[available_mid]="#957FBB" +theme[available_end]="#9CABCA" + +# Mem/Disk used meter +theme[used_start]="#658594" +theme[used_mid]="#7E9CDB" +theme[used_end]="#7FB4CA" + +# Download graph colors +theme[download_start]="#7E9CDB" +theme[download_mid]="#938AA9" +theme[download_end]="#957FBB" + +# Upload graph colors +theme[upload_start]="#DCA561" +theme[upload_mid]="#E6C384" +theme[upload_end]="#E82424" + +# Process box color gradient for threads, mem and cpu usage +theme[process_start]="#98BB6C" +theme[process_mid]="#DCA561" +theme[process_end]="#C34043" diff --git a/themes/kanagawa/colors.toml b/themes/kanagawa/colors.toml new file mode 100644 index 0000000..7ca002e --- /dev/null +++ b/themes/kanagawa/colors.toml @@ -0,0 +1,23 @@ +accent = "#7e9cd8" +cursor = "#c8c093" +foreground = "#dcd7ba" +background = "#1f1f28" +selection_foreground = "#c8c093" +selection_background = "#2d4f67" + +color0 = "#090618" +color1 = "#c34043" +color2 = "#76946a" +color3 = "#c0a36e" +color4 = "#7e9cd8" +color5 = "#957fb8" +color6 = "#6a9589" +color7 = "#c8c093" +color8 = "#727169" +color9 = "#e82424" +color10 = "#98bb6c" +color11 = "#e6c384" +color12 = "#7fb4ca" +color13 = "#938aa9" +color14 = "#7aa89f" +color15 = "#dcd7ba" diff --git a/themes/kanagawa/hyprland.conf b/themes/kanagawa/hyprland.conf new file mode 100644 index 0000000..0ee92ca --- /dev/null +++ b/themes/kanagawa/hyprland.conf @@ -0,0 +1,12 @@ +$activeBorderColor = rgb(dcd7ba) + +general { + col.active_border = $activeBorderColor +} + +group { + col.border_active = $activeBorderColor +} + +# Kanagawa backdrop is too strong for detault opacity +windowrule = opacity 0.98 0.95, match:tag terminal diff --git a/themes/kanagawa/icons.theme b/themes/kanagawa/icons.theme new file mode 100644 index 0000000..6ce2f14 --- /dev/null +++ b/themes/kanagawa/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/kanagawa/neovim.lua b/themes/kanagawa/neovim.lua new file mode 100644 index 0000000..b31e9e5 --- /dev/null +++ b/themes/kanagawa/neovim.lua @@ -0,0 +1,9 @@ +return { + { "rebelot/kanagawa.nvim" }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "kanagawa", + }, + }, +} diff --git a/themes/kanagawa/preview.png b/themes/kanagawa/preview.png new file mode 100644 index 0000000..67b1ac1 Binary files /dev/null and b/themes/kanagawa/preview.png differ diff --git a/themes/kanagawa/vscode.json b/themes/kanagawa/vscode.json new file mode 100644 index 0000000..91f7539 --- /dev/null +++ b/themes/kanagawa/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Kanagawa", + "extension": "qufiwefefwoyn.kanagawa" +} diff --git a/themes/lumon/backgrounds/01-united-in-severance.jpg b/themes/lumon/backgrounds/01-united-in-severance.jpg new file mode 100644 index 0000000..d07b636 Binary files /dev/null and b/themes/lumon/backgrounds/01-united-in-severance.jpg differ diff --git a/themes/lumon/backgrounds/02-opinions-equally.jpg b/themes/lumon/backgrounds/02-opinions-equally.jpg new file mode 100644 index 0000000..4f2a0bf Binary files /dev/null and b/themes/lumon/backgrounds/02-opinions-equally.jpg differ diff --git a/themes/lumon/btop.theme b/themes/lumon/btop.theme new file mode 100644 index 0000000..d9d0572 --- /dev/null +++ b/themes/lumon/btop.theme @@ -0,0 +1,64 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="" +theme_background=false + +# Main text color +theme[main_fg]="#c7d2de" + +# Title color for boxes +theme[title]="#9fcfe9" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#b5deef" + +# Background color of selected item in processes box +theme[selected_bg]="#355066" + +# Foreground color of selected item in processes box +theme[selected_fg]="#c7d2de" + +# Color of inactive/disabled text +theme[inactive_fg]="#355066" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#9fcfe9" + +# Box outline and divider line color +theme[cpu_box]="#79abd2" +theme[mem_box]="#79abd2" +theme[net_box]="#79abd2" +theme[proc_box]="#79abd2" +theme[div_line]="#355066" + +# Gradient for all meters and graphs +theme[temp_start]="#b5deef" +theme[temp_mid]="#92c7e7" +theme[temp_end]="#79abd2" + +theme[cpu_start]="#b5deef" +theme[cpu_mid]="#92c7e7" +theme[cpu_end]="#79abd2" + +theme[free_start]="#92c7e7" +theme[free_mid]="#86b6da" +theme[free_end]="#86b6da" + +theme[cached_start]="#86b6da" +theme[cached_mid]="#86b6da" +theme[cached_end]="#86b6da" + +theme[available_start]="#b5deef" +theme[available_mid]="#b5deef" +theme[available_end]="#b5deef" + +theme[used_start]="#79abd2" +theme[used_mid]="#79abd2" +theme[used_end]="#79abd2" + +theme[download_start]="#86b6da" +theme[download_mid]="#b5deef" +theme[download_end]="#92c7e7" + +theme[upload_start]="#86b6da" +theme[upload_mid]="#b5deef" +theme[upload_end]="#92c7e7" diff --git a/themes/lumon/chromium.theme b/themes/lumon/chromium.theme new file mode 100644 index 0000000..fdf694b --- /dev/null +++ b/themes/lumon/chromium.theme @@ -0,0 +1 @@ +14,31,41 diff --git a/themes/lumon/colors.toml b/themes/lumon/colors.toml new file mode 100644 index 0000000..b94e758 --- /dev/null +++ b/themes/lumon/colors.toml @@ -0,0 +1,35 @@ +# Accent and UI colors +accent = "#f2fcff" +active_border_color = "#f2fcff" +active_tab_background = "#6fb8e3" + +# Cursor colors +cursor = "#f2fcff" + +# Primary colors +foreground = "#d6e2ee" +background = "#16242d" + +# Selection colors +selection_foreground = "#1b2d40" +selection_background = "#4d9ed3" + +# Normal colors (ANSI 0-7) +color0 = "#1b2d40" +color1 = "#4d86b0" +color2 = "#5e95bc" +color3 = "#6fa4c9" +color4 = "#6fb8e3" +color5 = "#8bc9eb" +color6 = "#b4e4f6" +color7 = "#d6e2ee" + +# Bright colors (ANSI 8-15) +color8 = "#304860" +color9 = "#73a6cb" +color10 = "#86b7d8" +color11 = "#9dcae5" +color12 = "#f2fcff" +color13 = "#b1d8ee" +color14 = "#d1eef8" +color15 = "#ffffff" diff --git a/themes/lumon/hyprland.conf b/themes/lumon/hyprland.conf new file mode 100644 index 0000000..40d21b4 --- /dev/null +++ b/themes/lumon/hyprland.conf @@ -0,0 +1,26 @@ +$activeBorderColor = rgb(f2fcff) +$activeShadowColor = rgb(6fb8e3) +$inactiveBorderColor = rgba(30486099) +$inactiveShadowColor = rgba(30486077) + +general { + col.active_border = $activeBorderColor + col.inactive_border = $inactiveBorderColor + gaps_in = 8 + gaps_out = 16 +} + +group { + col.border_active = $activeBorderColor + col.border_inactive = $inactiveBorderColor +} + +decoration { + shadow { + enabled = true + range = 16 + render_power = 4 + color = $activeShadowColor + color_inactive = $inactiveShadowColor + } +} diff --git a/themes/lumon/icons.theme b/themes/lumon/icons.theme new file mode 100644 index 0000000..66be38a --- /dev/null +++ b/themes/lumon/icons.theme @@ -0,0 +1 @@ +Yaru-blue \ No newline at end of file diff --git a/themes/lumon/neovim.lua b/themes/lumon/neovim.lua new file mode 100644 index 0000000..0c6407c --- /dev/null +++ b/themes/lumon/neovim.lua @@ -0,0 +1,13 @@ +return { + { + "omacom-io/lumon.nvim", + name = "lumon", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "lumon", + }, + }, +} diff --git a/themes/lumon/preview.png b/themes/lumon/preview.png new file mode 100644 index 0000000..9a87f6d Binary files /dev/null and b/themes/lumon/preview.png differ diff --git a/themes/lumon/swayosd.css b/themes/lumon/swayosd.css new file mode 100644 index 0000000..5d71e32 --- /dev/null +++ b/themes/lumon/swayosd.css @@ -0,0 +1,44 @@ +@define-color background-color #1b2d40; +@define-color border-color #304860; +@define-color label #d6e2ee; +@define-color image #d6e2ee; +@define-color progress #6fb8e3; +@define-color edge-light #f2fcff; + +/* Cancel out Nomarchy defaults */ +window:not(:backdrop), +window:backdrop { + border: none; + border-width: 0; + background-color: transparent; + box-shadow: none; + padding: 12px; +} + +/* Draw the Lumon OSD shell */ +window:not(:backdrop) #container, +window:backdrop #container { + border: 2px solid alpha(@border-color, 0.92); + background-color: alpha(@background-color, 0.95); + padding: 12px 16px; + background-clip: padding-box; +} + +image, +label { + color: @label; +} + +progressbar { + min-height: 8px; +} + +progressbar trough { + background: alpha(@border-color, 0.24); + box-shadow: inset 0 1px rgba(242, 252, 255, 0.03); +} + +progressbar progress { + background: linear-gradient(90deg, @progress, @edge-light); + box-shadow: 0 0 10px rgba(111, 184, 227, 0.18); +} diff --git a/themes/lumon/vscode.json b/themes/lumon/vscode.json new file mode 100644 index 0000000..045878d --- /dev/null +++ b/themes/lumon/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Lumon", + "extension": "oldjobobo.lumon-theme" +} diff --git a/themes/lumon/waybar.css b/themes/lumon/waybar.css new file mode 100644 index 0000000..11f4905 --- /dev/null +++ b/themes/lumon/waybar.css @@ -0,0 +1,2 @@ +@define-color foreground #d6e2ee; +@define-color background #213442; diff --git a/themes/matte-black/backgrounds/0-ship-at-sea.jpg b/themes/matte-black/backgrounds/0-ship-at-sea.jpg new file mode 100644 index 0000000..4375ee2 Binary files /dev/null and b/themes/matte-black/backgrounds/0-ship-at-sea.jpg differ diff --git a/themes/matte-black/backgrounds/1-dark-waters.jpg b/themes/matte-black/backgrounds/1-dark-waters.jpg new file mode 100644 index 0000000..2afb1bc Binary files /dev/null and b/themes/matte-black/backgrounds/1-dark-waters.jpg differ diff --git a/themes/matte-black/backgrounds/2-dot-hands.jpg b/themes/matte-black/backgrounds/2-dot-hands.jpg new file mode 100644 index 0000000..b76792c Binary files /dev/null and b/themes/matte-black/backgrounds/2-dot-hands.jpg differ diff --git a/themes/matte-black/btop.theme b/themes/matte-black/btop.theme new file mode 100644 index 0000000..472154c --- /dev/null +++ b/themes/matte-black/btop.theme @@ -0,0 +1,92 @@ +# ──────────────────────────────────────────────────────────── +# Bashtop theme - Nomarchy Matte Black +# by tahayvr +# https://github.com/tahayvr +# ──────────────────────────────────────────────────────────── + +# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal: "#RRGGBB", "#BW" or "0-255 0-255 0-255" +# example for white: "#ffffff", "#ff" or "255 255 255". + +# All graphs and meters can be gradients +# For single color graphs leave "mid" and "end" variable empty. +# Use "start" and "end" variables for two color gradient +# Use "start", "mid" and "end" for three color gradient + +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="" + +# Main text color +theme[main_fg]="#EAEAEA" + +# Title color for boxes +theme[title]="#8a8a8d" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#f59e0b" + +# Background color of selected item in processes box +theme[selected_bg]="#f59e0b" + +# Foreground color of selected item in processes box +theme[selected_fg]="#EAEAEA" + +# Color of inactive/disabled text +theme[inactive_fg]="#333333" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#8a8a8d" + +# Cpu box outline color +theme[cpu_box]="#8a8a8d" + +# Memory/disks box outline color +theme[mem_box]="#8a8a8d" + +# Net up/down box outline color +theme[net_box]="#8a8a8d" + +# Processes box outline color +theme[proc_box]="#8a8a8d" + +# Box divider line and small boxes line color +theme[div_line]="#8a8a8d" + +# Temperature graph colors +theme[temp_start]="#8a8a8d" +theme[temp_mid]="#f59e0b" +theme[temp_end]="#b91c1c" + +# CPU graph colors +theme[cpu_start]="#8a8a8d" +theme[cpu_mid]="#f59e0b" +theme[cpu_end]="#b91c1c" + +# Mem/Disk free meter +theme[free_start]="#8a8a8d" +theme[free_mid]="#f59e0b" +theme[free_end]="#b91c1c" + +# Mem/Disk cached meter +theme[cached_start]="#8a8a8d" +theme[cached_mid]="#f59e0b" +theme[cached_end]="#b91c1c" + +# Mem/Disk available meter +theme[available_start]="#8a8a8d" +theme[available_mid]="#f59e0b" +theme[available_end]="#b91c1c" + +# Mem/Disk used meter +theme[used_start]="#8a8a8d" +theme[used_mid]="#f59e0b" +theme[used_end]="#b91c1c" + +# Download graph colors +theme[download_start]="#8a8a8d" +theme[download_mid]="#f59e0b" +theme[download_end]="#b91c1c" + +# Upload graph colors +theme[upload_start]="#8a8a8d" +theme[upload_mid]="#f59e0b" +theme[upload_end]="#b91c1c" diff --git a/themes/matte-black/colors.toml b/themes/matte-black/colors.toml new file mode 100644 index 0000000..f0f1d3a --- /dev/null +++ b/themes/matte-black/colors.toml @@ -0,0 +1,23 @@ +accent = "#e68e0d" +cursor = "#eaeaea" +foreground = "#bebebe" +background = "#121212" +selection_foreground = "#bebebe" +selection_background = "#333333" + +color0 = "#333333" +color1 = "#D35F5F" +color2 = "#FFC107" +color3 = "#b91c1c" +color4 = "#e68e0d" +color5 = "#D35F5F" +color6 = "#bebebe" +color7 = "#bebebe" +color8 = "#8a8a8d" +color9 = "#B91C1C" +color10 = "#FFC107" +color11 = "#b90a0a" +color12 = "#f59e0b" +color13 = "#B91C1C" +color14 = "#eaeaea" +color15 = "#ffffff" diff --git a/themes/matte-black/icons.theme b/themes/matte-black/icons.theme new file mode 100644 index 0000000..a3c0a4c --- /dev/null +++ b/themes/matte-black/icons.theme @@ -0,0 +1 @@ +Yaru-red diff --git a/themes/matte-black/neovim.lua b/themes/matte-black/neovim.lua new file mode 100644 index 0000000..7b3f72b --- /dev/null +++ b/themes/matte-black/neovim.lua @@ -0,0 +1,9 @@ +return { + { "tahayvr/matteblack.nvim", lazy = false, priority = 1000 }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "matteblack", + }, + }, +} \ No newline at end of file diff --git a/themes/matte-black/preview.png b/themes/matte-black/preview.png new file mode 100644 index 0000000..ed9c7b4 Binary files /dev/null and b/themes/matte-black/preview.png differ diff --git a/themes/matte-black/vscode.json b/themes/matte-black/vscode.json new file mode 100644 index 0000000..7786fc7 --- /dev/null +++ b/themes/matte-black/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Matte Black", + "extension": "TahaYVR.matteblack" +} diff --git a/themes/miasma/backgrounds/01-nature-of-fear.jpg b/themes/miasma/backgrounds/01-nature-of-fear.jpg new file mode 100644 index 0000000..16cf45b Binary files /dev/null and b/themes/miasma/backgrounds/01-nature-of-fear.jpg differ diff --git a/themes/miasma/backgrounds/02-crowned.jpg b/themes/miasma/backgrounds/02-crowned.jpg new file mode 100644 index 0000000..3a83fb3 Binary files /dev/null and b/themes/miasma/backgrounds/02-crowned.jpg differ diff --git a/themes/miasma/btop.theme b/themes/miasma/btop.theme new file mode 100644 index 0000000..4db76eb --- /dev/null +++ b/themes/miasma/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#222222" + +# Main text color +theme[main_fg]="#c2c2b0" + +# Title color for boxes +theme[title]="#bb7744" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#c9a554" + +# Background color of selected item in processes box +theme[selected_bg]="#e4c47a" + +# Foreground color of selected item in processes box +theme[selected_fg]="#000000" + +# Color of inactive/disabled text +theme[inactive_fg]="#666666" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#bb7744" + +# Box outline and divider line color +theme[cpu_box]="#5f875f" +theme[mem_box]="#5f875f" +theme[net_box]="#5f875f" +theme[proc_box]="#5f875f" +theme[div_line]="#666666" + +# Gradient for all meters and graphs +theme[temp_start]="#c9a554" +theme[temp_mid]="#78824b" +theme[temp_end]="#5f875f" + + +theme[cpu_start]="#c9a554" +theme[cpu_mid]="#78824b" +theme[cpu_end]="#5f875f" + + +theme[free_start]="#78824b" +theme[free_mid]="#b36d43" +theme[free_end]="#b36d43" + + +theme[cached_start]="#b36d43" +theme[cached_mid]="#b36d43" +theme[cached_end]="#b36d43" + + +theme[available_start]="#c9a554" +theme[available_mid]="#c9a554" +theme[available_end]="#c9a554" + + +theme[used_start]="#5f875f" +theme[used_mid]="#5f875f" +theme[used_end]="#5f875f" + + +theme[download_start]="#b36d43" +theme[download_mid]="#c9a554" +theme[download_end]="#78824b" + + +theme[upload_start]="#b36d43" +theme[upload_mid]="#c9a554" +theme[upload_end]="#78824b" diff --git a/themes/miasma/colors.toml b/themes/miasma/colors.toml new file mode 100644 index 0000000..705ce2e --- /dev/null +++ b/themes/miasma/colors.toml @@ -0,0 +1,23 @@ +accent = "#78824b" +cursor = "#c7c7c7" +foreground = "#c2c2b0" +background = "#222222" +selection_foreground = "#c2c2b0" +selection_background = "#78824b" + +color0 = "#000000" +color1 = "#685742" +color2 = "#5f875f" +color3 = "#b36d43" +color4 = "#78824b" +color5 = "#bb7744" +color6 = "#c9a554" +color7 = "#d7c483" +color8 = "#666666" +color9 = "#685742" +color10 = "#5f875f" +color11 = "#b36d43" +color12 = "#78824b" +color13 = "#bb7744" +color14 = "#c9a554" +color15 = "#d7c483" diff --git a/themes/miasma/icons.theme b/themes/miasma/icons.theme new file mode 100644 index 0000000..37b2350 --- /dev/null +++ b/themes/miasma/icons.theme @@ -0,0 +1 @@ +Yaru-wartybrown \ No newline at end of file diff --git a/themes/miasma/neovim.lua b/themes/miasma/neovim.lua new file mode 100644 index 0000000..a46c690 --- /dev/null +++ b/themes/miasma/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "OldJobobo/miasma.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "miasma", + }, + }, +} diff --git a/themes/miasma/preview.png b/themes/miasma/preview.png new file mode 100644 index 0000000..e080d82 Binary files /dev/null and b/themes/miasma/preview.png differ diff --git a/themes/miasma/vscode.json b/themes/miasma/vscode.json new file mode 100644 index 0000000..f133d52 --- /dev/null +++ b/themes/miasma/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Miasma", + "extension": "oldjobobo.miasma-theme" +} diff --git a/themes/nomarchy-palettes.nix b/themes/nomarchy-palettes.nix new file mode 100644 index 0000000..8bd6ea6 --- /dev/null +++ b/themes/nomarchy-palettes.nix @@ -0,0 +1,46 @@ +{ + dracula = { + name = "dracula"; + author = "dracula"; + palette = { + base00 = "282a36"; + base01 = "3a3c4e"; + base02 = "4d4f68"; + base03 = "6272a4"; + base04 = "62d6e8"; + base05 = "e9e9f4"; + base06 = "f1f2f8"; + base07 = "f8f8f2"; + base08 = "ff5555"; + base09 = "ffb86c"; + base0A = "f1fa8c"; + base0B = "50fa7b"; + base0C = "8be9fd"; + base0D = "bd93f9"; + base0E = "ff79c6"; + base0F = "bd93f9"; + }; + }; + nord = { + name = "nord"; + author = "arcticicestudio"; + palette = { + base00 = "2e3440"; + base01 = "3b4252"; + base02 = "434c5e"; + base03 = "4c566a"; + base04 = "d8dee9"; + base05 = "e5e9f0"; + base06 = "eceff4"; + base07 = "8fbcbb"; + base08 = "88c0d0"; + base09 = "81a1c1"; + base0A = "5e81ac"; + base0B = "bf616a"; + base0C = "d08770"; + base0D = "ebcb8b"; + base0E = "a3be8c"; + base0F = "b48ead"; + }; + }; +} diff --git a/themes/nord/backgrounds/0-black-moon.jpg b/themes/nord/backgrounds/0-black-moon.jpg new file mode 100644 index 0000000..55df377 Binary files /dev/null and b/themes/nord/backgrounds/0-black-moon.jpg differ diff --git a/themes/nord/backgrounds/1-city-view.png b/themes/nord/backgrounds/1-city-view.png new file mode 100644 index 0000000..56dbc1d Binary files /dev/null and b/themes/nord/backgrounds/1-city-view.png differ diff --git a/themes/nord/backgrounds/2-night-hawks.png b/themes/nord/backgrounds/2-night-hawks.png new file mode 100644 index 0000000..412eb52 Binary files /dev/null and b/themes/nord/backgrounds/2-night-hawks.png differ diff --git a/themes/nord/btop.theme b/themes/nord/btop.theme new file mode 100644 index 0000000..fbd0af1 --- /dev/null +++ b/themes/nord/btop.theme @@ -0,0 +1,89 @@ +#Bashtop theme with nord palette (https://www.nordtheme.com) +#by Justin Zobel + +# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal: "#RRGGBB", "#BW" or "0-255 0-255 0-255" +# example for white: "#ffffff", "#ff" or "255 255 255". + +# All graphs and meters can be gradients +# For single color graphs leave "mid" and "end" variable empty. +# Use "start" and "end" variables for two color gradient +# Use "start", "mid" and "end" for three color gradient + +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#2E3440" + +# Main text color +theme[main_fg]="#D8DEE9" + +# Title color for boxes +theme[title]="#8FBCBB" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#5E81AC" + +# Background color of selected item in processes box +theme[selected_bg]="#4C566A" + +# Foreground color of selected item in processes box +theme[selected_fg]="#ECEFF4" + +# Color of inactive/disabled text +theme[inactive_fg]="#4C566A" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#5E81AC" + +# Cpu box outline color +theme[cpu_box]="#4C566A" + +# Memory/disks box outline color +theme[mem_box]="#4C566A" + +# Net up/down box outline color +theme[net_box]="#4C566A" + +# Processes box outline color +theme[proc_box]="#4C566A" + +# Box divider line and small boxes line color +theme[div_line]="#4C566A" + +# Temperature graph colors +theme[temp_start]="#81A1C1" +theme[temp_mid]="#88C0D0" +theme[temp_end]="#ECEFF4" + +# CPU graph colors +theme[cpu_start]="#81A1C1" +theme[cpu_mid]="#88C0D0" +theme[cpu_end]="#ECEFF4" + +# Mem/Disk free meter +theme[free_start]="#81A1C1" +theme[free_mid]="#88C0D0" +theme[free_end]="#ECEFF4" + +# Mem/Disk cached meter +theme[cached_start]="#81A1C1" +theme[cached_mid]="#88C0D0" +theme[cached_end]="#ECEFF4" + +# Mem/Disk available meter +theme[available_start]="#81A1C1" +theme[available_mid]="#88C0D0" +theme[available_end]="#ECEFF4" + +# Mem/Disk used meter +theme[used_start]="#81A1C1" +theme[used_mid]="#88C0D0" +theme[used_end]="#ECEFF4" + +# Download graph colors +theme[download_start]="#81A1C1" +theme[download_mid]="#88C0D0" +theme[download_end]="#ECEFF4" + +# Upload graph colors +theme[upload_start]="#81A1C1" +theme[upload_mid]="#88C0D0" +theme[upload_end]="#ECEFF4" diff --git a/themes/nord/colors.toml b/themes/nord/colors.toml new file mode 100644 index 0000000..79c2ae2 --- /dev/null +++ b/themes/nord/colors.toml @@ -0,0 +1,23 @@ +accent = "#81a1c1" +cursor = "#d8dee9" +foreground = "#d8dee9" +background = "#2e3440" +selection_foreground = "#d8dee9" +selection_background = "#4c566a" + +color0 = "#3b4252" +color1 = "#bf616a" +color2 = "#a3be8c" +color3 = "#ebcb8b" +color4 = "#81a1c1" +color5 = "#b48ead" +color6 = "#88c0d0" +color7 = "#e5e9f0" +color8 = "#4c566a" +color9 = "#bf616a" +color10 = "#a3be8c" +color11 = "#ebcb8b" +color12 = "#81a1c1" +color13 = "#b48ead" +color14 = "#8fbcbb" +color15 = "#eceff4" diff --git a/themes/nord/icons.theme b/themes/nord/icons.theme new file mode 100644 index 0000000..6ce2f14 --- /dev/null +++ b/themes/nord/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/nord/neovim.lua b/themes/nord/neovim.lua new file mode 100644 index 0000000..27a68b1 --- /dev/null +++ b/themes/nord/neovim.lua @@ -0,0 +1,9 @@ +return { + { "EdenEast/nightfox.nvim" }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "nordfox", + }, + }, +} diff --git a/themes/nord/preview.png b/themes/nord/preview.png new file mode 100644 index 0000000..57d5035 Binary files /dev/null and b/themes/nord/preview.png differ diff --git a/themes/nord/vscode.json b/themes/nord/vscode.json new file mode 100644 index 0000000..897b8ba --- /dev/null +++ b/themes/nord/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Nord", + "extension": "arcticicestudio.nord-visual-studio-code" +} diff --git a/themes/osaka-jade/backgrounds/1-glowing-city.jpg b/themes/osaka-jade/backgrounds/1-glowing-city.jpg new file mode 100644 index 0000000..be7d857 Binary files /dev/null and b/themes/osaka-jade/backgrounds/1-glowing-city.jpg differ diff --git a/themes/osaka-jade/backgrounds/2-shaded-entrance.jpg b/themes/osaka-jade/backgrounds/2-shaded-entrance.jpg new file mode 100644 index 0000000..9b97956 Binary files /dev/null and b/themes/osaka-jade/backgrounds/2-shaded-entrance.jpg differ diff --git a/themes/osaka-jade/backgrounds/3-mountain-moon.jpg b/themes/osaka-jade/backgrounds/3-mountain-moon.jpg new file mode 100644 index 0000000..729ccae Binary files /dev/null and b/themes/osaka-jade/backgrounds/3-mountain-moon.jpg differ diff --git a/themes/osaka-jade/btop.theme b/themes/osaka-jade/btop.theme new file mode 100644 index 0000000..8e22ec9 --- /dev/null +++ b/themes/osaka-jade/btop.theme @@ -0,0 +1,87 @@ +# Main background +theme[main_bg]="#111c18" + +# Main text color +theme[main_fg]="#F7E8B2" + +# Title color for boxes +theme[title]="#D6D5BC" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#E67D64" + +# Background color of selected items +theme[selected_bg]="#364538" + +# Foreground color of selected items +theme[selected_fg]="#DEB266" + +# Color of inactive/disabled text +theme[inactive_fg]="#32473B" + +# Color of text appearing on top of graphs +theme[graph_text]="#E6D8BA" + +# Misc colors for processes box +theme[proc_misc]="#E6D8BA" + +# Cpu box outline color +theme[cpu_box]="#81B8A8" + +# Memory/disks box outline color +theme[mem_box]="#81B8A8" + +# Net up/down box outline color +theme[net_box]="#81B8A8" + +# Processes box outline color +theme[proc_box]="#81B8A8" + +# Box divider line and small boxes line color +theme[div_line]="#81B8A8" + +# Temperature graph colors +theme[temp_start]="#BFD99A" +theme[temp_mid]="#E1B55E" +theme[temp_end]="#DBB05C" + +# CPU graph colors +theme[cpu_start]="#5F8C86" +theme[cpu_mid]="#629C89" +theme[cpu_end]="#76AD98" + +# Mem/Disk free meter +theme[free_start]="#5F8C86" +theme[free_mid]="#629C89" +theme[free_end]="#76AD98" + +# Mem/Disk cached meter +theme[cached_start]="#5F8C86" +theme[cached_mid]="#629C89" +theme[cached_end]="#76AD98" + +# Mem/Disk available meter +theme[available_start]="#5F8C86" +theme[available_mid]="#629C89" +theme[available_end]="#76AD98" + +# Mem/Disk used meter +theme[used_start]="#5F8C86" +theme[used_mid]="#629C89" +theme[used_end]="#76AD98" + +# Download graph colors +theme[download_start]="#75BBB3" +theme[download_mid]="#61949A" +theme[download_end]="#215866" + +# Upload graph colors +theme[upload_start]="#215866" +theme[upload_mid]="#91C080" +theme[upload_end]="#549E6A" + +# Process box color gradient for threads, mem and cpu usage +theme[process_start]="#72CFA3" +theme[process_mid]="#D0D494" +theme[process_end]="#DB9F9C" + diff --git a/themes/osaka-jade/colors.toml b/themes/osaka-jade/colors.toml new file mode 100644 index 0000000..76f763e --- /dev/null +++ b/themes/osaka-jade/colors.toml @@ -0,0 +1,23 @@ +accent = "#509475" +cursor = "#D7C995" +foreground = "#C1C497" +background = "#111c18" +selection_foreground = "#111C18" +selection_background = "#C1C497" + +color0 = "#23372B" +color1 = "#FF5345" +color2 = "#549e6a" +color3 = "#459451" +color4 = "#509475" +color5 = "#D2689C" +color6 = "#2DD5B7" +color7 = "#F6F5DD" +color8 = "#53685B" +color9 = "#db9f9c" +color10 = "#63b07a" +color11 = "#E5C736" +color12 = "#ACD4CF" +color13 = "#75bbb3" +color14 = "#8CD3CB" +color15 = "#9eebb3" diff --git a/themes/osaka-jade/icons.theme b/themes/osaka-jade/icons.theme new file mode 100644 index 0000000..140e422 --- /dev/null +++ b/themes/osaka-jade/icons.theme @@ -0,0 +1 @@ +Yaru-sage diff --git a/themes/osaka-jade/neovim.lua b/themes/osaka-jade/neovim.lua new file mode 100644 index 0000000..30afe40 --- /dev/null +++ b/themes/osaka-jade/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "ribru17/bamboo.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "bamboo", + }, + }, +} diff --git a/themes/osaka-jade/preview.png b/themes/osaka-jade/preview.png new file mode 100644 index 0000000..c1fe99f Binary files /dev/null and b/themes/osaka-jade/preview.png differ diff --git a/themes/osaka-jade/vscode.json b/themes/osaka-jade/vscode.json new file mode 100644 index 0000000..efe2d63 --- /dev/null +++ b/themes/osaka-jade/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Ocean Green: Dark", + "extension": "jovejonovski.ocean-green" +} diff --git a/themes/retro-82/backgrounds/1-in-the-groove.jpg b/themes/retro-82/backgrounds/1-in-the-groove.jpg new file mode 100644 index 0000000..c9537a4 Binary files /dev/null and b/themes/retro-82/backgrounds/1-in-the-groove.jpg differ diff --git a/themes/retro-82/backgrounds/2-dusk-guardian.jpg b/themes/retro-82/backgrounds/2-dusk-guardian.jpg new file mode 100644 index 0000000..4f30b56 Binary files /dev/null and b/themes/retro-82/backgrounds/2-dusk-guardian.jpg differ diff --git a/themes/retro-82/backgrounds/3-glassy-lines.jpg b/themes/retro-82/backgrounds/3-glassy-lines.jpg new file mode 100644 index 0000000..c1106dc Binary files /dev/null and b/themes/retro-82/backgrounds/3-glassy-lines.jpg differ diff --git a/themes/retro-82/backgrounds/4-gateway.jpg b/themes/retro-82/backgrounds/4-gateway.jpg new file mode 100644 index 0000000..067baa4 Binary files /dev/null and b/themes/retro-82/backgrounds/4-gateway.jpg differ diff --git a/themes/retro-82/backgrounds/5-zen-boat.jpg b/themes/retro-82/backgrounds/5-zen-boat.jpg new file mode 100644 index 0000000..4a4821e Binary files /dev/null and b/themes/retro-82/backgrounds/5-zen-boat.jpg differ diff --git a/themes/retro-82/backgrounds/6-abstract-pyramids.jpg b/themes/retro-82/backgrounds/6-abstract-pyramids.jpg new file mode 100644 index 0000000..6dd9d0a Binary files /dev/null and b/themes/retro-82/backgrounds/6-abstract-pyramids.jpg differ diff --git a/themes/retro-82/backgrounds/7-the-journey.jpg b/themes/retro-82/backgrounds/7-the-journey.jpg new file mode 100644 index 0000000..03fc55c Binary files /dev/null and b/themes/retro-82/backgrounds/7-the-journey.jpg differ diff --git a/themes/retro-82/backgrounds/8-glitter-glass.jpg b/themes/retro-82/backgrounds/8-glitter-glass.jpg new file mode 100644 index 0000000..dfa5322 Binary files /dev/null and b/themes/retro-82/backgrounds/8-glitter-glass.jpg differ diff --git a/themes/retro-82/btop.theme b/themes/retro-82/btop.theme new file mode 100644 index 0000000..ded67f1 --- /dev/null +++ b/themes/retro-82/btop.theme @@ -0,0 +1,63 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="" + +# Main text color +theme[main_fg]="#f6dcac" + +# Title color for boxes +theme[title]="#3f8f8a" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#8cbfb8" + +# Background color of selected item in processes box +theme[selected_bg]="#134e5a" + +# Foreground color of selected item in processes box +theme[selected_fg]="#f6dcac" + +# Color of inactive/disabled text +theme[inactive_fg]="#134e5a" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#3f8f8a" + +# Box outline and divider line color +theme[cpu_box]="#e97b3c" +theme[mem_box]="#e97b3c" +theme[net_box]="#e97b3c" +theme[proc_box]="#e97b3c" +theme[div_line]="#134e5a" + +# Gradient for all meters and graphs +theme[temp_start]="#a7c9c6" +theme[temp_mid]="#8cbfb8" +theme[temp_end]="#028391" + +theme[cpu_start]="#a7c9c6" +theme[cpu_mid]="#e97b3c" +theme[cpu_end]="#f85525" + +theme[free_start]="#faa968" +theme[free_mid]="#e97b3c" +theme[free_end]="#f85525" + +theme[cached_start]="#faa968" +theme[cached_mid]="#e97b3c" +theme[cached_end]="#f85525" + +theme[available_start]="#faa968" +theme[available_mid]="#e97b3c" +theme[available_end]="#f85525" + +theme[used_start]="#faa968" +theme[used_mid]="#e97b3c" +theme[used_end]="#f85525" + +theme[download_start]="#faa968" +theme[download_mid]="#e97b3c" +theme[download_end]="#f85525" + +theme[upload_start]="#faa968" +theme[upload_mid]="#e97b3c" +theme[upload_end]="#f85525" diff --git a/themes/retro-82/chromium.theme b/themes/retro-82/chromium.theme new file mode 100644 index 0000000..efb75ae --- /dev/null +++ b/themes/retro-82/chromium.theme @@ -0,0 +1 @@ +0,23,46 diff --git a/themes/retro-82/colors.toml b/themes/retro-82/colors.toml new file mode 100644 index 0000000..21cf810 --- /dev/null +++ b/themes/retro-82/colors.toml @@ -0,0 +1,35 @@ +# Accent and UI colors +accent = "#faa968" +active_border_color = "#faa968" +active_tab_background = "#faa968" + +# Cursor colors +cursor = "#f6dcac" + +# Primary colors +foreground = "#f6dcac" +background = "#05182e" + +# Selection colors +selection_foreground = "#00172e" +selection_background = "#faa968" + +# Normal colors (ANSI 0-7) +color0 = "#00172e" +color1 = "#f85525" +color2 = "#028391" +color3 = "#e97b3c" +color4 = "#faa968" +color5 = "#3f8f8a" +color6 = "#8cbfb8" +color7 = "#a7c9c6" + +# Bright colors (ANSI 8-15) +color8 = "#134e5a" +color9 = "#f85525" +color10 = "#028391" +color11 = "#e97b3c" +color12 = "#faa968" +color13 = "#3f8f8a" +color14 = "#8cbfb8" +color15 = "#f6dcac" diff --git a/themes/retro-82/hyprland.conf b/themes/retro-82/hyprland.conf new file mode 100644 index 0000000..4d4c6ad --- /dev/null +++ b/themes/retro-82/hyprland.conf @@ -0,0 +1,9 @@ +$activeBorderColor = rgb(faa968) + +general { + col.active_border = $activeBorderColor +} + +group { + col.border_active = $activeBorderColor +} diff --git a/themes/retro-82/icons.theme b/themes/retro-82/icons.theme new file mode 100644 index 0000000..3a73239 --- /dev/null +++ b/themes/retro-82/icons.theme @@ -0,0 +1 @@ +Yaru-wartybrown diff --git a/themes/retro-82/neovim.lua b/themes/retro-82/neovim.lua new file mode 100644 index 0000000..871a218 --- /dev/null +++ b/themes/retro-82/neovim.lua @@ -0,0 +1,13 @@ +return { + { + "OldJobobo/retro-82.nvim", + name = "retro-82", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "retro-82", + }, + }, +} diff --git a/themes/retro-82/preview.png b/themes/retro-82/preview.png new file mode 100644 index 0000000..328ae9f Binary files /dev/null and b/themes/retro-82/preview.png differ diff --git a/themes/retro-82/swayosd.css b/themes/retro-82/swayosd.css new file mode 100644 index 0000000..b3e2364 --- /dev/null +++ b/themes/retro-82/swayosd.css @@ -0,0 +1,5 @@ +@define-color background-color #00172e; +@define-color border-color #134e5a; +@define-color label #f6dcac; +@define-color image #f6dcac; +@define-color progress #e97b3c; diff --git a/themes/retro-82/vscode.json b/themes/retro-82/vscode.json new file mode 100644 index 0000000..e2b3bbd --- /dev/null +++ b/themes/retro-82/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Retro '82", + "extension": "oldjobobo.retro-82-theme" +} diff --git a/themes/retro-82/waybar.css b/themes/retro-82/waybar.css new file mode 100644 index 0000000..f5944b1 --- /dev/null +++ b/themes/retro-82/waybar.css @@ -0,0 +1,3 @@ +@define-color bg #00172e; +@define-color foreground #f6dcac; +@define-color background alpha(@bg, 0.8); diff --git a/themes/ristretto/backgrounds/1-color-curves.jpg b/themes/ristretto/backgrounds/1-color-curves.jpg new file mode 100644 index 0000000..7618e1b Binary files /dev/null and b/themes/ristretto/backgrounds/1-color-curves.jpg differ diff --git a/themes/ristretto/backgrounds/2-coffee-beans.jpg b/themes/ristretto/backgrounds/2-coffee-beans.jpg new file mode 100644 index 0000000..faf63ea Binary files /dev/null and b/themes/ristretto/backgrounds/2-coffee-beans.jpg differ diff --git a/themes/ristretto/backgrounds/3-industrial-moon.jpg b/themes/ristretto/backgrounds/3-industrial-moon.jpg new file mode 100644 index 0000000..385b01d Binary files /dev/null and b/themes/ristretto/backgrounds/3-industrial-moon.jpg differ diff --git a/themes/ristretto/btop.theme b/themes/ristretto/btop.theme new file mode 100644 index 0000000..b058a7f --- /dev/null +++ b/themes/ristretto/btop.theme @@ -0,0 +1,82 @@ +#Btop monokai pro ristretto theme +#Reconfigured from monokai theme + +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#2c2421" + +# Main text color +theme[main_fg]="#e6d9db" + +# Title color for boxes +theme[title]="#e6d9db" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#fd6883" + +# Background color of selected item in processes box +theme[selected_bg]="#3d2f2a" + +# Foreground color of selected item in processes box +theme[selected_fg]="#e6d9db" + +# Color of inactive/disabled text +theme[inactive_fg]="#72696a" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#adda78" + +# Cpu box outline color +theme[cpu_box]="#5b4a45" + +# Memory/disks box outline color +theme[mem_box]="#5b4a45" + +# Net up/down box outline color +theme[net_box]="#5b4a45" + +# Processes box outline color +theme[proc_box]="#5b4a45" + +# Box divider line and small boxes line color +theme[div_line]="#72696a" + +# Temperature graph colors +theme[temp_start]="#a8a9eb" +theme[temp_mid]="#f38d70" +theme[temp_end]="#fd6a85" + +# CPU graph colors +theme[cpu_start]="#adda78" +theme[cpu_mid]="#f9cc6c" +theme[cpu_end]="#fd6883" + +# Mem/Disk free meter +theme[free_start]="#5b4a45" +theme[free_mid]="#adda78" +theme[free_end]="#c5e2a3" + +# Mem/Disk cached meter +theme[cached_start]="#5b4a45" +theme[cached_mid]="#85dacc" +theme[cached_end]="#b3e8dd" + +# Mem/Disk available meter +theme[available_start]="#5b4a45" +theme[available_mid]="#f9cc6c" +theme[available_end]="#fce2a3" + +# Mem/Disk used meter +theme[used_start]="#5b4a45" +theme[used_mid]="#fd6a85" +theme[used_end]="#feb5c7" + +# Download graph colors +theme[download_start]="#3d2f2a" +theme[download_mid]="#a8a9eb" +theme[download_end]="#c5c6f0" + +# Upload graph colors +theme[upload_start]="#3d2f2a" +theme[upload_mid]="#fd6a85" +theme[upload_end]="#feb5c7" + diff --git a/themes/ristretto/colors.toml b/themes/ristretto/colors.toml new file mode 100644 index 0000000..b5ca9ab --- /dev/null +++ b/themes/ristretto/colors.toml @@ -0,0 +1,23 @@ +accent = "#f38d70" +cursor = "#c3b7b8" +foreground = "#e6d9db" +background = "#2c2525" +selection_foreground = "#e6d9db" +selection_background = "#403e41" + +color0 = "#72696a" +color1 = "#fd6883" +color2 = "#adda78" +color3 = "#f9cc6c" +color4 = "#f38d70" +color5 = "#a8a9eb" +color6 = "#85dacc" +color7 = "#e6d9db" +color8 = "#948a8b" +color9 = "#ff8297" +color10 = "#c8e292" +color11 = "#fcd675" +color12 = "#f8a788" +color13 = "#bebffd" +color14 = "#9bf1e1" +color15 = "#f1e5e7" diff --git a/themes/ristretto/icons.theme b/themes/ristretto/icons.theme new file mode 100644 index 0000000..e38b9ce --- /dev/null +++ b/themes/ristretto/icons.theme @@ -0,0 +1 @@ +Yaru-yellow diff --git a/themes/ristretto/neovim.lua b/themes/ristretto/neovim.lua new file mode 100644 index 0000000..4263da7 --- /dev/null +++ b/themes/ristretto/neovim.lua @@ -0,0 +1,31 @@ +return { + { + "gthelding/monokai-pro.nvim", + config = function() + require("monokai-pro").setup({ + filter = "ristretto", + override = function() + return { + NonText = { fg = "#948a8b" }, + MiniIconsGrey = { fg = "#948a8b" }, + MiniIconsRed = { fg = "#fd6883" }, + MiniIconsBlue = { fg = "#85dacc" }, + MiniIconsGreen = { fg = "#adda78" }, + MiniIconsYellow = { fg = "#f9cc6c" }, + MiniIconsOrange = { fg = "#f38d70" }, + MiniIconsPurple = { fg = "#a8a9eb" }, + MiniIconsAzure = { fg = "#a8a9eb" }, + MiniIconsCyan = { fg = "#85dacc" }, -- same value as MiniIconsBlue for consistency + } + end, + }) + vim.cmd([[colorscheme monokai-pro]]) + end, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "monokai-pro", + }, + }, +} diff --git a/themes/ristretto/preview.png b/themes/ristretto/preview.png new file mode 100644 index 0000000..978b80f Binary files /dev/null and b/themes/ristretto/preview.png differ diff --git a/themes/ristretto/vscode.json b/themes/ristretto/vscode.json new file mode 100644 index 0000000..41a587e --- /dev/null +++ b/themes/ristretto/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Monokai Pro (Filter Ristretto)", + "extension": "monokai.theme-monokai-pro-vscode" +} diff --git a/themes/rose-pine/backgrounds/1-funky-shapes.jpg b/themes/rose-pine/backgrounds/1-funky-shapes.jpg new file mode 100644 index 0000000..adfe242 Binary files /dev/null and b/themes/rose-pine/backgrounds/1-funky-shapes.jpg differ diff --git a/themes/rose-pine/backgrounds/2-dot-map.png b/themes/rose-pine/backgrounds/2-dot-map.png new file mode 100644 index 0000000..53e136c Binary files /dev/null and b/themes/rose-pine/backgrounds/2-dot-map.png differ diff --git a/themes/rose-pine/backgrounds/3-nomarchy-plants.png b/themes/rose-pine/backgrounds/3-nomarchy-plants.png new file mode 100644 index 0000000..f19c3ff Binary files /dev/null and b/themes/rose-pine/backgrounds/3-nomarchy-plants.png differ diff --git a/themes/rose-pine/btop.theme b/themes/rose-pine/btop.theme new file mode 100644 index 0000000..a992faa --- /dev/null +++ b/themes/rose-pine/btop.theme @@ -0,0 +1,119 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#faf4ed" +# Base + +# Main text color +theme[main_fg]="#575279" +# Text + +# Title color for boxes +theme[title]="#908caa" +# Subtle + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#e0def4" +# Text + +# Background color of selected item in processes box +theme[selected_bg]="#524f67" +# HL High + +# Foreground color of selected item in processes box +theme[selected_fg]="#f6c177" +# Gold + +# Color of inactive/disabled text +theme[inactive_fg]="#403d52" +# HL Med + +# Color of text appearing on top of graphs, i.e uptime and current network graph scaling +theme[graph_text]="#9ccfd8" +# Foam + +# Background color of the percentage meters +theme[meter_bg]="#9ccfd8" +# Foam + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#c4a7e7" +# Iris + +# Cpu box outline color +theme[cpu_box]="#ebbcba" +# Rose + +# Memory/disks box outline color +theme[mem_box]="#31748f" +# Pine + +# Net up/down box outline color +theme[net_box]="#c4a7e7" +# Iris + +# Processes box outline color +theme[proc_box]="#eb6f92" +# Love + +# Box divider line and small boxes line color +theme[div_line]="#6e6a86" +# Muted + +# Temperature graph colors +theme[temp_start]="#ebbcba" +# Rose +theme[temp_mid]="#f6c177" +# Gold +theme[temp_end]="#eb6f92" +# Love + +# CPU graph colors +theme[cpu_start]="#f6c177" +# Gold +theme[cpu_mid]="#ebbcba" +# Rose +theme[cpu_end]="#eb6f92" +# Love + +# Mem/Disk free meter +# all love +theme[free_start]="#eb6f92" +theme[free_mid]="#eb6f92" +theme[free_end]="#eb6f92" + +# Mem/Disk cached meter +# all iris +theme[cached_start]="#c4a7e7" +theme[cached_mid]="#c4a7e7" +theme[cached_end]="#c4a7e7" + +# Mem/Disk available meter +# all pine +theme[available_start]="#31748f" +theme[available_mid]="#31748f" +theme[available_end]="#31748f" + +# Mem/Disk used meter +# all rose +theme[used_start]="#ebbcba" +theme[used_mid]="#ebbcba" +theme[used_end]="#ebbcba" + +# Download graph colors +# Pine for start, foam for the rest +theme[download_start]="#31748f" +theme[download_mid]="#9ccfd8" +theme[download_end]="#9ccfd8" + +# Upload graph colors +theme[upload_start]="#ebbcba" +# Rose for start +theme[upload_mid]="#eb6f92" +# Love for mid and end +theme[upload_end]="#eb6f92" + +# Process box color gradient for threads, mem and cpu usage +theme[process_start]="#31748f" +# Pine +theme[process_mid]="#9ccfd8" +# Foam for mid and end +theme[process_end]="#9ccfd8" diff --git a/themes/rose-pine/chromium.theme b/themes/rose-pine/chromium.theme new file mode 100644 index 0000000..072dd44 --- /dev/null +++ b/themes/rose-pine/chromium.theme @@ -0,0 +1 @@ +210,196,219 diff --git a/themes/rose-pine/colors.toml b/themes/rose-pine/colors.toml new file mode 100644 index 0000000..e757ad0 --- /dev/null +++ b/themes/rose-pine/colors.toml @@ -0,0 +1,23 @@ +accent = "#56949f" +cursor = "#cecacd" +foreground = "#575279" +background = "#faf4ed" +selection_foreground = "#575279" +selection_background = "#dfdad9" + +color0 = "#f2e9e1" +color1 = "#b4637a" +color2 = "#286983" +color3 = "#ea9d34" +color4 = "#56949f" +color5 = "#907aa9" +color6 = "#d7827e" +color7 = "#575279" +color8 = "#9893a5" +color9 = "#b4637a" +color10 = "#286983" +color11 = "#ea9d34" +color12 = "#56949f" +color13 = "#907aa9" +color14 = "#d7827e" +color15 = "#575279" diff --git a/themes/rose-pine/icons.theme b/themes/rose-pine/icons.theme new file mode 100644 index 0000000..6ce2f14 --- /dev/null +++ b/themes/rose-pine/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/rose-pine/light.mode b/themes/rose-pine/light.mode new file mode 100644 index 0000000..66bb2d0 --- /dev/null +++ b/themes/rose-pine/light.mode @@ -0,0 +1 @@ +# This will set "prefer-light" and use "Adwaita" as the theme diff --git a/themes/rose-pine/neovim.lua b/themes/rose-pine/neovim.lua new file mode 100644 index 0000000..591e8c7 --- /dev/null +++ b/themes/rose-pine/neovim.lua @@ -0,0 +1,9 @@ +return { + { "rose-pine/neovim", name = "rose-pine" }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "rose-pine-dawn", + }, + }, +} diff --git a/themes/rose-pine/preview.png b/themes/rose-pine/preview.png new file mode 100644 index 0000000..e5fa45a Binary files /dev/null and b/themes/rose-pine/preview.png differ diff --git a/themes/rose-pine/vscode.json b/themes/rose-pine/vscode.json new file mode 100644 index 0000000..07e0050 --- /dev/null +++ b/themes/rose-pine/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Rosé Pine Dawn", + "extension": "mvllow.rose-pine" +} diff --git a/themes/tokyo-night/backgrounds/0-swirl-buck.jpg b/themes/tokyo-night/backgrounds/0-swirl-buck.jpg new file mode 100644 index 0000000..504f3db Binary files /dev/null and b/themes/tokyo-night/backgrounds/0-swirl-buck.jpg differ diff --git a/themes/tokyo-night/backgrounds/1-sunset-lake.png b/themes/tokyo-night/backgrounds/1-sunset-lake.png new file mode 100644 index 0000000..d806728 Binary files /dev/null and b/themes/tokyo-night/backgrounds/1-sunset-lake.png differ diff --git a/themes/tokyo-night/backgrounds/2-pawel-czerwinski.jpg b/themes/tokyo-night/backgrounds/2-pawel-czerwinski.jpg new file mode 100644 index 0000000..2767138 Binary files /dev/null and b/themes/tokyo-night/backgrounds/2-pawel-czerwinski.jpg differ diff --git a/themes/tokyo-night/backgrounds/3-milad-fakurian.jpg b/themes/tokyo-night/backgrounds/3-milad-fakurian.jpg new file mode 100644 index 0000000..b9663ff Binary files /dev/null and b/themes/tokyo-night/backgrounds/3-milad-fakurian.jpg differ diff --git a/themes/tokyo-night/btop.theme b/themes/tokyo-night/btop.theme new file mode 100644 index 0000000..290a3c7 --- /dev/null +++ b/themes/tokyo-night/btop.theme @@ -0,0 +1,82 @@ +# Theme: tokyo-night +# By: Pascal Jaeger + +# Main bg +theme[main_bg]="#1a1b26" + +# Main text color +theme[main_fg]="#cfc9c2" + +# Title color for boxes +theme[title]="#cfc9c2" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#7dcfff" + +# Background color of selected item in processes box +theme[selected_bg]="#414868" + +# Foreground color of selected item in processes box +theme[selected_fg]="#cfc9c2" + +# Color of inactive/disabled text +theme[inactive_fg]="#565f89" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#7dcfff" + +# Cpu box outline color +theme[cpu_box]="#565f89" + +# Memory/disks box outline color +theme[mem_box]="#565f89" + +# Net up/down box outline color +theme[net_box]="#565f89" + +# Processes box outline color +theme[proc_box]="#565f89" + +# Box divider line and small boxes line color +theme[div_line]="#565f89" + +# Temperature graph colors +theme[temp_start]="#9ece6a" +theme[temp_mid]="#e0af68" +theme[temp_end]="#f7768e" + +# CPU graph colors +theme[cpu_start]="#9ece6a" +theme[cpu_mid]="#e0af68" +theme[cpu_end]="#f7768e" + +# Mem/Disk free meter +theme[free_start]="#9ece6a" +theme[free_mid]="#e0af68" +theme[free_end]="#f7768e" + +# Mem/Disk cached meter +theme[cached_start]="#9ece6a" +theme[cached_mid]="#e0af68" +theme[cached_end]="#f7768e" + +# Mem/Disk available meter +theme[available_start]="#9ece6a" +theme[available_mid]="#e0af68" +theme[available_end]="#f7768e" + +# Mem/Disk used meter +theme[used_start]="#9ece6a" +theme[used_mid]="#e0af68" +theme[used_end]="#f7768e" + +# Download graph colors +theme[download_start]="#9ece6a" +theme[download_mid]="#e0af68" +theme[download_end]="#f7768e" + +# Upload graph colors +theme[upload_start]="#9ece6a" +theme[upload_mid]="#e0af68" +theme[upload_end]="#f7768e" + diff --git a/themes/tokyo-night/colors.toml b/themes/tokyo-night/colors.toml new file mode 100644 index 0000000..fe51dd0 --- /dev/null +++ b/themes/tokyo-night/colors.toml @@ -0,0 +1,23 @@ +accent = "#7aa2f7" +cursor = "#c0caf5" +foreground = "#a9b1d6" +background = "#1a1b26" +selection_foreground = "#c0caf5" +selection_background = "#7aa2f7" + +color0 = "#32344a" +color1 = "#f7768e" +color2 = "#9ece6a" +color3 = "#e0af68" +color4 = "#7aa2f7" +color5 = "#ad8ee6" +color6 = "#449dab" +color7 = "#787c99" +color8 = "#444b6a" +color9 = "#ff7a93" +color10 = "#b9f27c" +color11 = "#ff9e64" +color12 = "#7da6ff" +color13 = "#bb9af7" +color14 = "#0db9d7" +color15 = "#acb0d0" diff --git a/themes/tokyo-night/icons.theme b/themes/tokyo-night/icons.theme new file mode 100644 index 0000000..5d00638 --- /dev/null +++ b/themes/tokyo-night/icons.theme @@ -0,0 +1 @@ +Yaru-magenta diff --git a/themes/tokyo-night/keyboard.rgb b/themes/tokyo-night/keyboard.rgb new file mode 100644 index 0000000..c9f4a7c --- /dev/null +++ b/themes/tokyo-night/keyboard.rgb @@ -0,0 +1 @@ +ff00ff diff --git a/themes/tokyo-night/neovim.lua b/themes/tokyo-night/neovim.lua new file mode 100644 index 0000000..39327c9 --- /dev/null +++ b/themes/tokyo-night/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "folke/tokyonight.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "tokyonight-night", + }, + }, +} diff --git a/themes/tokyo-night/preview.png b/themes/tokyo-night/preview.png new file mode 100644 index 0000000..8f5f7e3 Binary files /dev/null and b/themes/tokyo-night/preview.png differ diff --git a/themes/tokyo-night/vscode.json b/themes/tokyo-night/vscode.json new file mode 100644 index 0000000..89af98c --- /dev/null +++ b/themes/tokyo-night/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Tokyo Night", + "extension": "enkia.tokyo-night" +} diff --git a/themes/vantablack/backgrounds/1-twisted-stairs.jpg b/themes/vantablack/backgrounds/1-twisted-stairs.jpg new file mode 100644 index 0000000..ad81cf1 Binary files /dev/null and b/themes/vantablack/backgrounds/1-twisted-stairs.jpg differ diff --git a/themes/vantablack/backgrounds/2-layers-deep.jpg b/themes/vantablack/backgrounds/2-layers-deep.jpg new file mode 100644 index 0000000..e0f04b6 Binary files /dev/null and b/themes/vantablack/backgrounds/2-layers-deep.jpg differ diff --git a/themes/vantablack/backgrounds/3-layers-stacked.jpg b/themes/vantablack/backgrounds/3-layers-stacked.jpg new file mode 100644 index 0000000..4a81b94 Binary files /dev/null and b/themes/vantablack/backgrounds/3-layers-stacked.jpg differ diff --git a/themes/vantablack/btop.theme b/themes/vantablack/btop.theme new file mode 100644 index 0000000..cf3d98c --- /dev/null +++ b/themes/vantablack/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#0d0d0d" + +# Main text color +theme[main_fg]="#ffffff" + +# Title color for boxes +theme[title]="#9b9b9b" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#b0b0b0" + +# Background color of selected item in processes box +theme[selected_bg]="#fdfdfd" + +# Foreground color of selected item in processes box +theme[selected_fg]="#ffffff" + +# Color of inactive/disabled text +theme[inactive_fg]="#fdfdfd" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#9b9b9b" + +# Box outline and divider line color +theme[cpu_box]="#b6b6b6" +theme[mem_box]="#b6b6b6" +theme[net_box]="#b6b6b6" +theme[proc_box]="#b6b6b6" +theme[div_line]="#fdfdfd" + +# Gradient for all meters and graphs +theme[temp_start]="#b0b0b0" +theme[temp_mid]="#8d8d8d" +theme[temp_end]="#b6b6b6" + + +theme[cpu_start]="#b0b0b0" +theme[cpu_mid]="#8d8d8d" +theme[cpu_end]="#b6b6b6" + + +theme[free_start]="#8d8d8d" +theme[free_mid]="#cecece" +theme[free_end]="#cecece" + + +theme[cached_start]="#cecece" +theme[cached_mid]="#cecece" +theme[cached_end]="#cecece" + + +theme[available_start]="#b0b0b0" +theme[available_mid]="#b0b0b0" +theme[available_end]="#b0b0b0" + + +theme[used_start]="#b6b6b6" +theme[used_mid]="#b6b6b6" +theme[used_end]="#b6b6b6" + + +theme[download_start]="#cecece" +theme[download_mid]="#b0b0b0" +theme[download_end]="#8d8d8d" + + +theme[upload_start]="#cecece" +theme[upload_mid]="#b0b0b0" +theme[upload_end]="#8d8d8d" \ No newline at end of file diff --git a/themes/vantablack/colors.toml b/themes/vantablack/colors.toml new file mode 100644 index 0000000..96e095f --- /dev/null +++ b/themes/vantablack/colors.toml @@ -0,0 +1,31 @@ +# UI Colors (extended) +accent = "#8d8d8d" +cursor = "#ffffff" + +# Primary colors +foreground = "#ffffff" +background = "#0d0d0d" + +# Selection colors +selection_foreground = "#0d0d0d" +selection_background = "#ffffff" + +# Normal colors (ANSI 0-7) +color0 = "#0d0d0d" +color1 = "#a4a4a4" +color2 = "#b6b6b6" +color3 = "#cecece" +color4 = "#8d8d8d" +color5 = "#9b9b9b" +color6 = "#b0b0b0" +color7 = "#ececec" + +# Bright colors (ANSI 8-15) +color8 = "#fdfdfd" +color9 = "#a4a4a4" +color10 = "#b6b6b6" +color11 = "#cecece" +color12 = "#8d8d8d" +color13 = "#9b9b9b" +color14 = "#b0b0b0" +color15 = "#ffffff" diff --git a/themes/vantablack/icons.theme b/themes/vantablack/icons.theme new file mode 100644 index 0000000..0bc3e2d --- /dev/null +++ b/themes/vantablack/icons.theme @@ -0,0 +1 @@ +Yaru-gray diff --git a/themes/vantablack/neovim.lua b/themes/vantablack/neovim.lua new file mode 100644 index 0000000..f9d9616 --- /dev/null +++ b/themes/vantablack/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "bjarneo/vantablack.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "vantablack", + }, + }, +} diff --git a/themes/vantablack/preview.png b/themes/vantablack/preview.png new file mode 100644 index 0000000..e6a3a72 Binary files /dev/null and b/themes/vantablack/preview.png differ diff --git a/themes/vantablack/vscode.json b/themes/vantablack/vscode.json new file mode 100644 index 0000000..a4edfca --- /dev/null +++ b/themes/vantablack/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Vantablack", + "extension": "Bjarne.vantablack-nomarchy" +} diff --git a/themes/white/backgrounds/1-white.jpg b/themes/white/backgrounds/1-white.jpg new file mode 100644 index 0000000..0e6121f Binary files /dev/null and b/themes/white/backgrounds/1-white.jpg differ diff --git a/themes/white/backgrounds/2-white.jpg b/themes/white/backgrounds/2-white.jpg new file mode 100644 index 0000000..b8c5a7d Binary files /dev/null and b/themes/white/backgrounds/2-white.jpg differ diff --git a/themes/white/backgrounds/3-white.jpg b/themes/white/backgrounds/3-white.jpg new file mode 100644 index 0000000..4ec4553 Binary files /dev/null and b/themes/white/backgrounds/3-white.jpg differ diff --git a/themes/white/btop.theme b/themes/white/btop.theme new file mode 100644 index 0000000..244253a --- /dev/null +++ b/themes/white/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#ffffff" + +# Main text color +theme[main_fg]="#000000" + +# Title color for boxes +theme[title]="#2e2e2e" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#3e3e3e" + +# Background color of selected item in processes box +theme[selected_bg]="#c0c0c0" + +# Foreground color of selected item in processes box +theme[selected_fg]="#000000" + +# Color of inactive/disabled text +theme[inactive_fg]="#c0c0c0" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#2e2e2e" + +# Box outline and divider line color +theme[cpu_box]="#3a3a3a" +theme[mem_box]="#3a3a3a" +theme[net_box]="#3a3a3a" +theme[proc_box]="#3a3a3a" +theme[div_line]="#c0c0c0" + +# Gradient for all meters and graphs +theme[temp_start]="#3e3e3e" +theme[temp_mid]="#1a1a1a" +theme[temp_end]="#3a3a3a" + + +theme[cpu_start]="#3e3e3e" +theme[cpu_mid]="#1a1a1a" +theme[cpu_end]="#3a3a3a" + + +theme[free_start]="#1a1a1a" +theme[free_mid]="#4a4a4a" +theme[free_end]="#4a4a4a" + + +theme[cached_start]="#4a4a4a" +theme[cached_mid]="#4a4a4a" +theme[cached_end]="#4a4a4a" + + +theme[available_start]="#3e3e3e" +theme[available_mid]="#3e3e3e" +theme[available_end]="#3e3e3e" + + +theme[used_start]="#3a3a3a" +theme[used_mid]="#3a3a3a" +theme[used_end]="#3a3a3a" + + +theme[download_start]="#4a4a4a" +theme[download_mid]="#3e3e3e" +theme[download_end]="#1a1a1a" + + +theme[upload_start]="#4a4a4a" +theme[upload_mid]="#3e3e3e" +theme[upload_end]="#1a1a1a" \ No newline at end of file diff --git a/themes/white/colors.toml b/themes/white/colors.toml new file mode 100644 index 0000000..de6cce9 --- /dev/null +++ b/themes/white/colors.toml @@ -0,0 +1,31 @@ +# UI Colors (extended) +accent = "#6e6e6e" +cursor = "#000000" + +# Primary colors +foreground = "#000000" +background = "#ffffff" + +# Selection colors +selection_foreground = "#ffffff" +selection_background = "#1a1a1a" + +# Normal colors (ANSI 0-7) +color0 = "#ffffff" +color1 = "#2a2a2a" +color2 = "#3a3a3a" +color3 = "#4a4a4a" +color4 = "#1a1a1a" +color5 = "#2e2e2e" +color6 = "#3e3e3e" +color7 = "#000000" + +# Bright colors (ANSI 8-15) +color8 = "#c0c0c0" +color9 = "#2a2a2a" +color10 = "#3a3a3a" +color11 = "#4a4a4a" +color12 = "#1a1a1a" +color13 = "#2e2e2e" +color14 = "#3e3e3e" +color15 = "#000000" diff --git a/themes/white/icons.theme b/themes/white/icons.theme new file mode 100644 index 0000000..3d157d9 --- /dev/null +++ b/themes/white/icons.theme @@ -0,0 +1 @@ +Yaru-grey diff --git a/themes/white/light.mode b/themes/white/light.mode new file mode 100644 index 0000000..66bb2d0 --- /dev/null +++ b/themes/white/light.mode @@ -0,0 +1 @@ +# This will set "prefer-light" and use "Adwaita" as the theme diff --git a/themes/white/neovim.lua b/themes/white/neovim.lua new file mode 100644 index 0000000..f9afa38 --- /dev/null +++ b/themes/white/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "bjarneo/white.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "white", + }, + }, +} diff --git a/themes/white/preview.png b/themes/white/preview.png new file mode 100644 index 0000000..597b3c4 Binary files /dev/null and b/themes/white/preview.png differ diff --git a/themes/white/vscode.json b/themes/white/vscode.json new file mode 100644 index 0000000..70019ac --- /dev/null +++ b/themes/white/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "White", + "extension": "Bjarne.white-theme" +}