Ano-sys a395470d88 + image scaling on mouse scroll
+ window resize redraws surface
+ moved window loop into own function
- removed on_wheel call to resize window for now -> hyprland is not handling this
+ image is not initially drawn onto displayed surface anymore, a subsurface is used (image_surface) to allow scaling on the real surface without redrawing the image in buffer.
+ renamed free_image to free_image_buffer to be more clear about the functionallity
+ renamed draw_image to create_image_surface
+ draw_image is a new function which draws the image_surface with linear scale onto the windows surface
2026-08-15 17:44:43 +02:00
2026-05-29 03:37:25 +02:00

SimpleImageViewer

View images fast and without any hocus pocus, sometimes less is better

Disclaimer

The inspiration was a YouTube video, I've watched the beginning and though to myself that this cannot be that hard to implement.
Of course it is not without usage, I will prepare the app to be hooked in Hyprland to launch the current photo stored in clipboard.

Requirements

  • SDL3

Installations

As of now the only like-indented working implementation is for macOS. Wayland ignores the desired window states (resize, position).

macOS

  • brew install sdl3
  • clone this repo and navigate into it
  • gcc SimpleImageViewer.c -o SimpleImageViewer -Wall -Werror $(pkg-config --cflags --libs sdl3) or with clang
  • additional compiler arguments for ide: -I/opt/homebrew/include -L/opt/homebrew/lib -Wl,-rpath,/opt/homebrew/lib -lSDL3

Linux

  • sudo pacman -S sdl3 --noconfirm
  • gcc SimpleImageViewer.c -o SimpleImageViewer -Wall -Werror $(pkg-config --cflags --libs sdl3) -lm or with clang
  • when using Hyprland, move the scripts folder into your ~/.config/hypr/
  • in simple-image-viewer-clipboard.sh: set viewer, I placed my binary beside this script
  • move the hypr_simpleimageviewer.lua file into ~/.config/hypr/
  • replace [USER] with your user
  • add require(hypr_simpleimageviewer) at the top of your Hyprland config
S
Description
No description provided
Readme 149 KiB
Languages
C 99.1%
Shell 0.8%