# mu-picture

> **mu-picture** is a featherlight, highly versatile GTK3 image and slideshow viewer written in Vala.

## Core Capabilities & Highlights

* **🖼️ Image Viewer:** Smoothly scales and renders popular image formats (`.jpg`, `.png`, `.webp`) with custom bevel borders, inner margins, and background colors.
* **🎞️ Slideshow Mode:** Automatically iterates through all valid images in a configured directory at user-defined time intervals, complete with play, pause, next, and previous controls.
* **📄 Track of File Containing Image Name:** Continuously monitors an external text configuration file (`file.rc`). Whenever the file path string written inside changes, the viewer instantly updates to show the new image.
* **🔄 Tracking of the Image Itself for Changes:** Observes the active image file directly on disk. If an external script or program overwrites or modifies the image file, it reloads and updates instantly.
* **🔲 Borderless:** Runs without window manager decorations or title bars for a sleek, embedded widget appearance.
* **📐 Resizable:** Grab edges or corners to resize freely, or click and drag anywhere on the canvas to move the window. All geometry changes persist automatically.
* **📌 Layer Selection:** Easily configure window stacking behavior (`above`, `normal`, or `below`) and window hints (`utility`, `dock`, `desktop`) to keep your viewer pinned as a background wallpaper widget or a floating overlay.

---

## Installation & Compilation

Ensure you have the Vala compiler and GTK3 development libraries installed on your system (e.g., on Debian/Ubuntu/Mint):

    sudo apt install valac libgtk-3-dev

Compile the source code using the following command:

    valac --pkg gtk+-3.0 mu-picture.vala -o mu-picture

Run the application:

    ./mu-picture

---

## Configuration (`mu-picture.rc`)

On startup, `mu-picture` looks inside `~/.mu-picture/` for configuration files (defaults to `mu-picture.rc`). Below is an example configuration file outlining all parameters:

    x = 100
    y = 100
    width = 500
    height = 400
    borderwidth = 4
    inner_border = 2
    bordercolor1 = #FFFFFF
    bordercolor2 = #808080
    bgcolor = #000000
    window_type = normal
    window_layer = above
    filerc = file.rc
    slideshow = false
    interval = 5
    slideshow_dir = ~/Pictures/Wallpapers

---

## Complete Command-Line Options Reference

You can invoke `mu-picture` directly from the terminal with a custom configuration profile and argument overrides:

    ./mu-picture [CUSTOM_CONFIG.rc] [OPTIONS]

### Position & Geometry Options
* **`-x, --xpos INT`** - Sets the initial X-coordinate position of the window on your screen (e.g., `-x 200`).
* **`-y, --ypos INT`** - Sets the initial Y-coordinate position of the window on your screen (e.g., `-y 150`).
* **`-w, --width INT`** - Sets the initial width of the window frame in pixels (e.g., `-w 600`).
* **`-g, --height INT`** - Sets the initial height of the window frame in pixels (e.g., `-g 450`).

### Styling & Appearance Options
* **`-b, --border INT`** - Defines the thickness of the outer bevel frame in pixels (e.g., `-b 6`).
* **`-i, --inner-border INT`** - Defines the inner margin space gap between the bevel border and the rendered image content in pixels (e.g., `-i 4`).
* **`-1, --color1 HEX`** - Sets the top/left bevel highlight color using standard hexadecimal format (e.g., `-1 #E0E0E0`).
* **`-2, --color2 HEX`** - Sets the bottom/right bevel shadow color using standard hexadecimal format (e.g., `-2 #404040`).
* **`-3, --bgcolor HEX`** - Sets the background canvas color that shows behind or around the scaled image (e.g., `-3 #1A1A1A`).

### Window Management & Behavior Options
* **`-l, --layer LAYER`** - Configures the window stacking layer strategy (`above`, `normal`, or `below`).
* **`-t, --title 0|1`** - Toggles window manager decorations/title bars (`0` for borderless utility frame, `1` for standard title bar).
* **`-f, --filerc FILENAME`** - Specifies a custom tracker file path that `mu-picture` watches for image path changes instead of `file.rc`.

---

## License

This program is free software distributed under the terms of the **GNU General Public License (v2 or later)**.

Changes:
1.0.1
- fixed non working scaling