Skip to content

Commit 2ada23e

Browse files
Prep for crates.io
1 parent f6ed712 commit 2ada23e

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
name = "hypr_steam_watcher"
33
version = "1.1.0"
44
edition = "2024"
5+
authors = ["Lennard Kittner"]
6+
description = "Automatically tags newly launched Steam games in Hyprland."
7+
readme = "README.md"
8+
repository = "https://github.com/LennardKittner/hypr_steam_watcher"
9+
homepage = "https://github.com/LennardKittner/hypr_steam_watcher"
10+
license = "MIT"
11+
keywords = ["steam", "hyprland"]
12+
categories = ["command-line-utilities"]
513

614
[dependencies]
715
clap = "4.5.60"

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
Automatically tags newly launched Steam games in Hyprland so you can target or exclude them in window rules without manual configuration.
66

77
<p align="center">
8-
<img src="screenshot/image.png" width="700">
8+
<img src="https://raw.githubusercontent.com/LennardKittner/hypr_steam_watcher/main/screenshot/image.png" width="700">
99
<br>
1010
<em>VA-11 Hall-A tagged with steam_game and steam_app_id_447530</em>
1111
</p>
1212

1313
`hypr_steam_watcher` listens for newly created windows in Hyprland and automatically tags Steam game windows with `steam_game` and `steam_app_id_<game-id>`.
1414
This allows you to exclude Steam games from certain window rules or define specific window rules that only apply to Steam games.
15-
```
15+
```text
1616
windowrule = match:tag negative:steam_game, opacity 0.9 # Everything except steam games is transparent
1717
windowrule = match:tag steam_game, opacity no_blur # Disable blur for steam games
1818
windowrule = match:tag steam_game, render_unfocused true # Forces the window to think it’s being rendered when it’s not visible
@@ -53,7 +53,7 @@ sudo cp target/release/hypr_steam_watcher /usr/bin/
5353
Then add `exec-once = hypr_steam_watcher` to your `hyprland.conf` to start it automatically.
5454

5555
## Usage
56-
```
56+
```fish
5757
hypr_steam_watcher --help
5858
Automatically tag newly launched Steam games in Hyprland.
5959
@@ -79,41 +79,41 @@ Running `hypr_steam_watcher` without any arguments will automatically tag any St
7979
You can optionally run a command whenever a Steam game window opens or closes.
8080

8181
The simplest is to pass a callback directly:
82-
```
82+
```fish
8383
hypr_steam_watcher echo game:
8484
```
8585
This prints:
86-
```
86+
```fish
8787
game: <pid> <steam_app_id>
8888
```
8989
each time a steam game window opens.
9090

9191
You can also execute script:
92-
```
92+
```fish
9393
hypr_steam_watcher ./activate_game_mod.sh
9494
```
9595
Callbacks are executed asynchronously so they will not block the watcher.
9696

9797
#### More Complex Callbacks
9898
More complex callbacks can be executed using `bash -c`:
99-
```
99+
```fish
100100
hypr_steam_watcher bash -c 'sleep 2 && echo game: "$0 $1"'
101101
```
102102
This prints the game information after a two-second delay
103103

104104
#### Open / Close Callbacks
105105
To register a callback on window closure, use the dedicated options:
106-
```
106+
```fish
107107
hypr_steam_watcher --open-callback echo open: \; --close-callback echo close:
108108
```
109109
Output example:
110-
```
110+
```fish
111111
open: <pid> <steam_app_id>
112112
close: <pid> <steam_app_id>
113113
```
114114

115115
More complex callbacks are also possible:
116-
```
116+
```fish
117117
hypr_steam_watcher \
118118
--open-callback bash -c 'sleep 2 && echo open: "$0 $1"' \; \
119119
--close-callback bash -c 'sleep 2 && echo close: "$0 $1"'

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![doc = include_str!("../README.md")]
12
use std::{
23
collections::HashMap,
34
ffi::OsString,

0 commit comments

Comments
 (0)