Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Manos Pitsidianakis <[email protected]>
  • Loading branch information
epilys committed Nov 25, 2024
1 parent 177df88 commit 7608a82
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 14 deletions.
61 changes: 47 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# `rlr`: a pixel screen ruler

![Minimum Supported Rust Version](https://img.shields.io/badge/MSRV-1.70.0-blue) [![GitHub license](https://img.shields.io/github/license/epilys/rlr)](https://github.com/epilys/rlr/blob/master/LICENSE) [![Crates.io](https://img.shields.io/crates/v/rlr-gtk)](https://crates.io/crates/rlr-gtk)

![./rlr.png](./rlr.png)

Rust + GTK interactive pixel screen ruler with protractor mode.

## demo
```shell
cargo install rlr
```

## Demo

<table>
<tr><td colspan=2 align="center"><kbd>
Expand All @@ -20,27 +26,54 @@ Rust + GTK interactive pixel screen ruler with protractor mode.

</kbd></td></tr></table>

## Use

To use application settings, the app's settings schema but be installed in your system.
It is possible to attempt to do this automatically via the Settings menu, which will install the schema to `${HOME}/.local/share/glib-2.0/schemas/` and subsequently attempt to compile it; but the directory must exist beforehand, it won't be created.

`rlr` includes a command-line argument `--install-gsettings-schema` that creates the settings schema at the given directory.
If directory is `-`, it will be printed to standard output instead.

*Note*: The directory values should probably be one of: `${HOME}/.local/share/glib-2.0/schemas/`, `/usr/share/glib-2.0/schemas/` or similar.

For the settings schema to be discoverable, it must be compiled with `glib-compile-schemas`.

An example usage:

```shell
rlr --install-gsettings-schema "${HOME}/.local/share/glib-2.0/schemas/"
```

and then:

```shell
glib-compile-schemas "${HOME}/.local/share/glib-2.0/schemas/"
```

### Shortcuts

## use
If you are on macOS, use <kbd>⌘</kbd> (Command) key instead of <kbd>Ctrl</kbd>.

- Quit with `q` or `Ctrl-Q`.
- Click to drag.
- Press `r` to rotate 90 degrees. Press `<Shift>r` to flip (mirror) the marks without rotation.
- Press `p` to toggle protractor mode.
- Press `f` or `<Space>` to toggle freezing the measurements.
- Press `Control_L` and drag the angle base side to rotate it in protractor mode.
- Press `Control_L` continuously to disable precision (measurements will snap to nearest integer).
- Press `+` to increase size.
- Press `-` to decrease size.
- Press `Up`, `Down`, `Left`, `Right` to move window position by 10 pixels. Also hold down `Control_L` to move by 1 pixel.
- **Quit** with <kbd>q</kbd> or <kbd>Ctrl</kbd> + <kbd>Q</kbd>.
- Click to **drag**.
- Press <kbd>?</kbd> or <kbd>F1</kbd> to **open the About and Help window**.
- Press <kbd>s</kbd> or <kbd>F2</kbd> to **open the Settings window**.
- Press <kbd>r</kbd> to **rotate** 90 degrees. Press <kbd>Shift</kbd> + <kbd>r</kbd> to **flip (mirror)** the marks without rotation.
- Press <kbd>p</kbd> to toggle **protractor mode**.
- Press <kbd>f</kbd> or <kbd>Space</kbd> to toggle **freezing the measurements**.
- Press <kbd>Ctrl</kbd> and drag the angle base side to **rotate it while in protractor mode**.
- Press <kbd>Ctrl</kbd> continuously to **disable precision** (measurements will snap to nearest integer).
- Press <kbd>+</kbd> to **increase size**. Press <kbd>-</kbd> to **decrease size**.
- Press <kbd>Ctrl</kbd> + <kbd>+</kbd>, <kbd>Ctrl</kbd> + <kbd>+</kbd> to **increase font size**. Press <kbd>Ctrl</kbd> + <kbd>-</kbd>, <kbd>Ctrl</kbd> + <kbd>-</kbd> to **decrease font size**.
- Press <kbd>Up</kbd>, <kbd>Down</kbd>, <kbd>Left</kbd>, <kbd>Right</kbd> to **move window position by 10 pixels**. Also hold down <kbd>Ctrl</kbd> to **move by 1 pixel**.

## build
## Build

```shell
cargo build --release
```

## packaging
## Packaging

To help packagers in OSes that support the XDG Desktop standards, a `.desktop`
app launcher filer, an application icon and a symbolic application icon are
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,7 @@ fn show_about_window(window: &gtk::ApplicationWindow) {
format!(
"{bs}Quit{be} with {ms}q{me} or {ms}{lt}{primary}{gt}Q{me}.
Click to {bs}drag{be}.
Press {ms}?{me} or {ms}F1{me} to {bs}open the About and Help window{be}.
Press {ms}s{me} or {ms}F2{me} to {bs}open the Settings window{be}.
Press {ms}r{me} to {bs}rotate{be} 90 degrees. Press {ms}{lt}Shift{gt}r{me} to {bs}flip \
(mirror){be} the marks without rotation.
Expand Down

0 comments on commit 7608a82

Please sign in to comment.