diff --git a/README.md b/README.md index f54f00e..cb5e6f3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,440 @@ -# Minimal-Debian-Desktop +# labwc Desktop Setup +A lightweight, keyboard-driven Wayland desktop for **Debian 13 (trixie)** and Debian-based systems, built around the [labwc](https://github.com/labwc/labwc) stacking compositor. + +The repository contains a complete dotfiles bundle, matching **dark and light themes**, and an interactive installer that sets up packages, applications, the login screen, the keyring, and optional developer tooling. + +The look is inspired by KDE Breeze, but the desktop itself is plain Wayland + GTK: labwc, Waybar, fuzzel, Thunar, kitty/foot, and Arc/Qogir themes. + +--- + +## Contents + +- [What this is](#what-this-is) +- [Who it is for](#who-it-is-for) +- [Features](#features) +- [Included components](#included-components) +- [Requirements](#requirements) +- [Installation](#installation) +- [Installer menu](#installer-menu) +- [Optional components](#optional-components) +- [After installation](#after-installation) +- [Keyboard shortcuts](#keyboard-shortcuts) +- [Everyday usage](#everyday-usage) +- [Themes](#themes) +- [Configuration](#configuration) +- [Repository layout](#repository-layout) +- [What the installer changes](#what-the-installer-changes) +- [Troubleshooting](#troubleshooting) +- [Limitations](#limitations) +- [Credits](#credits) + +--- + +## What this is + +This is **not a full desktop environment** like GNOME or KDE Plasma. It is an opinionated, ready-to-use labwc desktop: + +- **labwc** handles windows, workspaces, and keybindings. +- **Waybar** provides a compact bottom panel with launcher, taskbar, tray, system status, and clock. +- **fuzzel** is the application launcher. +- **kitty** and **foot** are the terminals, using fish as the shell. +- **Thunar**, **Loupe**, **GParted**, Firefox, Evince, and Flatseal cover everyday desktop tasks. +- **greetd + tuigreet** provide a text-based login screen with power buttons. +- Everything is configured through plain text files under `~/.config`. + +The result is a small, fast, reproducible desktop that stays out of the way and is easy to version-control. + +## Who it is for + +### Good fit + +- **Developers** who work primarily in a terminal and want a consistent, keyboard-driven setup. +- **Power users** who prefer editing configuration files over clicking through settings dialogs. +- **Users of older or low-power hardware** and **virtual machines**, where a full desktop environment is too heavy. +- **Debian users** who want a coherent Breeze-style Wayland desktop without installing KDE. +- **People who like reproducible setups**: the whole desktop lives in this repository and is applied by one script. + +### Less suitable + +- Users who expect a graphical settings center, themes app, or GNOME/KDE-style conveniences. +- Non-Debian distributions (Fedora, Arch, openSUSE, …) — the installer is apt-based and will not work there. +- Beginners who do not want to touch configuration files. +- NVIDIA users who need proprietary driver setup — the installer only provides the standard Mesa stack and does not configure NVIDIA drivers. + +## Features + +- Minimal **Wayland** desktop with labwc, Waybar, and fuzzel. +- Coherent **dark and light themes** across the panel, terminals, launcher, notifications, lock screen, login screen, and fish prompt. +- **Keyboard-first workflow**: window management, four workspaces, snapping, screenshots, volume, session menu. +- **Automatic idle handling**: lock after 10 minutes, display off after 15, suspend after 30 — paused while audio or video is playing. +- **Text-based login screen** with tuigreet, including shutdown and reboot buttons. +- **gnome-keyring** integration, unlocked at login, with Flatpak secret-service support. +- **Flatpak** with Flathub, Firefox, Evince, and Flatseal preconfigured. +- **Bundled Qogir icon theme** (light and dark) and Nerd Font symbols. +- **Optional developer tooling**: Node.js (nvm), opencode, uv, Rust/Cargo, Ollama, Docker + Compose. +- **Hardware-aware options**: Rusticl/OpenCL for AMD GPUs, pixman software rendering in virtual machines. +- **Safe by default**: existing files are backed up before they are replaced; nothing is changed before the final confirmation. + +## Included components + +| Area | Components | +| --- | --- | +| Compositor | labwc | +| Panel | Waybar (launcher, taskbar, tray, network, audio, CPU, memory, session, clock) | +| Launcher | fuzzel | +| Terminals | kitty, foot (both use fish) | +| Shell | fish, with custom prompt and abbreviations | +| File manager | Thunar (with udisks2, gvfs, tumbler, thunar-volman) | +| Notifications | mako | +| Lock / idle | swaylock, swayidle, custom `idle-action` helper | +| Wallpaper | swaybg | +| Login | greetd + tuigreet | +| Screenshots | grim, slurp, wl-clipboard, swappy | +| Audio | PipeWire, WirePlumber, ALSA utilities | +| Network | NetworkManager | +| Displays | wdisplays, wlr-randr, wlopm | +| Theming | Arc / Arc-Darker, Qogir-Manjaro icons, DejaVu Sans, JetBrains Mono, Nerd Font symbols | +| Applications | Firefox (Flatpak), Evince (Flatpak), Flatseal (Flatpak), Loupe, GParted, mousepad, Helix (`hx`), kew | +| System utilities | fastfetch, btop, htop, nvtop, lazygit, git, jq, polkit agent, xdg-desktop-portal, Flatpak | +| Optional | Node.js (nvm), opencode, uv, Rust/Cargo, Ollama, Docker + Compose, Rusticl | + +## Requirements + +- **Debian 13 (trixie)** — the tested target. Other Debian-based distributions with `apt` may work, but are not officially supported; the installer warns when it detects a non-Debian system. +- A **Wayland-capable graphics setup** (Intel/AMD Mesa is the tested path, including virtual machines with pixman). +- **systemd**, `sudo`, and a regular user account. Do **not** run the installer as root; it invokes `sudo` itself. +- An **internet connection** for apt packages, Flatpak applications, and Nerd Fonts. The Qogir icon archive is bundled. +- A **local terminal** (running the installer over SSH is possible, but the installer can only apply live GTK/theme changes to the graphical session it can detect). + +## Installation + +```bash +git clone desktop-setup +cd desktop-setup +chmod +x install.sh +./install.sh +``` + +Or download the repository as an archive and run the same command from the extracted directory. + +The installer is **interactive and accepts no command-line parameters**. It shows a menu, asks about optional components, and prints a summary before changing anything. + +> **Important:** The files in `home/` and `themes/*/home/` contain the placeholders `@HOME@` and `@NODE_BIN@`. Do not copy them manually — the installer substitutes the real home directory and Node.js path while installing. + +## Installer menu + +```text +1) Full installation (recommended) +2) Change theme only (light/dark) +3) Patch GParted for Wayland only +4) Set up keyring (gnome-keyring) only +5) Quit +``` + +| Option | What it does | +| --- | --- | +| **1 — Full installation** | Installs packages, icon theme, fonts, dotfiles, Flatpak apps, services, login screen, keyring, and all selected optional components. | +| **2 — Change theme only** | Switches between dark and light. Updates dotfiles, GTK/dconf, wallpaper, terminals, panel, launcher, notifications, lock screen, fish colors, and the greetd theme. Preserves an existing VM renderer and Rusticl configuration. | +| **3 — GParted patch only** | Makes GParted started as root (`pkexec`/`sudo`) use the Wayland display of the desktop user. | +| **4 — Keyring only** | Installs and configures gnome-keyring, PAM integration, and the portal secret backend. | +| **5 — Quit** | Exits without changes. | + +### Full installation flow + +1. Choose **dark** or **light**. +2. Answer the questions about virtual machine, Node.js, opencode, uv, Cargo, Ollama, Docker, Rusticl, and fish as the login shell. +3. Review the summary and confirm with **Install now? [Y/n]**. +4. Enter your sudo password when prompted. + +Existing files that would be overwritten are copied to: + +```text +~/Backups/desktop-setup-YYYYMMDD-HHMMSS/ +``` + +An existing display manager (LightDM, GDM, SDDM, Ly) is **not disabled automatically**. The installer asks before enabling greetd in its place. + +## Optional components + +| Component | Purpose | +| --- | --- | +| **pixman renderer** | Software rendering for virtual machines without working 3D acceleration. Prevents black windows and graphics glitches. | +| **Node.js (nvm)** | Installs nvm and the current Node.js LTS release. | +| **opencode** | Terminal-based AI coding agent. | +| **uv** | Fast Python package and project manager. | +| **Cargo / Rust (rustup)** | Rust toolchain; also installs `build-essential` for native crates. | +| **Ollama** | Local LLM runtime and service. | +| **Docker + Compose** | Docker Engine, CLI, and Compose; adds the user to the `docker` group. | +| **Rusticl (AMD)** | OpenCL 3.0 via Mesa/radeonsi, with only Rusticl exposed as the OpenCL ICD. Default is on when an AMD GPU is detected. | +| **fish as login shell** | Runs `chsh -s /usr/bin/fish` after checking `/etc/shells`. | + +## After installation + +1. **Log out and back in** so GTK applications pick up the icon, cursor, and theme settings. +2. **Reboot** if you enabled greetd, so the new login screen becomes active. +3. Log in through tuigreet and press **Super+Return** to open a terminal. + +Useful first commands: + +```bash +fastfetch # system overview +btop # resource monitor +lazygit # Git TUI, inside a repository +session-menu # session actions (also Super+X) +``` + +If you ever need to start the desktop manually from a local TTY, the fish function `startlabwc` starts labwc with `dbus-run-session`, pixman, and software cursors. This is intended for recovery and VM testing, not for normal daily use. + +## Keyboard shortcuts + +`Super` is the Windows/Command key. The same bindings are defined in `~/.config/labwc/rc.xml`. + +### Applications and menus + +| Shortcut | Action | +| --- | --- | +| `Super+Return` | Open kitty | +| `Super+D` / `Super+Space` | Open fuzzel launcher | +| `Super+E` | Open Thunar | +| `Super+Menu` | Open the desktop root menu | +| Right-click desktop | Open the desktop root menu | + +### Windows + +| Shortcut | Action | +| --- | --- | +| `Super+Q` | Close window | +| `Super+M` | Toggle maximize | +| `Super+F` | Toggle fullscreen | +| `Super+A` | Toggle always-on-top | +| `Super+Tab` | Next window | +| `Super+Shift+Tab` | Previous window | +| `Super+Left/Right/Up/Down` | Snap window to screen edge | + +### Workspaces + +| Shortcut | Action | +| --- | --- | +| `Super+1` … `Super+4` | Switch to workspace 1–4 | +| `Super+Shift+1` … `Super+Shift+4` | Move window to workspace 1–4 and follow | +| `Super+Shift+Left/Right` | Move window one workspace left/right | + +### System + +| Shortcut | Action | +| --- | --- | +| `Super+Shift+Up` | Volume +5 % | +| `Super+Shift+Down` | Volume −5 % | +| `Super+Shift+M` | Mute/unmute | +| `Print` | Full-screen screenshot | +| `Shift+Print` | Region screenshot | +| `Super+Shift+S` | Region screenshot | +| `Super+L` | Lock screen | +| `Super+X` / `Super+Shift+Q` | Session menu | +| `Super+R` | Reload labwc configuration | + +Screenshots are saved to `~/Pictures/Screenshots` (or `~/Bilder/Screenshots` when XDG user directories are localized) and copied to the clipboard. + +### Terminal (kitty) + +| Shortcut | Action | +| --- | --- | +| `Ctrl+Shift+Enter` | New vertical split | +| `Ctrl+Shift+Alt+Enter` | New horizontal split | +| `Ctrl+Shift+T` | New tab | +| `Ctrl+Shift+Q` | Close tab | +| `Ctrl+Shift+W` | Close split/window | +| `Ctrl+Shift+Left/Right` | Previous/next tab | +| `Ctrl+Shift+]` / `Ctrl+Shift+[` | Next/previous window | + +## Everyday usage + +- **Launcher:** press `Super+D` or click the ☰ button in Waybar. Type to search installed applications. +- **Taskbar:** Waybar's taskbar shows running applications as icons. Left click focuses or minimizes, middle click closes. +- **System status:** the right side of Waybar shows tray icons, network, volume, CPU, memory, session menu, and clock. Hover for details. +- **Session menu:** `Super+X` or the ⚙ button. It offers lock, suspend, reload labwc, exit labwc, reboot, and shutdown. The menu labels are in German. +- **Notifications:** appear in the top-right corner via mako. +- **Idle behavior:** after 10 minutes the screen locks, after 15 the display turns off, after 30 the machine suspends. Active PipeWire media playback delays these actions, and any activity cancels pending actions. +- **Theme changes:** run `./install.sh` and choose option **2**. + +## Themes + +Two complete themes are included: + +| | Dark | Light | +| --- | --- | --- | +| GTK theme | Arc-Darker (GTK3), Arc-Dark (GTK4) | Arc | +| Icon theme | Qogir-Manjaro-Dark | Qogir-Manjaro | +| Cursor | Qogir-Manjaro-Dark | Qogir-Manjaro | +| Wallpaper | `labwc-dark.png` | `labwc-light.png` | +| Accent | `#3daee9` | `#1c7ed6` | +| Background | `#1b1e20` | `#eef4fb` | + +The theme covers labwc decorations, Waybar, kitty, foot, fuzzel, mako, swaylock, tuigreet, fish colors, and GTK/dconf settings. + +Switch themes by re-running the installer and choosing **Change theme only**. The new theme is fully active after the next login; the login screen changes after a reboot. + +## Configuration + +All user configuration is installed under `~/.config` and `~/.local/bin`. + +| What | Where | Apply changes | +| --- | --- | --- | +| Window manager, keybindings, workspaces | `~/.config/labwc/rc.xml` | `Super+R` | +| Desktop right-click menu | `~/.config/labwc/menu.xml` | `Super+R` | +| Autostart programs, idle timers | `~/.config/labwc/autostart` | Log out/in | +| Session environment (keyboard layout, cursor, PATH) | `~/.config/labwc/environment` | Log out/in | +| Panel layout | `~/.config/waybar/config` | Restart Waybar | +| Panel appearance | `~/.config/waybar/style.css` | Saved automatically (`reload_style_on_change`) | +| Launcher | `~/.config/fuzzel/fuzzel.ini` | Next launch | +| Terminal (kitty) | `~/.config/kitty/kitty.conf` and `theme.conf` | New terminal | +| Terminal (foot) | `~/.config/foot/foot.ini` | New terminal | +| Notifications | `~/.config/mako/config` | Restart mako | +| Lock screen | `~/.config/swaylock/config` | Next lock | +| Login screen theme | `~/.config/tuigreet/theme.conf` | `greeter-theme --restart` or reboot | +| Shell and prompt | `~/.config/fish/config.fish`, `functions/`, `conf.d/` | New shell | +| Helper scripts | `~/.local/bin/` | Immediately | + +Notes: + +- The **keyboard layout is German** (`XKB_DEFAULT_LAYOUT=de`). Change it in `~/.config/labwc/environment` and log out/in if you need another layout. +- The **desktop design targets 1280×1024**, but works at other resolutions. Use `wdisplays` or `wlr-randr` to configure monitors. +- Theme-specific files live in the repository under `themes//home/` and are copied into `$HOME` by the installer. Editing the installed files is fine, but the next installation backs them up and replaces them. +- Configuration files and menu labels are mostly **in German**; the code is documented in German as well. This README is the English entry point. + +## Repository layout + +```text +. +├── install.sh # interactive installer +├── home/ # dotfiles shared by both themes +│ ├── .config/ +│ │ ├── labwc/ # rc.xml, menu.xml, shutdown +│ │ ├── waybar/ # config (layout) +│ │ ├── kitty/ # shared kitty.conf +│ │ ├── fish/ # config, prompt, abbreviations +│ │ ├── xdg-desktop-portal/ +│ │ └── mimeapps.list +│ └── .local/bin/ # session-menu, idle-action, screenshot, +│ # set-gtk-settings, greeter-theme, … +├── themes/ +│ ├── dark/home/ # dark overrides (colors, CSS, theme.conf) +│ └── light/home/ # light overrides +└── assets/ + ├── dconf-dark.conf # reference GSettings dumps + ├── dconf-light.conf + ├── dconf-dark-user # binary dconf fallback databases + ├── dconf-light-user + ├── labwc-dark.png # wallpapers + ├── labwc-light.png + └── Qogir-icons-2025-02-15-all.tar.gz +``` + +The shared `home/` tree is copied first, then the selected theme's `home/` tree is copied over it. This keeps common configuration in one place while themes override colors and appearance. + +## What the installer changes + +The full installation performs these steps: + +1. Installs apt packages (`--no-install-recommends`, with explicitly added essentials). +2. Installs `xfce-polkit` as the PolicyKit agent (from unstable on Debian 13 if necessary). +3. Patches `/usr/sbin/gparted` so root-started GParted uses the user's Wayland display. +4. Installs the bundled Qogir icons and downloads Nerd Font symbols. +5. Installs optional toolchains selected in the menu. +6. Backs up and copies dotfiles into `$HOME`, substituting `@HOME@` and `@NODE_BIN@`. +7. Configures Rusticl and/or the pixman renderer if selected. +8. Configures gnome-keyring, PAM, and the portal secret backend. +9. Applies GTK, icon, cursor, and font settings through GSettings/dconf. +10. Installs Flatpak apps (Firefox, Evince, Flatseal) from Flathub. +11. Writes `/etc/greetd/config.toml` and a polkit rule allowing the greeter to power off/reboot. +12. Enables NetworkManager, PipeWire, WirePlumber, and greetd. +13. Reloads the running session where possible and runs a final diagnostic check. + +Where the installer modifies system configuration files, it keeps backups next to the original when applicable (for example `/etc/greetd/config.toml.bak.YYYYMMDD-HHMMSS`). User files are backed up under `~/Backups/desktop-setup-*`. + +## Troubleshooting + +### GTK applications show Adwaita icons + +- Log out and back in — GTK caches the icon theme when applications start. +- Make sure the SVG loader is present: `sudo apt install librsvg2-common`. +- Re-run the installer (full installation or theme change) to restore the reference dconf database. +- Close conflicting XSETTINGS daemons (Xfce, GNOME) if they are running. + +### GParted shows no window when started as root + +Run the installer and choose **Patch GParted for Wayland only**, or manually: + +```bash +./install.sh # option 3 +``` + +### Keyring is not unlocked at login + +Run option **4** in the installer, then log out and back in. Verify that `/etc/pam.d/greetd` contains `pam_gnome_keyring.so`. + +### Black windows or graphics glitches in a VM + +Enable the pixman renderer. The installer offers this automatically when it detects a virtual machine, or add to `~/.config/labwc/environment`: + +```bash +WLR_RENDERER=pixman +``` + +Then log out and back in. + +### Screen stays black after the display was turned off + +Run `idle-action resume`. If the problem persists, check that the `resume` handlers in `~/.config/labwc/autostart` are intact. + +### Waybar shows boxes instead of icons + +The Nerd Font symbols are missing. Re-run the installer, or install the font manually and refresh the cache with `fc-cache -f`. + +### The old login screen still appears + +greetd was probably not enabled, or another display manager is still active: + +```bash +systemctl status greetd +sudo systemctl enable greetd +sudo systemctl disable --now lightdm # or gdm3, sddm, ly +``` + +### fish is not the login shell + +```bash +chsh -s /usr/bin/fish +``` + +Log out and back in afterwards. + +### Volume or screenshot keys do nothing + +This setup intentionally uses `Super`-based shortcuts instead of media keys. Use `Super+Shift+Up/Down` for volume and `Print` / `Shift+Print` for screenshots. + +## Limitations + +- **Debian/Debian-based only.** The package installation is apt-specific. Fedora, Arch, and others are unsupported. +- **Tested on Debian 13 (trixie)** with Mesa graphics and in virtual machines. Other combinations may need manual fixes. +- **Not a full desktop environment.** There is no graphical settings app; configuration is done in text files. +- **German defaults.** Keyboard layout, menu labels, and comments are German. Change `XKB_DEFAULT_LAYOUT` for a different keyboard. +- **No NVIDIA driver setup.** The installer provides the standard Mesa stack; proprietary NVIDIA configuration is left to the user. +- **No uninstaller.** User files can be restored from `~/Backups/desktop-setup-*`; system packages, files under `/etc`, and the GParted patch must be reverted manually. +- **The installer is interactive.** It does not support unattended or scripted installations. +- **Theme switching is not live.** GTK applications need a new login; greetd needs a reboot. + +## Credits + +This setup builds on the work of these projects: + +- [labwc](https://github.com/labwc/labwc) — Wayland stacking compositor +- [Waybar](https://github.com/Alexays/Waybar) — status bar +- [fuzzel](https://codeberg.org/dnkl/fuzzel) — application launcher +- [kitty](https://github.com/kovidgoyal/kitty) and [foot](https://codeberg.org/dnkl/foot) — terminals +- [Qogir icon theme](https://github.com/vinceliuice/Qogir-icon-theme) by Vinceliuice +- [Arc theme](https://github.com/jnsh/arc-theme) +- [greetd](https://git.sr.ht/~kennylevinsen/greetd) and [tuigreet](https://github.com/apognu/tuigreet) +- [Nerd Fonts](https://www.nerdfonts.com/) and [JetBrains Mono](https://www.jetbrains.com/lp/mono/) +- The Debian project and the wider Wayland ecosystem diff --git a/assets/Qogir-icons-2025-02-15-all.tar.gz b/assets/Qogir-icons-2025-02-15-all.tar.gz new file mode 100644 index 0000000..c4c7ae4 Binary files /dev/null and b/assets/Qogir-icons-2025-02-15-all.tar.gz differ diff --git a/assets/dconf-dark-user b/assets/dconf-dark-user new file mode 100644 index 0000000..8e300ff Binary files /dev/null and b/assets/dconf-dark-user differ diff --git a/assets/dconf-dark.conf b/assets/dconf-dark.conf new file mode 100644 index 0000000..3a46bba --- /dev/null +++ b/assets/dconf-dark.conf @@ -0,0 +1,56 @@ +[org/gnome/Loupe] +show-properties=true + +[org/gnome/desktop/interface] +color-scheme='prefer-dark' +cursor-size=24 +cursor-theme='Qogir-Manjaro-Dark' +enable-animations=true +font-name='DejaVu Sans 9' +gtk-theme='Arc-Darker' +icon-theme='Qogir-Manjaro-Dark' +monospace-font-name='JetBrains Mono 10' + +[org/gnome/desktop/wm/preferences] +button-layout='appmenu:minimize,maximize,close' + +[org/gnome/eog/ui] +image-gallery=false +sidebar=false + +[org/gtk/settings/file-chooser] +date-format='regular' +location-mode='path-bar' +show-hidden=false +show-size-column=true +show-type-column=true +sidebar-width=148 +sort-column='name' +sort-directories-first=false +sort-order='ascending' +type-format='category' +window-position=(23, 15) +window-size=(990, 762) + +[org/mate/engrampa/general] +unar-open-zip=false + +[org/mate/engrampa/listing] +list-mode='as-folder' +show-path=false +sort-method='name' +sort-type='ascending' + +[org/mate/engrampa/ui] +sidebar-width=200 +window-height=480 +window-width=885 + +[org/xfce/mousepad/state/application] +session=@as [] + +[org/xfce/mousepad/state/window] +fullscreen=false +height=uint32 689 +maximized=false +width=uint32 1026 diff --git a/assets/dconf-light-user b/assets/dconf-light-user new file mode 100644 index 0000000..e7f6d40 Binary files /dev/null and b/assets/dconf-light-user differ diff --git a/assets/dconf-light.conf b/assets/dconf-light.conf new file mode 100644 index 0000000..6bc9748 --- /dev/null +++ b/assets/dconf-light.conf @@ -0,0 +1,56 @@ +[org/gnome/Loupe] +show-properties=true + +[org/gnome/desktop/interface] +color-scheme='prefer-light' +cursor-size=24 +cursor-theme='Qogir-Manjaro' +enable-animations=true +font-name='DejaVu Sans 9' +gtk-theme='Arc' +icon-theme='Qogir-Manjaro' +monospace-font-name='JetBrains Mono 10' + +[org/gnome/desktop/wm/preferences] +button-layout='appmenu:minimize,maximize,close' + +[org/gnome/eog/ui] +image-gallery=false +sidebar=false + +[org/gtk/settings/file-chooser] +date-format='regular' +location-mode='path-bar' +show-hidden=false +show-size-column=true +show-type-column=true +sidebar-width=148 +sort-column='name' +sort-directories-first=false +sort-order='ascending' +type-format='category' +window-position=(23, 15) +window-size=(990, 762) + +[org/mate/engrampa/general] +unar-open-zip=false + +[org/mate/engrampa/listing] +list-mode='as-folder' +show-path=false +sort-method='name' +sort-type='ascending' + +[org/mate/engrampa/ui] +sidebar-width=200 +window-height=480 +window-width=885 + +[org/xfce/mousepad/state/application] +session=@as [] + +[org/xfce/mousepad/state/window] +fullscreen=false +height=uint32 689 +maximized=false +width=uint32 1026 diff --git a/assets/labwc-dark.png b/assets/labwc-dark.png new file mode 100644 index 0000000..ea54d3c Binary files /dev/null and b/assets/labwc-dark.png differ diff --git a/assets/labwc-light.png b/assets/labwc-light.png new file mode 100644 index 0000000..8981395 Binary files /dev/null and b/assets/labwc-light.png differ diff --git a/home/.config/fish/config.fish b/home/.config/fish/config.fish new file mode 100644 index 0000000..6f5198e --- /dev/null +++ b/home/.config/fish/config.fish @@ -0,0 +1,102 @@ +# ~/.config/fish/config.fish +# Breeze-Dark-Farbschema für fish + +# ---------- PATH ---------- +# opencode +if test -d "$HOME/.opencode/bin"; and not contains -- "$HOME/.opencode/bin" $PATH + set -gx PATH "$HOME/.opencode/bin" $PATH +end + +# Node.js (nvm) +# Standardversion aus ~/.nvm/alias/default ableiten, damit der Pfad auch +# nach einem nvm-Versionswechsel stimmt ("26", "v26.13.0", "lts/*"). +set -gx NVM_DIR "$HOME/.nvm" +if test -d "$HOME/.nvm/versions/node" + set -l nvm_alias + if test -f "$HOME/.nvm/alias/default" + set nvm_alias (string trim < "$HOME/.nvm/alias/default") + end + # Verschachtelte Aliase wie lts/* -> lts/lithium -> v26.13.0 auflösen + for i in 1 2 3 + test -n "$nvm_alias"; or break + test -f "$HOME/.nvm/alias/$nvm_alias"; or break + set nvm_alias (string trim < "$HOME/.nvm/alias/$nvm_alias") + end + + set -l nvm_matches + if test -n "$nvm_alias" + for d in "$HOME"/.nvm/versions/node/v$nvm_alias.* "$HOME"/.nvm/versions/node/$nvm_alias + test -x "$d/bin/node"; and set -a nvm_matches $d + end + end + # Ohne auflösbaren Alias: neueste installierte Version nehmen + if test (count $nvm_matches) -eq 0 + for d in "$HOME"/.nvm/versions/node/*/ + test -x "$d/bin/node"; and set -a nvm_matches (string trim -r -c / -- $d) + end + end + + if test (count $nvm_matches) -gt 0 + set -l nvm_bin (printf '%s\n' $nvm_matches | sort -V | tail -n 1)/bin + if not contains -- "$nvm_bin" $PATH + set -gx PATH "$nvm_bin" $PATH + end + end +end + +# Eigene Skripte +if test -d "$HOME/.local/bin"; and not contains -- "$HOME/.local/bin" $PATH + set -gx PATH "$HOME/.local/bin" $PATH +end + +# Flatpak-Programme (z. B. org.mozilla.firefox) +for dir in /var/lib/flatpak/exports/bin "$HOME/.local/share/flatpak/exports/bin" + if test -d "$dir"; and not contains -- "$dir" $PATH + set -gx PATH $PATH "$dir" + end +end + +# Systemwerkzeuge aus sbin (z. B. gparted, adduser, halt, blkid) +for dir in /usr/local/sbin /usr/sbin /sbin + if test -d "$dir"; and not contains -- "$dir" $PATH + set -gx PATH $PATH "$dir" + end +end + +# ---------- X11 / XWayland ---------- +# SSH-Sitzungen haben kein DISPLAY. labwc stellt XWayland auf :0 bereit, +# damit X11-Programme (als Benutzer) auf dem Desktop erscheinen. +# Für als root gestartete X11-Programme reicht DISPLAY nicht; GParted +# nutzt stattdessen die Wayland-Anzeige (siehe /usr/sbin/gparted). +if not set -q DISPLAY; and test -S /tmp/.X11-unix/X0 + set -gx DISPLAY :0 +end + +if status is-interactive + set -gx EDITOR nano + set -gx VISUAL nano + set -gx PAGER less + set -gx MANPAGER 'less -R' + set -gx TERMINAL kitty + + # Pfadanzeige im Prompt: vollständig, aber mit ~ abgekürzt + set -g fish_prompt_pwd_dir_length 0 + + # Farben stehen in ~/.config/fish/conf.d/10-theme.fish + # (wird vom Desktop-Theme hell/dunkel gesetzt) + + # ---------- Abkürzungen ---------- + abbr -a ls 'ls --color=auto' + abbr -a ll 'ls -lah --color=auto' + abbr -a la 'ls -A --color=auto' + abbr -a lt 'ls -lah --color=auto --sort=time' + abbr -a .. 'cd ..' + abbr -a ... 'cd ../..' + abbr -a c clear + abbr -a df 'df -h' + abbr -a free 'free -h' + abbr -a ff fastfetch + abbr -a files thunar + abbr -a reload 'pkill -HUP -x labwc' + abbr -a session session-menu +end diff --git a/home/.config/fish/functions/fish_greeting.fish b/home/.config/fish/functions/fish_greeting.fish new file mode 100644 index 0000000..5037e06 --- /dev/null +++ b/home/.config/fish/functions/fish_greeting.fish @@ -0,0 +1,12 @@ +function fish_greeting + if status is-login + set_color $theme_muted + echo " Willkommen, $USER." + echo " Desktop starten: " + set_color $theme_accent + echo -n " startlabwc" + set_color $theme_muted + echo " (nur auf der lokalen Konsole)" + set_color normal + end +end diff --git a/home/.config/fish/functions/fish_prompt.fish b/home/.config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..1c09186 --- /dev/null +++ b/home/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,36 @@ +function fish_prompt + set -l last_status $status + set -l normal (set_color $theme_normal) + set -l dim (set_color $theme_muted) + set -l accent (set_color $theme_accent) + set -l red (set_color $theme_danger) + set -l green (set_color $theme_success) + + # Erste Zeile: ╭─ [user@host] ~/pfad on branch + echo -n "$dim╭─$normal" + + if set -q SSH_CONNECTION + echo -n " $dim$USER@"(prompt_hostname)"$normal" + end + + echo -n " $accent"(prompt_pwd)$normal + + if command -q git + set -l branch (command git symbolic-ref --short HEAD 2>/dev/null) + if test -z "$branch" + set branch (command git rev-parse --short HEAD 2>/dev/null) + end + if test -n "$branch" + echo -n " $dim"on"$normal $green$branch$normal" + end + end + + echo + + # Zweite Zeile: ╰─❯ + if test $last_status -ne 0 + echo -n "$dim╰─$red❯$normal " + else + echo -n "$dim╰─$accent❯$normal " + end +end diff --git a/home/.config/fish/functions/fish_right_prompt.fish b/home/.config/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..8f9c5da --- /dev/null +++ b/home/.config/fish/functions/fish_right_prompt.fish @@ -0,0 +1,4 @@ +function fish_right_prompt + set -l dim (set_color $theme_muted) + echo -n "$dim"(date '+%H:%M')" "(set_color normal) +end diff --git a/home/.config/fish/functions/startlabwc.fish b/home/.config/fish/functions/startlabwc.fish new file mode 100644 index 0000000..14af417 --- /dev/null +++ b/home/.config/fish/functions/startlabwc.fish @@ -0,0 +1,24 @@ +function startlabwc --description 'Startet labwc auf der lokalen Konsole' + if set -q WAYLAND_DISPLAY + set_color $theme_danger + echo "Wayland läuft bereits (WAYLAND_DISPLAY=$WAYLAND_DISPLAY)." + set_color normal + return 1 + end + + # QEMU/bochs-drm: kein OpenGL, keine Hardware-Cursor + set -lx WLR_RENDERER pixman + set -lx WLR_NO_HARDWARE_CURSORS 1 + set -lx XKB_DEFAULT_LAYOUT de + set -lx XDG_SESSION_TYPE wayland + + set_color $theme_muted + echo "Starte labwc (pixman, Software-Rendering) ..." + set_color normal + + if command -q dbus-run-session + exec dbus-run-session -- labwc + else + exec labwc + end +end diff --git a/home/.config/kitty/kitty.conf b/home/.config/kitty/kitty.conf new file mode 100644 index 0000000..ca6c98d --- /dev/null +++ b/home/.config/kitty/kitty.conf @@ -0,0 +1,53 @@ +# kitty – gemeinsame Einstellungen für Breeze Dark/Light +# Die Farben stehen in theme.conf und werden vom Desktop-Theme ersetzt. + +font_family JetBrains Mono +font_size 10 +bold_font auto +italic_font auto +bold_italic_font auto + +# Shell: fish. Die Login-Shell wird zusätzlich einmalig per chsh gesetzt. +shell /usr/bin/fish + +cursor_shape beam +cursor_blink_interval 0 +scrollback_lines 10000 + +# foot-Padding 12x9 px optisch übernommen (kitty rechnet in pt) +window_padding_width 9 12 + +# Startgröße wie bei foot, Größe nicht dauerhaft merken +remember_window_size no +initial_window_width 1100 +initial_window_height 680 + +# Ghostty-artige Splits: kitty startet direkt im splits-Layout. +# (Das Standard-Layout "fat" würde vsplit/hsplit ignorieren.) +enabled_layouts splits + +# Neues Fenster rechts daneben (vertikale Trennlinie) +map ctrl+shift+enter launch --location=vsplit --cwd=current +# Neues Fenster darunter (horizontale Trennlinie) +map ctrl+shift+alt+enter launch --location=hsplit --cwd=current +# Alternativ mit Pfeiltasten (gleiche Aktion) +map ctrl+shift+alt+right launch --location=vsplit --cwd=current +map ctrl+shift+alt+down launch --location=hsplit --cwd=current + +# Tabs (kitty-Standard): +# ctrl+shift+t neuer Tab +# ctrl+shift+q Tab schließen +# ctrl+shift+left/right Tab wechseln +# ctrl+shift+l Layout wechseln (hier nur "splits") +# +# Fenster/Splits: +# ctrl+shift+w Fenster schließen +# ctrl+shift+] / [ nächstes/vorheriges Fenster +# ctrl+shift+r Größe ändern (Pfeiltasten), Enter beendet + +# Tab-Leiste oben, erst ab zwei Tabs sichtbar +tab_bar_edge top +tab_bar_style fade +tab_bar_min_tabs 2 + +include theme.conf diff --git a/home/.config/labwc/menu.xml b/home/.config/labwc/menu.xml new file mode 100644 index 0000000..027c889 --- /dev/null +++ b/home/.config/labwc/menu.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/home/.config/labwc/rc.xml b/home/.config/labwc/rc.xml new file mode 100644 index 0000000..cbf957f --- /dev/null +++ b/home/.config/labwc/rc.xml @@ -0,0 +1,206 @@ + + + + + + server + 0 + no + no + yes + yes + + + + cascade + + + + 8 + yes + yes + + icon:iconify,max,close + yes + + + DejaVu Sans + 10 + bold + + + DejaVu Sans + 10 + + + DejaVu Sans + 10 + + + DejaVu Sans + 10 + + + DejaVu Sans + 10 + + + + + 4 + 500 + Desktop + + + + + + + + + + + + + 30 + 500 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/home/.config/labwc/shutdown b/home/.config/labwc/shutdown new file mode 100644 index 0000000..518ff26 --- /dev/null +++ b/home/.config/labwc/shutdown @@ -0,0 +1,8 @@ +#!/bin/sh +# labwc – Shutdown: laufende Panel-/Hintergrundprozesse sauber beenden. + +pkill -TERM -x waybar >/dev/null 2>&1 +pkill -TERM -x mako >/dev/null 2>&1 +pkill -TERM -x swaybg >/dev/null 2>&1 + +exit 0 diff --git a/home/.config/mimeapps.list b/home/.config/mimeapps.list new file mode 100644 index 0000000..f7fe12d --- /dev/null +++ b/home/.config/mimeapps.list @@ -0,0 +1,25 @@ +[Default Applications] +image/png=org.gnome.Loupe.desktop +image/jpeg=org.gnome.Loupe.desktop +image/gif=org.gnome.Loupe.desktop +image/webp=org.gnome.Loupe.desktop +image/bmp=org.gnome.Loupe.desktop +image/tiff=org.gnome.Loupe.desktop +image/svg+xml=org.gnome.Loupe.desktop +application/pdf=org.gnome.Evince.desktop +x-scheme-handler/http=org.mozilla.firefox.desktop +x-scheme-handler/https=org.mozilla.firefox.desktop +text/html=org.mozilla.firefox.desktop + +[Added Associations] +image/png=org.gnome.Loupe.desktop; +image/jpeg=org.gnome.Loupe.desktop; +image/gif=org.gnome.Loupe.desktop; +image/webp=org.gnome.Loupe.desktop; +image/bmp=org.gnome.Loupe.desktop; +image/tiff=org.gnome.Loupe.desktop; +image/svg+xml=org.gnome.Loupe.desktop; +application/pdf=org.gnome.Evince.desktop; +x-scheme-handler/http=org.mozilla.firefox.desktop; +x-scheme-handler/https=org.mozilla.firefox.desktop; +text/html=org.mozilla.firefox.desktop; diff --git a/home/.config/waybar/config b/home/.config/waybar/config new file mode 100644 index 0000000..b32d58c --- /dev/null +++ b/home/.config/waybar/config @@ -0,0 +1,107 @@ +{ + "layer": "top", + "position": "bottom", + "height": 34, + "spacing": 3, + "exclusive": true, + "reload_style_on_change": true, + + "modules-left": [ + "custom/launcher", + "wlr/taskbar" + ], + + "modules-center": [], + + "modules-right": [ + "tray", + "network", + "wireplumber", + "cpu", + "memory", + "custom/session", + "clock" + ], + + "custom/launcher": { + "format": "☰", + "tooltip": true, + "tooltip-format": "Anwendungen (Super+D)", + "on-click": "fuzzel" + }, + + "wlr/taskbar": { + "all-outputs": true, + "format": "{icon}", + "icon-size": 16, + "sort-by-app-id": true, + "icon-theme": ["Qogir-Manjaro-Dark", "Adwaita"], + "tooltip": true, + "tooltip-format": "{name}\n{title}", + "on-click": "minimize-raise", + "on-click-middle": "close", + "on-click-right": "minimize-raise" + }, + + "clock": { + "interval": 30, + "format": "{:%H:%M}", + "tooltip": true, + "tooltip-format": "{:%d.%m.%Y}" + }, + + "tray": { + "icon-size": 16, + "spacing": 8, + "show-passive-items": true + }, + + "network": { + "interval": 5, + "align": 0.5, + "justify": "center", + "format-wifi": "\uf1eb {signalStrength}%", + "format-ethernet": "\udb80\udf17 LAN", + "format-disconnected": "\uf05e offline", + "tooltip": true, + "tooltip-format-wifi": "{ifname} · {essid} · {signalStrength}%", + "tooltip-format-ethernet": "{ifname} · {ipaddr}", + "tooltip-format-disconnected": "Keine Verbindung" + }, + + "cpu": { + "interval": 3, + "align": 0.5, + "justify": "center", + "format": "\uf2db {usage}%", + "tooltip": false + }, + + "wireplumber": { + "align": 0.5, + "justify": "center", + "format": "\uf028 {volume}%", + "format-muted": "\uf026", + "tooltip": true, + "tooltip-format": "{node_name} · {volume}%", + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", + "scroll-step": 5.0, + "max-volume": 100.0 + }, + + "memory": { + "interval": 5, + "align": 0.5, + "justify": "center", + "format": "\udb80\udf5b {percentage}%", + "tooltip": true, + "tooltip-format": "{used:0.1f} GiB / {total:0.1f} GiB" + }, + + "custom/session": { + "format": "⚙", + "tooltip": true, + "tooltip-format": "Sitzung (Super+X)", + "on-click": "session-menu" + } +} diff --git a/home/.config/xdg-desktop-portal/labwc-portals.conf b/home/.config/xdg-desktop-portal/labwc-portals.conf new file mode 100644 index 0000000..6908610 --- /dev/null +++ b/home/.config/xdg-desktop-portal/labwc-portals.conf @@ -0,0 +1,5 @@ +# labwc: gnome-keyring als Secret-Backend für Flatpak-Apps (z. B. Element) +[preferred] +default=wlr;* +org.freedesktop.impl.portal.Inhibit=none +org.freedesktop.impl.portal.Secret=gnome-keyring diff --git a/home/.config/xfce4/helpers.rc b/home/.config/xfce4/helpers.rc new file mode 100644 index 0000000..43d538b --- /dev/null +++ b/home/.config/xfce4/helpers.rc @@ -0,0 +1,5 @@ +# XFCE/exo – bevorzugte Anwendungen +# Wird u. a. von Thunar („Ordner im Terminal öffnen“) und exo-open gelesen. +# Kein [Default]-Header: exo setzt ihn selbst vor den Dateiinhalt. + +TerminalEmulator=kitty diff --git a/home/.local/bin/greeter-theme b/home/.local/bin/greeter-theme new file mode 100755 index 0000000..30724ac --- /dev/null +++ b/home/.local/bin/greeter-theme @@ -0,0 +1,131 @@ +#!/bin/sh +# greeter-theme – trägt das tuigreet-Theme in /etc/greetd/config.toml ein. +# +# Aufruf: +# greeter-theme nur schreiben, aktiv beim nächsten Login/Neustart +# greeter-theme --restart greetd sofort neu starten (beendet ggf. die Sitzung!) +# +# Das Theme selbst steht in ~/.config/tuigreet/theme.conf. + +set -eu + +usage() { + cat <<'EOF' +Aufruf: greeter-theme [--restart] + +Ohne --restart wird nur /etc/greetd/config.toml geschrieben und ein Backup +der alten Datei angelegt. Das neue Theme greift nach dem nächsten Neustart +(oder nach einem Neustart von greetd). +EOF +} + +restart=0 +for arg in "$@"; do + case "$arg" in + --restart) restart=1 ;; + -h|--help) usage; exit 0 ;; + *) echo "Unbekannte Option: $arg" >&2; usage >&2; exit 2 ;; + esac +done + +# Ohne Root automatisch über sudo erneut starten. +if [ "$(id -u)" -ne 0 ]; then + self=$(command -v "$0" 2>/dev/null || true) + [ -n "$self" ] || self=$0 + self=$(readlink -f "$self") + exec sudo -- "$self" "$@" +fi + +# Home des aufrufenden Benutzers ermitteln (auch unter sudo). +user=${SUDO_USER:-$(id -un)} +if [ "$user" = root ]; then + home=/root +else + home=$(getent passwd "$user" | cut -d: -f6) +fi + +theme_file="$home/.config/tuigreet/theme.conf" +conf=/etc/greetd/config.toml + +if [ ! -r "$theme_file" ]; then + echo "Fehlt: $theme_file" >&2 + exit 1 +fi + +theme=$(tr -d '\n' < "$theme_file") + +# Nur harmlose Zeichen für den TOML-String zulassen. +if [ -z "$theme" ] || printf '%s' "$theme" | LC_ALL=C grep -q '[^A-Za-z0-9=;.#_-]'; then + echo "Ungültiges Theme in $theme_file" >&2 + exit 1 +fi + +# Backup der bestehenden Konfiguration +stamp=$(date +%Y%m%d-%H%M%S) +if [ -f "$conf" ]; then + cp -a "$conf" "$conf.bak.$stamp" + echo "Backup: $conf.bak.$stamp" +fi + +umask 022 +cat > "$conf" < "$polkit_rule" <<'EOF' +// Erlaubt dem Greeter-Benutzer _greetd, das System herunterzufahren +// oder neu zu starten. Der Greeter läuft in keiner aktiven logind- +// Sitzung; die Standardregel (allow_active=yes) greift daher nicht. +polkit.addRule(function(action, subject) { + if (subject.user != "_greetd") + return; + + if (action.id == "org.freedesktop.login1.power-off" || + action.id == "org.freedesktop.login1.power-off-multiple-sessions" || + action.id == "org.freedesktop.login1.reboot" || + action.id == "org.freedesktop.login1.reboot-multiple-sessions") { + return polkit.Result.YES; + } +}); +EOF + chmod 644 "$polkit_rule" + echo "Geschrieben: $polkit_rule" +else + echo "Hinweis: /etc/polkit-1/rules.d fehlt – Power-Aktionen bleiben gesperrt." >&2 +fi + +if [ "$restart" -eq 1 ]; then + echo + echo "WARNUNG: Ein Neustart von greetd kann die laufende Sitzung beenden." + systemctl restart greetd +else + echo + echo "Aktiv nach dem nächsten Neustart." + echo "Sofort anwenden (beendet ggf. die laufende Sitzung):" + echo " sudo systemctl restart greetd" +fi diff --git a/home/.local/bin/idle-action b/home/.local/bin/idle-action new file mode 100755 index 0000000..5db495f --- /dev/null +++ b/home/.local/bin/idle-action @@ -0,0 +1,145 @@ +#!/bin/sh +# idle-action – Aktionen für swayidle, mit Rücksicht auf Medienwiedergabe. +# +# idle-action lock sperrt den Bildschirm, wartet aber, solange +# Audio/Video über PipeWire läuft +# idle-action lock-now sperrt sofort (für before-sleep/logind-Lock) +# idle-action dpms-off schaltet den Monitor aus, ebenfalls erst wenn +# keine Medienwiedergabe mehr läuft +# idle-action suspend versetzt den Rechner in Ruhezustand (Suspend), +# ebenfalls erst wenn keine Medienwiedergabe läuft +# idle-action resume bricht wartende Aktionen ab und schaltet den +# Monitor wieder ein +# idle-action cancel bricht wartende Aktionen ab +set -u + +state_dir="${XDG_RUNTIME_DIR:-/tmp}/idle-action-$(id -u)" +mkdir -p "$state_dir" 2>/dev/null || true + +media_playing() { + # Ist der Bildschirm bereits gesperrt, soll laufendes Audio den + # Monitor nicht dauerhaft anlassen. + pgrep -x swaylock >/dev/null 2>&1 && return 1 + + command -v pw-dump >/dev/null 2>&1 || return 1 + command -v python3 >/dev/null 2>&1 || return 1 + + pw-dump 2>/dev/null | python3 -c ' +import json, sys +try: + nodes = json.load(sys.stdin) +except Exception: + sys.exit(1) +for node in nodes: + if node.get("type") != "PipeWire:Interface:Node": + continue + info = node.get("info") or {} + props = info.get("props") or {} + if props.get("media.class", "").startswith("Stream/Output/") \ + and info.get("state") == "running": + sys.exit(0) +sys.exit(1) +' +} + +cancel_pending() { + for pidfile in "$state_dir"/*.pid; do + [ -f "$pidfile" ] || continue + kill "$(cat "$pidfile")" 2>/dev/null || true + rm -f "$pidfile" + done +} + +outputs() { + wlr-randr --json 2>/dev/null | python3 -c ' +import json, sys +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) +for output in data: + name = output.get("name") + if name: + print(name) +' +} + +display_on() { + if command -v wlopm >/dev/null 2>&1; then + wlopm --on '*' >/dev/null 2>&1 || true + elif command -v wlr-randr >/dev/null 2>&1; then + outputs | while IFS= read -r output; do + wlr-randr --output "$output" --on >/dev/null 2>&1 || true + done + fi +} + +display_off() { + if command -v wlopm >/dev/null 2>&1; then + wlopm --off '*' >/dev/null 2>&1 || true + elif command -v wlr-randr >/dev/null 2>&1; then + outputs | while IFS= read -r output; do + wlr-randr --output "$output" --off >/dev/null 2>&1 || true + done + fi +} + +wait_for_media() { + while media_playing; do + sleep 5 + done + # Kurze Schonfrist: startet die Wiedergabe gleich wieder, weiter warten. + sleep 2 + media_playing && return 1 + return 0 +} + +lock_now() { + # Nur eine Instanz starten. swaylock beendet sich bei + # ext-session-lock ohnehin selbst, wenn bereits gesperrt ist. + pgrep -x swaylock >/dev/null 2>&1 || swaylock -f +} + +run_action() { + action=$1 + pidfile="$state_dir/$action.pid" + + if [ -f "$pidfile" ]; then + kill "$(cat "$pidfile")" 2>/dev/null || true + rm -f "$pidfile" + fi + + ( + trap 'rm -f "$pidfile"' EXIT + wait_for_media || exit 0 + rm -f "$pidfile" + case "$action" in + lock) + lock_now + ;; + dpms-off) + display_off + ;; + suspend) + systemctl suspend + ;; + esac + ) & + echo $! > "$pidfile" +} + +case "${1:-}" in + lock|dpms-off|suspend) run_action "$1" ;; + lock-now) lock_now ;; + resume) + cancel_pending + display_on + ;; + cancel) + cancel_pending + ;; + *) + echo "Aufruf: idle-action lock|lock-now|dpms-off|suspend|resume|cancel" >&2 + exit 2 + ;; +esac diff --git a/home/.local/bin/screenshot b/home/.local/bin/screenshot new file mode 100755 index 0000000..e1c588c --- /dev/null +++ b/home/.local/bin/screenshot @@ -0,0 +1,50 @@ +#!/bin/sh +# screenshot – Bildschirmfoto unter labwc (Wayland) +# Benötigt: grim, slurp, wl-clipboard (optional: libnotify-bin) + +set -eu + +mode="${1:-full}" +dir="${XDG_PICTURES_DIR:-$HOME/Bilder}/Screenshots" +mkdir -p "$dir" +file="$dir/$(date +%Y-%m-%d_%H-%M-%S).png" + +need() { + if ! command -v "$1" >/dev/null 2>&1; then + echo "screenshot: '$1' fehlt." >&2 + echo "Installieren mit: sudo apt install grim slurp wl-clipboard" >&2 + exit 1 + fi +} + +need grim + +case "$mode" in + full) + grim "$file" + ;; + region) + need slurp + geom="$(slurp)" || exit 0 + grim -g "$geom" "$file" + ;; + output) + need slurp + geom="$(slurp -o -r)" || exit 0 + grim -g "$geom" "$file" + ;; + *) + echo "Verwendung: screenshot [full|region|output]" >&2 + exit 2 + ;; +esac + +# In die Zwischenablage kopieren +if command -v wl-copy >/dev/null 2>&1; then + wl-copy --type image/png < "$file" +fi + +# Kurze Benachrichtigung, falls libnotify vorhanden ist +if command -v notify-send >/dev/null 2>&1; then + notify-send -a Screenshot "Screenshot gespeichert" "$file" +fi diff --git a/home/.local/bin/session-menu b/home/.local/bin/session-menu new file mode 100755 index 0000000..c327bc6 --- /dev/null +++ b/home/.local/bin/session-menu @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# Sitzungsmenü für labwc (fuzzel --dmenu) + +set -uo pipefail + +if ! command -v fuzzel >/dev/null 2>&1; then + echo "fuzzel ist nicht installiert." >&2 + exit 1 +fi + +choice=$( + printf '%s\n' \ + "Bildschirm sperren" \ + "Standby (Ruhezustand)" \ + "labwc neu laden" \ + "labwc beenden" \ + "Neu starten" \ + "Herunterfahren" \ + "Abbrechen" | + fuzzel --dmenu --prompt='Sitzung ' --lines=7 --width=26 --anchor=center +) || exit 0 + +lock_now() { + if command -v idle-action >/dev/null 2>&1; then + idle-action lock-now + else + pgrep -x swaylock >/dev/null 2>&1 || swaylock -f + fi +} + +case "$choice" in + "Bildschirm sperren") + lock_now + ;; + "Standby (Ruhezustand)") + lock_now + systemctl suspend + ;; + "labwc neu laden") + pkill -HUP -x labwc + ;; + "labwc beenden") + pkill -TERM -x labwc + ;; + "Neu starten") + systemctl reboot + ;; + "Herunterfahren") + systemctl poweroff + ;; + *) + exit 0 + ;; +esac diff --git a/home/.local/bin/set-gtk-settings b/home/.local/bin/set-gtk-settings new file mode 100755 index 0000000..17ab1fb --- /dev/null +++ b/home/.local/bin/set-gtk-settings @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +"""Setzt Icon-, GTK-, Cursor- und Schrift-Einstellungen über GSettings. + +Aufruf: + set-gtk-settings [dark|light] + +Standard ist ``dark``. Hintergrund: Unter Wayland (labwc/sway) liest GDK/GTK +die Einstellungen über das XDG-Desktop-Portal aus +``org.gnome.desktop.interface``. Eine ``~/.config/gtk-3.0/settings.ini`` +allein wird von GDK überschrieben, sobald das Portal erreichbar ist. + +Das Skript braucht keine ``gsettings``-CLI; es nutzt libgio direkt über +ctypes. Es ist idempotent und kann jederzeit erneut ausgeführt werden. +""" + +import ctypes as C +import sys + +SCHEMA = b"org.gnome.desktop.interface" +WM_SCHEMA = b"org.gnome.desktop.wm.preferences" +BUTTON_LAYOUT = "appmenu:minimize,maximize,close" + +THEMES = { + "dark": { + "icon-theme": "Qogir-Manjaro-Dark", + "gtk-theme": "Arc-Darker", + "cursor-theme": "Qogir-Manjaro-Dark", + "color-scheme": "prefer-dark", + }, + "light": { + "icon-theme": "Qogir-Manjaro", + "gtk-theme": "Arc", + "cursor-theme": "Qogir-Manjaro", + "color-scheme": "prefer-light", + }, +} + +STRINGS = { + "font-name": "DejaVu Sans 9", + "monospace-font-name": "JetBrains Mono 10", +} +INTS = { + "cursor-size": 24, +} +BOOLS = { + "enable-animations": True, +} + + +def load_libs(): + gio = C.CDLL("libgio-2.0.so.0") + glib = C.CDLL("libglib-2.0.so.0") + + gio.g_settings_new.argtypes = [C.c_char_p] + gio.g_settings_new.restype = C.c_void_p + + gio.g_settings_get_string.argtypes = [C.c_void_p, C.c_char_p] + gio.g_settings_get_string.restype = C.c_void_p + gio.g_settings_set_string.argtypes = [C.c_void_p, C.c_char_p, C.c_char_p] + gio.g_settings_set_string.restype = C.c_int + + gio.g_settings_get_int.argtypes = [C.c_void_p, C.c_char_p] + gio.g_settings_get_int.restype = C.c_int + gio.g_settings_set_int.argtypes = [C.c_void_p, C.c_char_p, C.c_int] + gio.g_settings_set_int.restype = C.c_int + + gio.g_settings_get_boolean.argtypes = [C.c_void_p, C.c_char_p] + gio.g_settings_get_boolean.restype = C.c_int + gio.g_settings_set_boolean.argtypes = [C.c_void_p, C.c_char_p, C.c_int] + gio.g_settings_set_boolean.restype = C.c_int + + gio.g_settings_sync.argtypes = [] + gio.g_settings_sync.restype = None + + glib.g_free.argtypes = [C.c_void_p] + glib.g_free.restype = None + + return gio, glib + + +def get_string(gio, glib, settings, key): + ptr = gio.g_settings_get_string(settings, key.encode()) + if not ptr: + return None + value = C.cast(ptr, C.c_char_p).value.decode() + glib.g_free(ptr) + return value + + +def main(): + mode = sys.argv[1] if len(sys.argv) > 1 else "dark" + if mode in ("-h", "--help"): + print("Aufruf: set-gtk-settings [dark|light]", file=sys.stderr) + return 0 + if mode not in THEMES: + print(f"Unbekanntes Design: {mode!r} (erlaubt: dark, light)", file=sys.stderr) + return 2 + + strings = dict(STRINGS) + strings.update(THEMES[mode]) + + gio, glib = load_libs() + settings = gio.g_settings_new(SCHEMA) + if not settings: + print(f"FEHLER: Schema {SCHEMA.decode()} nicht gefunden.", file=sys.stderr) + return 1 + + wm_settings = gio.g_settings_new(WM_SCHEMA) + if not wm_settings: + print(f"FEHLER: Schema {WM_SCHEMA.decode()} nicht gefunden.", file=sys.stderr) + return 1 + + failed = False + + print(f"== Design: {mode} ==") + print("== Vorher ==") + for key in strings: + print(f" {key:22} = {get_string(gio, glib, settings, key)!r}") + for key in INTS: + print(f" {key:22} = {gio.g_settings_get_int(settings, key.encode())}") + for key in BOOLS: + print(f" {key:22} = {bool(gio.g_settings_get_boolean(settings, key.encode()))}") + print(f" {'button-layout':22} = {get_string(gio, glib, wm_settings, 'button-layout')!r}") + + print("\n== Setzen ==") + for key, value in strings.items(): + ok = bool(gio.g_settings_set_string(settings, key.encode(), value.encode())) + print(f" {key:22} = {value!r} {'OK' if ok else 'FEHLER'}") + failed |= not ok + for key, value in INTS.items(): + ok = bool(gio.g_settings_set_int(settings, key.encode(), value)) + print(f" {key:22} = {value} {'OK' if ok else 'FEHLER'}") + failed |= not ok + for key, value in BOOLS.items(): + ok = bool(gio.g_settings_set_boolean(settings, key.encode(), int(value))) + print(f" {key:22} = {value} {'OK' if ok else 'FEHLER'}") + failed |= not ok + + ok = bool(gio.g_settings_set_string(wm_settings, b"button-layout", + BUTTON_LAYOUT.encode())) + print(f" {'button-layout':22} = {BUTTON_LAYOUT!r} {'OK' if ok else 'FEHLER'}") + failed |= not ok + + gio.g_settings_sync() + + print("\n== Nachher ==") + for key in strings: + print(f" {key:22} = {get_string(gio, glib, settings, key)!r}") + for key in INTS: + print(f" {key:22} = {gio.g_settings_get_int(settings, key.encode())}") + for key in BOOLS: + print(f" {key:22} = {bool(gio.g_settings_get_boolean(settings, key.encode()))}") + print(f" {'button-layout':22} = {get_string(gio, glib, wm_settings, 'button-layout')!r}") + + if failed: + print("\nMindestens ein Wert konnte nicht gesetzt werden.", file=sys.stderr) + return 1 + + print("\nFertig. Waybar/Thunar neu starten, damit die Icons sofort aktualisiert werden:") + print(" killall waybar thunar 2>/dev/null; waybar & thunar --daemon &") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/home/.local/bin/update-gtk4-dark-css b/home/.local/bin/update-gtk4-dark-css new file mode 100755 index 0000000..d49406d --- /dev/null +++ b/home/.local/bin/update-gtk4-dark-css @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# update-gtk4-dark-css – erzeugt die GTK4-User-CSS für Arc-Dark. +# +# GTK3 bleibt auf Arc-Darker (dunkle Kopfleisten, helle Inhaltsflächen). +# GTK4-Programme (inkl. libadwaita) laden dagegen Arc-Dark über +# ~/.config/gtk-4.0/gtk.css. Die CSS wird aus dem installierten +# Arc-Theme extrahiert, damit sie bei Theme-Updates mitwandert. +set -Eeuo pipefail + +config_home=${XDG_CONFIG_HOME:-$HOME/.config} +dest="$config_home/gtk-4.0/arc-dark" +gtk_css="$config_home/gtk-4.0/gtk.css" + +theme="" +for candidate in /usr/share/themes/Arc-Dark/gtk-4.0 \ + /usr/share/themes/Arc-Darker/gtk-4.0; do + if [ -f "$candidate/gtk.gresource" ]; then + theme=$candidate + break + fi +done + +if [ -z "$theme" ]; then + echo "Fehler: Arc-Dark/Arc-Darker (GTK4) nicht gefunden." >&2 + exit 1 +fi + +command -v gresource >/dev/null 2>&1 || { + echo "Fehler: gresource fehlt (Paket libglib2.0-bin)." >&2 + exit 1 +} + +resource=/org/gnome/arc-theme/gtk-main-dark.css +if ! gresource list "$theme/gtk.gresource" | grep -Fqx "$resource"; then + echo "Fehler: $resource fehlt in $theme/gtk.gresource." >&2 + exit 1 +fi + +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT +mkdir -p "$tmp/assets" + +gresource extract "$theme/gtk.gresource" "$resource" > "$tmp/gtk-main-dark.css" +while IFS= read -r r; do + case "$r" in + */assets/*) + gresource extract "$theme/gtk.gresource" "$r" > "$tmp/assets/${r##*/}" + ;; + esac +done < <(gresource list "$theme/gtk.gresource") + +install -d "$config_home/gtk-4.0" +rm -rf "$dest" +mv "$tmp" "$dest" +trap - EXIT + +cat > "$gtk_css" <<'EOF' +/* GTK4: Arc-Dark für alle GTK4-Programme. + * GTK3 bleibt bewusst auf Arc-Darker (siehe gtk-3.0/settings.ini). + * Die Datei arc-dark/gtk-main-dark.css wird von + * ~/.local/bin/update-gtk4-dark-css aus dem Arc-Theme erzeugt. + */ +@import url("arc-dark/gtk-main-dark.css"); +EOF + +echo "GTK4-User-CSS geschrieben: $gtk_css" +echo "Arc-Dark-CSS: $dest/gtk-main-dark.css (aus $theme)" diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..19e5b5c --- /dev/null +++ b/install.sh @@ -0,0 +1,2330 @@ +#!/usr/bin/env bash +# install.en.sh – interactive installer for the labwc desktop. +# +# This script does not accept installation parameters. It guides you +# through a menu and asks about all optional components: +# +# • full installation +# • change theme only (light/dark) +# • patch GParted for Wayland only +# • set up keyring (gnome-keyring) only +# +# Optional components: Node.js (nvm), opencode, uv, Cargo/Rust (rustup), +# Ollama, Docker (incl. compose), Rusticl for AMD, fish as the default +# login shell and pixman as the renderer in a virtual machine. +# +# The bundle uses @HOME@ and @NODE_BIN@ as placeholders. They are +# replaced at install time with the real home directory and the nvm bin +# path. This way the package contains no fixed user name. + +set -Eeuo pipefail + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) + +MODE="" +DO_NODE=0 +DO_OPENCODE=0 +DO_UV=0 +DO_CARGO=0 +DO_OLLAMA=0 +DO_DOCKER=0 +DO_RUSTICL=0 +DO_VM_RENDERER=0 +SET_FISH_SHELL=0 +BACKUP_DIR="" +NVM_VERSION=${NVM_VERSION:-v0.41.0} + +if [ -t 1 ]; then + B=$'\033[1;34m'; G=$'\033[1;32m'; Y=$'\033[1;33m'; R=$'\033[1;31m'; N=$'\033[0m' +else + B=""; G=""; Y=""; R=""; N="" +fi + +info() { printf '%s==>%s %s\n' "$B" "$N" "$*"; } +ok() { printf '%s ✓%s %s\n' "$G" "$N" "$*"; } +warn() { printf '%sWarning:%s %s\n' "$Y" "$N" "$*" >&2; } +err() { printf '%sError:%s %s\n' "$R" "$N" "$*" >&2; } +die() { err "$*"; exit 1; } + +# Identity of the user who started this script. $USER and $HOME are +# environment variables and can be stale (exported from another account, +# `su` without `-`, etc.). Everything user-bound – home directory, shell, +# docker group, dotfiles – is derived from the passwd database instead, +# so the installer always configures the user who actually ran it. +USER_NAME=$(id -un) +USER_HOME=$(getent passwd "$USER_NAME" 2>/dev/null | cut -d: -f6 || true) +if [ -z "$USER_HOME" ]; then + USER_HOME=${HOME:?} +elif [ -n "${HOME:-}" ] && [ "$HOME" != "$USER_HOME" ]; then + warn "HOME is '$HOME', but '$USER_NAME' is registered with '$USER_HOME' – using '$USER_HOME'." +fi + +usage() { + cat <<'EOF' +Usage: ./install.en.sh + +This script is interactive and does not accept installation parameters. +Start it without arguments and follow the menu. +EOF +} + +# ---------------------------------------------------------------- Prompts + +ask_yes_no() { + local prompt=$1 default=${2:-n} answer + if [ ! -t 0 ]; then + case "$default" in + y|Y) return 0 ;; + *) return 1 ;; + esac + fi + case "$default" in + y|Y) prompt="$prompt [Y/n]" ;; + *) prompt="$prompt [y/N]" ;; + esac + while true; do + read -r -p "$prompt " answer || answer="" + answer=${answer:-$default} + case "$answer" in + y|Y|yes|Yes) return 0 ;; + n|N|no|No) return 1 ;; + *) printf 'Please enter y or n.\n' >&2 ;; + esac + done +} + +ask_theme() { + local answer + if [ ! -t 0 ]; then + printf 'dark\n' + return 0 + fi + # Menu goes to stderr: the return value is captured via $(ask_theme). + printf '\nWhich theme?\n' >&2 + printf ' 1) dark (Breeze Dark)\n' >&2 + printf ' 2) light (Breeze Light)\n' >&2 + while true; do + read -r -p "Choice [1/2, default: 1]: " answer || answer="" + case "${answer:-1}" in + 1|d|D|dark|Dark) printf 'dark\n'; return 0 ;; + 2|l|L|light|Light) printf 'light\n'; return 0 ;; + *) printf 'Please enter 1 or 2.\n' >&2 ;; + esac + done +} + +has_amd_gpu() { + local f + for f in /sys/class/drm/card*/device/vendor; do + [ -f "$f" ] || continue + if [ "$(cat "$f" 2>/dev/null)" = "0x1002" ]; then + return 0 + fi + done + return 1 +} + +in_virtual_machine() { + if command -v systemd-detect-virt >/dev/null 2>&1; then + systemd-detect-virt --vm --quiet && return 0 + return 1 + fi + # Fallback without systemd-detect-virt: DMI data of known hypervisors + local f value + for f in /sys/class/dmi/id/product_name \ + /sys/class/dmi/id/sys_vendor \ + /sys/class/dmi/id/bios_vendor; do + [ -r "$f" ] || continue + value=$(cat "$f" 2>/dev/null || true) + case "$value" in + *QEMU*|*KVM*|*VirtualBox*|*VMware*|*Hyper-V*|*Xen*|*Bochs*|*Parallels*) + return 0 ;; + esac + done + return 1 +} + +require_sudo() { + command -v sudo >/dev/null 2>&1 \ + || die "sudo is missing. Please install as root or install sudo first." + info "sudo privileges are required (apt/greetd/services/GParted/keyring) …" + sudo -v || die "sudo failed." +} + +# ---------------------------------------------------------------- Packages + +APT_PACKAGES=( + labwc waybar kitty foot fuzzel + thunar thunar-volman tumbler udisks2 gvfs + gparted loupe + swaybg mako-notifier swayidle swaylock + greetd tuigreet + pipewire pipewire-pulse pipewire-audio pipewire-alsa wireplumber alsa-utils + network-manager wpasupplicant wireless-regdb + grim slurp wl-clipboard swappy libnotify-bin + wdisplays wlr-randr wlopm + flatpak xdg-desktop-portal xdg-desktop-portal-gtk gnome-keyring polkitd + libpam-gnome-keyring libsecret-tools + xdg-utils xdg-user-dirs dbus dbus-user-session + arc-theme fonts-dejavu-core fonts-dejavu-mono fonts-jetbrains-mono + fish kf6-breeze-icon-theme librsvg2-common gtk-update-icon-cache libglib2.0-bin + gsettings-desktop-schemas dconf-gsettings-backend dconf-service dconf-cli + fontconfig python3 python3-venv nano less fastfetch btop htop nvtop mousepad hx kew + python3-gi gir1.2-gtk-3.0 + mesa-opencl-icd ocl-icd-libopencl1 clinfo pciutils + mesa-va-drivers mesa-vdpau-drivers mesa-vulkan-drivers + qtwayland5 + git curl wget xz-utils unzip ca-certificates zstd jq lazygit +) + +install_packages() { + command -v apt-get >/dev/null 2>&1 \ + || die "This script only supports Debian/Ubuntu (apt)." + # shellcheck disable=SC1091 + . /etc/os-release 2>/dev/null || true + if [ "${ID:-}" != "debian" ]; then + warn "Tested on Debian 13 (trixie); detected: ${PRETTY_NAME:-unknown}." + fi + + # Cargo/Rust needs a C toolchain and linker. `gcc` only Recommends + # libc6-dev, which --no-install-recommends would skip – build-essential + # pulls in cc, libc6-dev, make and g++ as real dependencies. + if [ "$DO_CARGO" -eq 1 ] \ + || [ -x "${CARGO_HOME:-$USER_HOME/.cargo}/bin/cargo" ] \ + || command -v cargo >/dev/null 2>&1; then + APT_PACKAGES+=(build-essential) + fi + + # docker.io only Recommends docker-cli; with --no-install-recommends + # the `docker` command itself would be missing. docker-compose ships + # both `docker compose` (CLI plugin) and the `docker-compose` wrapper. + if [ "$DO_DOCKER" -eq 1 ]; then + APT_PACKAGES+=(docker.io docker-cli docker-compose) + fi + + info "Updating apt package lists …" + sudo apt-get update + + local p available=() missing=() + for p in "${APT_PACKAGES[@]}"; do + if apt-cache show "$p" >/dev/null 2>&1; then + available+=("$p") + else + missing+=("$p") + fi + done + if [ ${#missing[@]} -gt 0 ]; then + warn "Not available and will be skipped: ${missing[*]}" + fi + [ ${#available[@]} -gt 0 ] || die "None of the required packages is available." + + info "Installing ${#available[@]} packages …" + sudo env DEBIAN_FRONTEND=noninteractive \ + apt-get install -y --no-install-recommends "${available[@]}" + ok "Packages installed." +} + +# ---------------------------------------------------------------- PolicyKit agent + +install_polkit_agent() { + if [ -x /usr/libexec/xfce-polkit ] || command -v xfce-polkit >/dev/null 2>&1; then + ok "xfce-polkit (PolicyKit agent) already installed" + return 0 + fi + + # Starting with Debian 14 (forky), xfce-polkit is in the official repositories. + if apt-cache show xfce-polkit >/dev/null 2>&1; then + info "Installing xfce-polkit …" + if sudo env DEBIAN_FRONTEND=noninteractive \ + apt-get install -y --no-install-recommends xfce-polkit; then + ok "xfce-polkit installed." + return 0 + fi + warn "apt installation of xfce-polkit failed – trying package download." + fi + + # Debian 13 (trixie): the package arrived only after the freeze and is + # only in unstable. All dependencies are present in trixie in matching + # versions, so the .deb can be installed directly. + local arch deb tmp + arch=$(dpkg --print-architecture 2>/dev/null) || arch=amd64 + tmp=$(mktemp -d) + info "xfce-polkit is missing in trixie – downloading the package from Debian unstable …" + deb=$(curl -fsSL https://deb.debian.org/debian/pool/main/x/xfce-polkit/ 2>/dev/null \ + | grep -oE "xfce-polkit_[^\"]*_${arch}\.deb" | sort -Vu | tail -n 1) + if [ -z "$deb" ] \ + || ! curl -fsSL -o "$tmp/$deb" "https://deb.debian.org/debian/pool/main/x/xfce-polkit/$deb"; then + rm -rf "$tmp" + warn "xfce-polkit could not be downloaded – pkexec/gparted cannot ask for the password." + return 0 + fi + if sudo dpkg -i "$tmp/$deb" >/dev/null 2>&1 \ + || sudo env DEBIAN_FRONTEND=noninteractive apt-get install -f -y >/dev/null 2>&1; then + ok "xfce-polkit installed ($deb)." + else + warn "Installation of $deb failed." + fi + rm -rf "$tmp" +} + +# ---------------------------------------------------------------- GParted + +patch_gparted_wayland() { + local target=/usr/sbin/gparted tmp block + + if [ ! -f "$target" ]; then + warn "gparted is not installed – skipping the Wayland patch." + return 0 + fi + if grep -q 'desktop-setup: wayland root' "$target" 2>/dev/null; then + ok "gparted Wayland patch already present" + return 0 + fi + + info "Patching gparted for root startup under Wayland …" + tmp=$(mktemp) + block=$(mktemp) + cat >"$block" <<'EOF' +# +# desktop-setup: wayland root +# Run GParted on the Wayland display of the desktop user when started +# as root (pkexec/sudo). labwc's Xwayland denies root access and X11 +# cookies are not available to root, so use the Wayland backend. +# +if test "x`id -u`" = "x0" && test "x${WAYLAND_DISPLAY:-}" = "x"; then + _uid="${PKEXEC_UID:-${SUDO_UID:-}}" + if test -n "$_uid"; then + _runtime="/run/user/$_uid" + for _sock in "$_runtime"/wayland-*; do + case "$_sock" in *.lock) continue ;; esac + if test -S "$_sock"; then + XDG_RUNTIME_DIR="$_runtime" + WAYLAND_DISPLAY="${_sock##*/}" + GDK_BACKEND=wayland + export XDG_RUNTIME_DIR WAYLAND_DISPLAY GDK_BACKEND + break + fi + done + fi +fi +EOF + + awk -v blockfile="$block" ' + { print } + /exit \$status$/ { seen = 1; next } + seen && /^fi$/ { + print "" + while ((getline line < blockfile) > 0) print line + close(blockfile) + seen = 0 + } + ' "$target" >"$tmp" + + if ! grep -q 'desktop-setup: wayland root' "$tmp" 2>/dev/null; then + rm -f "$tmp" "$block" + warn "gparted patch not possible (unexpected file version)." + return 0 + fi + + sudo install -m 755 "$tmp" "$target" + rm -f "$tmp" "$block" + ok "gparted patched (root startup uses the Wayland display)." +} + +install_gparted() { + if command -v gparted >/dev/null 2>&1; then + ok "gparted is already installed." + return 0 + fi + info "Installing gparted …" + sudo apt-get update + sudo env DEBIAN_FRONTEND=noninteractive \ + apt-get install -y --no-install-recommends gparted \ + || { warn "gparted could not be installed."; return 0; } + ok "gparted installed." +} + +# ---------------------------------------------------------------- Icons + +# Checks whether both Qogir variants are complete. Qogir-Manjaro-Dark +# symlinks 48/96/128/scalable/symbolic relatively into Qogir-Manjaro. If +# the light variant is missing, Thunar finds no icons despite an existing +# index.theme. +qogir_icons_complete() { + local dest="$USER_HOME/.local/share/icons" + local d p + for d in Qogir-Manjaro Qogir-Manjaro-Dark; do + for p in index.theme 16/places/folder.svg 48/places/folder.svg \ + scalable/places/folder.svg \ + scalable/apps/org.xfce.thunar.svg \ + cursors/default; do + # -s also catches empty/corrupted files from a broken copy. + [ -s "$dest/$d/$p" ] || return 1 + done + done + return 0 +} + +install_icons() { + local dest="$USER_HOME/.local/share/icons" + local ver=2025-02-15 + local sha=b0d07cad5601e0341a53a62df0ed111823b75fc38741d435486620a59fb239ee + local cand tarball="" tmp qogir_dir + local bundle_sha=6a2863348a6935686be2403b9a168e431b94f1108419bcff3e31edd6a3aec0b1 + + mkdir -p "$dest" + + for cand in "$SCRIPT_DIR/assets/Qogir-icons-$ver-all.tar.gz" \ + "$USER_HOME"/Backups/*/icons/Qogir-icons-$ver-all.tar.gz; do + if [ -f "$cand" ]; then tarball=$cand; break; fi + done + + if [ -n "$tarball" ]; then + # The bundled archive is the icon tree of the reference system + # where the icons work. Always extract it, so that a stale, + # partial or wrongly linked tree can never survive. + if [ "$tarball" = "$SCRIPT_DIR/assets/Qogir-icons-$ver-all.tar.gz" ] \ + && ! printf '%s %s\n' "$bundle_sha" "$tarball" \ + | sha256sum -c - >/dev/null 2>&1; then + die "The bundled Qogir archive is corrupted (checksum mismatch). Copy desktop-setup again." + fi + info "Installing Qogir icons from the bundled archive: $tarball" + rm -rf "$dest/Qogir-Manjaro" "$dest/Qogir-Manjaro-Dark" + if ! tar -xzf "$tarball" -C "$dest" Qogir-Manjaro Qogir-Manjaro-Dark; then + die "The bundled Qogir archive could not be extracted." + fi + elif qogir_icons_complete; then + ok "Qogir icons are already fully installed." + else + # Remove incomplete or stale leftovers so that no mixed symlinks + # remain. + rm -rf "$dest/Qogir-Manjaro" "$dest/Qogir-Manjaro-Dark" + + info "Downloading Qogir icons $ver from GitHub …" + tmp=$(mktemp -d) + if ! curl -fL --retry 3 -o "$tmp/qogir.tar.gz" \ + "https://github.com/vinceliuice/Qogir-icon-theme/archive/refs/tags/$ver.tar.gz"; then + rm -rf "$tmp" + die "Qogir download failed and no bundled archive is available." + fi + if ! printf '%s %s\n' "$sha" "$tmp/qogir.tar.gz" | sha256sum -c - >/dev/null 2>&1; then + rm -rf "$tmp" + die "Checksum of the Qogir source does not match." + fi + if ! tar -xzf "$tmp/qogir.tar.gz" -C "$tmp"; then + rm -rf "$tmp" + die "Qogir archive could not be extracted." + fi + # Only the two required variants (light/dark) instead of all 9. + # Note: in the Qogir script (tag 2025-02-15) the colour table is + # swapped – "-c dark" produces "-Light" there. Patch the order; + # if the pattern no longer matches, build all Manjaro variants + # and remove the unwanted light one afterwards. + qogir_dir="$tmp/Qogir-icon-theme-$ver" + if grep -qx "COLOR_VARIANTS=('' '-Light' '-Dark')" "$qogir_dir/install.sh"; then + sed -i "s/^COLOR_VARIANTS=('' '-Light' '-Dark')\$/COLOR_VARIANTS=('' '-Dark' '-Light')/" \ + "$qogir_dir/install.sh" + if ! ( cd "$qogir_dir" && ./install.sh -d "$dest" -t manjaro -c standard dark ); then + rm -rf "$tmp" + die "Qogir installation script failed." + fi + else + if ! ( cd "$qogir_dir" && ./install.sh -d "$dest" -t manjaro -c all ); then + rm -rf "$tmp" + die "Qogir installation script failed." + fi + rm -rf "$dest/Qogir-Manjaro-Light" + fi + rm -rf "$tmp" + fi + + # Always rebuild the cache – a missing or stale icon-theme.cache is one + # of the causes of wrong Thunar icons. + local d + for d in Qogir-Manjaro Qogir-Manjaro-Dark; do + if [ -e "$dest/$d/index.theme" ]; then + gtk-update-icon-cache -f "$dest/$d" >/dev/null 2>&1 || true + fi + done + + if qogir_icons_complete; then + ok "Qogir icons installed." + else + die "Qogir icons are incomplete after installation – Thunar would show Adwaita icons." + fi +} + +# libXcursor (labwc/mouse pointer, GTK under X11) only searches +# ~/.icons, /usr/share/icons and /usr/share/pixmaps – not +# ~/.local/share/icons. Therefore point ~/.icons at the icon directory +# (as on the reference system). +ensure_cursor_theme_link() { + local dest="$USER_HOME/.local/share/icons" + local icons_link="$USER_HOME/.icons" + local d names + + [ -d "$dest" ] || return 0 + + # Already ~/.icons -> ~/.local/share/icons? Then everything is done. + if [ -L "$icons_link" ]; then + if [ "$(readlink -f "$icons_link")" = "$(readlink -f "$dest")" ]; then + return 0 + fi + warn "~/.icons already points to $(readlink "$icons_link") – Qogir cursors will not be linked." + return 0 + fi + + if [ ! -e "$icons_link" ]; then + if ln -s "$dest" "$icons_link"; then + ok "~/.icons -> ~/.local/share/icons linked." + else + warn "Could not create ~/.icons as a symlink." + fi + return 0 + fi + + # Legacy install: a real directory containing only our two Qogir + # links. Replace it with the whole-directory symlink so that the + # relative links of Qogir-Manjaro-Dark resolve as well. + if [ -d "$icons_link" ]; then + names=$(ls -A "$icons_link" 2>/dev/null | sort | tr '\n' ' ') + if [ "$names" = "Qogir-Manjaro Qogir-Manjaro-Dark " ] \ + && [ -L "$icons_link/Qogir-Manjaro" ] \ + && [ -L "$icons_link/Qogir-Manjaro-Dark" ]; then + rm -rf "$icons_link" + if ln -s "$dest" "$icons_link"; then + ok "~/.icons switched to ~/.local/share/icons." + return 0 + fi + fi + fi + + # Real directory with its own content: leave it alone, only add the + # two Qogir variants as links. + mkdir -p "$icons_link" + for d in Qogir-Manjaro Qogir-Manjaro-Dark; do + [ -d "$dest/$d" ] || continue + ln -sfn "$dest/$d" "$icons_link/$d" + done +} + +# ---------------------------------------------------------------- Fonts + +install_fonts() { + local dest="$USER_HOME/.local/share/fonts/NerdFonts" + local confdir="$USER_HOME/.config/fontconfig/conf.d" + local tmp found + + mkdir -p "$dest" "$confdir" + + if [ -f "$dest/SymbolsNerdFont-Regular.ttf" ] \ + && [ -f "$dest/SymbolsNerdFontMono-Regular.ttf" ]; then + ok "Symbols Nerd Font is already installed – skipping." + fc-cache -f >/dev/null 2>&1 || true + return 0 + fi + + info "Downloading Symbols Nerd Font …" + tmp=$(mktemp -d) + if curl -fL --retry 3 -o "$tmp/nerd.tar.xz" \ + "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/NerdFontsSymbolsOnly.tar.xz"; then + tar -xf "$tmp/nerd.tar.xz" -C "$tmp" + cp -f "$tmp/SymbolsNerdFont-Regular.ttf" \ + "$tmp/SymbolsNerdFontMono-Regular.ttf" "$dest/" + [ -f "$tmp/10-nerd-font-symbols.conf" ] && \ + cp -f "$tmp/10-nerd-font-symbols.conf" "$confdir/" + ok "Nerd Fonts installed." + else + warn "Download failed – trying an existing backup …" + found=0 + local cand + for cand in "$USER_HOME"/Backups/*/dotfiles-*.tar.gz; do + [ -f "$cand" ] || continue + rm -rf "$tmp/backup"; mkdir -p "$tmp/backup" + if tar -xzf "$cand" -C "$tmp/backup" \ + .local/share/fonts/NerdFonts \ + .config/fontconfig/conf.d/10-nerd-font-symbols.conf 2>/dev/null; then + cp -f "$tmp/backup/.local/share/fonts/NerdFonts/"*.ttf "$dest/" 2>/dev/null || continue + cp -f "$tmp/backup/.config/fontconfig/conf.d/10-nerd-font-symbols.conf" \ + "$confdir/" 2>/dev/null || true + found=1; break + fi + done + if [ "$found" -eq 1 ]; then + ok "Nerd Fonts restored from backup." + else + warn "Nerd Fonts are still missing; Waybar symbols may appear as boxes." + fi + fi + rm -rf "$tmp" + fc-cache -f >/dev/null 2>&1 || true +} + +# ---------------------------------------------------------------- Dotfiles + +backup_existing() { + local src=$1 rel target + while IFS= read -r -d '' target; do + rel=${target#"$src"/} + target="$USER_HOME/$rel" + [ -e "$target" ] || [ -L "$target" ] || continue + mkdir -p "$BACKUP_DIR/$(dirname -- "$rel")" + cp -a -- "$target" "$BACKUP_DIR/$rel" 2>/dev/null || true + done < <(find "$src" -type f -print0) +} + +escape_sed_replacement() { + printf '%s' "$1" | sed -e 's/[\\&|]/\\&/g' +} + +# Returns the nvm bin path including a trailing colon, or "". +detect_node_prefix() { + local node_bin node_dir + node_bin=$(command -v node 2>/dev/null || true) + if [ -z "$node_bin" ] && [ -d "$USER_HOME/.nvm/versions/node" ]; then + node_bin=$(find "$USER_HOME/.nvm/versions/node" -maxdepth 3 \ + -type f -name node -perm -u+x 2>/dev/null \ + | sort -V | tail -n 1 || true) + fi + [ -n "$node_bin" ] || return 0 + node_dir=$(dirname -- "$node_bin") + case "$node_dir" in + "$USER_HOME"/.nvm/versions/node/*/bin) printf '%s:' "$node_dir" ;; + esac + return 0 +} + +substitute_placeholders() { + local node_prefix=$1 f home_esc node_esc + home_esc=$(escape_sed_replacement "$USER_HOME") + node_esc=$(escape_sed_replacement "$node_prefix") + + while IFS= read -r -d '' f; do + grep -Iq . "$f" 2>/dev/null || continue + if grep -q '@HOME@\|@NODE_BIN@' "$f" 2>/dev/null; then + sed -i -e "s|@HOME@|$home_esc|g" \ + -e "s|@NODE_BIN@|$node_esc|g" "$f" + fi + done < <(find "$USER_HOME/.config" "$USER_HOME/.local/bin" -type f -print0 2>/dev/null) +} + +apply_dotfiles() { + local stamp node_prefix + node_prefix=$(detect_node_prefix) + stamp=$(date +%Y%m%d-%H%M%S) + BACKUP_DIR="$USER_HOME/Backups/desktop-setup-$stamp" + mkdir -p "$BACKUP_DIR" + + info "Backing up existing files to $BACKUP_DIR …" + backup_existing "$SCRIPT_DIR/home" + backup_existing "$SCRIPT_DIR/themes/$MODE/home" + + info "Copying dotfiles …" + cp -a "$SCRIPT_DIR/home/." "$USER_HOME/" + cp -a "$SCRIPT_DIR/themes/$MODE/home/." "$USER_HOME/" + + install -Dm644 "$SCRIPT_DIR/assets/labwc-dark.png" \ + "$USER_HOME/.local/share/backgrounds/labwc-dark.png" + install -Dm644 "$SCRIPT_DIR/assets/labwc-light.png" \ + "$USER_HOME/.local/share/backgrounds/labwc-light.png" + + chmod 755 "$USER_HOME/.local/bin/screenshot" \ + "$USER_HOME/.local/bin/session-menu" \ + "$USER_HOME/.local/bin/greeter-theme" \ + "$USER_HOME/.local/bin/set-gtk-settings" \ + "$USER_HOME/.local/bin/update-gtk4-dark-css" \ + "$USER_HOME/.local/bin/idle-action" 2>/dev/null || true + + substitute_placeholders "$node_prefix" + + # Avoid an empty backup directory + if [ -z "$(find "$BACKUP_DIR" -type f -print -quit)" ]; then + rmdir "$BACKUP_DIR" 2>/dev/null || true + BACKUP_DIR="" + fi + + ok "Dotfiles copied." +} + +# ---------------------------------------------------------------- Rusticl + +setup_rusticl() { + [ "$DO_RUSTICL" -eq 1 ] || return 0 + + local vendors="$USER_HOME/.config/OpenCL/vendors" + local env_file="$USER_HOME/.config/labwc/environment" + local envd_file="$USER_HOME/.config/environment.d/90-labwc.conf" + local fish_file="$USER_HOME/.config/fish/config.fish" + + info "Setting up Rusticl (OpenCL via Mesa/radeonsi) …" + mkdir -p "$vendors" + printf 'libRusticlOpenCL.so.1\n' > "$vendors/rusticl.icd" + + if [ -f "$env_file" ] && ! grep -q 'RUSTICL_ENABLE' "$env_file"; then + cat >> "$env_file" <> "$envd_file" <> "$fish_file" <<'EOF' + +# ---------- Rusticl (OpenCL) ---------- +set -gx RUSTICL_ENABLE radeonsi +set -gx OCL_ICD_VENDORS "$HOME/.config/OpenCL/vendors" +EOF + fi + + ok "Rusticl configured (active after the next login)." +} + +# ---------------------------------------------------------------- VM renderer + +setup_vm_renderer() { + [ "$DO_VM_RENDERER" -eq 1 ] || return 0 + + local env_file="$USER_HOME/.config/labwc/environment" + + info "Setting pixman as the software renderer for the VM …" + mkdir -p "$(dirname -- "$env_file")" + touch "$env_file" + + if grep -qE '^[[:space:]]*WLR_RENDERER=' "$env_file"; then + # Replace an existing line so that no duplicate values are created. + sed -i 's|^[[:space:]]*WLR_RENDERER=.*|WLR_RENDERER=pixman|' "$env_file" + else + cat >> "$env_file" <<'EOF' + +# Virtual machine: software renderer (pixman) instead of GPU/GL. +# Prevents graphics glitches and black windows when the VM does not +# provide working 3D acceleration. +WLR_RENDERER=pixman +EOF + fi + + ok "pixman renderer set (active after the next login)." +} + +# ---------------------------------------------------------------- GTK + +install_gtk4_dark_css() { + local script="$USER_HOME/.local/bin/update-gtk4-dark-css" + local gtk_css="$USER_HOME/.config/gtk-4.0/gtk.css" + local css_dir="$USER_HOME/.config/gtk-4.0/arc-dark" + + if [ "$MODE" != "dark" ]; then + rm -f "$gtk_css" + rm -rf "$css_dir" + ok "GTK4 uses the light theme (no Arc-Dark user CSS)." + return 0 + fi + + [ -x "$script" ] || { warn "update-gtk4-dark-css is missing – GTK4 remains Arc-Darker."; return 0; } + + if "$script"; then + ok "GTK4 applications use Arc-Dark (GTK3 remains Arc-Darker)." + else + warn "GTK4 Arc-Dark CSS could not be generated." + fi +} + +# Removes a marked block from a text file. Used to take back the Thunar +# override when switching back to the dark design. +strip_managed_block() { + local file=$1 begin=$2 end=$3 + [ -f "$file" ] || return 0 + grep -qF "$begin" "$file" || return 0 + awk -v b="$begin" -v e="$end" ' + $0 == b { skip = 1; next } + $0 == e { skip = 0; next } + !skip { print } + ' "$file" > "$file.tmp.$$" && mv "$file.tmp.$$" "$file" +} + +# Arc ships a Thunar-specific rule that paints the shortcuts pane dark +# in *every* variant, including the light one: +# .thunar scrolledwindow.sidebar treeview.view { +# background: rgba(53, 57, 69, 0.95); color: #BAC3CF; } +# That is intentional in Arc (Nautilus/Nemo look the same), but it +# breaks the light design. A user CSS block restores the light palette. +# It is appended to an existing gtk.css so custom rules are preserved. +install_thunar_light_css() { + local dir="$USER_HOME/.config/gtk-3.0" + local css="$dir/gtk.css" + local begin='/* BEGIN desktop-setup thunar-light */' + local end='/* END desktop-setup thunar-light */' + + if [ "$MODE" = light ]; then + mkdir -p "$dir" + strip_managed_block "$css" "$begin" "$end" + cat >> "$css" <<'EOF' + +/* BEGIN desktop-setup thunar-light */ +/* Arc paints Thunar's shortcuts pane dark even in the light theme. + * These rules restore the light surface colour (#f4f9ff). */ +.thunar scrolledwindow.sidebar treeview.view { + background: #f4f9ff; + color: #232629; +} +.thunar scrolledwindow.sidebar treeview.view:hover { + background: #e7f2ff; +} +.thunar scrolledwindow.sidebar treeview.view:selected, +.thunar scrolledwindow.sidebar treeview.view:active { + background: #d0ebff; + color: #1864ab; +} +.thunar scrolledwindow.sidebar separator.sidebar { + background-color: #cfe0f3; +} +/* END desktop-setup thunar-light */ +EOF + ok "Thunar sidebar: light Arc override installed." + else + if [ -f "$css" ] && grep -qF "$begin" "$css"; then + strip_managed_block "$css" "$begin" "$end" + if ! grep -q '[^[:space:]]' "$css"; then + rm -f "$css" + fi + ok "Thunar sidebar: light override removed (dark theme)." + fi + fi +} + +# Runs a command inside a D-Bus session. dconf – the persistent store +# behind GSettings – only writes to ~/.config/dconf/user via D-Bus. +# Without a session bus the values stay in memory and are lost at logout. +# Reads one variable from the environment of a process. The installer is +# often started over SSH, where the shell has none of the session +# variables; the process that owns the graphical session does. +proc_env() { + local pid=$1 var=$2 + tr '\0' '\n' < "/proc/$pid/environ" 2>/dev/null \ + | awk -v k="$var" 'index($0, k "=") == 1 { sub(/^[^=]*=/, ""); print; exit }' +} + +# Prints " " of the process that owns the graphical session. +session_process() { + local cand pid + for cand in labwc sway xfwm4 gnome-shell kwin_wayland plasmashell; do + pid=$(pgrep -u "$(id -u)" -x "$cand" 2>/dev/null | head -n 1) + if [ -n "$pid" ]; then + printf '%s %s\n' "$cand" "$pid" + return 0 + fi + done + return 1 +} + +# Adopts the environment of the real graphical session, but only for +# variables the current shell does not already have. This makes +# gsettings/dconf, the GTK self-test and reload_session act on the +# session that is actually running – even when started via SSH. +adopt_session_env() { + local sp="" pid="" v="" val="" + sp=$(session_process) || return 1 + pid=${sp##* } + for v in XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS WAYLAND_DISPLAY DISPLAY \ + XDG_CURRENT_DESKTOP XDG_SESSION_TYPE; do + [ -n "${!v:-}" ] && continue + val=$(proc_env "$pid" "$v") + [ -n "$val" ] && export "$v=$val" + done + # The compositor itself usually has no WAYLAND_DISPLAY; use its socket. + if [ -z "${WAYLAND_DISPLAY:-}" ] && [ -z "${DISPLAY:-}" ]; then + local rt=${XDG_RUNTIME_DIR:-/run/user/$(id -u)} sock + for sock in "$rt"/wayland-*; do + [ -S "$sock" ] || continue + case "$sock" in *.lock) continue ;; esac + export XDG_RUNTIME_DIR="$rt" + export WAYLAND_DISPLAY=${sock##*/} + break + done + fi + return 0 +} + +# Prints what the graphical session really uses. This is the decisive +# information when the installer itself runs in an SSH shell: GTK and +# Thunar read their settings from the session, not from that shell. +diagnose_session() { + local sp="" name="" pid="" v="" val="" found=0 + info "Graphical session (what GTK/Thunar really use) …" + + if sp=$(session_process); then + name=${sp% *}; pid=${sp##* } + printf ' compositor = %s (pid %s)\n' "$name" "$pid" + else + info "No graphical session yet (fresh installation) – settings are stored for the next login." + fi + + # Print the values the installer will actually use. They were adopted + # from the session above when the shell itself had none (SSH). + for v in XDG_CURRENT_DESKTOP XDG_SESSION_TYPE WAYLAND_DISPLAY DISPLAY \ + XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS; do + val=${!v:-} + if [ -z "$val" ] && [ -n "$pid" ]; then + val=$(proc_env "$pid" "$v") + fi + printf ' %-17s = %s\n' "$v" "${val:-(unset)}" + done + + # XSETTINGS daemons (Xfce, GNOME, xsettingsd) override the icon theme + # of GTK3 programs such as Thunar. + for v in xfsettingsd xsettingsd gsd-xsettings gnome-settings-daemon; do + if pgrep -x "$v" >/dev/null 2>&1; then + warn "$v is running and may override the GTK icon theme (XSETTINGS)." + found=1 + fi + done + if [ "$found" -eq 0 ]; then + ok "No competing XSETTINGS daemon found." + fi + return 0 +} + +run_with_dbus() { + # Prefer the bus of the running session, so that dconf-service and + # the already running GTK programs see the new values immediately. + if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ]; then + adopt_session_env >/dev/null 2>&1 || true + fi + if [ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ]; then + "$@" + elif command -v dbus-run-session >/dev/null 2>&1; then + dbus-run-session -- "$@" + else + "$@" + fi +} + +# Reads a GSettings value without quotes. +gsettings_value() { + run_with_dbus gsettings get "$1" "$2" 2>/dev/null \ + | sed -e "s/^'//" -e "s/'$//" +} + +# Installs the dconf settings captured from the reference system where +# the Qogir icons work. This is the authoritative state: it guarantees +# the icon theme even if writing through GSettings does not persist. +install_dconf_theme_db() { + local src_db="$SCRIPT_DIR/assets/dconf-$MODE-user" + local src_conf="$SCRIPT_DIR/assets/dconf-$MODE.conf" + local dir="$USER_HOME/.config/dconf" + local dst="$dir/user" + + # Target the bus of the running session, otherwise dconf-service of + # the session keeps its old in-memory state and can overwrite the file. + adopt_session_env >/dev/null 2>&1 || true + + [ -f "$src_db" ] || { warn "Bundled dconf database is missing: $src_db"; return 1; } + + mkdir -p "$dir" + chmod 700 "$dir" 2>/dev/null || true + + if [ -e "$dst" ]; then + local backup="$USER_HOME/Backups/desktop-setup-dconf-$(date +%Y%m%d-%H%M%S)" + mkdir -p "$backup" + cp -a "$dst" "$backup/user" 2>/dev/null || true + info "Backed up existing dconf database to $backup/user" + fi + + # Preferred: load the readable reference dump through the dconf + # service. The service then owns the state and persists it itself, + # so a later flush cannot undo our values. + if [ -f "$src_conf" ] && command -v dconf >/dev/null 2>&1; then + if run_with_dbus dconf load / < "$src_conf"; then + ok "Loaded the reference dconf settings ($MODE)." + return 0 + fi + warn "dconf load failed – installing the database file instead." + fi + + # Fallback: install the binary database captured from the reference + # system. Stop the running service first so it cannot write its old + # in-memory database over the file. + if command -v systemctl >/dev/null 2>&1; then + systemctl --user stop dconf.service >/dev/null 2>&1 || true + fi + # systemctl may return before the process has really exited. Wait for + # it, otherwise the dying service overwrites the file again. + local i + for i in 1 2 3 4 5 6 7 8 9 10; do + pgrep -x dconf-service >/dev/null 2>&1 || break + sleep 0.2 + done + if pgrep -x dconf-service >/dev/null 2>&1; then + pkill -x dconf-service >/dev/null 2>&1 || true + sleep 0.3 + fi + + install -m 600 "$src_db" "$dst" + ok "Installed the reference dconf database ($MODE)." + + if command -v systemctl >/dev/null 2>&1; then + systemctl --user start dconf.service >/dev/null 2>&1 || true + fi + return 0 +} + +# Qogir ships SVG icons only. GTK3 renders them through the gdk-pixbuf +# SVG loader from librsvg2-common. That package is only a Recommends of +# libgtk-3-0t64, so `apt-get --no-install-recommends` (used by this +# installer) leaves it out – Thunar then shows generic icons even though +# the theme name and the icon files are perfectly correct. +svg_loader_ok() { + local f="" found=0 + # Fast path that also works without python3-gi: the loader library + # must be installed. + for f in /usr/lib/*/gdk-pixbuf-2.0/*/loaders/libpixbufloader[_-]svg.so \ + /usr/lib/gdk-pixbuf-2.0/*/loaders/libpixbufloader[_-]svg.so; do + if [ -e "$f" ]; then + found=1 + break + fi + done + [ "$found" -eq 1 ] || return 1 + + f="" + for f in "$USER_HOME/.local/share/icons/Qogir-Manjaro-Dark/48/places/folder.svg" \ + "$USER_HOME/.local/share/icons/Qogir-Manjaro/48/places/folder.svg"; do + [ -f "$f" ] && break + done + [ -f "$f" ] || return 0 # nothing to test yet + command -v python3 >/dev/null 2>&1 || return 0 + python3 -c 'import gi; gi.require_version("GdkPixbuf", "2.0")' >/dev/null 2>&1 \ + || return 0 + python3 - "$f" <<'PY' >/dev/null 2>&1 +import sys +import gi +gi.require_version("GdkPixbuf", "2.0") +from gi.repository import GdkPixbuf +try: + GdkPixbuf.Pixbuf.new_from_file(sys.argv[1]) +except Exception: + raise SystemExit(1) +PY +} + +ensure_svg_loader() { + if svg_loader_ok; then + return 0 + fi + + warn "SVG icons cannot be rendered: the gdk-pixbuf SVG loader is missing." + warn "Qogir uses SVG only – Thunar would show generic icons." + if ! command -v apt-get >/dev/null 2>&1; then + warn "Install 'librsvg2-common' manually and restart Thunar." + return 1 + fi + + info "Installing librsvg2-common (SVG support for GTK/Thunar) …" + if sudo env DEBIAN_FRONTEND=noninteractive \ + apt-get install -y librsvg2-common; then + ok "librsvg2-common installed." + else + warn "Installation failed. Run: sudo apt install librsvg2-common" + return 1 + fi + + if svg_loader_ok; then + ok "SVG icons can be rendered now." + else + warn "SVG loader still not usable – a logout/login may be required." + fi + return 0 +} + +# Verifies with GTK3 itself that the installed theme really resolves +# icons. Only runs when a display is reachable; it never aborts the +# installation. +verify_icon_theme() { + local theme=$1 + command -v python3 >/dev/null 2>&1 || return 0 + python3 -c 'import gi; gi.require_version("Gtk", "3.0")' >/dev/null 2>&1 \ + || return 0 + + # When started over SSH, the shell has no display and no session bus. + # Adopt them from the process that owns the graphical session, so the + # test reflects what Thunar really sees. + adopt_session_env >/dev/null 2>&1 || true + + if [ -z "${WAYLAND_DISPLAY:-}" ] && [ -z "${DISPLAY:-}" ]; then + info "GTK3 icon self-test skipped (no graphical display reachable)." + return 0 + fi + export GDK_BACKEND=${GDK_BACKEND:-wayland,x11} + + info "GTK3 icon self-test ($theme) …" + local out + out=$(python3 - "$theme" <<'PY' || true +import sys +import gi +gi.require_version("Gtk", "3.0") +from gi.repository import Gtk + +theme = sys.argv[1] +settings = Gtk.Settings.get_default() +if settings is None: + print(" GTK could not open a display.") + raise SystemExit(0) + +print(" gtk-icon-theme-name = %s" % settings.get_property("gtk-icon-theme-name")) +icons = Gtk.IconTheme.get_default() +print(" search path = %s" % icons.get_search_path()) +for name in ("folder", "org.xfce.thunar", "pan-down-symbolic"): + info = icons.lookup_icon(name, 48, 0) + if info is None: + print(" %-20s-> NOT FOUND" % name) + continue + try: + pix = info.load_icon() + print(" %-20s-> %s (%dx%d)" % (name, info.get_filename(), + pix.get_width(), pix.get_height())) + except Exception as exc: + print(" %-20s-> %s (LOAD FAILED: %s)" % (name, info.get_filename(), exc)) +PY +) + printf '%s\n' "$out" + + # Turn the self-test into an explicit warning – the log is the only + # diagnostic available when the installer runs over SSH. + if printf '%s\n' "$out" | grep -q 'gtk-icon-theme-name = Adwaita'; then + warn "GTK in the running session resolves 'Adwaita' instead of '$theme'." + warn "The theme value is stored, but the session does not use it (logout/login or wrong session)." + elif printf '%s\n' "$out" | grep -q 'LOAD FAILED'; then + warn "GTK cannot render the icons of '$theme' (missing SVG loader)." + warn "Install librsvg2-common, then restart Thunar." + elif printf '%s\n' "$out" | grep -q 'NOT FOUND'; then + warn "GTK cannot resolve at least one icon of '$theme' in the running session." + elif printf '%s\n' "$out" | grep -q 'gtk-icon-theme-name =' \ + && ! printf '%s\n' "$out" | grep -q "folder .*-> .*/$theme/"; then + # GTK silently falls back to hicolor/built-in icons when it cannot + # load the SVG files – the theme name still looks correct. + warn "GTK resolves the 'folder' icon from outside '$theme'." + warn "The theme is set, but its icons are not usable (missing SVG loader or incomplete tree)." + warn "Fix: sudo apt install librsvg2-common" + fi +} + +apply_gtk() { + local script="$USER_HOME/.local/bin/set-gtk-settings" + [ -x "$script" ] || { warn "set-gtk-settings is missing – GTK values not set."; return 0; } + + local expected=Qogir-Manjaro-Dark + [ "$MODE" = dark ] || expected=Qogir-Manjaro + + info "Setting GTK, icon, cursor and font values ($MODE) …" + adopt_session_env >/dev/null 2>&1 || true + diagnose_session + local sess_desktop=${XDG_CURRENT_DESKTOP:-} sp + if [ -z "$sess_desktop" ]; then + sp=$(session_process || true) + sess_desktop=${sp%% *} + fi + case "$sess_desktop" in + ""|labwc|sway|*labwc*|*Labwc*|*sway*|*Sway*) ;; + *) warn "The graphical session is '$sess_desktop', not labwc/sway. Xfce/GNOME settings may override the icon theme." ;; + esac + + # dconf is the persistent store behind GSettings. Without the + # backend the values stay in memory – GTK/Thunar fall back to + # Adwaita after the next login. + if ! dpkg -s dconf-gsettings-backend >/dev/null 2>&1 \ + || ! dpkg -s dconf-service >/dev/null 2>&1; then + if command -v sudo >/dev/null 2>&1 && sudo -n true 2>/dev/null; then + info "Installing dconf (persistent GSettings store) …" + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y \ + dconf-gsettings-backend dconf-service >/dev/null 2>&1 \ + || warn "dconf could not be installed." + else + warn "dconf-gsettings-backend is missing – GSettings will not persist." + fi + fi + + # Write through GSettings first (updates a running session and keeps + # unrelated keys). This can fail silently when the installer has no + # usable D-Bus session, so it is not relied upon. + if ! run_with_dbus "$script" "$MODE"; then + warn "GSettings could not be set completely." + fi + + # Install the reference database from the working system verbatim. + # This is what actually guarantees Qogir in Thunar and all GTK apps. + install_dconf_theme_db || true + + # Verify the final state. + local got + got=$(gsettings_value org.gnome.desktop.interface icon-theme) + if [ "$got" = "$expected" ]; then + ok "GSettings: icon-theme = $got (persisted)." + else + warn "GSettings: icon-theme is '${got:-unknown}' instead of '$expected'." + warn "The reference database is installed; the value will be read at the next login." + fi + + # Light mode uses the normal Arc theme; dark mode uses Arc-Darker + # for GTK3 (dark headerbars) plus Arc-Dark for GTK4 via user CSS. + local expected_gtk=Arc-Darker + [ "$MODE" = dark ] || expected_gtk=Arc + got=$(gsettings_value org.gnome.desktop.interface gtk-theme) + if [ "$got" = "$expected_gtk" ]; then + ok "GSettings: gtk-theme = $got (persisted)." + else + warn "GSettings: gtk-theme is '${got:-unknown}' instead of '$expected_gtk'." + warn "The reference database is installed; the value will be read at the next login." + fi + + # Qogir icons are SVG; without librsvg2-common Thunar renders only + # generic placeholders. Install it before the self-test. + ensure_svg_loader || true + + verify_icon_theme "$expected" + + install_gtk4_dark_css + install_thunar_light_css +} + +# ---------------------------------------------------------------- Greetd + +write_greeter_config() { + local theme_file="$USER_HOME/.config/tuigreet/theme.conf" + local theme tmp conf=/etc/greetd/config.toml + + [ -r "$theme_file" ] || { warn "Missing: $theme_file"; return 1; } + theme=$(tr -d '\n' < "$theme_file") + if [ -z "$theme" ] || printf '%s' "$theme" | LC_ALL=C grep -q '[^A-Za-z0-9=;.#_-]'; then + warn "Invalid tuigreet theme in $theme_file" + return 1 + fi + + tmp=$(mktemp) + cat > "$tmp" < "$tmp" <<'EOF' +// Allow the greeter user _greetd to shut down or reboot the system. +// The greeter does not run in an active logind session, so the default +// rule (allow_active=yes) does not apply. +polkit.addRule(function(action, subject) { + if (subject.user != "_greetd") + return; + + if (action.id == "org.freedesktop.login1.power-off" || + action.id == "org.freedesktop.login1.power-off-multiple-sessions" || + action.id == "org.freedesktop.login1.reboot" || + action.id == "org.freedesktop.login1.reboot-multiple-sessions") { + return polkit.Result.YES; + } +}); +EOF + + if [ -f "$rule" ]; then + sudo cp -a "$rule" "$rule.bak.$(date +%Y%m%d-%H%M%S)" + fi + sudo install -Dm644 "$tmp" "$rule" + rm -f "$tmp" + ok "polkit rule for greeter power written: $rule" +} + +apply_greeter() { + command -v tuigreet >/dev/null 2>&1 \ + || { warn "tuigreet is missing – skipping the greeter."; return 0; } + + local dm other="" + for dm in lightdm gdm3 sddm ly; do + if systemctl is-enabled "$dm" >/dev/null 2>&1; then other=$dm; break; fi + done + + write_greeter_config || return 0 + write_greeter_polkit + + if [ -n "$other" ]; then + warn "Display manager '$other' is enabled." + if ask_yes_no "Enable greetd instead and disable '$other'?" n; then + sudo systemctl disable --now "$other" >/dev/null 2>&1 \ + || warn "Could not disable '$other'." + sudo systemctl enable greetd >/dev/null 2>&1 \ + && ok "greetd is enabled (reboot required)." \ + || warn "greetd could not be enabled." + else + warn "greetd will not be enabled – '$other' remains the login screen." + fi + else + sudo systemctl enable greetd >/dev/null 2>&1 \ + && ok "greetd is enabled (reboot required)." \ + || warn "greetd could not be enabled." + fi +} + +# ---------------------------------------------------------------- Keyring + +install_keyring_packages() { + info "Installing keyring packages …" + sudo apt-get update >/dev/null 2>&1 || warn "apt package lists could not be updated." + if sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + libpam-gnome-keyring libsecret-tools; then + ok "libpam-gnome-keyring and libsecret-tools installed." + else + warn "Keyring packages could not be installed." + fi +} + +setup_keyring() { + info "Setting up gnome-keyring as the secret service …" + + # PAM module: installed via APT_PACKAGES (libpam-gnome-keyring). + local module + module=$(dpkg -L libpam-gnome-keyring 2>/dev/null \ + | grep '/pam_gnome_keyring\.so$' | head -n 1 || true) + if [ -n "$module" ] && [ -e "$module" ]; then + ok "PAM module pam_gnome_keyring present." + else + warn "pam_gnome_keyring.so is missing – the keyring will not be unlocked automatically at login." + fi + + # greetd PAM: unlock the keyring with the password at login. + local pam=/etc/pam.d/greetd + if [ -f "$pam" ]; then + local tmp changed=0 + tmp=$(mktemp) + cp "$pam" "$tmp" + if ! grep -qE '^[[:space:]]*-?auth[[:space:]]+optional[[:space:]]+pam_gnome_keyring\.so' "$tmp"; then + printf '\n# desktop-setup: unlock keyring at login\n-auth optional pam_gnome_keyring.so\n' >>"$tmp" + changed=1 + fi + if ! grep -qE '^[[:space:]]*-?session[[:space:]]+optional[[:space:]]+pam_gnome_keyring\.so' "$tmp"; then + printf -- '-session optional pam_gnome_keyring.so auto_start\n' >>"$tmp" + changed=1 + fi + if [ "$changed" -eq 1 ]; then + sudo cp -a "$pam" "$pam.desktop-setup.bak.$(date +%Y%m%d-%H%M%S)" + sudo install -m 644 "$tmp" "$pam" + ok "PAM for greetd extended (keyring is unlocked at login)." + else + ok "PAM for greetd already configured." + fi + rm -f "$tmp" + else + warn "$pam is missing – skipping keyring PAM." + fi + + # Portal configuration: selects gnome-keyring as the secret backend. + local portal="$USER_HOME/.config/xdg-desktop-portal/labwc-portals.conf" + if [ -f "$portal" ]; then + ok "Portal configuration present." + elif [ -f "$SCRIPT_DIR/home/.config/xdg-desktop-portal/labwc-portals.conf" ]; then + install -Dm644 "$SCRIPT_DIR/home/.config/xdg-desktop-portal/labwc-portals.conf" "$portal" + ok "Portal configuration created: $portal" + else + warn "Portal configuration is missing – Flatpak apps may not find the secret service." + fi + + # Restart the running portal so that the configuration takes effect. + if systemctl --user is-active --quiet xdg-desktop-portal.service 2>/dev/null; then + systemctl --user restart xdg-desktop-portal.service >/dev/null 2>&1 \ + && ok "xdg-desktop-portal restarted." \ + || warn "xdg-desktop-portal could not be restarted." + fi + + ok "Keyring configured – the keyring is unlocked after the next login." +} + +# ---------------------------------------------------------------- Flatpak + +install_flatpak_apps() { + command -v flatpak >/dev/null 2>&1 \ + || { warn "flatpak is missing – skipping Flatpak apps."; return 0; } + + info "Setting up Flathub …" + sudo flatpak remote-add --if-not-exists flathub \ + https://flathub.org/repo/flathub.flatpakrepo \ + || warn "Flathub could not be added." + + local id + for id in org.mozilla.firefox org.gnome.Evince com.github.tchx84.Flatseal; do + if flatpak info "$id" >/dev/null 2>&1; then + ok "$id is already installed." + else + info "Installing $id …" + if sudo flatpak install -y flathub "$id"; then + ok "$id installed." + else + warn "$id could not be installed." + fi + fi + done + + # Firefox: GTK window buttons as a fallback in case the portal does + # not pass the global GSettings value into the Flatpak sandbox. + local app_cfg="$USER_HOME/.var/app/org.mozilla.firefox/config" + mkdir -p "$app_cfg/gtk-3.0" "$app_cfg/gtk-4.0" + printf '[Settings]\ngtk-decoration-layout=:minimize,maximize,close\n' \ + > "$app_cfg/gtk-3.0/settings.ini" + printf '[Settings]\ngtk-decoration-layout=:minimize,maximize,close\n' \ + > "$app_cfg/gtk-4.0/settings.ini" + + # Short commands in the terminal: firefox, evince, flatseal. + mkdir -p "$USER_HOME/.local/bin" + local pair name app_id + for pair in "firefox:org.mozilla.firefox" \ + "evince:org.gnome.Evince" \ + "flatseal:com.github.tchx84.Flatseal"; do + name=${pair%%:*} + app_id=${pair#*:} + if [ -x "/var/lib/flatpak/exports/bin/$app_id" ]; then + ln -sfn "/var/lib/flatpak/exports/bin/$app_id" \ + "$USER_HOME/.local/bin/$name" + fi + done + + ok "Flatpak apps set up (Firefox, Evince, Flatseal)." +} + +setup_flatpak_overrides() { + command -v flatpak >/dev/null 2>&1 || return 0 + + info "Setting Flatpak overrides …" + + # Signal: default is SIGNAL_PASSWORD_STORE=basic (file). With + # gnome-libsecret, Signal uses the keyring (org.freedesktop.secrets). + # The Flatpak already allows access via its metadata. + if flatpak info org.signal.Signal >/dev/null 2>&1; then + if flatpak override --user \ + --env=SIGNAL_PASSWORD_STORE=gnome-libsecret \ + org.signal.Signal >/dev/null 2>&1; then + ok "Signal uses gnome-keyring (SIGNAL_PASSWORD_STORE=gnome-libsecret)." + else + warn "Signal override could not be set." + fi + fi +} + +# ---------------------------------------------------------------- Services + +apply_services() { + info "Enabling services …" + sudo systemctl enable --now NetworkManager >/dev/null 2>&1 \ + && ok "NetworkManager enabled." \ + || warn "NetworkManager could not be enabled." + + local s + for s in pipewire pipewire-pulse wireplumber; do + systemctl --user enable --now "$s" >/dev/null 2>&1 || \ + warn "User service '$s' could not be enabled." + done + systemctl --user daemon-reload >/dev/null 2>&1 || true + xdg-user-dirs-update >/dev/null 2>&1 || true + ok "Services processed." +} + +# ---------------------------------------------------------------- Node.js (nvm) + +install_node() { + [ "$DO_NODE" -eq 1 ] || return 0 + + local nvm_dir="$USER_HOME/.nvm" installed + export NVM_DIR="$nvm_dir" + + info "Installing Node.js via nvm …" + + if [ ! -s "$nvm_dir/nvm.sh" ]; then + command -v curl >/dev/null 2>&1 \ + || { warn "curl is missing – nvm cannot be downloaded."; return 0; } + + local tmp + tmp=$(mktemp) + if ! curl -fsSL \ + "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" \ + -o "$tmp"; then + rm -f "$tmp" + warn "nvm installation script could not be downloaded." + return 0 + fi + if ! bash "$tmp"; then + rm -f "$tmp" + warn "nvm installation failed." + return 0 + fi + rm -f "$tmp" + ok "nvm $NVM_VERSION installed: $nvm_dir" + else + ok "nvm already present: $nvm_dir" + fi + + # shellcheck disable=SC1090 + . "$nvm_dir/nvm.sh" + + installed=$(nvm ls --no-colors 2>/dev/null \ + | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1 || true) + + if [ -z "$installed" ]; then + info "Installing Node.js LTS …" + if ! nvm install --lts; then + warn "Node.js LTS could not be installed." + return 0 + fi + installed=$(nvm version 2>/dev/null || true) + else + ok "Node.js already present: $installed" + fi + + # Do not override an existing nvm installation: only create the + # default alias if none exists yet. fish resolves it dynamically. + if [ ! -f "$nvm_dir/alias/default" ] && [ -n "$installed" ]; then + nvm alias default "${installed#v}" >/dev/null 2>&1 || true + fi + + nvm use default >/dev/null 2>&1 \ + || nvm use "$installed" >/dev/null 2>&1 \ + || true + + ok "Node.js: $(node --version 2>/dev/null || echo unknown) / npm $(npm --version 2>/dev/null || echo unknown)" +} + +# ---------------------------------------------------------------- opencode + +install_opencode() { + [ "$DO_OPENCODE" -eq 1 ] || return 0 + + local bin="$USER_HOME/.opencode/bin/opencode" + if [ -x "$bin" ]; then + ok "opencode already present: $("$bin" --version 2>/dev/null || echo "$bin")" + return 0 + fi + command -v curl >/dev/null 2>&1 \ + || { warn "curl is missing – opencode cannot be downloaded."; return 0; } + + info "Installing opencode …" + local tmp + tmp=$(mktemp) + if ! curl -fsSL https://opencode.ai/install -o "$tmp"; then + rm -f "$tmp" + warn "opencode installation script could not be downloaded." + return 0 + fi + # --no-modify-path: ~/.config/fish/config.fish already adds + # ~/.opencode/bin to PATH (the dotfiles are installed by this script). + if ! bash "$tmp" --no-modify-path; then + rm -f "$tmp" + warn "opencode installation failed." + return 0 + fi + rm -f "$tmp" + + if [ -x "$bin" ]; then + ok "opencode installed: $("$bin" --version 2>/dev/null || echo "$bin")" + else + warn "opencode binary was not found after installation." + fi +} + +# ---------------------------------------------------------------- uv + +install_uv() { + [ "$DO_UV" -eq 1 ] || return 0 + + local bin="$USER_HOME/.local/bin/uv" + if [ -x "$bin" ]; then + ok "uv already present: $("$bin" --version 2>/dev/null || echo "$bin")" + return 0 + fi + command -v curl >/dev/null 2>&1 \ + || { warn "curl is missing – uv cannot be downloaded."; return 0; } + + info "Installing uv (Python package manager) …" + local tmp + tmp=$(mktemp) + if ! curl -LsSf https://astral.sh/uv/install.sh -o "$tmp"; then + rm -f "$tmp" + warn "uv installation script could not be downloaded." + return 0 + fi + # ~/.local/bin is already in PATH via the fish config. + if ! env UV_NO_MODIFY_PATH=1 sh "$tmp"; then + rm -f "$tmp" + warn "uv installation failed." + return 0 + fi + rm -f "$tmp" + + if [ -x "$bin" ]; then + ok "uv installed: $("$bin" --version 2>/dev/null || echo "$bin")" + else + warn "uv binary was not found after installation." + fi +} + +# ---------------------------------------------------------------- Cargo / Rust + +install_cargo() { + [ "$DO_CARGO" -eq 1 ] || return 0 + + local bin="${CARGO_HOME:-$USER_HOME/.cargo}/bin/cargo" + if [ -x "$bin" ]; then + ok "Cargo already present: $("$bin" --version 2>/dev/null || echo "$bin")" + return 0 + fi + command -v curl >/dev/null 2>&1 \ + || { warn "curl is missing – Rust cannot be downloaded."; return 0; } + + info "Installing Rust (rustup, cargo) …" + local tmp + tmp=$(mktemp) + if ! curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs -o "$tmp"; then + rm -f "$tmp" + warn "rustup installation script could not be downloaded." + return 0 + fi + # rustup writes ~/.config/fish/conf.d/rustup.fish, so cargo is in + # PATH in the desktop session after the next login. + if ! sh "$tmp" -y; then + rm -f "$tmp" + warn "Rust installation failed." + return 0 + fi + rm -f "$tmp" + + if [ -x "$bin" ]; then + ok "Cargo installed: $("$bin" --version 2>/dev/null || echo "$bin")" + else + warn "cargo binary was not found after installation." + fi + if ! command -v cc >/dev/null 2>&1; then + warn "C compiler 'cc' is missing – crates with native code cannot link." + warn "Fix: sudo apt install build-essential" + fi +} + +# ---------------------------------------------------------------- Docker + +install_docker() { + [ "$DO_DOCKER" -eq 1 ] || return 0 + + # docker.io, docker-cli and docker-compose are installed by + # install_packages() (conditional apt list). + if ! command -v docker >/dev/null 2>&1; then + warn "docker is missing – the package installation seems to have failed." + return 0 + fi + + info "Enabling Docker …" + if sudo systemctl enable --now docker >/dev/null 2>&1; then + ok "Docker service enabled." + else + warn "Docker service could not be enabled." + fi + + # Running docker without sudo requires membership in the docker group. + if id -nG "$USER_NAME" 2>/dev/null | tr ' ' '\n' | grep -qx docker; then + ok "$USER_NAME is already in the docker group." + elif sudo usermod -aG docker "$USER_NAME"; then + ok "$USER_NAME added to the docker group (active after the next login)." + else + warn "Could not add $USER_NAME to the docker group." + fi + + local compose + compose=$(docker compose version --short 2>/dev/null \ + || docker-compose --version 2>/dev/null || true) + ok "Docker: $(docker --version 2>/dev/null || echo unknown)${compose:+ / Compose: $compose}" +} + +# ---------------------------------------------------------------- Ollama + +install_ollama() { + [ "$DO_OLLAMA" -eq 1 ] || return 0 + + if command -v ollama >/dev/null 2>&1; then + ok "Ollama already present: $(ollama --version 2>/dev/null | head -n 1)" + return 0 + fi + command -v curl >/dev/null 2>&1 \ + || { warn "curl is missing – Ollama cannot be downloaded."; return 0; } + command -v zstd >/dev/null 2>&1 \ + || { warn "zstd is missing – Ollama cannot be unpacked."; return 0; } + + info "Installing Ollama (local LLMs) …" + local tmp + tmp=$(mktemp) + if ! curl -fsSL https://ollama.com/install.sh -o "$tmp"; then + rm -f "$tmp" + warn "Ollama installation script could not be downloaded." + return 0 + fi + # The script installs the binary to /usr/local/bin, creates the + # ollama user and enables the systemd service – therefore root. + if ! sudo sh "$tmp"; then + rm -f "$tmp" + warn "Ollama installation failed." + return 0 + fi + rm -f "$tmp" + + if command -v ollama >/dev/null 2>&1; then + ok "Ollama installed: $(ollama --version 2>/dev/null | head -n 1)" + else + warn "ollama binary was not found after installation." + fi +} + +# ---------------------------------------------------------------- fish + +set_fish_shell() { + [ "$SET_FISH_SHELL" -eq 1 ] || return 0 + + local fish_bin=/usr/bin/fish + if ! command -v fish >/dev/null 2>&1; then + warn "fish is not installed – login shell remains unchanged." + return 0 + fi + if ! grep -qx "$fish_bin" /etc/shells 2>/dev/null; then + warn "fish is not listed in /etc/shells – login shell remains unchanged." + return 0 + fi + + local current + current=$(getent passwd "$USER_NAME" | cut -d: -f7) + if [ "$current" = "$fish_bin" ]; then + ok "fish is already the login shell." + return 0 + fi + + info "Setting fish as the login shell for $USER_NAME …" + if chsh -s "$fish_bin"; then + ok "fish is now the login shell." + else + warn "chsh failed – fish remains only the terminal shell." + fi +} + +# ---------------------------------------------------------------- Reload + +reload_session() { + # Also works when the installer was started over SSH. + adopt_session_env >/dev/null 2>&1 || true + [ -n "${WAYLAND_DISPLAY:-}" ] || return 0 + + info "Reloading the running session (wallpaper, Waybar, mako, Thunar, labwc) …" + local wp="$USER_HOME/.local/share/backgrounds/labwc-$MODE.png" + + if command -v swaybg >/dev/null 2>&1; then + pkill -x swaybg >/dev/null 2>&1 || true + setsid swaybg -i "$wp" -m fill >/dev/null 2>&1 & + fi + if command -v waybar >/dev/null 2>&1; then + pkill -x waybar >/dev/null 2>&1 || true + setsid waybar >/dev/null 2>&1 & + fi + if command -v mako >/dev/null 2>&1; then + pkill -x mako >/dev/null 2>&1 || true + setsid mako >/dev/null 2>&1 & + fi + # Thunar caches the icon theme when it starts; without a restart the + # old icons remain visible. + if command -v thunar >/dev/null 2>&1 && pgrep -x thunar >/dev/null 2>&1; then + pkill -x thunar >/dev/null 2>&1 || true + setsid thunar --daemon >/dev/null 2>&1 & + fi + if command -v labwc >/dev/null 2>&1; then + labwc -r >/dev/null 2>&1 || true + fi +} + +# ---------------------------------------------------------------- Checks + +final_checks() { + local full=${1:-1} + info "Checking core components …" + + if [ "$full" -eq 1 ]; then + local cmd + for cmd in labwc waybar kitty foot fuzzel fish thunar swaylock \ + gparted loupe python3; do + if command -v "$cmd" >/dev/null 2>&1; then + ok "$cmd" + else + warn "$cmd is missing" + fi + done + + if command -v flatpak >/dev/null 2>&1; then + local id + for id in org.mozilla.firefox org.gnome.Evince com.github.tchx84.Flatseal; do + if flatpak info "$id" >/dev/null 2>&1; then + ok "Flatpak: $id" + else + warn "Flatpak missing: $id" + fi + done + else + warn "flatpak is missing" + fi + + if [ "$DO_RUSTICL" -eq 1 ]; then + if [ -f "$USER_HOME/.config/OpenCL/vendors/rusticl.icd" ]; then + ok "Rusticl ICD configured" + else + warn "Rusticl ICD is missing" + fi + fi + + if [ "$DO_VM_RENDERER" -eq 1 ]; then + if grep -qE '^[[:space:]]*WLR_RENDERER=pixman' \ + "$USER_HOME/.config/labwc/environment" 2>/dev/null; then + ok "pixman renderer set for the VM" + else + warn "pixman renderer is missing in ~/.config/labwc/environment" + fi + fi + + if [ "$SET_FISH_SHELL" -eq 1 ]; then + if [ "$(getent passwd "$USER_NAME" | cut -d: -f7)" = /usr/bin/fish ]; then + ok "fish is the login shell" + else + warn "fish is not the login shell (chsh -s /usr/bin/fish)" + fi + fi + + if [ -x /usr/libexec/xfce-polkit ] || command -v xfce-polkit >/dev/null 2>&1; then + ok "xfce-polkit (PolicyKit agent)" + elif command -v lxpolkit >/dev/null 2>&1; then + ok "lxpolkit (PolicyKit agent)" + else + warn "No PolicyKit agent – pkexec/gparted cannot ask for the password" + fi + + if grep -q 'desktop-setup: wayland root' /usr/sbin/gparted 2>/dev/null; then + ok "gparted uses the desktop user's display under Wayland" + else + warn "gparted Wayland patch is missing – 'gparted' as root may show no window" + fi + + if [ -f /etc/polkit-1/rules.d/49-greetd-power.rules ]; then + ok "polkit rule for greeter power" + else + warn "polkit rule for greeter power is missing" + fi + + if dpkg -L libpam-gnome-keyring 2>/dev/null \ + | grep -q '/pam_gnome_keyring\.so$'; then + ok "PAM module pam_gnome_keyring" + else + warn "libpam-gnome-keyring is missing – the keyring is not unlocked at login" + fi + + if grep -qE '^[[:space:]]*-?session[[:space:]]+optional[[:space:]]+pam_gnome_keyring\.so' \ + /etc/pam.d/greetd 2>/dev/null; then + ok "greetd PAM unlocks the keyring at login" + else + warn "pam_gnome_keyring is missing in /etc/pam.d/greetd" + fi + + if grep -q 'org.freedesktop.impl.portal.Secret=gnome-keyring' \ + "$USER_HOME/.config/xdg-desktop-portal/labwc-portals.conf" 2>/dev/null; then + ok "Secret portal uses gnome-keyring" + else + warn "Secret portal configuration is missing – Flatpak apps may not find the keyring" + fi + + if command -v flatpak >/dev/null 2>&1 \ + && flatpak info org.signal.Signal >/dev/null 2>&1; then + if flatpak override --user --show org.signal.Signal 2>/dev/null \ + | grep -q '^SIGNAL_PASSWORD_STORE=gnome-libsecret$'; then + ok "Signal uses gnome-keyring (SIGNAL_PASSWORD_STORE)" + else + warn "Signal keyring override is missing – Signal otherwise stores the password in a file" + fi + fi + + if systemctl is-enabled greetd >/dev/null 2>&1; then + ok "greetd is enabled" + else + warn "greetd is not enabled" + fi + fi + + # Node.js + local node_bin + if command -v node >/dev/null 2>&1; then + ok "node $(node --version 2>/dev/null) ($(command -v node))" + elif [ -d "$USER_HOME/.nvm/versions/node" ]; then + node_bin=$(find "$USER_HOME/.nvm/versions/node" -maxdepth 3 \ + -type f -name node -perm -u+x 2>/dev/null \ + | sort -V | tail -n 1 || true) + if [ -n "$node_bin" ]; then + ok "node $("$node_bin" --version 2>/dev/null) (nvm, in PATH after login)" + elif [ "$DO_NODE" -eq 1 ]; then + warn "Node.js was selected but cannot be found" + else + info "Node.js not installed." + fi + else + if [ "$DO_NODE" -eq 1 ]; then + warn "Node.js was selected but is not installed" + else + info "Node.js not installed." + fi + fi + + # Optional developer tools + local tool tool_bin tool_want + for tool in opencode uv cargo ollama; do + case "$tool" in + opencode) tool_bin="$USER_HOME/.opencode/bin/opencode"; tool_want=$DO_OPENCODE ;; + uv) tool_bin="$USER_HOME/.local/bin/uv"; tool_want=$DO_UV ;; + cargo) tool_bin="${CARGO_HOME:-$USER_HOME/.cargo}/bin/cargo"; tool_want=$DO_CARGO ;; + ollama) tool_bin=$(command -v ollama 2>/dev/null || true); tool_want=$DO_OLLAMA ;; + esac + if [ -n "$tool_bin" ] && [ -x "$tool_bin" ]; then + ok "$tool $("$tool_bin" --version 2>/dev/null | head -n 1) ($tool_bin)" + elif [ "$tool_want" -eq 1 ]; then + warn "$tool was selected but cannot be found" + else + info "$tool not installed." + fi + done + + # Cargo needs cc to link; report it whenever cargo is present. + if [ "$DO_CARGO" -eq 1 ] \ + || [ -x "${CARGO_HOME:-$USER_HOME/.cargo}/bin/cargo" ] \ + || command -v cargo >/dev/null 2>&1; then + if command -v cc >/dev/null 2>&1; then + ok "C toolchain: $(cc --version 2>/dev/null | head -n 1)" + else + warn "C toolchain (cc) is missing – cargo cannot link native code" + warn "Fix: sudo apt install build-essential" + fi + fi + + # Editors / music player from the apt list + local app + for app in mousepad hx kew; do + if command -v "$app" >/dev/null 2>&1; then + ok "$app installed" + else + warn "$app is missing" + fi + done + + if python3 -c 'import ensurepip' >/dev/null 2>&1; then + ok "python3-venv present (venv can install pip)" + else + warn "python3-venv is missing – 'python3 -m venv' cannot install pip" + fi + + if [ "$DO_DOCKER" -eq 1 ] || command -v docker >/dev/null 2>&1; then + if command -v docker >/dev/null 2>&1; then + ok "docker $(docker --version 2>/dev/null | head -n 1)" + if docker compose version >/dev/null 2>&1; then + ok "docker compose $(docker compose version --short 2>/dev/null)" + elif command -v docker-compose >/dev/null 2>&1; then + ok "docker-compose $(docker-compose --version 2>/dev/null | head -n 1)" + else + warn "docker-compose is missing" + fi + if id -nG "$USER_NAME" 2>/dev/null | tr ' ' '\n' | grep -qx docker; then + ok "$USER_NAME is in the docker group" + else + warn "$USER_NAME is not in the docker group (docker needs sudo)" + fi + elif [ "$DO_DOCKER" -eq 1 ]; then + warn "Docker was selected but docker is missing" + fi + fi + + if qogir_icons_complete; then + ok "Qogir icons complete (light and dark)" + else + warn "Qogir icons are incomplete – Thunar may show Adwaita icons" + fi + + local want_icons=Qogir-Manjaro have_icons + if [ "$MODE" = dark ]; then + want_icons=Qogir-Manjaro-Dark + fi + have_icons=$(gsettings_value org.gnome.desktop.interface icon-theme) + if [ "$have_icons" = "$want_icons" ]; then + ok "Icon theme: $want_icons" + else + warn "Icon theme is ${have_icons:-unknown} instead of '$want_icons'" + fi + + if [ -s "$USER_HOME/.config/dconf/user" ]; then + ok "dconf database present ($(stat -c%s "$USER_HOME/.config/dconf/user" 2>/dev/null) bytes)" + else + warn "dconf database is missing – the icon theme may be lost at logout" + fi + + if [ -e "$USER_HOME/.local/share/icons/$want_icons/index.theme" ]; then + ok "Icon directory: ~/.local/share/icons/$want_icons" + else + warn "Icon directory ~/.local/share/icons/$want_icons is missing" + fi + + if svg_loader_ok; then + ok "SVG icon loader present (Qogir icons can be rendered)" + else + warn "SVG icon loader missing – Thunar will show generic icons" + warn "Fix: sudo apt install librsvg2-common" + fi + + if [ -L "$USER_HOME/.icons" ] \ + && [ "$(readlink -f "$USER_HOME/.icons")" = "$(readlink -f "$USER_HOME/.local/share/icons")" ]; then + ok "~/.icons points to ~/.local/share/icons" + elif [ -e "$USER_HOME/.icons/Qogir-Manjaro-Dark/cursors/default" ]; then + ok "Qogir cursor theme linked (~/.icons)" + else + warn "Qogir cursor theme not linked in ~/.icons" + fi + + local want_scheme=prefer-light have_scheme + if [ "$MODE" = dark ]; then + want_scheme=prefer-dark + fi + have_scheme=$(gsettings_value org.gnome.desktop.interface color-scheme) + if [ "$have_scheme" = "$want_scheme" ]; then + ok "GTK colour scheme: $want_scheme" + else + warn "GTK colour scheme is '${have_scheme:-unknown}' instead of '$want_scheme'" + fi + + local want_gtk=Arc have_gtk + if [ "$MODE" = dark ]; then + want_gtk=Arc-Darker + fi + have_gtk=$(gsettings_value org.gnome.desktop.interface gtk-theme) + if [ "$have_gtk" = "$want_gtk" ]; then + ok "GTK theme: $want_gtk" + else + warn "GTK theme is '${have_gtk:-unknown}' instead of '$want_gtk'" + fi + + local thunar_css="$USER_HOME/.config/gtk-3.0/gtk.css" + if [ "$MODE" = light ]; then + if grep -qF 'BEGIN desktop-setup thunar-light' "$thunar_css" 2>/dev/null; then + ok "Thunar sidebar: light override active" + else + warn "Thunar sidebar override is missing – the pane stays dark (Arc default)" + fi + elif grep -qF 'BEGIN desktop-setup thunar-light' "$thunar_css" 2>/dev/null; then + warn "Thunar light override is still active in the dark theme" + fi + + if [ "$MODE" = dark ]; then + if grep -q 'arc-dark/gtk-main-dark.css' \ + "$USER_HOME/.config/gtk-4.0/gtk.css" 2>/dev/null \ + && [ -f "$USER_HOME/.config/gtk-4.0/arc-dark/gtk-main-dark.css" ]; then + ok "GTK4: Arc-Dark (GTK3 remains Arc-Darker)" + else + warn "GTK4 Arc-Dark CSS is missing – GTK4 apps remain Arc-Darker" + fi + fi + + if command -v gsettings >/dev/null 2>&1; then + local layout + layout=$(gsettings_value org.gnome.desktop.wm.preferences button-layout) + case "$layout" in + *minimize*maximize*close*) + ok "Window buttons: minimize/maximize/close enabled ($layout)" ;; + *) + warn "Window buttons incomplete (button-layout=${layout:-unknown})" ;; + esac + fi + + if command -v swayidle >/dev/null 2>&1 \ + && [ -x "$USER_HOME/.local/bin/idle-action" ]; then + ok "Idle manager configured (lock 10 min, display off 15 min, suspend 30 min)" + else + warn "Idle manager incomplete – swayidle or idle-action is missing" + fi + + if command -v wlopm >/dev/null 2>&1; then + ok "wlopm installed (display off via wlr-output-power-management)" + else + warn "wlopm is missing – display off uses wlr-randr as fallback" + fi + + if command -v wdisplays >/dev/null 2>&1; then + ok "wdisplays installed (monitors/resolution)" + else + warn "wdisplays is missing – monitors can only be configured via wlr-randr" + fi +} + +# ---------------------------------------------------------------- Flows + +print_footer() { + printf '\n%sDone.%s\n' "$G" "$N" + [ -n "$MODE" ] && printf 'Theme: %s\n' "$MODE" + [ -n "${BACKUP_DIR:-}" ] && printf 'Backup: %s\n' "$BACKUP_DIR" + cat </dev/null; then + had_vm_renderer=1 + fi + + info "Theme: $MODE" + if ! ask_yes_no "Apply the theme now?" y; then + info "Cancelled – nothing was changed." + return 0 + fi + + # A theme-only run on a fresh system must also provide the icon tree, + # otherwise GTK falls back to Adwaita even though GSettings is correct. + if ! qogir_icons_complete; then + install_icons + fi + apply_dotfiles + ensure_cursor_theme_link + + # The greeter gets its theme from /etc/greetd/config.toml, which is + # generated from ~/.config/tuigreet/theme.conf. Rewrite it here, + # otherwise the login screen keeps the previous (e.g. dark) theme. + if [ -f /etc/greetd/config.toml ] && command -v tuigreet >/dev/null 2>&1; then + info "Updating the greetd login theme …" + if command -v sudo >/dev/null 2>&1 && sudo -v; then + write_greeter_config || warn "The greetd theme could not be updated." + else + warn "greetd theme not updated (sudo failed) – the login screen keeps its previous theme." + fi + fi + + # A previously configured pixman renderer (VM) is preserved. + if [ "$had_vm_renderer" -eq 1 ]; then + DO_VM_RENDERER=1 + setup_vm_renderer + fi + # A previously configured Rusticl is preserved when changing the theme. + if [ -f "$USER_HOME/.config/OpenCL/vendors/rusticl.icd" ]; then + DO_RUSTICL=1 + setup_rusticl + fi + apply_gtk + reload_session + final_checks 0 + print_footer +} + +gparted_only() { + require_sudo + install_gparted + patch_gparted_wayland + printf '\n%sDone.%s\n' "$G" "$N" +} + +keyring_only() { + require_sudo + install_keyring_packages + setup_keyring + setup_flatpak_overrides + printf '\n%sDone.%s\n' "$G" "$N" +} + +main_menu() { + local choice + printf '\n%s╔══════════════════════════════════════════════╗%s\n' "$B" "$N" + printf '%s║ labwc desktop – Installation ║%s\n' "$B" "$N" + printf '%s╚══════════════════════════════════════════════╝%s\n\n' "$B" "$N" + printf 'What would you like to do?\n\n' + printf ' 1) Full installation (recommended)\n' + printf ' 2) Change theme only (light/dark)\n' + printf ' 3) Patch GParted for Wayland only\n' + printf ' 4) Set up keyring (gnome-keyring) only\n' + printf ' 5) Quit\n\n' + + while true; do + read -r -p "Choice [1-5]: " choice || exit 0 + case "${choice:-}" in + 1) full_install; return 0 ;; + 2) theme_only; return 0 ;; + 3) gparted_only; return 0 ;; + 4) keyring_only; return 0 ;; + 5|q|Q|exit|quit) printf 'Cancelled.\n'; exit 0 ;; + *) printf 'Please enter 1 to 5.\n' ;; + esac + done +} + +# ---------------------------------------------------------------- Start + +if [ "$#" -gt 0 ]; then + case "$1" in + -h|--help) usage; exit 0 ;; + *) die "This script is interactive and does not accept parameters. Please start it without arguments." ;; + esac +fi + +[ "$(id -u)" -ne 0 ] \ + || die "Please start as a normal user – the script calls sudo itself." +[ -t 0 ] \ + || die "This script is interactive and requires a terminal. Please run it directly in a terminal." + +# If the graphical session belongs to a different user, the theme would be +# installed into the wrong home directory and would never be visible. +seat_user="" +if command -v loginctl >/dev/null 2>&1; then + seat_user=$(loginctl list-sessions --no-legend 2>/dev/null \ + | awk '$4 == "seat0" { print $3; exit }') +fi +if [ -n "${seat_user:-}" ] && [ "$seat_user" != "$USER_NAME" ]; then + warn "The graphical session belongs to '$seat_user', but this script is installing for '$USER_NAME'." + warn "The theme would be written to $USER_HOME and would not affect '$seat_user'." + if ! ask_yes_no "Continue anyway?" n; then + exit 1 + fi +fi + +[ -d "$SCRIPT_DIR/themes/dark/home" ] \ + || die "Theme 'dark' not found – is the bundle complete?" +[ -d "$SCRIPT_DIR/themes/light/home" ] \ + || die "Theme 'light' not found – is the bundle complete?" +[ -d "$SCRIPT_DIR/home" ] \ + || die "Base skeleton '$SCRIPT_DIR/home' is missing." + +main_menu diff --git a/themes/dark/home/.config/environment.d/90-labwc.conf b/themes/dark/home/.config/environment.d/90-labwc.conf new file mode 100644 index 0000000..a47d07e --- /dev/null +++ b/themes/dark/home/.config/environment.d/90-labwc.conf @@ -0,0 +1,3 @@ +GTK_THEME=Arc-Darker +XCURSOR_THEME=Qogir-Manjaro-Dark +XCURSOR_SIZE=24 diff --git a/themes/dark/home/.config/fish/conf.d/10-theme.fish b/themes/dark/home/.config/fish/conf.d/10-theme.fish new file mode 100644 index 0000000..fa18473 --- /dev/null +++ b/themes/dark/home/.config/fish/conf.d/10-theme.fish @@ -0,0 +1,34 @@ +# ~/.config/fish/conf.d/10-theme.fish +# Breeze-Dark-Farbschema – wird vom Desktop-Theme gesetzt. +# Bei einem Theme-Wechsel ersetzt das Installationsskript diese Datei. + +# GTK-Programme aus dieser Shell im passenden Design starten +set -gx GTK_THEME Arc-Darker + +# Farben für eigene Prompt-Funktionen +set -g theme_normal eff0f1 +set -g theme_muted 7f8c8d +set -g theme_accent 3daee9 +set -g theme_danger da4453 +set -g theme_success 27ae60 + +# fish-eigene Farben +set -g fish_color_normal eff0f1 +set -g fish_color_command 3daee9 +set -g fish_color_param eff0f1 +set -g fish_color_error da4453 +set -g fish_color_comment 7f8c8d +set -g fish_color_quote 27ae60 +set -g fish_color_operator 1abc9c +set -g fish_color_escape f67400 +set -g fish_color_selection --background=3daee9 +set -g fish_color_autosuggestion 5f6b73 +set -g fish_color_valid_path --underline +set -g fish_color_match --background=3daee9 +set -g fish_color_history_current --bold +set -g fish_color_search_match --background=3daee9 + +set -g fish_pager_color_prefix 3daee9 +set -g fish_pager_color_progress 7f8c8d +set -g fish_pager_color_completion eff0f1 +set -g fish_pager_color_description 7f8c8d diff --git a/themes/dark/home/.config/foot/foot.ini b/themes/dark/home/.config/foot/foot.ini new file mode 100644 index 0000000..1feff8a --- /dev/null +++ b/themes/dark/home/.config/foot/foot.ini @@ -0,0 +1,48 @@ +# foot – Breeze Dark +# Farben ohne führendes #, sechsstellig. + +[main] +shell=/usr/bin/fish +font=JetBrains Mono:size=10 +initial-window-size-pixels=1100x680 +pad=12x9 +dpi-aware=no +app-id=foot +title=foot +resize-delay-ms=120 + +[scrollback] +lines=10000 + +[cursor] +style=beam +blink=no +color=eff0f1 3daee9 + +[colors] +alpha=0.97 +background=1b1e20 +foreground=eff0f1 + +regular0=232629 +regular1=da4453 +regular2=27ae60 +regular3=f67400 +regular4=3daee9 +regular5=9b59b6 +regular6=1abc9c +regular7=bdc3c7 + +bright0=5f6b73 +bright1=ed5565 +bright2=2ecc71 +bright3=fdc253 +bright4=5bc0eb +bright5=b07cc6 +bright6=48c9b0 +bright7=eff0f1 + +selection-foreground=1b1e20 +selection-background=3daee9 +urls=3daee9 +flash=da4453 diff --git a/themes/dark/home/.config/fuzzel/fuzzel.ini b/themes/dark/home/.config/fuzzel/fuzzel.ini new file mode 100644 index 0000000..8b6f529 --- /dev/null +++ b/themes/dark/home/.config/fuzzel/fuzzel.ini @@ -0,0 +1,34 @@ +# fuzzel – Breeze Dark + +[main] +font=DejaVu Sans:size=11 +dpi-aware=no +prompt="❯ " +icons-enabled=yes +icon-theme=Qogir-Manjaro-Dark +terminal=kitty +lines=10 +width=44 +horizontal-pad=18 +vertical-pad=14 +inner-pad=8 +anchor=center +layer=overlay + +[border] +width=1 +radius=10 + +[colors] +background=1b1e20f2 +text=eff0f1ff +prompt=3daee9ff +match=3daee9ff +selection=3daee9ff +selection-text=1b1e20ff +selection-match=1b1e20ff +counter=7f8c8dff +border=2f3437ff + +[dmenu] +exit-immediately-if-empty=yes diff --git a/themes/dark/home/.config/gtk-3.0/settings.ini b/themes/dark/home/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..1e133c8 --- /dev/null +++ b/themes/dark/home/.config/gtk-3.0/settings.ini @@ -0,0 +1,13 @@ +[Settings] +gtk-theme-name=Arc-Darker +gtk-icon-theme-name=Qogir-Manjaro-Dark +gtk-font-name=DejaVu Sans 9 +# Arc-Darker: dunkle Kopfleisten/Seitenleisten, helle Inhaltsflächen. +# prefer-dark-theme=0 verhindert, dass GTK zusätzlich gtk-dark.css lädt +# (das wäre wieder vollständig dunkel wie Arc-Dark). +gtk-application-prefer-dark-theme=0 +gtk-cursor-theme-name=Qogir-Manjaro-Dark +gtk-cursor-theme-size=24 +gtk-enable-animations=1 +gtk-menu-images=0 +gtk-decoration-layout=:minimize,maximize,close diff --git a/themes/dark/home/.config/gtk-4.0/gtk.css b/themes/dark/home/.config/gtk-4.0/gtk.css new file mode 100644 index 0000000..26df46f --- /dev/null +++ b/themes/dark/home/.config/gtk-4.0/gtk.css @@ -0,0 +1,6 @@ +/* GTK4: Arc-Dark für alle GTK4-Programme. + * GTK3 bleibt bewusst auf Arc-Darker (siehe gtk-3.0/settings.ini). + * Die Datei arc-dark/gtk-main-dark.css wird von + * ~/.local/bin/update-gtk4-dark-css aus dem Arc-Theme erzeugt. + */ +@import url("arc-dark/gtk-main-dark.css"); diff --git a/themes/dark/home/.config/gtk-4.0/settings.ini b/themes/dark/home/.config/gtk-4.0/settings.ini new file mode 100644 index 0000000..fa2fa1d --- /dev/null +++ b/themes/dark/home/.config/gtk-4.0/settings.ini @@ -0,0 +1,11 @@ +[Settings] +gtk-theme-name=Arc-Darker +gtk-icon-theme-name=Qogir-Manjaro-Dark +gtk-font-name=DejaVu Sans 9 +# GTK4: Arc-Dark kommt über ~/.config/gtk-4.0/gtk.css (User-CSS). +# prefer-dark-theme=0 vermeidet die libadwaita-Warnung; die dunkle +# Darstellung liefert bereits das importierte Arc-Dark-Stylesheet. +gtk-application-prefer-dark-theme=0 +gtk-cursor-theme-name=Qogir-Manjaro-Dark +gtk-cursor-theme-size=24 +gtk-decoration-layout=:minimize,maximize,close diff --git a/themes/dark/home/.config/kitty/theme.conf b/themes/dark/home/.config/kitty/theme.conf new file mode 100644 index 0000000..1721f89 --- /dev/null +++ b/themes/dark/home/.config/kitty/theme.conf @@ -0,0 +1,39 @@ +# kitty – Breeze Dark +# Wird beim Design-Wechsel durch themes/dark/.../theme.conf ersetzt. + +background #1b1e20 +foreground #eff0f1 +cursor #eff0f1 +cursor_text_color #3daee9 +selection_background #3daee9 +selection_foreground #1b1e20 +url_color #3daee9 +background_opacity 0.97 + +active_border_color #3daee9 +inactive_border_color #2f3437 + +tab_bar_background #1b1e20 +active_tab_background #3daee9 +active_tab_foreground #1b1e20 +inactive_tab_background #232629 +inactive_tab_foreground #7f8c8d +active_tab_font_style bold +inactive_tab_font_style normal + +color0 #232629 +color1 #da4453 +color2 #27ae60 +color3 #f67400 +color4 #3daee9 +color5 #9b59b6 +color6 #1abc9c +color7 #bdc3c7 +color8 #5f6b73 +color9 #ed5565 +color10 #2ecc71 +color11 #fdc253 +color12 #5bc0eb +color13 #b07cc6 +color14 #48c9b0 +color15 #eff0f1 diff --git a/themes/dark/home/.config/labwc/autostart b/themes/dark/home/.config/labwc/autostart new file mode 100644 index 0000000..66efc10 --- /dev/null +++ b/themes/dark/home/.config/labwc/autostart @@ -0,0 +1,68 @@ +#!/bin/sh +# labwc – Autostart (wird als Shell-Skript ausgeführt) + +# GTK-, Icon- und Cursor-Werte über GSettings (dconf) setzen. Unter +# Wayland liest GTK diese Werte aus dconf; ~/.config/gtk-3.0/settings.ini +# wird ignoriert. Der Aufruf steht vor den Programmen, damit Waybar, +# Thunar und GTK-Apps von Anfang an das richtige Icon-Theme sehen. +if [ -x "$HOME/.local/bin/set-gtk-settings" ]; then + if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v dbus-run-session >/dev/null 2>&1; then + dbus-run-session -- "$HOME/.local/bin/set-gtk-settings" dark >/dev/null 2>&1 || true + else + "$HOME/.local/bin/set-gtk-settings" dark >/dev/null 2>&1 || true + fi +fi + +# Hintergrundbild +if [ -f "$HOME/.local/share/backgrounds/labwc-dark.png" ]; then + swaybg -i "$HOME/.local/share/backgrounds/labwc-dark.png" -m fill >/dev/null 2>&1 & +else + swaybg -c '#1b1e20' >/dev/null 2>&1 & +fi + +# Benachrichtigungen +mako >/dev/null 2>&1 & + +# Taskleiste +waybar >/dev/null 2>&1 & + +# PolicyKit-Agent (Passwortdialog für pkexec, z. B. gparted) +if [ -x /usr/libexec/xfce-polkit ]; then + /usr/libexec/xfce-polkit >/dev/null 2>&1 & +elif command -v xfce-polkit >/dev/null 2>&1; then + xfce-polkit >/dev/null 2>&1 & +elif command -v lxpolkit >/dev/null 2>&1; then + lxpolkit >/dev/null 2>&1 & +fi + +# D-Bus-Aktivierungsumgebung aktuell halten (für GTK/Portal-Programme) +if command -v dbus-update-activation-environment >/dev/null 2>&1; then + dbus-update-activation-environment \ + WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE \ + >/dev/null 2>&1 +fi + +# KDE Connect (Indikator; kdeconnectd wird bei Bedarf per D-Bus gestartet) +if command -v kdeconnect-indicator >/dev/null 2>&1; then + kdeconnect-indicator >/dev/null 2>&1 & +fi + +# Idle-Manager: nach 10 Min sperren, nach 15 Min Monitor aus, +# nach 30 Min Ruhezustand (Suspend). Laufende Medienwiedergabe +# über PipeWire verhindert die Aktionen. +# +# "resume" gehört jeweils direkt hinter den zugehörigen "timeout": +# Bei Aktivität wird der Monitor wieder eingeschaltet und wartende +# Aktionen werden abgebrochen. Ohne diese Zuordnung bliebe der +# Bildschirm nach dem Ausschalten schwarz. +if command -v swayidle >/dev/null 2>&1; then + swayidle -w \ + timeout 600 'idle-action lock' resume 'idle-action cancel' \ + timeout 900 'idle-action dpms-off' resume 'idle-action resume' \ + timeout 1800 'idle-action suspend' resume 'idle-action resume' \ + after-resume 'idle-action resume' \ + before-sleep 'idle-action lock-now' \ + lock 'idle-action lock-now' >/dev/null 2>&1 & +fi + +exit 0 diff --git a/themes/dark/home/.config/labwc/environment b/themes/dark/home/.config/labwc/environment new file mode 100644 index 0000000..9e051e2 --- /dev/null +++ b/themes/dark/home/.config/labwc/environment @@ -0,0 +1,23 @@ +# labwc – Umgebung +# Wird bei jedem Start und bei "Reconfigure" neu eingelesen. + +# Tastatur +XKB_DEFAULT_LAYOUT=de + +# Mauszeiger +XCURSOR_THEME=Qogir-Manjaro-Dark +XCURSOR_SIZE=24 + +# Dunkles GTK für alle GTK-Programme +GTK_THEME=Arc-Darker + +# Wayland für Firefox / Qt +MOZ_ENABLE_WAYLAND=1 +QT_QPA_PLATFORM=wayland + +# Eigene Skripte (session-menu), opencode, Node.js (nvm) und +# Flatpak-Programme auffindbar machen. +# Absoluter Pfad, damit kein rekursives $PATH entsteht. +# /usr/sbin und /sbin sind enthalten, damit Werkzeuge wie gparted auch aus +# GUI-Terminals und von der Leiste gestarteten Programmen gefunden werden. +PATH=@NODE_BIN@@HOME@/.opencode/bin:@HOME@/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/flatpak/exports/bin:@HOME@/.local/share/flatpak/exports/bin:/usr/local/games:/usr/games diff --git a/themes/dark/home/.config/labwc/themerc-override b/themes/dark/home/.config/labwc/themerc-override new file mode 100644 index 0000000..584dd7c --- /dev/null +++ b/themes/dark/home/.config/labwc/themerc-override @@ -0,0 +1,74 @@ +# labwc – Breeze-Dark-Farbwelt +# Nur Abweichungen vom eingebauten Standard-Theme. + +border.width: 1 +window.titlebar.padding.width: 6 +window.titlebar.padding.height: 4 + +# Fensterrahmen +window.active.border.color: #3daee9 +window.inactive.border.color: #2f3437 +window.active.indicator.toggled-keybind.color: #f67400 + +# Titelleiste +window.active.title.bg.color: #232629 +window.inactive.title.bg.color: #1b1e20 +window.active.label.text.color: #eff0f1 +window.inactive.label.text.color: #7f8c8d +window.label.text.justify: center + +# Buttons +window.button.width: 24 +window.button.height: 24 +window.button.spacing: 2 +window.button.hover.bg.corner-radius: 6 +window.active.button.unpressed.image.color: #bdc3c7 +window.inactive.button.unpressed.image.color: #5f6b73 +window.active.button.close.unpressed.image.color: #da4453 +window.active.button.close.hover.image.color: #eff0f1 + +# Schatten (pixman-schonend) +window.active.shadow.size: 18 +window.inactive.shadow.size: 10 +window.active.shadow.color: #00000070 +window.inactive.shadow.color: #00000040 + +# Menü +menu.border.width: 1 +menu.border.color: #2f3437 +menu.items.bg.color: #232629 +menu.items.text.color: #eff0f1 +menu.items.active.bg.color: #3daee9 +menu.items.active.text.color: #1b1e20 +menu.items.padding.x: 12 +menu.items.padding.y: 6 +menu.separator.width: 1 +menu.separator.padding.width: 8 +menu.separator.padding.height: 4 +menu.separator.color: #2f3437 +menu.title.bg.color: #1b1e20 +menu.title.text.color: #7f8c8d +menu.title.text.justify: Left + +# Fensterwechsler / OSD +osd.bg.color: #232629 +osd.border.color: #3daee9 +osd.border.width: 1 +osd.label.text.color: #eff0f1 +osd.window-switcher.width: 480 +osd.window-switcher.padding: 8 +osd.window-switcher.item.padding.x: 10 +osd.window-switcher.item.padding.y: 4 +osd.window-switcher.item.active.border.width: 2 +osd.window-switcher.preview.border.width: 1 +osd.window-switcher.preview.border.color: #3daee9 +osd.workspace-switcher.boxes.width: 16 +osd.workspace-switcher.boxes.height: 16 + +# Andock-Vorschau +snapping.overlay.region.bg.color: #3daee940 +snapping.overlay.edge.bg.color: #3daee940 +snapping.overlay.region.border.width: 1 +snapping.overlay.edge.border.width: 1 +snapping.overlay.region.border.color: #3daee9 +snapping.overlay.edge.border.color: #3daee9 diff --git a/themes/dark/home/.config/mako/config b/themes/dark/home/.config/mako/config new file mode 100644 index 0000000..c141e5f --- /dev/null +++ b/themes/dark/home/.config/mako/config @@ -0,0 +1,22 @@ +# mako – Breeze Dark + +font=DejaVu Sans 10 +background-color=#1b1e20f2 +text-color=#eff0f1 +border-color=#3daee9 +progress-color=over #3daee9ff +border-size=2 +border-radius=8 +padding=12 +margin=12 +width=360 +height=140 +max-visible=4 +anchor=top-right +default-timeout=6000 +icons=1 +layer=overlay + +[urgency=high] +border-color=#da4453 +default-timeout=0 diff --git a/themes/dark/home/.config/swaylock/config b/themes/dark/home/.config/swaylock/config new file mode 100644 index 0000000..d570255 --- /dev/null +++ b/themes/dark/home/.config/swaylock/config @@ -0,0 +1,51 @@ +# swaylock – Breeze-Dark, passend zu Waybar/labwc +# Palette: Hintergrund #1b1e20 · Fläche #232629 · Text #eff0f1 +# Akzent #3daee9 · Rot #da4453 · Grau #7f8c8d + +# Hintergrundbild (gleiches Wallpaper wie der Desktop) +image=@HOME@/.local/share/backgrounds/labwc-dark.png +scaling=fill +color=1b1e20 + +# Schrift wie Waybar +font=DejaVu Sans +font-size=14 + +# Entsperr-Kreis +indicator-radius=80 +indicator-thickness=8 + +# Ring: Akzent, neutral, prüfen, falsch +ring-color=3daee9 +ring-clear-color=7f8c8d +ring-ver-color=3daee9 +ring-wrong-color=da4453 + +# Innenfläche: dunkel und leicht transparent +inside-color=1b1e20cc +inside-clear-color=1b1e20cc +inside-ver-color=1b1e20cc +inside-wrong-color=1b1e20cc + +# Text im Kreis +text-color=eff0f1 +text-clear-color=eff0f1 +text-ver-color=eff0f1 +text-wrong-color=eff0f1 + +# Tastendrücke +key-hl-color=3daee9 +bs-hl-color=da4453 + +# Caps-Lock-Zustand anzeigen (hilft bei fehlgeschlagener Eingabe) +indicator-caps-lock + +# Trennlinien ausblenden +separator-color=00000000 +line-color=00000000 +line-clear-color=00000000 +line-ver-color=00000000 +line-wrong-color=00000000 + +# Fehlversuche anzeigen +show-failed-attempts diff --git a/themes/dark/home/.config/tuigreet/theme.conf b/themes/dark/home/.config/tuigreet/theme.conf new file mode 100644 index 0000000..2300725 --- /dev/null +++ b/themes/dark/home/.config/tuigreet/theme.conf @@ -0,0 +1 @@ +border=lightcyan;title=lightcyan;text=white;time=lightcyan;greet=gray;prompt=lightcyan;input=white;action=gray;button=lightcyan;container=black diff --git a/themes/dark/home/.config/waybar/style.css b/themes/dark/home/.config/waybar/style.css new file mode 100644 index 0000000..5311cfb --- /dev/null +++ b/themes/dark/home/.config/waybar/style.css @@ -0,0 +1,168 @@ +/* waybar – Breeze Dark, kompakt für 1280×1024 + Hintergrund #1b1e20 · Text #eff0f1 · Akzent #3daee9 */ + +* { + font-family: "DejaVu Sans", "Symbols Nerd Font", sans-serif; + font-size: 11px; + min-height: 0; + border: none; + border-radius: 0; +} + +window#waybar { + background: #1b1e20; + color: #eff0f1; + border-top: 1px solid #2f3437; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* ---------- links: Launcher + Taskleiste ---------- */ + +#custom-launcher { + color: #3daee9; + background: #232629; + font-size: 15px; + padding: 0 10px; + margin: 4px 3px 4px 5px; + border-radius: 6px; +} + +#custom-launcher:hover { + color: #1b1e20; + background: #3daee9; +} + +#taskbar { + padding: 0 1px; +} + +/* Nur Icons: kompakt, damit die rechten Module sichtbar bleiben */ +#taskbar button { + padding: 0 5px; + margin: 4px 1px; + min-width: 20px; + border-radius: 6px; + background: transparent; + color: #bdc3c7; +} + +#taskbar button:hover { + background: #2a2e32; + color: #eff0f1; +} + +#taskbar button.active { + background: #232629; + color: #eff0f1; + box-shadow: inset 0 -2px 0 #3daee9; +} + +#taskbar button.minimized { + color: #7f8c8d; +} + +#taskbar button.urgent { + color: #eff0f1; + background: #da4453; +} + +/* ---------- rechts: Status + Uhr ---------- */ + +#tray, +#network, +#wireplumber, +#cpu, +#memory, +#custom-session { + color: #bdc3c7; + padding: 0 8px; + margin: 4px 1px; + border-radius: 6px; +} + +#tray { + padding: 0 5px; +} + +/* Feste Breiten: verhindern das Springen bei 9 % → 10 % → 100 % + und beim Stummschalten. Werte aus den gemessenen Textbreiten (11 px). */ +#network { + min-width: 58px; + padding: 0; +} + +#wireplumber { + min-width: 58px; + padding: 0; +} + +#cpu { + min-width: 54px; + padding: 0; +} + +#memory { + min-width: 52px; + padding: 0; +} + +#network:hover, +#wireplumber:hover, +#cpu:hover, +#memory:hover { + background: #232629; + color: #eff0f1; +} + +#wireplumber.muted { + color: #da4453; +} + +#memory.warning { + color: #f67400; +} + +#memory.critical { + color: #da4453; +} + +#custom-session { + color: #3daee9; + font-size: 13px; + padding: 0 10px; +} + +#custom-session:hover { + color: #eff0f1; + background: #da4453; +} + +#clock { + color: #eff0f1; + font-weight: bold; + font-size: 12px; + padding: 0 12px; + margin: 4px 6px 4px 1px; + border-radius: 6px; + letter-spacing: 0.3px; +} + +#clock:hover { + background: #232629; +} + +/* ---------- Tooltips ---------- */ + +tooltip { + background: #232629; + border: 1px solid #3daee9; + border-radius: 8px; +} + +tooltip label { + color: #eff0f1; + padding: 5px 8px; +} diff --git a/themes/light/home/.config/environment.d/90-labwc.conf b/themes/light/home/.config/environment.d/90-labwc.conf new file mode 100644 index 0000000..803325a --- /dev/null +++ b/themes/light/home/.config/environment.d/90-labwc.conf @@ -0,0 +1,3 @@ +GTK_THEME=Arc +XCURSOR_THEME=Qogir-Manjaro +XCURSOR_SIZE=24 diff --git a/themes/light/home/.config/fish/conf.d/10-theme.fish b/themes/light/home/.config/fish/conf.d/10-theme.fish new file mode 100644 index 0000000..851241e --- /dev/null +++ b/themes/light/home/.config/fish/conf.d/10-theme.fish @@ -0,0 +1,34 @@ +# ~/.config/fish/conf.d/10-theme.fish +# Breeze-Light-Farbschema – wird vom Desktop-Theme gesetzt. +# Bei einem Theme-Wechsel ersetzt das Installationsskript diese Datei. + +# GTK-Programme aus dieser Shell im passenden Design starten +set -gx GTK_THEME Arc + +# Farben für eigene Prompt-Funktionen +set -g theme_normal 232629 +set -g theme_muted 6d7880 +set -g theme_accent 1c7ed6 +set -g theme_danger d64545 +set -g theme_success 2f9e44 + +# fish-eigene Farben +set -g fish_color_normal 232629 +set -g fish_color_command 1c7ed6 +set -g fish_color_param 232629 +set -g fish_color_error d64545 +set -g fish_color_comment 6d7880 +set -g fish_color_quote 2f9e44 +set -g fish_color_operator 0c8599 +set -g fish_color_escape b8860b +set -g fish_color_selection --background=d0ebff +set -g fish_color_autosuggestion 8a949b +set -g fish_color_valid_path --underline +set -g fish_color_match --background=d0ebff +set -g fish_color_history_current --bold +set -g fish_color_search_match --background=d0ebff + +set -g fish_pager_color_prefix 1c7ed6 +set -g fish_pager_color_progress 6d7880 +set -g fish_pager_color_completion 232629 +set -g fish_pager_color_description 6d7880 diff --git a/themes/light/home/.config/foot/foot.ini b/themes/light/home/.config/foot/foot.ini new file mode 100644 index 0000000..b285e53 --- /dev/null +++ b/themes/light/home/.config/foot/foot.ini @@ -0,0 +1,48 @@ +# foot – Breeze Light +# Farben ohne führendes #, sechsstellig. + +[main] +shell=/usr/bin/fish +font=JetBrains Mono:size=10 +initial-window-size-pixels=1100x680 +pad=12x9 +dpi-aware=no +app-id=foot +title=foot +resize-delay-ms=120 + +[scrollback] +lines=10000 + +[cursor] +style=beam +blink=no +color=ffffff 1c7ed6 + +[colors] +alpha=0.98 +background=f8fbff +foreground=232629 + +regular0=232629 +regular1=d64545 +regular2=2f9e44 +regular3=b8860b +regular4=1c7ed6 +regular5=9c36b5 +regular6=0c8599 +regular7=6d7880 + +bright0=5f6b73 +bright1=f03e3e +bright2=37b24d +bright3=e8a317 +bright4=4dabf7 +bright5=ae3ec9 +bright6=15aabf +bright7=232629 + +selection-foreground=1864ab +selection-background=d0ebff +urls=1c7ed6 +flash=d64545 diff --git a/themes/light/home/.config/fuzzel/fuzzel.ini b/themes/light/home/.config/fuzzel/fuzzel.ini new file mode 100644 index 0000000..b98aa63 --- /dev/null +++ b/themes/light/home/.config/fuzzel/fuzzel.ini @@ -0,0 +1,35 @@ +# fuzzel – Breeze Light +# Weiche Pastellakzente: hellblaue Auswahl, dunkelblaue Schrift. + +[main] +font=DejaVu Sans:size=11 +dpi-aware=no +prompt="❯ " +icons-enabled=yes +icon-theme=Qogir-Manjaro +terminal=kitty +lines=10 +width=44 +horizontal-pad=18 +vertical-pad=14 +inner-pad=8 +anchor=center +layer=overlay + +[border] +width=1 +radius=10 + +[colors] +background=f4f9fff2 +text=232629ff +prompt=1c7ed6ff +match=1864abff +selection=d0ebffff +selection-text=1864abff +selection-match=1c7ed6ff +counter=6d7880ff +border=a5d8ffff + +[dmenu] +exit-immediately-if-empty=yes diff --git a/themes/light/home/.config/gtk-3.0/settings.ini b/themes/light/home/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..6c77c15 --- /dev/null +++ b/themes/light/home/.config/gtk-3.0/settings.ini @@ -0,0 +1,11 @@ +[Settings] +gtk-theme-name=Arc +gtk-icon-theme-name=Qogir-Manjaro +gtk-font-name=DejaVu Sans 9 +# Helles Arc: prefer-dark muss 0 sein. +gtk-application-prefer-dark-theme=0 +gtk-cursor-theme-name=Qogir-Manjaro +gtk-cursor-theme-size=24 +gtk-enable-animations=1 +gtk-menu-images=0 +gtk-decoration-layout=:minimize,maximize,close diff --git a/themes/light/home/.config/gtk-4.0/settings.ini b/themes/light/home/.config/gtk-4.0/settings.ini new file mode 100644 index 0000000..f5cc3b9 --- /dev/null +++ b/themes/light/home/.config/gtk-4.0/settings.ini @@ -0,0 +1,9 @@ +[Settings] +gtk-theme-name=Arc +gtk-icon-theme-name=Qogir-Manjaro +gtk-font-name=DejaVu Sans 9 +# Helles Arc: prefer-dark muss 0 sein. +gtk-application-prefer-dark-theme=0 +gtk-cursor-theme-name=Qogir-Manjaro +gtk-cursor-theme-size=24 +gtk-decoration-layout=:minimize,maximize,close diff --git a/themes/light/home/.config/kitty/theme.conf b/themes/light/home/.config/kitty/theme.conf new file mode 100644 index 0000000..c22acc8 --- /dev/null +++ b/themes/light/home/.config/kitty/theme.conf @@ -0,0 +1,39 @@ +# kitty – Breeze Light +# Wird beim Design-Wechsel durch themes/light/.../theme.conf ersetzt. + +background #f8fbff +foreground #232629 +cursor #1c7ed6 +cursor_text_color #ffffff +selection_background #d0ebff +selection_foreground #1864ab +url_color #1c7ed6 +background_opacity 0.98 + +active_border_color #1c7ed6 +inactive_border_color #cfe0f3 + +tab_bar_background #eef4fb +active_tab_background #1c7ed6 +active_tab_foreground #ffffff +inactive_tab_background #e1eaf5 +inactive_tab_foreground #5f6b73 +active_tab_font_style bold +inactive_tab_font_style normal + +color0 #232629 +color1 #d64545 +color2 #2f9e44 +color3 #b8860b +color4 #1c7ed6 +color5 #9c36b5 +color6 #0c8599 +color7 #6d7880 +color8 #5f6b73 +color9 #f03e3e +color10 #37b24d +color11 #e8a317 +color12 #4dabf7 +color13 #ae3ec9 +color14 #15aabf +color15 #232629 diff --git a/themes/light/home/.config/labwc/autostart b/themes/light/home/.config/labwc/autostart new file mode 100644 index 0000000..3129189 --- /dev/null +++ b/themes/light/home/.config/labwc/autostart @@ -0,0 +1,68 @@ +#!/bin/sh +# labwc – Autostart (wird als Shell-Skript ausgeführt) + +# GTK-, Icon- und Cursor-Werte über GSettings (dconf) setzen. Unter +# Wayland liest GTK diese Werte aus dconf; ~/.config/gtk-3.0/settings.ini +# wird ignoriert. Der Aufruf steht vor den Programmen, damit Waybar, +# Thunar und GTK-Apps von Anfang an das richtige Icon-Theme sehen. +if [ -x "$HOME/.local/bin/set-gtk-settings" ]; then + if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v dbus-run-session >/dev/null 2>&1; then + dbus-run-session -- "$HOME/.local/bin/set-gtk-settings" light >/dev/null 2>&1 || true + else + "$HOME/.local/bin/set-gtk-settings" light >/dev/null 2>&1 || true + fi +fi + +# Hintergrundbild +if [ -f "$HOME/.local/share/backgrounds/labwc-light.png" ]; then + swaybg -i "$HOME/.local/share/backgrounds/labwc-light.png" -m fill >/dev/null 2>&1 & +else + swaybg -c '#eef4fb' >/dev/null 2>&1 & +fi + +# Benachrichtigungen +mako >/dev/null 2>&1 & + +# Taskleiste +waybar >/dev/null 2>&1 & + +# PolicyKit-Agent (Passwortdialog für pkexec, z. B. gparted) +if [ -x /usr/libexec/xfce-polkit ]; then + /usr/libexec/xfce-polkit >/dev/null 2>&1 & +elif command -v xfce-polkit >/dev/null 2>&1; then + xfce-polkit >/dev/null 2>&1 & +elif command -v lxpolkit >/dev/null 2>&1; then + lxpolkit >/dev/null 2>&1 & +fi + +# D-Bus-Aktivierungsumgebung aktuell halten (für GTK/Portal-Programme) +if command -v dbus-update-activation-environment >/dev/null 2>&1; then + dbus-update-activation-environment \ + WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE \ + >/dev/null 2>&1 +fi + +# KDE Connect (Indikator; kdeconnectd wird bei Bedarf per D-Bus gestartet) +if command -v kdeconnect-indicator >/dev/null 2>&1; then + kdeconnect-indicator >/dev/null 2>&1 & +fi + +# Idle-Manager: nach 10 Min sperren, nach 15 Min Monitor aus, +# nach 30 Min Ruhezustand (Suspend). Laufende Medienwiedergabe +# über PipeWire verhindert die Aktionen. +# +# "resume" gehört jeweils direkt hinter den zugehörigen "timeout": +# Bei Aktivität wird der Monitor wieder eingeschaltet und wartende +# Aktionen werden abgebrochen. Ohne diese Zuordnung bliebe der +# Bildschirm nach dem Ausschalten schwarz. +if command -v swayidle >/dev/null 2>&1; then + swayidle -w \ + timeout 600 'idle-action lock' resume 'idle-action cancel' \ + timeout 900 'idle-action dpms-off' resume 'idle-action resume' \ + timeout 1800 'idle-action suspend' resume 'idle-action resume' \ + after-resume 'idle-action resume' \ + before-sleep 'idle-action lock-now' \ + lock 'idle-action lock-now' >/dev/null 2>&1 & +fi + +exit 0 diff --git a/themes/light/home/.config/labwc/environment b/themes/light/home/.config/labwc/environment new file mode 100644 index 0000000..1229f7b --- /dev/null +++ b/themes/light/home/.config/labwc/environment @@ -0,0 +1,23 @@ +# labwc – Umgebung (helles Design) +# Wird bei jedem Start und bei "Reconfigure" neu eingelesen. + +# Tastatur +XKB_DEFAULT_LAYOUT=de + +# Mauszeiger +XCURSOR_THEME=Qogir-Manjaro +XCURSOR_SIZE=24 + +# Helles GTK für alle GTK-Programme +GTK_THEME=Arc + +# Wayland für Firefox / Qt +MOZ_ENABLE_WAYLAND=1 +QT_QPA_PLATFORM=wayland + +# Eigene Skripte (session-menu), opencode, Node.js (nvm) und +# Flatpak-Programme auffindbar machen. +# Absoluter Pfad, damit kein rekursives $PATH entsteht. +# /usr/sbin und /sbin sind enthalten, damit Werkzeuge wie gparted auch aus +# GUI-Terminals und von der Leiste gestarteten Programmen gefunden werden. +PATH=@NODE_BIN@@HOME@/.opencode/bin:@HOME@/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/flatpak/exports/bin:@HOME@/.local/share/flatpak/exports/bin:/usr/local/games:/usr/games diff --git a/themes/light/home/.config/labwc/themerc-override b/themes/light/home/.config/labwc/themerc-override new file mode 100644 index 0000000..f93cfba --- /dev/null +++ b/themes/light/home/.config/labwc/themerc-override @@ -0,0 +1,75 @@ +# labwc – Breeze-Light-Farbwelt +# Nur Abweichungen vom eingebauten Standard-Theme. +# Weiche Blau-/Pastellakzente statt reinem Weiß. + +border.width: 1 +window.titlebar.padding.width: 6 +window.titlebar.padding.height: 4 + +# Fensterrahmen +window.active.border.color: #4dabf7 +window.inactive.border.color: #cfe0f3 +window.active.indicator.toggled-keybind.color: #b8860b + +# Titelleiste +window.active.title.bg.color: #e7f2ff +window.inactive.title.bg.color: #eef1f4 +window.active.label.text.color: #1864ab +window.inactive.label.text.color: #6d7880 +window.label.text.justify: center + +# Buttons +window.button.width: 24 +window.button.height: 24 +window.button.spacing: 2 +window.button.hover.bg.corner-radius: 6 +window.active.button.unpressed.image.color: #5f6b73 +window.inactive.button.unpressed.image.color: #98a2a8 +window.active.button.close.unpressed.image.color: #d64545 +window.active.button.close.hover.image.color: #232629 + +# Schatten (pixman-schonend) +window.active.shadow.size: 18 +window.inactive.shadow.size: 10 +window.active.shadow.color: #00000026 +window.inactive.shadow.color: #00000017 + +# Menü +menu.border.width: 1 +menu.border.color: #cfe0f3 +menu.items.bg.color: #ffffff +menu.items.text.color: #232629 +menu.items.active.bg.color: #d0ebff +menu.items.active.text.color: #1864ab +menu.items.padding.x: 12 +menu.items.padding.y: 6 +menu.separator.width: 1 +menu.separator.padding.width: 8 +menu.separator.padding.height: 4 +menu.separator.color: #dbe7f4 +menu.title.bg.color: #e7f2ff +menu.title.text.color: #1c7ed6 +menu.title.text.justify: Left + +# Fensterwechsler / OSD +osd.bg.color: #f8fbff +osd.border.color: #4dabf7 +osd.border.width: 1 +osd.label.text.color: #232629 +osd.window-switcher.width: 480 +osd.window-switcher.padding: 8 +osd.window-switcher.item.padding.x: 10 +osd.window-switcher.item.padding.y: 4 +osd.window-switcher.item.active.border.width: 2 +osd.window-switcher.preview.border.width: 1 +osd.window-switcher.preview.border.color: #4dabf7 +osd.workspace-switcher.boxes.width: 16 +osd.workspace-switcher.boxes.height: 16 + +# Andock-Vorschau +snapping.overlay.region.bg.color: #4dabf740 +snapping.overlay.edge.bg.color: #4dabf740 +snapping.overlay.region.border.width: 1 +snapping.overlay.edge.border.width: 1 +snapping.overlay.region.border.color: #4dabf7 +snapping.overlay.edge.border.color: #4dabf7 diff --git a/themes/light/home/.config/mako/config b/themes/light/home/.config/mako/config new file mode 100644 index 0000000..0a26c8d --- /dev/null +++ b/themes/light/home/.config/mako/config @@ -0,0 +1,23 @@ +# mako – Breeze Light +# Leicht blau getönte Benachrichtigungen statt reinem Weiß. + +font=DejaVu Sans 10 +background-color=#f4f9fff2 +text-color=#232629 +border-color=#4dabf7 +progress-color=over #4dabf7ff +border-size=2 +border-radius=8 +padding=12 +margin=12 +width=360 +height=140 +max-visible=4 +anchor=top-right +default-timeout=6000 +icons=1 +layer=overlay + +[urgency=high] +border-color=#d64545 +default-timeout=0 diff --git a/themes/light/home/.config/swaylock/config b/themes/light/home/.config/swaylock/config new file mode 100644 index 0000000..95a135b --- /dev/null +++ b/themes/light/home/.config/swaylock/config @@ -0,0 +1,51 @@ +# swaylock – Breeze Light, passend zu Waybar/labwc +# Palette: Hintergrund #eef4fb · Fläche #f4f9ff · Text #232629 +# Akzent #1c7ed6 · Grün #2f9e44 · Rot #d64545 · Grau #6d7880 + +# Hintergrundbild (gleiches Wallpaper wie der Desktop) +image=@HOME@/.local/share/backgrounds/labwc-light.png +scaling=fill +color=eef4fb + +# Schrift wie Waybar +font=DejaVu Sans +font-size=14 + +# Entsperr-Kreis +indicator-radius=80 +indicator-thickness=8 + +# Ring: Akzent, neutral, prüfen, falsch +ring-color=1c7ed6 +ring-clear-color=6d7880 +ring-ver-color=2f9e44 +ring-wrong-color=d64545 + +# Innenfläche: hell, leicht blau getönt und transparent +inside-color=f4f9ffdd +inside-clear-color=f4f9ffdd +inside-ver-color=eef8f1dd +inside-wrong-color=fdf0f0dd + +# Text im Kreis +text-color=232629 +text-clear-color=232629 +text-ver-color=1e6b31 +text-wrong-color=a32d2d + +# Tastendrücke +key-hl-color=1c7ed6 +bs-hl-color=d64545 + +# Caps-Lock-Zustand anzeigen (hilft bei fehlgeschlagener Eingabe) +indicator-caps-lock + +# Trennlinien ausblenden +separator-color=00000000 +line-color=00000000 +line-clear-color=00000000 +line-ver-color=00000000 +line-wrong-color=00000000 + +# Fehlversuche anzeigen +show-failed-attempts diff --git a/themes/light/home/.config/tuigreet/theme.conf b/themes/light/home/.config/tuigreet/theme.conf new file mode 100644 index 0000000..755e283 --- /dev/null +++ b/themes/light/home/.config/tuigreet/theme.conf @@ -0,0 +1 @@ +container=white;border=lightblue;title=blue;text=black;time=lightblue;greet=darkgray;prompt=blue;input=black;action=darkgray;button=blue diff --git a/themes/light/home/.config/waybar/style.css b/themes/light/home/.config/waybar/style.css new file mode 100644 index 0000000..b8f4d2d --- /dev/null +++ b/themes/light/home/.config/waybar/style.css @@ -0,0 +1,173 @@ +/* waybar – Breeze Light, kompakt für 1280×1024 + Hintergrund #eef4fb · Text #232629 · Akzent #1c7ed6 + Weiche Pastellakzente für Netzwerk, Audio, CPU und Speicher. */ + +* { + font-family: "DejaVu Sans", "Symbols Nerd Font", sans-serif; + font-size: 11px; + min-height: 0; + border: none; + border-radius: 0; +} + +window#waybar { + background: linear-gradient(180deg, #eef6ff 0%, #e7eef9 100%); + color: #232629; + border-top: 1px solid #cfe0f3; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* ---------- links: Launcher + Taskleiste ---------- */ + +#custom-launcher { + color: #1c7ed6; + background: #ffffff; + font-size: 15px; + padding: 0 10px; + margin: 4px 3px 4px 5px; + border-radius: 6px; +} + +#custom-launcher:hover { + color: #ffffff; + background: #1c7ed6; +} + +#taskbar { + padding: 0 1px; +} + +/* Nur Icons: kompakt, damit die rechten Module sichtbar bleiben */ +#taskbar button { + padding: 0 5px; + margin: 4px 1px; + min-width: 20px; + border-radius: 6px; + background: transparent; + color: #5f6b73; +} + +#taskbar button:hover { + background: #d0ebff; + color: #1864ab; +} + +#taskbar button.active { + background: #ffffff; + color: #1864ab; + box-shadow: inset 0 -2px 0 #1c7ed6; +} + +#taskbar button.minimized { + color: #98a2a8; +} + +#taskbar button.urgent { + color: #ffffff; + background: #d64545; +} + +/* ---------- rechts: Status + Uhr ---------- */ + +#tray, +#network, +#wireplumber, +#cpu, +#memory, +#custom-session { + padding: 0 8px; + margin: 4px 1px; + border-radius: 6px; +} + +#tray { + color: #5f6b73; + padding: 0 5px; +} + +/* Feste Breiten: verhindern das Springen bei 9 % → 10 % → 100 % + und beim Stummschalten. Werte aus den gemessenen Textbreiten (11 px). */ +#network { + color: #1c7ed6; + min-width: 58px; + padding: 0; +} + +#wireplumber { + color: #0c8599; + min-width: 58px; + padding: 0; +} + +#cpu { + color: #e8590c; + min-width: 54px; + padding: 0; +} + +#memory { + color: #7048e8; + min-width: 52px; + padding: 0; +} + +#network:hover, +#wireplumber:hover, +#cpu:hover, +#memory:hover { + background: #ffffff; + color: #1864ab; +} + +#wireplumber.muted { + color: #d64545; +} + +#memory.warning { + color: #b8860b; +} + +#memory.critical { + color: #d64545; +} + +#custom-session { + color: #1c7ed6; + font-size: 13px; + padding: 0 10px; +} + +#custom-session:hover { + color: #ffffff; + background: #d64545; +} + +#clock { + color: #1864ab; + font-weight: bold; + font-size: 12px; + padding: 0 12px; + margin: 4px 6px 4px 1px; + border-radius: 6px; + letter-spacing: 0.3px; +} + +#clock:hover { + background: #ffffff; +} + +/* ---------- Tooltips ---------- */ + +tooltip { + background: #ffffff; + border: 1px solid #1c7ed6; + border-radius: 8px; +} + +tooltip label { + color: #232629; + padding: 5px 8px; +}