Compare commits

..

41 Commits

Author SHA1 Message Date
c8456a0885 fix: writeFile aus ags/file statt raw GLib — erstellt verzeichnisse automatisch 2026-05-30 20:14:24 +02:00
add4260a9b fix: setup nicht in AGS 3.1, zurück zu onChanged + closure variablen 2026-05-30 20:12:29 +02:00
419eccf4d0 fix: homelab setup form liest entry werte direkt per setup-ref statt closure-variablen, saveConfig mit try/catch und rebuild() 2026-05-30 20:07:22 +02:00
ecb925f510 fix: homelab save erstellt parent dir via mkdir_with_parents, string statt TextEncoder für GLib.file_set_contents 2026-05-30 20:01:56 +02:00
1a06ffa0dc fix: hyprland config globbing error (source=~), dotfiles deploy stabilität (cp -aT, set -e fix), homelab AGS setup form 2026-05-30 19:56:57 +02:00
d367c4edd0 version/update system: version.sh, --update flag, UPDATE_MODULES, auto-detect existing install 2026-05-30 17:44:38 +02:00
dc7ef3cc51 homelab-control: fallback terminal öffnen wenn zenity fehlt — kitty + gum statt notification ohne reaktion 2026-05-29 19:45:23 +02:00
ab0870db04 homelab-control.sh: zenity als primärer setup-dialog (funktioniert aus rofi/ags-menüs), terminal-check vor gum/whiptail/read 2026-05-29 19:01:20 +02:00
8f8c3cac3d homelab-control.sh: setup wizard bei fehlendem config — kein löschen mehr, setup auch nach installation nutzbar 2026-05-29 18:48:48 +02:00
e2f8313034 homelab control center nur bei konfiguration: module-reihenfolge geändert, dotfiles räumen homelab-files bei fehlendem config weg 2026-05-29 18:46:22 +02:00
de88e5b603 ags: optional statt required — wird nur auf y/N hin installiert 2026-05-29 18:43:59 +02:00
f39f886c9f fullscreen TUI from start: pretty box drawings, module selection with y/N, progress bar during execution 2026-05-29 17:42:32 +02:00
05a07ff006 fix: clear screen on each module transition to prevent old output piling up 2026-05-29 13:23:48 +02:00
3b96713771 fix: simplify fullscreen TUI - no scroll region, safe tput calls, no trap conflict 2026-05-29 13:22:19 +02:00
f840693320 feat: fullscreen TUI with progress bar for module execution 2026-05-29 13:17:27 +02:00
3abf4920df fix: awww-daemon blocks with &&, use & (background) so awww img runs 2026-05-29 01:52:57 +02:00
416487260c feat: one-time sudo at start with background keep-alive, no more password prompts 2026-05-29 01:13:57 +02:00
ad46515b5a fix: prefer yay-bin (static Go binary, no libalpm dep) over paru-bin 2026-05-29 00:50:26 +02:00
041a8c33ea fix: build paru from source when paru-bin has libalpm.so version mismatch 2026-05-29 00:31:25 +02:00
d6e94f5050 fix: fallback to direct AUR install when paru fails, verify paru after build 2026-05-28 23:43:35 +02:00
3761dc707d fix ags: build deps separately with log capture, sync DB preflight 2026-05-28 22:43:21 +02:00
0e0188c30d fix ags: use aylurs-gtk-shell-git (non-git deps libastal/libastal-4 dont exist)
The AUR package aylurs-gtk-shell depends on libastal and libastal-4
which no longer exist in AUR. Only the -git variants exist.
The -git version (aylurs-gtk-shell-git) correctly depends on
libastal-git and libastal-4-git.
2026-05-28 22:29:58 +02:00
6f3e5e8f2d fix fresh install hang: split AGS into own module, remove obsolete packages
- Remove slow fallback loop from is_package_installed (only use expac)
- Move aylurs-gtk-shell from hyprland group to dedicated core/ags module
  with clear progress warning and user confirmation before build
- Install AUR packages one at a time in install_aur (better error isolation)
- Replace obsolete ttf-font-awesome with otf-font-awesome
- Remove p7zip (deleted from repos and AUR)
2026-05-28 21:55:35 +02:00
110ae9e4eb fix is_package_installed to check provides (virtual packages)
aylurs-gtk-shell-git provides aylurs-gtk-shell, but pacman -Qi
only matches exact package names. This caused the installer to
think ags was missing and try to install aylurs-gtk-shell from
AUR, which conflicts with the already-installed -git variant.

Now uses expac (fast) or pacman loop (fallback) to check if any
installed package provides the requested virtual package name.
2026-05-28 18:27:22 +02:00
832cad605a add awww (wallpaper daemon) to hyprland group, add opencode to optional software 2026-05-28 18:09:01 +02:00
a819973018 fix: wofi-theme + wallpaper + ai-command-center source entfernt
Drei Fixes:

1. ai-command-center.conf aus hyprland.conf entfernt
   (existiert nicht auf frischer VM -> source= globbing error)

2. hyprpaper.conf in standard hyprpaper Format geschrieben
   (preload=/wallpaper= statt awww-block-format)
   awww.conf wird separat geschrieben falls awww installiert ist

3. apply-theme.sh Fehlerbehandlung: tui_spin || return 1
   (vorher wurde immer 'Theme applied' gemeldet auch bei Fehler)

4. replace_home_paths auch fuer wofi/ hinzugefuegt
2026-05-28 18:00:19 +02:00
39b7664de5 fix: makepkg braucht base-devel fuer fakeroot
Auf frischem Arch ist base-devel nicht installiert.
makepkg -si schlaegt fehl: 'fakeroot' not found.
Fix: sudo pacman -S base-devel vor dem ersten makepkg.
2026-05-27 23:26:44 +02:00
382747ba9b fix: theme-Auswahl + SDDM-Theme-Correctness
Drei Probleme gefixt:

1. Theme-Auswahl waehrend Install
   - apply-theme.sh zeigt jetzt alle .theme-Files via tui_choose
   - Benutzer waehlt interaktiv (gum/whiptail/basic)
   - Bei nur einem Theme: auto-select

2. SDDM wendet falsches Theme an
   - sddm.sh erzeugt /var/lib/pascal-sddm-theme/ mit user chown
   - Liest current-theme.conf + hyprpaper.conf fuer aktuelle Farben
   - Schreibt theme.conf in /usr/share/sddm/themes/pascal-hypr/
   - Config heisst jetzt 90-pascal-hypr.conf (hoehere Priority)
   - apply-theme.sh erzeugt state dir VOR theme-menu.sh --apply

3. tui_choose basic mode fix
   - ${!choice} funktioniert nicht fuer numerische Indices
   - labels+=("$@") + ${labels[$choice]} statt Positional-Params
2026-05-27 23:23:55 +02:00
1aa8c7cf40 feat: system hyprland.conf übernommen + ags + wallpapers
- hyprland.conf von /home/pascal/.config/hypr/ auf System übernommen
  (Monitore eDP-1/DP-3, awww-Background-Set via autostart,
   lid-dock-handler, hyprpolkitagent, ai-command-center source,
   clipboard-manager.sh bind, togglefloating auf F)
- scripts/lid-dock-handler.sh von System kopiert
- wallpapers/forest.jpg + rose-pink.jpg ins Projekt aufgenommen
  (werden via dotfiles-Deployment nach ~/Bilder/Wallpaper/ kopiert,
   replace_home_paths passt den Pfad im Theme an)
- aylurs-gtk-shell (ags) + hyprpolkitagent zur hyprland-Gruppe
- chmod +x auch für hypr/scripts/ (lowercase)
2026-05-27 23:18:27 +02:00
cf7f1a9f7e fix: theme application hängt nicht auf frischer VM (alle Display-D-Bus-Aufrufe guarded)
Vier Änderungen:

1. Duplikat in apply_wallpaper entfernt (überlappende Edits hinterließen
   einen zweiten hyprctl-Block außerhalb des pgrep-Guards)

2. gsettings in write_gtk_settings hinter pgrep -x Hyprland guard
   (gsettings set → D-Bus → könnte swaync auto-starten → hängt)

3. kwriteconfig6 in write_kde_color_scheme hinter pgrep -x Hyprland
   (kwriteconfig6 schreibt nicht nur Config, macht auch D-Bus-Calls)

4. apply_theme() blockt jetzt komplett: ALLE Display-Aufrufe
   (hyprctl, swaync-client, waybar, notify, awww, swww, gsettings,
   kwriteconfig6) werden nur ausgeführt wenn Hyprland läuft.

Ohne Hyprland: nur Config-Files schreiben (load_theme, write_app_styles,
write_desktop_app_theme, write_hyprlock_theme, write_starship_theme,
write_sddm_theme_assets, apply_wallpaper-schreibt-nur). Kein einziger
D-Bus-Call fällt mehr an.
2026-05-27 23:11:41 +02:00
a76f1f3af7 fix: theme application hängt nicht mehr auf frischer Installation
apply_theme() rief hyprctl (keyword + hyprpaper) und restart_waybar
ohne zu prüfen ob Hyprland läuft → hyprctl hing bis Timeout im TTY.

Fix: pgrep -x Hyprland guard vor allen hyprctl/waybar-Aufrufen.
apply_theme schreibt jetzt Config-Files (gelten beim nächsten Login),
überspringt aber Display-abhängige Kommandos.
2026-05-27 23:02:00 +02:00
06a21fb8c2 fix: paru-bin (pre-compiled) statt paru aus Source bauen
Alter Code:
- paru aus Source (braucht rustup + rust compiler → langsam + Fehleranfällig)
- 2>/dev/null + 2>&1 | tail -5 versteckte ALLE Fehler
- makepkg als root ausgeführt → schlägt fehl (makepkg verweigert root)
- yay als zweiter Versuch hatte die selben Probleme

Neuer Code:
- paru-bin (pre-compiled binary, kein Rust nötig)
- KEINE stderr-Unterdrückung mehr → Fehler sichtbar
- is_root()-Check: klare Warnung + Anleitung falls als root ausgeführt
- yay-bin als Fallback falls paru-bin scheitert
2026-05-27 22:53:36 +02:00
5c6c0f3fed fix: hostname -> uname -n (fehlt auf minimalem Arch)
hostname ist in inetutils, das bei einer minimalen Arch-Installation
nicht installiert ist. uname -n ist in coreutils und immer verfügbar.
2026-05-27 22:50:40 +02:00
ef092bd4a6 fix: sddm als letztes Modul ausführen
systemctl enable sddm --now kann sofort zu SDDM wechseln und das
Script vorzeitig beenden. sddm ist jetzt das letzte Modul in
FRESH_MODULES und DEFAULT_MODULES, nach post/apply-theme.
2026-05-27 22:40:17 +02:00
d8e7635b9f feat: paru auto-install + ASCII Header + Continue-Prompt
- paru wird jetzt in detect_environment() auf frischen Systemen installiert
  (vorher nur in preflight, das bei --fresh nie durchlief)
- install_aur_helper() von preflight nach utils.sh verschoben (global verfügbar)
- Header von Cherokee-Zeichen ('Ꮎ Ꮇ Ꭼ Ꮢ Ꮎ Ꮑ') auf ASCII ('O M E R O N')
  umgestellt — Cherokee zeigte auf manchen Terminals Fragezeichen
- Continue with installation? Prompt nach Banner als erster interaktiver Schritt
- basic mode header jetzt sauberes ASCII (===== statt Box-Zeichen)
2026-05-27 22:38:06 +02:00
25d9a361d6 fix: gum spin kann keine Bash-Funktionen ausführen
gum spin --title ... -- sudo_run pacman ...
→ gum startet sudo_run als externes Programm, nicht als Bash-Funktion
→ 'executable file not found in path'

Fix: tui_spin benutzt immer die einfache Ausführung ('▶ ... OK/FAILED'),
da gum spin mit Shell-Funktionen (sudo_run) nicht kompatibel ist.
2026-05-27 22:27:41 +02:00
547fb3e57f fix: UX vereinfacht - doppelten Durchlauf entfernt + Paketliste im Prompt
- show_summary entfernt (war redundant nach collect_all_interactive)
- collect_all_interactive: keine log_step-Header mehr, nur einfaches
  'Additional Software (Obsidian, ...)? [Y/n]:' pro Modul
- module_description von optional/install listet jetzt alle verfügbaren
  Pakete, damit User die Liste sieht BEVOR er Yes/No sagt
- Nicht-required Module: kompakter confirm ohne log_step-Gedöns
2026-05-27 22:00:11 +02:00
e87596f535 fix: stdout-leak in collect_all_interactive Subshell killte Module-Auswahl
collect_all_interactive wurde via <(...) in einer Subshell ausgeführt, deren
stdout an mapfile gebunden war. ALLE Ausgaben (log_step, tui_confirm-Prompts,
tui_info etc.) landeten im modules_to_run-Array → mapfile las Müllzeilen wie
'━━━ [4/7] ... ━━━' als Modul-Pfade → module_run('━━━ ... ━━━') → 'not found'.

Fix: exec 1>&2 zu Beginn der Subshell, nur die tatsächlichen Modul-Pfade
werden über erhaltenen fd 3 (> original stdout) an mapfile gegeben.
Prompt sagt jetzt auch welcher Step ('Run Modulbeschreibung?' statt
'Run this step?').
2026-05-27 21:56:39 +02:00
fa17585afc fix: module_required-Erkennung + subshell-safe OMERON_MODULE_DIR + collect_modules existence-check
- collect_all_interactive: module VOR declare -F sourcen (erstes Modul wurde nie
  als required erkannt, sondern immer mit tui_confirm nachgefragt)
- OMERON_MODULE_DIR exportieren (Subshell von <(...) könnte sonst leeren Wert
  haben → Module nicht gefunden)
- collect_modules (--modules): auch hier file-existence prüfen
2026-05-27 21:11:18 +02:00
7ab1a466cc fix: Array-Bug verhinderte Paketinstallation + optional/install in FRESH_MODULES
- all_packages=("$(remove_duplicates ...)") kollabierte Newlines → alle
  Pakete wurden ein einzelnes Array-Element → pacman -Si matchte nichts
  → nichts installiert. Fix: readarray -t statt $()-Subshell.
- optional/install in FRESH_MODULES aufgenommen, damit die Software-Auswahl
  auch auf --fresh erscheint.
2026-05-27 21:06:41 +02:00
9b6c05648f fix: sddm zu hyprland package group + homelab/setup in fresh modules
- sddm war in keiner Package-Gruppe → Modul schlug bei prereqs fehl
- homelab/setup fehlte in FRESH_MODULES → auf --fresh nicht ausgeführt
2026-05-27 21:03:46 +02:00
19 changed files with 947 additions and 285 deletions

View File

@@ -15,14 +15,11 @@ if ! command -v ags >/dev/null 2>&1; then
fi fi
if ! command -v sshpass >/dev/null 2>&1; then if ! command -v sshpass >/dev/null 2>&1; then
notify "sshpass ist nicht installiert." notify "sshpass wird benötigt. Bitte installieren: sudo pacman -S sshpass"
exit 1 exit 1
fi fi
if [[ -f "$HOMELAB_CONFIG" ]]; then
export HOMELAB_CONFIG export HOMELAB_CONFIG
fi
cd "$HYPR_DIR" cd "$HYPR_DIR"
ags quit --instance homelab-control >/dev/null 2>&1 || true ags quit --instance homelab-control >/dev/null 2>&1 || true
exec ags run "$HYPR_DIR/ags/homelab.tsx" exec ags run "$HYPR_DIR/ags/homelab.tsx"

View File

@@ -199,7 +199,7 @@ EOF
EOF EOF
done done
if command -v gsettings >/dev/null 2>&1; then if command -v gsettings >/dev/null 2>&1 && pgrep -x Hyprland >/dev/null 2>&1; then
gsettings set org.gnome.desktop.interface color-scheme "$APP_THEME_MODE" >/dev/null 2>&1 || true gsettings set org.gnome.desktop.interface color-scheme "$APP_THEME_MODE" >/dev/null 2>&1 || true
gsettings set org.gnome.desktop.interface accent-color "$GNOME_ACCENT_COLOR" >/dev/null 2>&1 || true gsettings set org.gnome.desktop.interface accent-color "$GNOME_ACCENT_COLOR" >/dev/null 2>&1 || true
gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME_NAME" >/dev/null 2>&1 || true gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME_NAME" >/dev/null 2>&1 || true
@@ -458,7 +458,7 @@ inactiveBackground=$panel_rgb
inactiveForeground=$muted_rgb inactiveForeground=$muted_rgb
EOF EOF
if command -v kwriteconfig6 >/dev/null 2>&1; then if command -v kwriteconfig6 >/dev/null 2>&1 && pgrep -x Hyprland >/dev/null 2>&1; then
kwriteconfig6 --file kdeglobals --group General --key ColorScheme "$KDE_COLOR_SCHEME" >/dev/null 2>&1 || true kwriteconfig6 --file kdeglobals --group General --key ColorScheme "$KDE_COLOR_SCHEME" >/dev/null 2>&1 || true
kwriteconfig6 --file kdeglobals --group General --key Name "$NAME" >/dev/null 2>&1 || true kwriteconfig6 --file kdeglobals --group General --key Name "$NAME" >/dev/null 2>&1 || true
kwriteconfig6 --file kdeglobals --group Icons --key Theme "$ICON_THEME_NAME" >/dev/null 2>&1 || true kwriteconfig6 --file kdeglobals --group Icons --key Theme "$ICON_THEME_NAME" >/dev/null 2>&1 || true
@@ -894,7 +894,7 @@ input-field {
label { label {
monitor = monitor =
text = cmd[update:1000] echo " $(whoami)@$(hostname)" text = cmd[update:1000] echo " $(whoami)@$(uname -n)"
color = rgba($muted_rgb, 0.70) color = rgba($muted_rgb, 0.70)
font_size = 16 font_size = 16
font_family = JetBrainsMono Nerd Font font_family = JetBrainsMono Nerd Font
@@ -1067,15 +1067,23 @@ EOF
apply_wallpaper() { apply_wallpaper() {
cat >"$HYPRPAPER_CONF" <<EOF cat >"$HYPRPAPER_CONF" <<EOF
preload = $WALLPAPER
wallpaper = ,$WALLPAPER
EOF
printf '%s\n' "$WALLPAPER" >"$CURRENT_WALLPAPER"
if command -v awww >/dev/null 2>&1; then
cat >"$(dirname "$HYPRPAPER_CONF")/awww.conf" <<EOF
wallpaper { wallpaper {
monitor = monitor =
path = $WALLPAPER path = $WALLPAPER
fit_mode = cover fit_mode = cover
} }
EOF EOF
fi
printf '%s\n' "$WALLPAPER" >"$CURRENT_WALLPAPER" if pgrep -x Hyprland >/dev/null 2>&1; then
if command -v awww >/dev/null 2>&1; then if command -v awww >/dev/null 2>&1; then
if ! pgrep -x awww-daemon >/dev/null 2>&1; then if ! pgrep -x awww-daemon >/dev/null 2>&1; then
start_detached awww-daemon start_detached awww-daemon
@@ -1113,6 +1121,8 @@ EOF
hyprctl hyprpaper preload "$WALLPAPER" >/dev/null || true hyprctl hyprpaper preload "$WALLPAPER" >/dev/null || true
hyprctl hyprpaper wallpaper ",$WALLPAPER" >/dev/null || true hyprctl hyprpaper wallpaper ",$WALLPAPER" >/dev/null || true
fi fi
fi
} }
apply_theme() { apply_theme() {
@@ -1134,11 +1144,12 @@ EOF
write_sddm_theme_assets write_sddm_theme_assets
apply_wallpaper apply_wallpaper
if command -v hyprctl >/dev/null 2>&1; then if command -v hyprctl >/dev/null 2>&1 && pgrep -x Hyprland >/dev/null 2>&1; then
hyprctl keyword general:col.active_border "$ACTIVE_BORDER" >/dev/null || true hyprctl keyword general:col.active_border "$ACTIVE_BORDER" >/dev/null || true
hyprctl keyword general:col.inactive_border "$INACTIVE_BORDER" >/dev/null || true hyprctl keyword general:col.inactive_border "$INACTIVE_BORDER" >/dev/null || true
fi fi
if pgrep -x Hyprland >/dev/null 2>&1; then
if command -v swaync-client >/dev/null 2>&1; then if command -v swaync-client >/dev/null 2>&1; then
swaync-client -rs >/dev/null 2>&1 || true swaync-client -rs >/dev/null 2>&1 || true
fi fi
@@ -1152,6 +1163,7 @@ EOF
fi fi
notify "$NAME aktiviert." notify "$NAME aktiviert."
fi
} }
if [[ "${1:-}" == "--apply" ]]; then if [[ "${1:-}" == "--apply" ]]; then

View File

@@ -2,16 +2,32 @@ import app from "ags/gtk4/app";
import { Astal, Gtk } from "ags/gtk4"; import { Astal, Gtk } from "ags/gtk4";
import { execAsync } from "ags/process"; import { execAsync } from "ags/process";
import css from "./homelab.css"; import css from "./homelab.css";
import { writeFile } from "ags/file";
import GLib from "gi://GLib"; import GLib from "gi://GLib";
let hasConfig = false;
const CONFIG_PATH = GLib.getenv("HOMELAB_CONFIG") || `${GLib.getenv("HOME")}/.config/homelab/config.yaml`;
function saveConfig(host: string, user: string, port: string) {
const yaml = `# Homelab Configuration\ngenerated_by: Omeron\n\nserver:\n address: "${host}"\n username: "${user}"\n port: ${port}\n\ncontrol_center:\n refresh_interval: 5\n theme: "dark"\n\nfeatures:\n docker: true\n services: true\n storage: true\n network: true\n monitoring: true\n`;
try {
writeFile(CONFIG_PATH, yaml);
} catch (e) {
print(`[homelab] save error: ${e}`);
return;
}
hasConfig = true;
rebuild();
}
function loadConfig() { function loadConfig() {
const configPath = GLib.getenv("HOMELAB_CONFIG") || `${GLib.getenv("HOME")}/.config/homelab/config.yaml`;
const defaults = { host: "10.0.0.15", user: "root", port: 22 }; const defaults = { host: "10.0.0.15", user: "root", port: 22 };
try { try {
const [ok, contents] = GLib.file_get_contents(configPath); const [ok, contents] = GLib.file_get_contents(CONFIG_PATH);
if (!ok || !contents) return defaults; if (!ok || !contents) return defaults;
hasConfig = true;
const text = new TextDecoder().decode(contents); const text = new TextDecoder().decode(contents);
const lines = text.split("\n"); const lines = text.split("\n");
let host = defaults.host; let host = defaults.host;
@@ -1113,6 +1129,51 @@ function startRefreshTimer() {
}); });
} }
function SetupView() {
let host = "";
let user = "root";
let port = "22";
function doSave() {
if (!host) return;
saveConfig(host, user || "root", port || "22");
}
return (
<box class="login-panel" orientation={Gtk.Orientation.VERTICAL} spacing={14}>
<box orientation={Gtk.Orientation.VERTICAL} spacing={4}>
<label class="title" xalign={0} label="Homelab Control Center" />
<label class="subtitle" xalign={0} label="Ersteinrichtung — Serververbindung konfigurieren" />
</box>
<entry
onChanged={self => { host = self.text || self.get_text(); }}
onActivate={doSave}
placeholderText="Server-Adresse (IP oder Domain)"
hexpand
/>
<entry
onChanged={self => { user = self.text || self.get_text(); }}
onActivate={doSave}
placeholderText="SSH-Benutzer"
text="root"
hexpand
/>
<entry
onChanged={self => { port = self.text || self.get_text(); }}
onActivate={doSave}
placeholderText="SSH-Port"
text="22"
hexpand
/>
<button
class="button primary"
label="Speichern"
onClicked={doSave}
/>
</box>
);
}
function HomelabWindow() { function HomelabWindow() {
return ( return (
<window <window
@@ -1132,7 +1193,7 @@ function HomelabWindow() {
return false; return false;
}} /> }} />
<box marginTop={WINDOW_MARGIN_TOP}> <box marginTop={WINDOW_MARGIN_TOP}>
{authed ? <DashboardView /> : <LoginView />} {!hasConfig ? <SetupView /> : (authed ? <DashboardView /> : <LoginView />)}
</box> </box>
</window> </window>
); );
@@ -1143,7 +1204,7 @@ function rebuild() {
if (!win) { if (!win) {
return; return;
} }
win.set_child(<box marginTop={WINDOW_MARGIN_TOP}>{authed ? <DashboardView /> : <LoginView />}</box> as Gtk.Widget); win.set_child(<box marginTop={WINDOW_MARGIN_TOP}>{!hasConfig ? <SetupView /> : (authed ? <DashboardView /> : <LoginView />)}</box> as Gtk.Widget);
} }
app.start({ app.start({

View File

@@ -22,8 +22,9 @@
################ ################
# See https://wiki.hypr.land/Configuring/Monitors/ # See https://wiki.hypr.land/Configuring/Monitors/
monitor=,preferred,auto,1 #monitor=,preferred,auto,1
monitor=eDP-1,preferred,auto,1
monitor=DP-3,preferred,auto,1
################### ###################
### MY PROGRAMS ### ### MY PROGRAMS ###
@@ -44,10 +45,13 @@ $menu = wofi
# Autostart necessary processes (like notifications daemons, status bars, etc.) # Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this: # Or execute your favorite apps at launch like this:
exec-once = sh -c 'if command -v awww-daemon >/dev/null 2>&1; then awww-daemon; elif command -v swww-daemon >/dev/null 2>&1; then swww-daemon; else hyprpaper; fi' exec-once = sh -c 'if command -v awww-daemon >/dev/null 2>&1; then awww-daemon & awww img /home/pascal/Bilder/Wallpaper/forest.jpg; elif command -v swww-daemon >/dev/null 2>&1; then swww-daemon & hyprctl hyprpaper wallpaper "eDP-1,/home/pascal/Bilder/Wallpaper/forest.jpg"; else hyprpaper; fi'
exec-once = waybar exec-once = waybar
exec-once = swaync exec-once = swaync
exec-once = env WIDGET_PANEL_START_HIDDEN=1 ~/.config/hypr/Scripts/widget-panel.sh exec-once = env WIDGET_PANEL_START_HIDDEN=1 ~/.config/hypr/Scripts/widget-panel.sh
exec-once = ~/.config/hypr/scripts/lid-dock-handler.sh
exec-once = /usr/lib/hyprpolkitagent
############################# #############################
### ENVIRONMENT VARIABLES ### ### ENVIRONMENT VARIABLES ###
@@ -63,7 +67,7 @@ env = QT_STYLE_OVERRIDE,Fusion
# https://wiki.hypr.land/Configuring/Variables/#general # https://wiki.hypr.land/Configuring/Variables/#general
general { general {
gaps_in = 6 gaps_in = 6
gaps_out = 25 gaps_out = 15
border_size = 2 border_size = 2
@@ -76,7 +80,7 @@ general {
layout = dwindle layout = dwindle
} }
source = ~/.config/hypr/current-theme.conf source = /home/pascal/.config/hypr/current-theme.conf
# https://wiki.hypr.land/Configuring/Variables/#decoration # https://wiki.hypr.land/Configuring/Variables/#decoration
decoration { decoration {
@@ -121,8 +125,8 @@ animations {
animation = fade, 1, 5, soft animation = fade, 1, 5, soft
animation = windows, 1, 6, smoothOut animation = windows, 1, 6, smoothOut
animation = windowsIn, 1, 6, smoothOut, popin 85% animation = windowsIn, 1, 6, smoothOut, popin 60%
animation = windowsOut, 1, 5, smoothIn, popin 85% animation = windowsOut, 1, 5, smoothIn
animation = layers, 1, 5, smoothOut animation = layers, 1, 5, smoothOut
animation = layersIn, 1, 5, smoothOut, fade animation = layersIn, 1, 5, smoothOut, fade
@@ -142,7 +146,7 @@ animations {
# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more # See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more
dwindle { dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below # pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this preserve_split = true # You probably want this
} }
@@ -203,7 +207,8 @@ bind = $mainMod, Q, killactive,
bind = $mainMod, M, exec, ~/.config/hypr/Scripts/main-menu.sh bind = $mainMod, M, exec, ~/.config/hypr/Scripts/main-menu.sh
bind = $mainMod, E, exec, $fileManager bind = $mainMod, E, exec, $fileManager
bind = $mainMod, N, exec, swaync-client -t bind = $mainMod, N, exec, swaync-client -t
bind = $mainMod, V, togglefloating, bind = $mainMod, F, togglefloating,
bind = $mainMod, V, exec, ~/.config/hypr/Scripts/clipboard-manager.sh
bind = $mainMod, R, exec, $menu bind = $mainMod, R, exec, $menu
bind = $mainMod, W, exec, ~/.config/hypr/Scripts/widget-panel.sh bind = $mainMod, W, exec, ~/.config/hypr/Scripts/widget-panel.sh
bind = $mainMod SHIFT, W, exec, ~/.config/hypr/Scripts/ags-switcher.sh wallpaper bind = $mainMod SHIFT, W, exec, ~/.config/hypr/Scripts/ags-switcher.sh wallpaper

View File

@@ -0,0 +1,74 @@
#!/bin/bash
LID_STATE_FILE="/proc/acpi/button/lid/LID/state"
DOCK_MONITOR="DP-3"
LAPTOP_MONITOR="eDP-1"
find_hypr_socket() {
local runtime_dir
runtime_dir="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
for d in "$runtime_dir"/hypr/*/; do
if [[ -S "${d}.socket.sock" ]]; then
echo "$(basename "$d")"
return 0
fi
done
return 1
}
ensure_hyprctl() {
if ! command -v hyprctl &>/dev/null; then
return 1
fi
if [[ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]]; then
local sig
sig=$(find_hypr_socket)
if [[ -n "$sig" ]]; then
export HYPRLAND_INSTANCE_SIGNATURE="$sig"
export HYPRLAND_INSTANCE_SIGNATURE="$sig"
else
return 1
fi
fi
return 0
}
hyprctl_wait() {
while ! ensure_hyprctl; do
sleep 1
done
}
is_docked() {
hyprctl monitors 2>/dev/null | grep -q "^Monitor $DOCK_MONITOR"
}
move_workspaces_to_dock() {
local workspaces
workspaces=$(hyprctl workspaces 2>/dev/null | grep -B1 "monitor: $LAPTOP_MONITOR" | grep "^workspace ID" | awk '{print $3}')
for ws in $workspaces; do
hyprctl dispatch moveworkspacetomonitor "$ws" "$DOCK_MONITOR" >/dev/null 2>&1
done
}
hyprctl_wait
prev_state=""
while true; do
if [[ -f "$LID_STATE_FILE" ]]; then
state=$(awk '{print $2}' < "$LID_STATE_FILE")
else
state="unknown"
fi
if [[ "$state" != "$prev_state" ]]; then
if [[ "$state" == "closed" ]] && is_docked; then
move_workspaces_to_dock
hyprctl keyword monitor "$LAPTOP_MONITOR,disable" >/dev/null 2>&1
elif [[ "$state" == "open" ]]; then
hyprctl keyword monitor "$LAPTOP_MONITOR,preferred,auto,1" >/dev/null 2>&1
fi
prev_state="$state"
fi
sleep 1
done

View File

@@ -9,30 +9,49 @@ export OMERON_PROJECT_DIR="$OMERON_ROOT"
source "$OMERON_ROOT/lib/log.sh" source "$OMERON_ROOT/lib/log.sh"
source "$OMERON_ROOT/lib/tui.sh" source "$OMERON_ROOT/lib/tui.sh"
source "$OMERON_ROOT/lib/tui-fs.sh"
source "$OMERON_ROOT/lib/utils.sh" source "$OMERON_ROOT/lib/utils.sh"
source "$OMERON_ROOT/lib/config.sh" source "$OMERON_ROOT/lib/config.sh"
source "$OMERON_ROOT/lib/modules.sh" source "$OMERON_ROOT/lib/modules.sh"
source "$OMERON_ROOT/lib/version.sh"
OMERON_FRESH_INSTALL="${OMERON_FRESH_INSTALL:-0}" OMERON_FRESH_INSTALL="${OMERON_FRESH_INSTALL:-0}"
export OMERON_FRESH_INSTALL export OMERON_FRESH_INSTALL
OMERON_UPDATE_MODE="${OMERON_UPDATE_MODE:-0}"
export OMERON_UPDATE_MODE
DEFAULT_MODULES=( DEFAULT_MODULES=(
"core/preflight" "core/preflight"
"core/packages" "core/packages"
"core/ags"
"homelab/setup"
"core/dotfiles" "core/dotfiles"
"core/services" "core/services"
"homelab/setup"
"optional/install" "optional/install"
"core/sddm"
"post/apply-theme" "post/apply-theme"
"core/sddm"
) )
FRESH_MODULES=( FRESH_MODULES=(
"core/packages" "core/packages"
"core/ags"
"homelab/setup"
"core/dotfiles" "core/dotfiles"
"core/services" "core/services"
"core/sddm" "optional/install"
"post/apply-theme" "post/apply-theme"
"core/sddm"
)
UPDATE_MODULES=(
"core/packages"
"core/ags"
"core/dotfiles"
"core/services"
"homelab/setup"
"optional/install"
"post/apply-theme"
"core/sddm"
) )
RUN_MODULES=() RUN_MODULES=()
@@ -47,6 +66,7 @@ Usage: ./install.sh [OPTIONS]
Options: Options:
--fresh Full system setup (Hyprland + GPU drivers + all deps) --fresh Full system setup (Hyprland + GPU drivers + all deps)
--update Update existing installation (skip preflight + GPU setup)
--modules m1,m2 Run only specific modules (comma-separated) --modules m1,m2 Run only specific modules (comma-separated)
--skip m1,m2 Skip specific modules (comma-separated) --skip m1,m2 Skip specific modules (comma-separated)
--skip-packages Skip package installation --skip-packages Skip package installation
@@ -57,6 +77,7 @@ Options:
Examples: Examples:
./install.sh Interactive (detects fresh install automatically) ./install.sh Interactive (detects fresh install automatically)
./install.sh --fresh Force full setup on a running system ./install.sh --fresh Force full setup on a running system
./install.sh --update Update existing installation
./install.sh --modules core/dotfiles,post/apply-theme ./install.sh --modules core/dotfiles,post/apply-theme
./install.sh --skip core/packages ./install.sh --skip core/packages
EOF EOF
@@ -80,7 +101,8 @@ list_modules() {
parse_args() { parse_args() {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--fresh) OMERON_FRESH_INSTALL=1; shift ;; --fresh) OMERON_FRESH_INSTALL=1; OMERON_UPDATE_MODE=0; shift ;;
--update) OMERON_UPDATE_MODE=1; OMERON_FRESH_INSTALL=0; shift ;;
--modules) IFS=',' read -ra RUN_MODULES <<< "$2"; shift 2 ;; --modules) IFS=',' read -ra RUN_MODULES <<< "$2"; shift 2 ;;
--skip) IFS=',' read -ra SKIP_MODULES <<< "$2"; shift 2 ;; --skip) IFS=',' read -ra SKIP_MODULES <<< "$2"; shift 2 ;;
--skip-packages) SKIP_MODULES+=("core/packages"); shift ;; --skip-packages) SKIP_MODULES+=("core/packages"); shift ;;
@@ -96,48 +118,55 @@ detect_environment() {
tui_detect tui_detect
if ((!OMERON_HAS_GUM)) && have pacman; then if ((!OMERON_HAS_GUM)) && have pacman; then
printf '\033[1;36m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m\n' tui_fs_show_msg "Installing gum for interactive TUI..."
printf '\033[1;36m Ꮎ Ꮎ Ꮑ — Modular System Setup Framework\033[0m\n' tui_install_gum 2>/dev/null || true
printf '\033[1;36m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m\n' tui_detect
printf '\n' if ((OMERON_HAS_GUM)); then
printf ' \033[1;33mgum is not installed.\033[0m Installing it enables the full TUI experience.\n' tui_fs_show_ok "gum installed"
printf '\n' else
tui_fs_show_msg "using terminal prompts"
fi
fi
if tui_install_gum; then if ((OMERON_UPDATE_MODE)); then
printf ' \033[1;32m✓ gum installed!\033[0m\n' tui_fs_show_ok "Update mode — existing installation detected"
else return
if ((OMERON_HAS_WHIPTAIL)); then
printf ' \033[1;33musing whiptail as fallback\033[0m\n'
else
printf ' \033[1;33musing basic text mode (install gum for UI: pacman -S gum)\033[0m\n'
fi
fi
printf '\n'
fi fi
if ((!OMERON_FRESH_INSTALL)) && ((${#RUN_MODULES[@]} == 0)); then if ((!OMERON_FRESH_INSTALL)) && ((${#RUN_MODULES[@]} == 0)); then
log_info "Checking for fresh install..." tui_fs_show_msg "Checking for fresh install..."
if is_fresh_install; then if is_fresh_install; then
OMERON_FRESH_INSTALL=1 OMERON_FRESH_INSTALL=1
export OMERON_FRESH_INSTALL export OMERON_FRESH_INSTALL
fi fi
fi fi
if ((OMERON_FRESH_INSTALL)) && ((!OMERON_HAS_GUM)) && have pacman; then if ((OMERON_FRESH_INSTALL)); then
if ((!OMERON_HAS_GUM)) && have pacman; then
tui_install_gum 2>/dev/null || true tui_install_gum 2>/dev/null || true
tui_detect
fi
if ! have paru && ! have yay; then
tui_fs_show_msg "Installing AUR helper..."
install_aur_helper
tui_fs_show_ok "AUR helper ready"
fi
fi fi
} }
collect_modules() { collect_modules() {
if ((${#RUN_MODULES[@]})); then if ((${#RUN_MODULES[@]})); then
for mod in "${RUN_MODULES[@]}"; do for mod in "${RUN_MODULES[@]}"; do
printf '%s\n' "$OMERON_MODULE_DIR/$mod.sh" local module_file="$OMERON_MODULE_DIR/$mod.sh"
[[ -f "$module_file" ]] && printf '%s\n' "$module_file"
done done
return return
fi fi
local modules=() local modules=()
if ((OMERON_FRESH_INSTALL)); then if ((OMERON_UPDATE_MODE)); then
modules=("${UPDATE_MODULES[@]}")
elif ((OMERON_FRESH_INSTALL)); then
modules=("${FRESH_MODULES[@]}") modules=("${FRESH_MODULES[@]}")
else else
modules=("${DEFAULT_MODULES[@]}") modules=("${DEFAULT_MODULES[@]}")
@@ -159,89 +188,59 @@ collect_modules() {
} }
collect_all_interactive() { collect_all_interactive() {
exec 3>&1
exec 1>&2
local modules=() local modules=()
if ((OMERON_FRESH_INSTALL)); then if ((OMERON_UPDATE_MODE)); then
modules=("${UPDATE_MODULES[@]}")
elif ((OMERON_FRESH_INSTALL)); then
modules=("${FRESH_MODULES[@]}") modules=("${FRESH_MODULES[@]}")
else else
modules=("${DEFAULT_MODULES[@]}") modules=("${DEFAULT_MODULES[@]}")
fi fi
local total=${#modules[@]}
local idx=1
local module_order=() local module_order=()
local idx=1
local total=${#modules[@]}
for mod in "${modules[@]}"; do for mod in "${modules[@]}"; do
local module_file="$OMERON_MODULE_DIR/$mod.sh" local module_file="$OMERON_MODULE_DIR/$mod.sh"
[[ -f "$module_file" ]] || continue [[ -f "$module_file" ]] || continue
source "$module_file" 2>/dev/null || continue
local description="" local description=""
if source "$module_file" 2>/dev/null && declare -F "module_description" >/dev/null 2>&1; then if declare -F "module_description" >/dev/null 2>&1; then
description="$(module_description)" description="$(module_description)"
fi fi
printf '\n' local required=0
log_step "$idx" "$total" "${description:-$mod}"
if declare -F "module_required" >/dev/null 2>&1; then if declare -F "module_required" >/dev/null 2>&1; then
source "$module_file"
if module_required; then if module_required; then
tui_info "Required module — will run" required=1
fi
fi
if ((required)); then
tui_fs_select_module "$idx" "$total" "$mod" "$description" 1
module_order+=("$module_file") module_order+=("$module_file")
((idx++)) ((idx++))
continue continue
fi fi
fi
if tui_confirm "Run this step?"; then if tui_fs_select_module "$idx" "$total" "$mod" "$description" 0; then
module_order+=("$module_file") module_order+=("$module_file")
else
log_info "Skipped"
fi fi
((idx++)) ((idx++))
done done
printf '%s\n' "${module_order[@]}" if ! tui_fs_confirm_start "${#module_order[@]}"; then
} exec 3>&-
return 1
show_banner() {
tui_header " Ꮎ Ꮎ Ꮑ "
tui_info "Modular System Setup Framework"
tui_info "Arch / Hyprland / CachyOS"
printf '\n'
if ((OMERON_FRESH_INSTALL)); then
tui_warn "FRESH INSTALL MODE"
tui_info "Will install Hyprland, GPU drivers, and all dependencies."
printf '\n'
fi
}
show_summary() {
local modules=("$@")
tui_separator
tui_bold "Installation Summary"
tui_info "$(tui_bold "${#modules[@]}") module(s) to run"
local gpu
gpu="$(detect_gpu)"
tui_info "Detected GPU: $(tui_bold "$gpu")"
if ((${#modules[@]})); then
printf '\n'
tui_bold "Steps:"
local i=1
for mod in "${modules[@]}"; do
printf ' \033[1;36m%d.\033[0m %s\n' "$i" "$(basename "$mod" .sh)"
((i++))
done
fi fi
printf '\n' printf '%s\n' "${module_order[@]}" >&3
if ! tui_confirm "Proceed with installation?"; then exec 3>&-
tui_bold "Installation cancelled."
exit 0
fi
} }
main() { main() {
@@ -255,23 +254,42 @@ main() {
log_info "Log file: $OMERON_LOG_FILE" log_info "Log file: $OMERON_LOG_FILE"
log_info "Project: $OMERON_ROOT" log_info "Project: $OMERON_ROOT"
detect_environment sudo_init
trap 'sudo_cleanup; tui_fs_exit' EXIT
show_banner tui_fs_init
if ((!OMERON_FRESH_INSTALL)) && ((!OMERON_UPDATE_MODE)) && ((${#RUN_MODULES[@]} == 0)); then
if version_read; then
if tui_fs_ask_update "${OMERON_INSTALL_DATE:-unknown}"; then
OMERON_UPDATE_MODE=1
export OMERON_UPDATE_MODE
tui_fs_show_ok "Update mode activated"
fi
fi
fi
detect_environment
local modules_to_run=() local modules_to_run=()
if ((${#RUN_MODULES[@]})); then if ((${#RUN_MODULES[@]})); then
mapfile -t modules_to_run < <(collect_modules) mapfile -t modules_to_run < <(collect_modules)
else else
mapfile -t modules_to_run < <(collect_all_interactive) local collected
collected="$(collect_all_interactive)" || {
tui_fs_exit
exit 0
}
mapfile -t modules_to_run <<< "$collected"
fi fi
if ((${#modules_to_run[@]} == 0)); then if ((${#modules_to_run[@]} == 0)); then
tui_warn "No modules selected. Nothing to do." tui_fs_show_msg "No modules selected. Nothing to do."
tui_fs_exit
exit 0 exit 0
fi fi
show_summary "${modules_to_run[@]}" tui_fs_start_execution
local total=${#modules_to_run[@]} local total=${#modules_to_run[@]}
local idx=1 local idx=1
@@ -281,6 +299,8 @@ main() {
if source "$module_path" 2>/dev/null && declare -F "module_description" >/dev/null 2>&1; then if source "$module_path" 2>/dev/null && declare -F "module_description" >/dev/null 2>&1; then
description="$(module_description)" description="$(module_description)"
fi fi
tui_fs_set_step "$idx" "$total" "${description:-$(basename "$module_path" .sh)}"
printf '\n' printf '\n'
log_step "$idx" "$total" "${description:-$(basename "$module_path" .sh)}" log_step "$idx" "$total" "${description:-$(basename "$module_path" .sh)}"
@@ -289,33 +309,49 @@ main() {
if declare -F "module_required" >/dev/null 2>&1; then if declare -F "module_required" >/dev/null 2>&1; then
source "$module_path" source "$module_path"
if module_required 2>/dev/null; then if module_required 2>/dev/null; then
tui_fs_exit
tui_error "Required module failed. Aborting." tui_error "Required module failed. Aborting."
exit $rc exit $rc
fi fi
fi fi
tui_warn "Module completed with warnings" tui_fs_show_msg "Module completed with warnings"
} }
((idx++)) ((idx++))
done done
tui_fs_exit
if ((OMERON_UPDATE_MODE)); then
version_update
else
version_write
fi
printf '\n' printf '\n'
tui_header " Ꮎ Ꮑ " tui_header "O M E R O N — Done"
tui_success "Installation Complete!" tui_success "Installation Complete!"
printf '\n' printf '\n'
tui_info "Log: ${OMERON_LOG_FILE}" tui_info "Log: ${OMERON_LOG_FILE}"
printf '\n' printf '\n'
if ((OMERON_FRESH_INSTALL)); then if ((OMERON_UPDATE_MODE)); then
tui_bold "Update complete!"
tui_list \
"Reload config: hyprctl reload" \
"Re-run updater: ./install.sh --update"
elif ((OMERON_FRESH_INSTALL)); then
tui_bold "Your system is ready for Hyprland!" tui_bold "Your system is ready for Hyprland!"
tui_list \ tui_list \
"Start Hyprland: Hyprland" \ "Start Hyprland: Hyprland" \
"Or enable SDDM: sudo systemctl enable --now sddm" \ "Or enable SDDM: sudo systemctl enable --now sddm" \
"Reload config: hyprctl reload" "Reload config: hyprctl reload" \
"Update later: ./install.sh --update"
else else
tui_bold "What next?" tui_bold "What next?"
tui_list \ tui_list \
"Reload config: hyprctl reload" \ "Reload config: hyprctl reload" \
"Re-run installer: ./install.sh" "Re-run installer: ./install.sh" \
"Update later: ./install.sh --update"
fi fi
printf '\n' printf '\n'

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
OMERON_MODULE_DIR="${OMERON_MODULE_DIR:-$OMERON_PROJECT_DIR/modules}" OMERON_MODULE_DIR="${OMERON_MODULE_DIR:-$OMERON_PROJECT_DIR/modules}"
export OMERON_MODULE_DIR
module_list() { module_list() {
local category="${1:-}" local category="${1:-}"

211
lib/tui-fs.sh Normal file
View File

@@ -0,0 +1,211 @@
#!/usr/bin/env bash
TUI_FS_ACTIVE=0
TUI_FS_ROWS=0
TUI_FS_COLS=0
TUI_FS_CURRENT=0
TUI_FS_TOTAL=0
TUI_FS_LABEL=""
TUI_FS_SAVED_STTY=""
tui_fs_init() {
TUI_FS_SAVED_STTY=$(stty -g 2>/dev/null || true)
TUI_FS_ROWS=$(tput lines 2>/dev/null || echo 24)
TUI_FS_COLS=$(tput cols 2>/dev/null || echo 80)
tput smcup 2>/dev/null || true
tput civis 2>/dev/null || true
tput clear 2>/dev/null || true
TUI_FS_ACTIVE=1
_tui_fs_draw_selection_banner
}
tui_fs_exit() {
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && return
TUI_FS_ACTIVE=0
tput cnorm 2>/dev/null || true
tput rmcup 2>/dev/null || true
[[ -n "$TUI_FS_SAVED_STTY" ]] && stty "$TUI_FS_SAVED_STTY" 2>/dev/null || true
}
_tui_fs_hline() {
local len=$1
local i
for ((i=0; i<len; i++)); do printf '─'; done
}
_tui_fs_title() {
local cols=$TUI_FS_COLS
local c=$((cols - 4))
((c < 30)) && c=30
printf '\033[1;36m╭%s╮\033[0m\n' "$(_tui_fs_hline "$c")"
printf '\033[1;36m│\033[0m \033[1;37m◆ Omeron\033[0m — \033[2mModular System Setup\033[0m \033[1;36m│\033[0m\n'
printf '\033[1;36m╰%s╯\033[0m\n' "$(_tui_fs_hline "$c")"
printf '\n'
}
_tui_fs_draw_selection_banner() {
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && return
tput clear 2>/dev/null || true
_tui_fs_title
}
tui_fs_show_msg() {
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && { printf '%s\n' "$*"; return; }
printf ' \033[1;34m▶\033[0m %s\n' "$*"
}
tui_fs_show_ok() {
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && { printf '%s\n' "$*"; return; }
printf ' \033[1;32m✓\033[0m %s\n' "$*"
}
tui_fs_start_execution() {
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && return
TUI_FS_CURRENT=0
TUI_FS_TOTAL=0
TUI_FS_LABEL=""
}
tui_fs_set_step() {
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && return
TUI_FS_CURRENT=$1
TUI_FS_TOTAL=$2
TUI_FS_LABEL="${3:-}"
_tui_fs_draw_exec_header
}
_tui_fs_draw_exec_header() {
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && return
tput cup 0 0 2>/dev/null || true
tput clear 2>/dev/null || true
local cols=$TUI_FS_COLS
local c=$((cols - 4))
((c < 30)) && c=30
local hline
hline="$(_tui_fs_hline "$c")"
printf '\033[1;36m╭%s╮\033[0m\n' "$hline"
local title="◆ Omeron"
if [[ -n "$TUI_FS_LABEL" ]]; then
title+="${TUI_FS_LABEL}"
fi
printf '\033[1;36m│\033[0m \033[1;37m%-*s\033[0m \033[1;36m│\033[0m\n' "$c" "$title"
local progress=0
if ((TUI_FS_TOTAL > 0)); then
progress=$(( TUI_FS_CURRENT * 100 / TUI_FS_TOTAL ))
((progress > 100)) && progress=100
fi
local bar_width=$((c - 24))
((bar_width < 10)) && bar_width=10
local filled=$(( progress * bar_width / 100 ))
local bar=""
local i
for ((i=0; i<filled && i<bar_width; i++)); do bar+='▓'; done
for ((i=filled; i<bar_width; i++)); do bar+='░'; done
local counter="[$TUI_FS_CURRENT/$TUI_FS_TOTAL]"
printf '\033[1;36m│\033[0m %s %s \033[1;33m%3d%%\033[0m \033[1;36m│\033[0m\n' "$counter" "$bar" "$progress"
printf '\033[1;36m╰%s╯\033[0m\n' "$hline"
printf '\n'
}
tui_fs_select_module() {
local idx="$1"
local total="$2"
local label="$3"
local description="${4:-$label}"
local required="${5:-0}"
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && {
if ((required)); then return 0; fi
printf ' '
tui_confirm "$description" && return 0 || return 1
}
tput cup 4 0 2>/dev/null || true
tput ed 2>/dev/null || true
printf ' \033[1;36m┌─\033[0m \033[1;37mModule %d/%d\033[0m\n' "$idx" "$total"
printf ' \033[1;36m│\033[0m\n'
printf ' \033[1;36m│\033[0m \033[1;37m%s\033[0m\n' "$description"
printf ' \033[1;36m│\033[0m \033[2m%s\033[0m\n' "$label"
printf ' \033[1;36m└─\033[0m\n'
printf '\n'
if ((required)); then
printf ' \033[1;33m▶\033[0m required module\n'
printf '\n'
printf ' Press any key to continue... '
read -n 1 -s -r
printf '\n'
return 0
fi
if ((OMERON_HAS_GUM)); then
gum confirm "Include this module?"
return $?
fi
printf ' \033[1;36m?\033[0m Include this module? \033[1m[Y/n]\033[0m '
read -r response
response="${response:-Y}"
[[ "$response" =~ ^[yY](es)?$ ]]
return $?
}
tui_fs_confirm_start() {
local count="$1"
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && return 0
tput cup 4 0 2>/dev/null || true
tput ed 2>/dev/null || true
printf ' \033[1;36m┌─\033[0m \033[1;37mSelection Complete\033[0m\n'
printf ' \033[1;36m│\033[0m\n'
printf ' \033[1;36m│\033[0m \033[1;37m%d\033[0m module(s) selected\n' "$count"
printf ' \033[1;36m└─\033[0m\n'
printf '\n'
if ((OMERON_HAS_GUM)); then
gum confirm "Start installation?"
return $?
fi
printf ' \033[1;36m?\033[0m Start installation? \033[1m[Y/n]\033[0m '
read -r response
response="${response:-Y}"
[[ "$response" =~ ^[yY](es)?$ ]]
return $?
}
tui_fs_ask_update() {
local date="$1"
[[ "$TUI_FS_ACTIVE" -eq 0 ]] && return 1
tput cup 4 0 2>/dev/null || true
tput ed 2>/dev/null || true
printf ' \033[1;36m┌─\033[0m \033[1;37mExisting Installation Found\033[0m\n'
printf ' \033[1;36m│\033[0m\n'
printf ' \033[1;36m│\033[0m Installed: \033[1;37m%s\033[0m\n' "$date"
printf ' \033[1;36m│\033[0m Update applies new dotfiles, packages and config\n'
printf ' \033[1;36m│\033[0m without re-running GPU/fresh-install setup.\n'
printf ' \033[1;36m└─\033[0m\n'
printf '\n'
printf ' \033[1;36m?\033[0m Update existing installation? \033[1m[Y/n]\033[0m '
if ((OMERON_HAS_GUM)); then
gum confirm "Update existing installation?"
return $?
fi
read -r response
response="${response:-Y}"
[[ "$response" =~ ^[yY](es)?$ ]]
return $?
}

View File

@@ -71,13 +71,13 @@ tui_choose() {
done done
whiptail --menu "$prompt" 20 60 10 "${items[@]}" 3>&1 1>&2 2>&3 whiptail --menu "$prompt" 20 60 10 "${items[@]}" 3>&1 1>&2 2>&3
else else
local labels=("$@")
printf '\n==============================\n' printf '\n==============================\n'
printf ' %s\n' "$(_strip_format "$prompt")" printf ' %s\n' "$(_strip_format "$prompt")"
printf '==============================\n' printf '==============================\n'
local i=0 local i
for item in "$@"; do for i in "${!labels[@]}"; do
printf ' [%d] %s\n' "$i" "$item" printf ' [%d] %s\n' "$i" "${labels[$i]}"
((i++))
done done
printf ' [x] Cancel\n' printf ' [x] Cancel\n'
printf '==============================\n' printf '==============================\n'
@@ -86,8 +86,8 @@ tui_choose() {
if [[ "$choice" == "x" ]]; then if [[ "$choice" == "x" ]]; then
return 1 return 1
fi fi
if [[ "$choice" =~ ^[0-9]+$ ]] && ((choice < ${#@})); then if [[ "$choice" =~ ^[0-9]+$ ]] && ((choice < ${#labels[@]})); then
printf '%s\n' "${!choice}" printf '%s\n' "${labels[$choice]}"
fi fi
fi fi
} }
@@ -174,9 +174,6 @@ tui_spin() {
shift shift
title="$(_strip_format "$title")" title="$(_strip_format "$title")"
if [[ "$OMERON_TUI_MODE" == "gum" ]]; then
gum spin --title "$title" -- "$@"
else
printf ' ▶ %s ... ' "$title" printf ' ▶ %s ... ' "$title"
"$@" "$@"
local rc=$? local rc=$?
@@ -186,25 +183,21 @@ tui_spin() {
printf '\033[1;31mFAILED\033[0m\n' printf '\033[1;31mFAILED\033[0m\n'
fi fi
return $rc return $rc
fi
} }
tui_header() { tui_header() {
local title="$(_strip_format "$1")" local title="$(_strip_format "$1")"
local len="${#title}"
if [[ "$OMERON_TUI_MODE" == "gum" ]]; then if [[ "$OMERON_TUI_MODE" == "gum" ]]; then
gum style --foreground 212 --border-foreground 212 --border double --align center --width 60 --margin "1 2" --padding "1 2" "$title" gum style --foreground 212 --border-foreground 212 --border double --align center --width 60 --margin "1 2" --padding "1 2" "$title"
else else
local width=50 local width=50
local pad=$(( (width - len) / 2 ))
[[ $pad -lt 2 ]] && pad=2
local line local line
printf -v line '%*s' "$width" '' && line="${line// /}" printf -v line '%*s' "$width" '' && line="${line// /#}"
line="${line//#/=}"
printf '\n' printf '\n'
printf '\033[1;36m%s\033[0m\n' "$line" printf '\033[1;36m%s\033[0m\n' "$line"
printf '\033[1;36m║\033[0m%*s%s%*s\033[1;36m║\033[0m\n' $pad '' "$title" $((width - pad - len)) '' printf '\033[1;36m %s\033[0m\n' "$title"
printf '\033[1;36m%s\033[0m\n' "$line" printf '\033[1;36m%s\033[0m\n' "$line"
printf '\n' printf '\n'
fi fi

View File

@@ -32,9 +32,39 @@ is_root() {
[[ "$EUID" -eq 0 ]] [[ "$EUID" -eq 0 ]]
} }
OMERON_SUDO_PID=""
OMERON_SUDO_PID=""
sudo_init() {
if is_root; then
return 0
fi
tui_info "Sudo access needed — enter your password once"
sudo -v || {
tui_error "Sudo authentication failed"
return 1
}
(
while true; do
sleep 240
sudo -v 2>/dev/null || break
done
) &
OMERON_SUDO_PID=$!
}
sudo_cleanup() {
[[ -n "$OMERON_SUDO_PID" ]] && kill "$OMERON_SUDO_PID" 2>/dev/null || true
}
sudo_run() { sudo_run() {
if is_root; then if is_root; then
"$@" "$@"
return
fi
if [[ -n "${OMERON_SUDO_PID:-}" ]] && kill -0 "$OMERON_SUDO_PID" 2>/dev/null; then
sudo -n "$@"
else else
sudo "$@" sudo "$@"
fi fi
@@ -70,9 +100,9 @@ copy_path() {
local target="$2" local target="$2"
backup_file "$target" backup_file "$target"
rm -rf "$target" rm -rf "$target" 2>/dev/null || true
mkdir -p "$(dirname "$target")" mkdir -p "$(dirname "$target")"
cp -a "$source" "$target" cp -aT "$source" "$target"
log_info "Copied $source -> $target" log_info "Copied $source -> $target"
} }
@@ -91,8 +121,14 @@ is_package_installed() {
local pkg="$1" local pkg="$1"
if command -v pacman >/dev/null 2>&1; then if command -v pacman >/dev/null 2>&1; then
pacman -Qi "$pkg" >/dev/null 2>&1 pacman -Qi "$pkg" >/dev/null 2>&1 && return 0
return $? if command -v expac >/dev/null 2>&1; then
expac -Q '%n %P' 2>/dev/null | awk -v pkg="$pkg" '
{ for (i=2; i<=NF; i++) if ($i == pkg) {found=1; exit} }
END {exit !found}
' && return 0
fi
return 1
fi fi
return 1 return 1
@@ -121,36 +157,6 @@ install_pacman() {
fi fi
} }
install_aur() {
local packages=("$@")
local aur_helper=""
if have paru; then
aur_helper="paru"
elif have yay; then
aur_helper="yay"
else
log_error "No AUR helper found (install paru or yay)"
return 1
fi
local to_install=()
local pkg
for pkg in "${packages[@]}"; do
if ! is_package_installed "$pkg"; then
to_install+=("$pkg")
fi
done
if ((${#to_install[@]})); then
log_info "Installing from AUR: ${to_install[*]}"
"$aur_helper" -S --needed --noconfirm "${to_install[@]}"
else
log_info "All AUR packages already installed"
fi
}
replace_home_paths() { replace_home_paths() {
local dir="$1" local dir="$1"
local original_home="${2:-/home/pascal}" local original_home="${2:-/home/pascal}"
@@ -261,3 +267,106 @@ system_summary() {
└─────────────────────────────────────────────┘ └─────────────────────────────────────────────┘
SUMMARY SUMMARY
} }
install_aur_package() {
local pkgname="$1"
local build_dir
build_dir="$(mktemp -d)"
tui_info "Cloning $pkgname from AUR directly..."
if ! git clone "https://aur.archlinux.org/$pkgname.git" "$build_dir/$pkgname" 2>/dev/null; then
rm -rf "$build_dir"
return 1
fi
tui_info "Building $pkgname..."
if (cd "$build_dir/$pkgname" && makepkg -si --needed --noconfirm); then
rm -rf "$build_dir"
return 0
fi
local rc=$?
rm -rf "$build_dir"
return $rc
}
install_aur_helper() {
if have paru || have yay; then
return 0
fi
if is_root; then
tui_warn "Running as root — makepkg refuses to run as root."
tui_info "Switch to a normal user with sudo access and re-run."
return 1
fi
command -v git >/dev/null 2>&1 || sudo_run pacman -S --needed --noconfirm git
sudo_run pacman -S --needed --noconfirm base-devel
local build_dir
build_dir="$(mktemp -d)"
tui_info "Installing yay-bin (statically linked, works on any libalpm)..."
if git clone https://aur.archlinux.org/yay-bin.git "$build_dir/yay-bin" &&
(cd "$build_dir/yay-bin" && makepkg -si --needed --noconfirm); then
tui_success "yay installed"
rm -rf "$build_dir"
return 0
fi
rm -rf "$build_dir"
mkdir -p "$build_dir"
tui_info "yay-bin failed. Trying paru-bin..."
if git clone https://aur.archlinux.org/paru-bin.git "$build_dir/paru-bin" &&
(cd "$build_dir/paru-bin" && makepkg -si --needed --noconfirm) &&
paru --version >/dev/null 2>&1; then
tui_success "paru works"
rm -rf "$build_dir"
return 0
fi
rm -rf "$build_dir"
tui_warn "No working AUR helper. Using direct git clone + makepkg for AUR packages."
return 0
}
install_aur() {
local packages=("$@")
local pkg
local rc=0
for pkg in "${packages[@]}"; do
if is_package_installed "$pkg"; then
continue
fi
if have yay; then
tui_info "Installing $pkg from AUR (via yay)..."
if yay -S --needed --noconfirm "$pkg"; then
tui_success "$pkg installed"
continue
fi
tui_warn "yay failed for $pkg. Trying direct AUR install..."
elif have paru && paru --version >/dev/null 2>&1; then
tui_info "Installing $pkg from AUR (via paru)..."
if paru -S --needed --noconfirm "$pkg"; then
tui_success "$pkg installed"
continue
fi
tui_warn "paru failed for $pkg. Trying direct AUR install..."
fi
if install_aur_package "$pkg"; then
tui_success "$pkg installed"
else
tui_warn "$pkg could not be installed. Try manually:"
tui_info " cd /tmp && git clone https://aur.archlinux.org/$pkg.git"
tui_info " cd $pkg && makepkg -si"
rc=1
fi
done
return $rc
}

39
lib/version.sh Normal file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
OMERON_VERSION_DIR="${OMERON_VERSION_DIR:-$HOME/.local/share/omeron}"
OMERON_VERSION_FILE="$OMERON_VERSION_DIR/version"
version_read() {
if [[ -f "$OMERON_VERSION_FILE" ]]; then
source "$OMERON_VERSION_FILE"
return 0
fi
return 1
}
version_write() {
mkdir -p "$OMERON_VERSION_DIR"
cat > "$OMERON_VERSION_FILE" <<VERSION
# Omeron Version File
OMERON_VERSION=1
OMERON_INSTALL_DATE="$(date '+%Y-%m-%d %H:%M:%S')"
OMERON_LAST_UPDATE="$(date '+%Y-%m-%d %H:%M:%S')"
VERSION
}
version_update() {
mkdir -p "$OMERON_VERSION_DIR"
if [[ -f "$OMERON_VERSION_FILE" ]]; then
local tmp
tmp="$(mktemp)"
while IFS= read -r line; do
case "$line" in
OMERON_LAST_UPDATE=*) printf 'OMERON_LAST_UPDATE="%s"\n' "$(date '+%Y-%m-%d %H:%M:%S')" ;;
*) printf '%s\n' "$line" ;;
esac
done < "$OMERON_VERSION_FILE" > "$tmp"
mv "$tmp" "$OMERON_VERSION_FILE"
else
version_write
fi
}

46
modules/core/ags.sh Normal file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
module_description() {
printf "AGS (Aylur's Gtk Shell) - Widget system for Hyprland\n"
}
module_required() { return 0; }
module_should_skip() {
command -v ags >/dev/null 2>&1
}
module_main() {
log_section "AGS Installation"
if command -v ags >/dev/null 2>&1; then
tui_success "AGS already installed"
return 0
fi
if ! have git; then
tui_warn "git not available. Install ags manually after installing git."
return 0
fi
tui_warn "AGS must be built from source (npm install + Go + meson)."
tui_warn "This will first build 3 libastal libraries, then AGS itself."
tui_warn "Total time can be 5-15 minutes depending on your system."
printf '\n'
if ! tui_confirm "Install AGS now?"; then
tui_info "AGS installation skipped."
return 0
fi
local deps=("libastal-io-git" "libastal-git" "libastal-4-git")
if ! install_aur "${deps[@]}"; then
tui_warn "Some AGS dependencies failed to build."
if ! tui_confirm "Try to install AGS anyway?"; then
tui_info "AGS installation aborted."
return 0
fi
fi
tui_info "Building aylurs-gtk-shell-git from AUR..."
install_aur "aylurs-gtk-shell-git"
}

View File

@@ -28,7 +28,7 @@ with open('$OMERON_PROJECT_DIR/config/omeron.yaml') as f:
data = yaml.safe_load(f) data = yaml.safe_load(f)
items = data.get('dotfiles', {}).get('items', []) items = data.get('dotfiles', {}).get('items', [])
print(' '.join(items)) print(' '.join(items))
" 2>/dev/null)" " 2>/dev/null)" || true
if [[ -n "$raw_items" ]]; then if [[ -n "$raw_items" ]]; then
read -ra config_items <<< "$raw_items" read -ra config_items <<< "$raw_items"
@@ -44,8 +44,10 @@ print(' '.join(items))
return 0 return 0
fi fi
backup_dir="$(backup_file "$HOME/.config/hypr" "$HOME/.dotfiles-backup/$(date +%Y%m%d-%H%M%S)")" local backup_timestamp
backup_dir="$(dirname "$backup_dir" 2>/dev/null || printf '%s' "$HOME/.dotfiles-backup/$(date +%Y%m%d-%H%M%S)")" backup_timestamp="$(date +%Y%m%d-%H%M%S)"
backup_file "$HOME/.config/hypr" "$HOME/.dotfiles-backup/$backup_timestamp" >/dev/null
backup_dir="$HOME/.dotfiles-backup/$backup_timestamp"
for item in "${config_items[@]}"; do for item in "${config_items[@]}"; do
local source="$dotfiles_dir/$item" local source="$dotfiles_dir/$item"
@@ -72,9 +74,11 @@ print(' '.join(items))
chmod +x "$HOME/.config/hypr/Scripts/"*.sh 2>/dev/null || true chmod +x "$HOME/.config/hypr/Scripts/"*.sh 2>/dev/null || true
chmod +x "$HOME/.config/hypr/Scripts/"*.py 2>/dev/null || true chmod +x "$HOME/.config/hypr/Scripts/"*.py 2>/dev/null || true
chmod +x "$HOME/.config/hypr/scripts/"*.sh 2>/dev/null || true
chmod +x "$HOME/.config/waybar/scripts/"*.sh 2>/dev/null || true chmod +x "$HOME/.config/waybar/scripts/"*.sh 2>/dev/null || true
replace_home_paths "$HOME/.config/hypr" "/home/pascal" replace_home_paths "$HOME/.config/hypr" "/home/pascal"
replace_home_paths "$HOME/.config/wofi" "/home/pascal"
replace_home_paths "$HOME/.config/gtk-3.0" "/home/pascal" replace_home_paths "$HOME/.config/gtk-3.0" "/home/pascal"
replace_home_paths "$HOME/.config/gtk-4.0" "/home/pascal" replace_home_paths "$HOME/.config/gtk-4.0" "/home/pascal"
replace_home_paths "$HOME/.config/qt5ct" "/home/pascal" replace_home_paths "$HOME/.config/qt5ct" "/home/pascal"

View File

@@ -49,7 +49,7 @@ module_main() {
all_packages+=("${pkgs[@]}") all_packages+=("${pkgs[@]}")
done done
all_packages=("$(remove_duplicates "${all_packages[@]}")") readarray -t all_packages < <(remove_duplicates "${all_packages[@]}")
local total=${#all_packages[@]} local total=${#all_packages[@]}
local existing=0 local existing=0
@@ -83,7 +83,7 @@ module_main() {
return 0 return 0
fi fi
if ((OMERON_FRESH_INSTALL)); then if ((OMERON_FRESH_INSTALL || OMERON_UPDATE_MODE)); then
tui_info "Running system update first..." tui_info "Running system update first..."
sudo_run pacman -Syu --noconfirm 2>&1 | tail -3 || true sudo_run pacman -Syu --noconfirm 2>&1 | tail -3 || true
fi fi
@@ -130,9 +130,11 @@ get_group_packages() {
printf '%s\n' \ printf '%s\n' \
hyprland hyprpaper hyprlock hypridle \ hyprland hyprpaper hyprlock hypridle \
waybar wofi swaync kitty \ waybar wofi swaync kitty \
sddm \
brightnessctl playerctl \ brightnessctl playerctl \
grim slurp swappy hyprshot \ grim slurp swappy hyprshot \
wl-clipboard libnotify sshpass wl-clipboard libnotify sshpass \
hyprpolkitagent awww
;; ;;
gpu) gpu)
@@ -159,7 +161,7 @@ get_group_packages() {
fonts) fonts)
printf '%s\n' \ printf '%s\n' \
noto-fonts noto-fonts-emoji ttf-jetbrains-mono-nerd \ noto-fonts noto-fonts-emoji ttf-jetbrains-mono-nerd \
ttf-font-awesome ttf-nerd-fonts-symbols ttf-dejavu otf-font-awesome ttf-nerd-fonts-symbols ttf-dejavu
;; ;;
tools) tools)
@@ -180,7 +182,7 @@ get_group_packages() {
development) development)
printf '%s\n' \ printf '%s\n' \
git base-devel \ git base-devel \
zip unzip unrar p7zip \ zip unzip unrar \
ripgrep fd bat lsd \ ripgrep fd bat lsd \
htop btop fastfetch htop btop fastfetch
;; ;;

View File

@@ -53,8 +53,10 @@ module_main() {
exit 0 exit 0
fi fi
tui_info "Updating system (pacman -Syu) on fresh VM..."
sudo_run pacman -Syu --noconfirm
if ! have paru && ! have yay; then if ! have paru && ! have yay; then
tui_info "No AUR helper found. Installing paru..."
install_aur_helper install_aur_helper
fi fi
@@ -69,35 +71,4 @@ module_main() {
fi fi
} }
install_aur_helper() {
if have paru || have yay; then
return 0
fi
if ! command -v git >/dev/null 2>&1; then
sudo_run pacman -S --needed --noconfirm git base-devel
fi
local build_dir
build_dir="$(mktemp -d)"
tui_info "Building paru from AUR..."
sudo_run pacman -S --needed --noconfirm rustup 2>/dev/null || true
if have rustup; then
rustup default stable >/dev/null 2>&1 || true
fi
if git clone https://aur.archlinux.org/paru.git "$build_dir/paru" 2>/dev/null; then
(cd "$build_dir/paru" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || {
tui_warn "paru build failed, trying yay..."
if git clone https://aur.archlinux.org/yay.git "$build_dir/yay" 2>/dev/null; then
(cd "$build_dir/yay" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || {
tui_warn "yay build failed too. Install manually: paru -S paru-bin"
}
fi
}
fi
rm -rf "$build_dir"
}

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
module_description() { module_description() {
printf "SDDM Theme - install custom login theme\n" printf "SDDM Theme - install custom login theme with current colors\n"
} }
module_required() { return 1; } module_required() { return 1; }
@@ -38,8 +38,75 @@ module_main() {
sudo_run cp -a "$sddm_theme_dir/pascal-hypr" /usr/share/sddm/themes/ sudo_run cp -a "$sddm_theme_dir/pascal-hypr" /usr/share/sddm/themes/
sudo_run mkdir -p /var/lib/pascal-sddm-theme
sudo_run chown "$(id -u):$(id -g)" /var/lib/pascal-sddm-theme
local current_theme_conf="$HOME/.config/hypr/current-theme.conf"
local current_wallpaper="$HOME/.config/hypr/current-wallpaper"
local hyprpaper_conf="$HOME/.config/hypr/hyprpaper.conf"
local wallpaper=""
local accent="#f38ba8"
local accent2="#cba6f7"
local background="#18141f"
local panel="#313244"
local foreground="#f5e0dc"
local muted="#cdd6f4"
local selected="#11111b"
local theme_name="Pascal Hypr"
if [[ -f "$current_wallpaper" ]]; then
wallpaper="$(< "$current_wallpaper")"
fi
if [[ -f "$current_theme_conf" ]]; then
local line
while IFS= read -r line; do
[[ "$line" =~ ^# ]] && continue
[[ "$line" =~ ^[[:space:]]*$ ]] && continue
if [[ "$line" =~ col\.active_border[[:space:]]*=[[:space:]]*(.*) ]]; then
local border="${BASH_REMATCH[1]}"
border="${border#rgba(}"
border="${border%ee)}"
accent="#${border:0:2}${border:2:2}${border:4:2}"
fi
done < "$current_theme_conf"
fi
if [[ -f "$hyprpaper_conf" ]]; then
if [[ -z "$wallpaper" ]]; then
local wl
wl="$(grep 'path' "$hyprpaper_conf" 2>/dev/null | head -1 | sed 's/.*=[[:space:]]*//' | tr -d ' "')"
[[ -n "$wl" ]] && wallpaper="$wl"
fi
if [[ "$wallpaper" == /home/pascal/* ]]; then
wallpaper="${wallpaper/#\/home\/pascal/$HOME}"
fi
fi
if [[ -n "$wallpaper" && -f "$wallpaper" ]]; then
local ext="${wallpaper##*.}"
[[ "$ext" == "$wallpaper" ]] && ext="jpg"
sudo_run cp "$wallpaper" "/var/lib/pascal-sddm-theme/wallpaper.$ext"
fi
local theme_conf="/usr/share/sddm/themes/pascal-hypr/theme.conf"
sudo_run tee "$theme_conf" >/dev/null <<SDDMEOF
[General]
background=/var/lib/pascal-sddm-theme/wallpaper.jpg
themeName=$theme_name
accent=$accent
accent2=$accent2
backgroundColor=$background
panelColor=$panel
foreground=$foreground
muted=$muted
selectedText=$selected
SDDMEOF
if [[ -f "$sddm_theme_dir/sddm.conf" ]]; then if [[ -f "$sddm_theme_dir/sddm.conf" ]]; then
sudo_run cp -a "$sddm_theme_dir/sddm.conf" /etc/sddm.conf.d/10-pascal-hypr.conf sudo_run cp -a "$sddm_theme_dir/sddm.conf" /etc/sddm.conf.d/90-pascal-hypr.conf
fi fi
log_success "SDDM theme installed" log_success "SDDM theme installed"

View File

@@ -27,7 +27,7 @@ with open('$OMERON_PROJECT_DIR/config/omeron.yaml') as f:
data = yaml.safe_load(f) data = yaml.safe_load(f)
svcs = data.get('services', []) svcs = data.get('services', [])
print(' '.join(svcs)) print(' '.join(svcs))
" 2>/dev/null)" " 2>/dev/null)" || true
if [[ -n "$raw_services" ]]; then if [[ -n "$raw_services" ]]; then
read -ra services <<< "$raw_services" read -ra services <<< "$raw_services"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
module_description() { module_description() {
printf "Optional Software - select and install additional packages\n" printf "Additional Software (Obsidian, Neovim, VS Code, Spotify, Brave, Chromium, VLC, PipeWire, Docker, Blender, opencode)\n"
} }
module_required() { return 1; } module_required() { return 1; }
@@ -30,7 +30,8 @@ module_main() {
"VLC" \ "VLC" \
"PipeWire Tools" \ "PipeWire Tools" \
"Docker" \ "Docker" \
"Blender" "Blender" \
"opencode"
)" )"
if [[ -z "$choices" ]]; then if [[ -z "$choices" ]]; then

View File

@@ -1,17 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
module_description() { module_description() {
printf "Apply Theme - set default Hyprland theme and restart services\n" printf "Apply Theme - select and apply a Hyprland theme\n"
} }
module_required() { return 1; } module_required() { return 1; }
module_should_skip() { return 1; } module_should_skip() { return 1; }
module_prereqs() { module_prereqs() {
if ! have hyprctl && ! have notify-send; then
log_warn "Neither hyprctl nor notify-send found. Theme can still be applied later."
return 0 return 0
fi
} }
module_main() { module_main() {
@@ -25,36 +22,72 @@ module_main() {
return 1 return 1
fi fi
local default_theme="${OMERON_DEFAULT_THEME:-forest-neon}" local theme_files=()
mapfile -t theme_files < <(find "$themes_dir" -name '*.theme' -type f | sort 2>/dev/null)
local theme_file="" if ((${#theme_files[@]} == 0)); then
if [[ -f "$themes_dir/$default_theme.theme" ]]; then
theme_file="$themes_dir/$default_theme.theme"
elif [[ -f "$themes_dir/forest-neon.theme" ]]; then
theme_file="$themes_dir/forest-neon.theme"
elif [[ -f "$themes_dir/rose-night.theme" ]]; then
theme_file="$themes_dir/rose-night.theme"
else
local available
available="$(find "$themes_dir" -name '*.theme' -type f | head -1)"
if [[ -n "$available" ]]; then
theme_file="$available"
fi
fi
if [[ -z "$theme_file" ]]; then
log_warn "No theme files found in $themes_dir" log_warn "No theme files found in $themes_dir"
return 1 return 1
fi fi
if tui_confirm "Apply theme: $(basename "$theme_file" .theme).theme?"; then local theme_names=()
log_info "Applying theme: $(basename "$theme_file")" local file
tui_spin "Applying theme..." bash "$theme_script" --apply "$theme_file" for file in "${theme_files[@]}"; do
theme_names+=("$(basename "$file" .theme)")
done
if have notify-send; then tui_bold "Available themes:"
notify-send "Omeron" "Theme applied: $(basename "$theme_file" .theme)" >/dev/null 2>&1 || true local i
for i in "${!theme_names[@]}"; do
tui_info "[$i] ${theme_names[$i]}"
done
printf '\n'
local choice
if ((${#theme_files[@]} == 1)); then
tui_info "Only one theme available, auto-selecting: ${theme_names[0]}"
choice="${theme_files[0]}"
else
choice="$(
local labels=()
for name in "${theme_names[@]}"; do
labels+=("$name")
done
tui_choose "Select a theme" "${labels[@]}"
)"
if [[ -z "$choice" ]]; then
log_info "No theme selected, skipping"
return 0
fi
local idx
for idx in "${!theme_names[@]}"; do
if [[ "$choice" == "${theme_names[$idx]}" ]]; then
choice="${theme_files[$idx]}"
break
fi
done
fi fi
log_success "Theme applied: $(basename "$theme_file" .theme)" if [[ -z "$choice" || ! -f "$choice" ]]; then
log_warn "Invalid theme selection"
return 1
fi fi
log_info "Selected theme: $(basename "$choice" .theme)"
if ! tui_confirm "Apply theme: $(basename "$choice" .theme)?"; then
log_info "Theme application skipped"
return 0
fi
sudo_run mkdir -p /var/lib/pascal-sddm-theme 2>/dev/null || true
sudo_run chown "$(id -u):$(id -g)" /var/lib/pascal-sddm-theme 2>/dev/null || true
log_info "Applying theme..."
if ! tui_spin "Applying theme..." bash "$theme_script" --apply "$choice"; then
log_warn "Theme application returned errors"
return 1
fi
log_success "Theme applied: $(basename "$choice" .theme)"
} }