Ivy is a basic image viewer that exports a small dbus interface.
ivy [options] [<actions>...] files...
Options:
--minimized Start the display minimized
Actions:
-h, --help Display this help and exit
--quit Close the display and quit
--scroll-<DIRECTION> Scroll in a particular direction
(left, up, right, down)
--zoom-<in|out> Adjust the zoom on the image
If ivy
is launched and the viewer is not present, then the viewer window is
created (except for -h). Invalid command-line options are ignored. Any number of
paths can be provided, and all files will be opened.
--minimized
is ignored if the viewer has already been launched.
Streaming: I originally created this project to show screenshots of a game window somewhere offscreen. Having a command-line client makes it possible to have a hotkey execute a script that reloads the viewer with a screenshot.
Example project: This project was supposed to be an example of a basic program that uses Qt's dbus.
- Executing
make clean
thenmake
results inmoc
complaining that it cannot open an options file that begins with@
.cmake .
on the project root directory fixes the issue.
In src/ivyservice.{cpp,h}
, create a new public slot that implements the action
or dispatches to IvyServer
. IvyServer
bus methods have a prefix of bus*
as a convention.
In src/ivy.cpp
, add entries to the option list, longopts, and help, then
implement the option.
The server's IvyService
uses an autogenerated (by Qt) dbus adaptor to receive
dbus arguments. The adaptor is updated when the project is rebuilt.
Ivy's design is largely inspired by xfce's ristretto
.