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
103
104
105
106
107
|
/*
cmdtree <git.sr.ht/~jb55/cmdtree> configuration file
This gets applied a compile time.
*/
enum position {
POSITION_TOP,
POSITION_LEFT,
POSITION_RIGHT,
POSITION_BOTTOM
};
static int xpad = 6;
static int ypad = 2;
static enum position position = POSITION_TOP;
static const char *separator = " → ";
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {
"monospace:size=12"
};
#define scheme_bg "#222222"
static struct scheme schemes[SchemeLast] = {
[SchemeNorm] = { .bg = scheme_bg,
.bind = "#D19A66",
.arrow = "#888",
.prefix = "",
.name = "#bbbbbb"
},
[SchemePrefix] = { .bg = scheme_bg,
.bind = "#eeeeee",
.arrow = "#888",
.prefix = "",
.name = "#c678dd"
},
};
static struct command mumble[] = {
DEFCMD("m", "mute", "mumble rpc togglemute")
DEFCMD("d", "deaf", "mumble rpc toggledeaf")
DEFCMD("o", "open", "mumble")
DEFCMD("q", "quit", "pkill mumble")
};
static struct command apps[] = {
DEFCMD ("c", "chromium" , "chromium")
DEFCMD ("d", "dolphin" , "dolphin")
DEFCMD ("f", "firefox" , "firefox")
DEFCMD ("h", "xterm htop" , "xterm htop")
// DEFCMD ("k", "keybase" , "keybase-gui")
DEFPREFIX ("m", "mumble" , mumble)
DEFCMD ("r", "ranger" , "xterm ranger")
DEFCMD ("t", "telegram" , "telegram-desktop")
DEFCMD ("q", "qutebrowser", "qutebrowser")
};
static struct command mail_commands[] = {
DEFCMD("a", "all", "eml all")
DEFCMD("i", "in", "n eml in")
DEFCMD("n", "new", "n eml new")
DEFCMD("o", "out", "n eml out")
DEFCMD("t", "tag", "n eml tag")
};
static struct command play_commands[] = {
DEFCMD("m", "morning brew", "mplayer /mnt/lake/ben/youtube/morning/morning-brew-MvlIb8EPq3Y.mp3")
};
static struct command system_commands[] = {
// DEFPREFIX("c", "copy/sync", sync_commands)
DEFCMD("R", "reboot", "reboot")
DEFCMD("S", "suspend", "systemctl suspend")
DEFCMD("h", "h-m switch", "home-manager switch")
DEFCMD("w", "fresh wall", "wal")
DEFCMD("x", "restart xbindkeys", "pkill xbindkeys && xbindkeys")
DEFCMD("l", "light theme", "xtheme light")
DEFCMD("d", "dark theme", "xtheme dark")
};
struct command volume_commands[] = {
DEFCMD("k", "up" , "amixer -q sset Master 2%+")
DEFCMD("j", "down", "amixer -q sset Master 2%-")
DEFCMD("m", "mute", "amixer -q sset Master toggle")
};
// top-level
static struct command commands[] = {
DEFPREFIX ("a", "apps" , apps)
DEFCMD ("e", "emacs" , "emacsclient -c")
DEFCMD ("f", "flameshot" , "flameshot gui")
DEFPREFIX ("m", "mail" , mail_commands)
DEFPREFIX ("p", "play" , play_commands)
DEFPREFIX ("s", "system" , system_commands)
DEFCMD ("r", "run" , "rofi -sidebar-mode -show run")
DEFPREFIX ("v", "volume" , volume_commands)
DEFCMD ("w", "windows" , "rofi -sidebar-mode -show window")
DEFCMD ("z", "seeme" , "seeme")
};
|