summaryrefslogtreecommitdiffstats
path: root/dwl-patches/patches/spawninfo/README.md
blob: 5ee345d246c90e79783cdea1b7e71acee970993f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
### Description

This patch adds `spawninfo` function that is very similar to `spawn`, except it
also passes some information about the focused client via stdin.

The info is passed in this format:

    PID
    TITLE
    APPID
    TAGS
    X,Y WIDTHxHEIGHT

I use it for 2 things: grabbing a screenshot of a focused window and adjusting
volume of audio produced by a focused window (so much simpler than having to
open pulsemixer every time). If you want to have the same functionality, you
need to put these scripts into your PATH and make them executable:

[screenshotwin](/dwl/dwl-patches/raw/branch/main/patches/spawninfo/screenshotwin)
for taking a screenshot (`grim` is required):

```c
	{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S,          spawninfo,      SHCMD("screenshotwin") },
```

[pamixerc](/dwl/dwl-patches/raw/branch/main/patches/spawninfo/pamixerc)
for adjusting volume (`pactl` is required):

```c
	{ MODKEY,                    XKB_KEY_XF86AudioRaiseVolume,spawninfo,SHCMD("pamixerc -- -i 5") },
	{ MODKEY,                    XKB_KEY_XF86AudioLowerVolume,spawninfo,SHCMD("pamixerc -- -d 5") },
	{ MODKEY,                    XKB_KEY_XF86AudioMute, spawninfo,    SHCMD("pamixerc -- -t") },
```

### Download

- [0.7](/dwl/dwl-patches/raw/branch/main/patches/spawninfo/spawninfo.patch)

### Authors

- [Nikita Ivanov](https://codeberg.org/nikitaivanov) ([GitHub](https://github.com/NikitaIvanovV))