-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
shotkey.1
102 lines (77 loc) · 2.25 KB
/
shotkey.1
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.TH SHOTKEY 1 shotkey\-VERSION
.SH NAME
shotkey \- A suckless hot key daemon for X inspired by the suckless philosophy with configurable custom modes.
.SH SYNOPSIS
.B shotkey
.SH DESCRIPTION
A suckless hot key daemon for X inspired by the suckless philosophy with configurable custom modes
.SH Configuration
You can cofigure your key bindings, modes and other shit inside `config.h`.
This keeps it fast, secure and simple.
.SS config.h
.TP
.B shell
The shell to use to execute the commands.
.TP
.B keys
This is where you declare the list of key bindings.
Examples -
.B Super+d
opens dmenu_run;
.B Super+m
enters VolumeControl mode;
.B Super+l
enters Layout mode and quits mode after the next key press
.EX
static Key keys[] = {
{ Mod4Mask, XK_d, cmd("dmenu_run") },
{ Mod4Mask, XK_m, mode(VolumeControl, True) },
{ Mod4Mask, XK_l, mode(Layout, False) },
};
.EE
.TP
.B modes
This is where you define the key bindings inside your modes
Once you are in volume control mode, (with persist: True), you can use j and k to increase/decrease the volume and then when you're done, press Escape to go back to normal mode.
Once you are in Layout mode, (with persist: False), you can use t or m to set the layout to tiled/monocle and then immedietely quit out of the mode and go back to normal mode.
.EX
enum {
VolumeControl,
Layout,
// Declare modes above this
MODE_SIZE, // NOTE: Do not remove this
};
static Key modes[MODE_SIZE][10] = {
[VolumeControl] = {
{ 0, XK_j, cmd("amixer sset Master '5%-'") },
{ 0, XK_k, cmd("amixer sset Master '5%+'") },
},
[Layout] = {
{ 0, XK_t, cmd("dwmc setlayoutex 0") },
{ 0, XK_m, cmd("dwmc setlayoutex 2") },
},
};
.EE
.TP
.B mode_properties
This list lets you set a label to your modes (Useful for
.B on_mode_change
hook)
.TP
.B on_mode_change
This option allows you to run a script on every layout change.
It will provide the following environment variables for scripting.
.B SHOTKEY_MODE_ID
This is the `index` of the mode. Normal mode is `-1`.
.B SHOTKEY_MODE_LABEL
This is the label assigned to a mode inside mode_properties
.SH BUGS
Report issues to https://github.com/phenax/shotkey/issues
.SH AUTHOR
.MT phenax5@gmail.com
Akshay Nair
.ME
.SH LINKS
.UR https://github.com/phenax/shotkey
Homepage
.UE