~jb55/citadel

ref: 45e53c7a7cdb0d3afa5e1f8537bf1a1d732ccb02 citadel/dotfiles/cmdtree/cfg.def.h -rw-r--r-- 8.4 KiB
45e53c7aWilliam Casarin Merge remote-tracking branch 'monad/master' 1 year, 7 months ago
                                                                                
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
/* See LICENSE file for copyright and license details. */
/* Default settings; can be overriden by command line. */

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[] = {
	"terminus:pixelsize=16"
};

#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 bitcoin_commands[] = {
	DEFCMD("p", "price", "n btc")
	DEFCMD("b", "bcalc", "dmenupn bcalc bcalc")
};

static struct command chromecast_commands[] = {
	DEFCMD(" ", "play/pause", "n chromecast space play-paused")
	DEFCMD("p", "prev", "n chromecast p prev")
	DEFCMD("n", "next", "n chromecast n next")
	DEFCMD("s", "stop", "n chromecast s stopped")
	DEFCMD("q", "quit", "n chromecast quit quit")
	DEFCMD("t", "subtitles", "n chromecast t subtitles")
	DEFCMD("m", "mute", "n chromecast m muted")
};

static struct command phone_music_commands[] = {
	DEFCMD("p", "play/pause", "phonectl music:playpause")
	DEFCMD("=", "volume up", "phonectl music:up")
	DEFCMD("-", "volume down", "phonectl music:down")
};

static struct command phone_clipboard[] = {
	DEFCMD("f", "from phone", "phone-clipboard | xclip && xclip -o | xargs notify-send")
	DEFCMD("t", "to phone", "xclip -o | xargs phone-clipboard")
};

static struct command phone_commands[] = {
	DEFCMD("b", "battery", "n phone-batt")
	DEFPREFIX("c", "clipboard", phone_clipboard)
	DEFCMD("r", "ring", "n phonectl ring:100")
	DEFCMD("s", "stop ring", "n phonectl ring:stop")
	DEFPREFIX("m", "music", phone_music_commands)
};

static struct command email_notifications[] = {
	DEFCMD("1", "on", "nostat +h && n echo email notifications on")
	DEFCMD("0", "off", "nostat -h && n echo email notifications off")
	DEFCMD("n", "status", "n nostat")
};

static struct command email_commands[] = {
	DEFCMD("c", "inbox zero", "n email-count")
	DEFCMD("f", "fetch", "email-fetch")
	DEFCMD("m", "sync monad", "n muchsync monad-local")
	DEFCMD("s", "status", "n email-status-once")
	DEFPREFIX("n", "notifications", email_notifications)
};

static struct command vm_commands[] = {
	DEFCMD("p", "pause/resume", "vmtoggle")
	DEFCMD("c", "close", "vmclose")
	DEFCMD("v", "virtualbox", "VirtualBox")
};


static struct command sync_commands[] = {
	DEFCMD("t", "quiver -> monad", "n sync-todo quiver monad")
	DEFCMD("f", "monad -> quiver", "n sync-todo monad quiver")
};

static struct command theme_commands[] = {
	DEFCMD("d", "dark", "themeswitch dark")
	DEFCMD("l", "light", "themeswitch light")
};

static struct command snap_commands[] = {
	DEFCMD("F", "full no upload", "snap -n")
	DEFCMD("f", "full", "snap")
	DEFCMD("S", "selection no upload", "sleep 0.2; snap -n -s")
	DEFCMD("s", "selection", "sleep 0.2; snap -s")
	DEFCMD("d", "dragon last ss", "dragon $(last_ss)")
	DEFCMD("D", "select no upload dragon", "sleep 0.2; snap -n -s; sleep 0.2; dragon $(last_ss)")
};

//static struct command query_commands[] = {
//	DEFCMD("u", "urban-dict", "dmenupn ud ud -plain")
//};

static struct command focus_commands[] = {
	DEFCMD("z", "zoom", "focus-zoom")
	DEFCMD("s", "signal", "wmctrl -a Signal")
	DEFCMD("b", "browser", "wmctrl -a qutebrowser")
	DEFCMD("a", "android", "wmctrl -a 'Android Studio'")
	DEFCMD("w", "wow", "focus-wow")
	DEFCMD("p", "pdf", "wmctrl -a pdf")
};

static struct command notify_commands[] = {
	DEFCMD("c", "close all", "dunstctl close-all")
	DEFCMD("C", "close last", "dunstctl close")
	DEFCMD("n", "open last", "dunstctl history-pop")
	DEFCMD("N", "open last 5", "dunstctl history-pop;dunstctl history-pop;dunstctl history-pop;dunstctl history-pop;dunstctl history-pop")
};

static struct command kill_commands[] = {
	DEFCMD("z", "zoom", "pkill zoom")
	DEFCMD("m", "spotify", "/home/jb55/bin/killspotify")
	DEFCMD("s", "signal", "pkill --oldest signal-desktop")
	DEFCMD("S", "skype", "pkill --oldest skype")
	DEFCMD("b", "browser", "browser kill")
};

static struct command window_commands[] = {
	DEFPREFIX("s", "snap", snap_commands)
	DEFPREFIX("t", "theme", theme_commands)
	DEFPREFIX("k", "kill", kill_commands)
	DEFPREFIX("f", "focus", focus_commands)
	DEFCMD("b", "bright", "bright")
	DEFCMD("c", "colorpick", "colorpick")
	DEFCMD("w", "switch", "dswitcher")
};

static struct command restart_commands[] = {
	DEFCMD("s", "spotifyd", "systemctl --user restart spotifyd && notify-send restarted spotfyd")
	DEFCMD("e", "emacs", "systemctl --user restart emacs && notify-send restarted emacs")
	DEFCMD("p", "phonectl", "systemctl --user restart phonectl && notify-send restarted phonectl")
};

static struct command system_commands[] = {
	DEFPREFIX("c", "copy/sync", sync_commands)
	DEFPREFIX("r", "restart services", restart_commands)
	DEFCMD("S", "suspend", "suspend")
	DEFCMD("s", "my suspend", "my-suspend")
	DEFCMD("k", "kill session", "killsession")
};

static struct command issue_commands[] = {
	DEFCMD("l", "lightning issue", "xclip -o | head -n1 | xargs ghissue ElementsProject lightning")
	DEFCMD("b", "bitcoin issue", "xclip -o | head -n1 | xargs ghissue bitcoin bitcoin")
};

static struct command calendar_commands[] = {
	DEFCMD("c", "viscal", "/home/jb55/src/c/viscal/open-my-cals")
	DEFCMD("s", "viscal-sync", "/home/jb55/src/c/viscal/sync")
	DEFCMD("m", "to-monad", "rsync -avzP /home/jb55/var/cal/ 172.24.242.111:/home/jb55/var/cal/")
	DEFCMD("M", "from-monad", "rsync -avzP 172.24.242.111:/home/jb55/var/cal/ /home/jb55/var/cal/ && n echo done || n echo failed")
};

static struct command auth_commands[] = {
	DEFCMD("p", "lastpass", "dmenu-lpass")
	DEFCMD("o", "otp", "n otp | xclip")
};

static struct command app_commands[] = {
	DEFPREFIX("c", "calendar", calendar_commands)
	DEFPREFIX("a", "auth", auth_commands)
	DEFPREFIX("v", "vm", vm_commands)
	DEFCMD("b", "browser", "browser")
	DEFCMD("B", "browser-work", "browser -r work")
	DEFCMD("e", "edit", "edit -c")
	DEFCMD("s", "signal", "signal-desktop")
	DEFCMD("m", "spotify", "spotify")
	DEFCMD("S", "skype", "skypeforlinux")
	DEFCMD("q", "qalc", "dmenupn calc qalc -t")
	DEFCMD("z", "zoom", "zoom-us")
};

/* static struct command spotify_commands[] = { */
/* 	DEFCMD("n", "next", "spotify-next") */
/* 	DEFCMD("p", "prev", "spotify-prev") */
/* 	DEFCMD(" ", "play/pause", "spotify-playpause") */
/* }; */


static struct command media_commands[] = {
	DEFPREFIX("c", "chromecast", chromecast_commands)
	DEFCMD("b", "connect-bose", "connect-bose")
	DEFCMD("n", "next", "spotify-next")
	DEFCMD("p", "prev", "spotify-prev")
	DEFCMD(" ", "play/pause", "spotify-playpause")
	/* DEFPREFIX("s", "spotify", spotify_commands) */
	DEFCMD("k", "vol+", "amixer sset Master 10%+")
	DEFCMD("j", "vol-", "amixer sset Master 10%-")
};

static struct command date_commands[] = {
	DEFCMD("d", "local", "n mydate")
	DEFCMD("u", "utc", "n mydate -u")
};

static struct command open_doc_commands[] = {
	DEFCMD("p", "downloads pdf", "open-dl /home/jb55/Downloads pdf")
	DEFCMD("P", "papers pdf", "open-dl /home/jb55/docs/papers pdf")
	DEFCMD("c", "edit clipboard", "edit-clipboard")
	DEFCMD("d", "docs pdf", "open-dl /home/jb55/docs pdf")
};

static struct command open_zoom_commands[] = {
	DEFCMD("z", "zoom link", "xclip -o | xargs zoom-link-opener")
	DEFCMD("i", "zoom id", "xclip -o | xargs zoom-id")
};

static struct command open_commands[] = {
	DEFPREFIX("d", "documents", open_doc_commands)
	DEFPREFIX("i", "issues", issue_commands)
	//DEFPREFIX("q", "query", query_commands)
	DEFPREFIX("z", "zoom", open_zoom_commands)
	DEFCMD("s", "spotify", "xclip -o | xargs spotify-open")
	DEFCMD("u", "urban-dict", "dmenupn ud ud -plain")
};

static struct command commands[] = {
	DEFPREFIX("B", "bitcoin", bitcoin_commands)
	DEFPREFIX("a", "apps", app_commands)
	DEFPREFIX("e", "email", email_commands)
	DEFPREFIX("m", "media", media_commands)
	DEFPREFIX("p", "phone", phone_commands)
	DEFPREFIX("s", "system", system_commands)
	DEFPREFIX("w", "window", window_commands)
	DEFPREFIX("d", "date", date_commands)
	DEFPREFIX("n", "notify", notify_commands)
	DEFPREFIX("o", "open", open_commands)
	DEFCMD("b", "battery", "n acpi")
	DEFCMD("l", "lock", "lock")
	DEFCMD("u", "clip", "dclip")
};