about summary refs log blame commit diff stats
path: root/core/conf/skel/.mutt/muttrc
blob: a56757ee5ab7043a9c0cf4201561aaf10643d880 (plain) (tree)
































































                                                                                                           
set config_charset="utf-8"
# set locale="de_CH"
set charset="utf-8"
set send_charset="utf-8"
set editor="vim"
set visual=vim
set auto_tag
set sort=threads

set sort_browser=reverse-date
set sort_aux=reverse-last-date-received
set duplicate_threads=yes

source ~/.mutt/gpg.rc

set pgp_autosign=yes
set pgp_sign_as=0x1D327CA1
set pgp_replyencrypt=yes
set pgp_timeout=1800

# automatically sign all outgoing messages
set crypt_autosign

# sign only replies to signed messages
set crypt_replysign

# automatically encrypt outgoing messages
#set crypt_autoencrypt=yes

# encrypt only replies to signed messages
set crypt_replyencrypt=yes

# encrypt and sign replies to encrypted messages
set crypt_replysignencrypted=yes

# automatically verify the sign of a message when opened
set crypt_verify_sig=yes

source "~/.mutt/mail_alias"
set alias_file=~/.mutt/mail_alias

# Header
set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates

set timeout=10    # mutt 'presses' (like) a key for you 
                  #(while you're idle) each x sec to trigger 
                  #the thing below
set mail_check=5  # mutt checks for new mails on every keystroke
                  # but not more often then once in 5 seconds
set beep_new      # beep on new messages in the mailboxes

## Local system account
folder-hook 'Mail' 'source ~/.mutt/system'

## Remote account
folder-hook 'MailExt' 'source ~/.mutt/external'

## Default account
source "~/.mutt/system"

## Shortcuts
macro index,pager <f2> '<sync-mailbox><enter-command>source ~/.mutt/system<enter><change-folder>!<enter>'
macro index,pager <f3> '<sync-mailbox><enter-command>source ~/.mutt/external<enter><change-folder>!<enter>'
2 +0200 added protocol killing stuff' href='/acidbong/suckless/dwm/commit/client.c?h=3.7&id=33996500763b04119a6867dfa4040a4236c21a41'>3399650 ^
ca65478 ^
1173723 ^
7e597ae ^
adaa28a ^
439e15d ^
adaa28a ^
b4d53bf ^
















ca65478 ^
26157e6 ^
adaa28a ^
8e37c78 ^
4ad20ff ^
1b9fe55 ^


26157e6 ^
1b9fe55 ^
26157e6 ^





15abade ^


26157e6 ^


2272df9 ^
26157e6 ^

adaa28a ^

adaa28a ^
ca65478 ^
adaa28a ^
dc5d967 ^
adaa28a ^






ca65478 ^
adaa28a ^
dc5d967 ^
adaa28a ^
7e597ae ^
adaa28a ^




ca65478 ^
adaa28a ^


72707c2 ^

adaa28a ^








1173723 ^
adaa28a ^



1173723 ^
adaa28a ^
83d2390 ^
adaa28a ^

72707c2 ^

adaa28a ^








1173723 ^
adaa28a ^



1173723 ^
adaa28a ^
83d2390 ^
adaa28a ^



83d2390 ^
1173723 ^

a05beb6 ^


ca65478 ^
adaa28a ^

080a38d ^
c09bf8d ^
adaa28a ^

dfd84f9 ^


ca65478 ^
aaad7bf ^
66da153 ^
dc5d967 ^
439e15d ^

b355755 ^
439e15d ^
1173723 ^




aebd745 ^
95e8d12 ^
d2d394e ^
a55f0e1 ^
1c2d673 ^

8c1fffe ^

1c2d673 ^
8c1fffe ^
a55f0e1 ^
8c1fffe ^
79cd408 ^
dba2306 ^
dfd84f9 ^
72707c2 ^
66da153 ^
439e15d ^

1d85225 ^
439e15d ^
7e597ae ^
a05beb6 ^
439e15d ^

0053620 ^
0a25fe9 ^
6092aa9 ^
aaad7bf ^
901b3ed ^
a55f0e1 ^

95e8d12 ^
6092aa9 ^
8a6679b ^
9d73909 ^


15abade ^

8a6679b ^
f15f45a ^
d4b7a9a ^
7e597ae ^
d7413ff ^
3aad922 ^
f15f45a ^
0aaa9a2 ^


ca65478 ^
1173723 ^
dc5d967 ^
a55f0e1 ^
b9da4b0 ^
04eb016 ^
7fe717c ^
1173723 ^
7fe717c ^
1173723 ^
04eb016 ^







7fe717c ^
8af1d97 ^
1173723 ^
8af1d97 ^
1173723 ^
4491bdd ^
28aba06 ^









dba2306 ^
a55f0e1 ^



95e8d12 ^


1c2d673 ^
281f098 ^
b4d53bf ^
e6cbe9c ^
b9da4b0 ^

adaa28a ^
6092aa9 ^


1c2d673 ^

6092aa9 ^







ca65478 ^
adaa28a ^
dc5d967 ^

adaa28a ^

































ca65478 ^
adaa28a ^
7b6d5ff ^
dc5d967 ^
adaa28a ^


c09bf8d ^
adaa28a ^














439e15d ^


ca65478 ^
0925dd5 ^

bda53ac ^
0053620 ^
dba2306 ^
0053620 ^
8a6679b ^
2e68f22 ^
0a25fe9 ^
0925dd5 ^

0a25fe9 ^
26157e6 ^



b355755 ^
0053620 ^

e6cbe9c ^
c0705ee ^
0053620 ^
d4b7a9a ^
439e15d ^
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413



                                                              
                
                   

                      
                      
 
                      
 
           
                        





                                                          
                                      

                                                           
                     





























                                                                                                     

 
          
                                              




                      
    
                
                                                      
                                                         
 
 
    
















                                                           
                  
                    
 
                                          
                       


                           
                          
                        





                                                


                                 


                                                                              
         

                                                                            

 
        
                     
                  
 






                                        
                     
                  
 
                                        
                                




                                 
                                   


                           

                      








                               
                                             



                              
                             
                      
         

                          

                      








                               
                                             



                              
                                         
                      
         



                         
         

                   


    
                      

                       
                                    
                                                                           

                                           


    
                                         
                  
                     
                                 

                                     
                                                 
                   




                                 
 
                      
                      
 

                                                

                         
                                           
                                     
                                   
                          
 
                                    
                                 
                                                                            
                                                  

                                               
                                                        
 
                                                                      
                                                                     

                                                                               
 
                              
                       
                                     
                       

                                                 
                                                                          
                       
 


                                  

                            
 
               
                                
                                 
                        
                         
                      


    
                                                  
                                 
                                
                          
 
                       
                           
                                                            
                           
                                                            







                                             
         
                                                    
                                    
                                                   
                                     
 









                                        
                       



                         


                                    
                                           
                                                                                           
                     
                          

 
    


                               

                                                   







                                                                                     
                       
                   

                        

































                                                                         
                        
                           
              
                           


                        
                                                                 














                                                                              


    
                     

                   
                                                               
                         
                                      
 
                  
                       
                      

                                                                      
         



                                                           
                      

                
                          
                                 
                           
                      
 
/*
 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
 * See LICENSE file for license details.
 */
#include "dwm.h"
#include <stdlib.h>
#include <string.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>

/* static functions */

static void
detachstack(Client *c) {
	Client **tc;
	for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
	*tc = c->snext;
}

static void
grabbuttons(Client *c, Bool focused) {
	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);

	if(focused) {
		XGrabButton(dpy, Button1, MODKEY, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button1, MODKEY | LockMask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button1, MODKEY | numlockmask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button1, MODKEY | numlockmask | LockMask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);

		XGrabButton(dpy, Button2, MODKEY, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button2, MODKEY | LockMask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button2, MODKEY | numlockmask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button2, MODKEY | numlockmask | LockMask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);

		XGrabButton(dpy, Button3, MODKEY, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button3, MODKEY | LockMask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button3, MODKEY | numlockmask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(dpy, Button3, MODKEY | numlockmask | LockMask, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
	}
	else
		XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK,
				GrabModeAsync, GrabModeSync, None, None);
}

static int
xerrordummy(Display *dsply, XErrorEvent *ee) {
	return 0;
}

/* extern functions */

void
ban(Client *c) {
	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
	XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
}

void
configure(Client *c) {
	XEvent synev;

	synev.type = ConfigureNotify;
	synev.xconfigure.display = dpy;
	synev.xconfigure.event = c->win;
	synev.xconfigure.window = c->win;
	synev.xconfigure.x = c->x;
	synev.xconfigure.y = c->y;
	synev.xconfigure.width = c->w;
	synev.xconfigure.height = c->h;
	synev.xconfigure.border_width = c->border;
	synev.xconfigure.above = None;
	XSendEvent(dpy, c->win, True, NoEventMask, &synev);
}

void
focus(Client *c) {
	Client *old;

	if(!issel || (c && !isvisible(c)))
		return;
	if(!sel)
		sel = c;
	else if(sel != c) {
		old = sel;
		sel = c;
		if(old) {
			grabbuttons(old, False);
			drawtitle(old);
		}
	}
	if(c) {
		detachstack(c);
		c->snext = stack;
		stack = c;
		grabbuttons(c, True);
		drawtitle(c);
		XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
	}
	else
		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}

Client *
getclient(Window w) {
	Client *c;

	for(c = clients; c; c = c->next)
		if(c->win == w)
			return c;
	return NULL;
}

Client *
getctitle(Window w) {
	Client *c;

	for(c = clients; c; c = c->next)
		if(c->twin == w)
			return c;
	return NULL;
}

void
gravitate(Client *c, Bool invert) {
	int dx = 0, dy = 0;

	switch(c->grav) {
	default:
		break;
	case StaticGravity:
	case NorthWestGravity:
	case NorthGravity:
	case NorthEastGravity:
		dy = c->border;
		break;
	case EastGravity:
	case CenterGravity:
	case WestGravity:
		dy = -(c->h / 2) + c->border;
		break;
	case SouthEastGravity:
	case SouthGravity:
	case SouthWestGravity:
		dy = -(c->h);
		break;
	}

	switch (c->grav) {
	default:
		break;
	case StaticGravity:
	case NorthWestGravity:
	case WestGravity:
	case SouthWestGravity:
		dx = c->border;
		break;
	case NorthGravity:
	case CenterGravity:
	case SouthGravity:
		dx = -(c->w / 2) + c->border;
		break;
	case NorthEastGravity:
	case EastGravity:
	case SouthEastGravity:
		dx = -(c->w + c->border);
		break;
	}

	if(invert) {
		dx = -dx;
		dy = -dy;
	}
	c->x += dx;
	c->y += dy;
}

void
killclient(Arg *arg) {
	if(!sel)
		return;
	if(sel->proto & PROTODELWIN)
		sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
	else
		XKillClient(dpy, sel->win);
}

void
manage(Window w, XWindowAttributes *wa) {
	Client *c;
	Window trans;
	XSetWindowAttributes twa;

	c = emallocz(sizeof(Client));
	c->tags = emallocz(ntags * sizeof(Bool));
	c->win = w;
	c->x = c->tx = wa->x;
	c->y = c->ty = wa->y;
	c->w = c->tw = wa->width;
	c->h = wa->height;
	c->th = bh;

	c->border = 0;
	updatesize(c);

	if(c->x + c->w + 2 * BORDERPX > sw)
		c->x = sw - c->w - 2 * BORDERPX;
	if(c->x < 0)
		c->x = 0;
	if(c->y + c->h + 2 * BORDERPX > sh)
		c->y = sh - c->h - 2;
	if(c->h != sh && c->y < bh)
		c->y = bh;

	c->proto = getproto(c->win);
	XSelectInput(dpy, c->win,
		StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
	XGetTransientForHint(dpy, c->win, &trans);
	twa.override_redirect = 1;
	twa.background_pixmap = ParentRelative;
	twa.event_mask = ExposureMask | EnterWindowMask;

	c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
			0, DefaultDepth(dpy, screen), CopyFromParent,
			DefaultVisual(dpy, screen),
			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);

	grabbuttons(c, False);
	updatetitle(c);
	settags(c, getclient(trans));
	if(!c->isfloat)
		c->isfloat = trans
			|| (c->maxw && c->minw &&
				c->maxw == c->minw && c->maxh == c->minh);
	resizetitle(c);

	if(clients)
		clients->prev = c;
	c->next = clients;
	c->snext = stack;
	stack = clients = c;

	ban(c);
	XMapWindow(dpy, c->win);
	XMapWindow(dpy, c->twin);
	if(isvisible(c))
		focus(c);
	arrange(NULL);
}

void
resize(Client *c, Bool sizehints, Corner sticky) {
	int bottom = c->y + c->h;
	int right = c->x + c->w;
	XWindowChanges wc;

	if(sizehints) {
		if(c->incw)
			c->w -= (c->w - c->basew) % c->incw;
		if(c->inch)
			c->h -= (c->h - c->baseh) % c->inch;
		if(c->minw && c->w < c->minw)
			c->w = c->minw;
		if(c->minh && c->h < c->minh)
			c->h = c->minh;
		if(c->maxw && c->w > c->maxw)
			c->w = c->maxw;
		if(c->maxh && c->h > c->maxh)
			c->h = c->maxh;
	}
	if(sticky == TopRight || sticky == BotRight)
		c->x = right - c->w;
	if(sticky == BotLeft || sticky == BotRight)
		c->y = bottom - c->h;

	/* offscreen appearance fixes */
	if(c->x + c->w < 0)
		c->x = 0;
	if(c->y + c->h < bh)
		c->y = bh;
	if(c->x > sw)
		c->x = sw - c->w;
	if(c->y > sh)
		c->y = sh - c->h;

	resizetitle(c);
	wc.x = c->x;
	wc.y = c->y;
	wc.width = c->w;
	wc.height = c->h;
	if(c->w == sw && c->h == sh)
		wc.border_width = 0;
	else
		wc.border_width = BORDERPX;
	XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
	configure(c);
	XSync(dpy, False);
}

void
resizetitle(Client *c) {
	c->tw = textw(c->name);
	if(c->tw > c->w)
		c->tw = c->w + 2 * BORDERPX;
	c->tx = c->x + c->w - c->tw + 2 * BORDERPX;
	c->ty = c->y;
	if(isvisible(c))
		XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
	else
		XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
}

void
updatesize(Client *c) {
	long msize;
	XSizeHints size;

	if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
		size.flags = PSize;
	c->flags = size.flags;
	if(c->flags & PBaseSize) {
		c->basew = size.base_width;
		c->baseh = size.base_height;
	}
	else
		c->basew = c->baseh = 0;
	if(c->flags & PResizeInc) {
		c->incw = size.width_inc;
		c->inch = size.height_inc;
	}
	else
		c->incw = c->inch = 0;
	if(c->flags & PMaxSize) {
		c->maxw = size.max_width;
		c->maxh = size.max_height;
	}
	else
		c->maxw = c->maxh = 0;
	if(c->flags & PMinSize) {
		c->minw = size.min_width;
		c->minh = size.min_height;
	}
	else
		c->minw = c->minh = 0;
	if(c->flags & PWinGravity)
		c->grav = size.win_gravity;
	else
		c->grav = NorthWestGravity;
}

void
updatetitle(Client *c) {
	char **list = NULL;
	int n;
	XTextProperty name;

	name.nitems = 0;
	c->name[0] = 0;
	XGetTextProperty(dpy, c->win, &name, netatom[NetWMName]);
	if(!name.nitems)
		XGetWMName(dpy, c->win, &name);
	if(!name.nitems)
		return;
	if(name.encoding == XA_STRING)
		strncpy(c->name, (char *)name.value, sizeof(c->name));
	else {
		if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
				&& n > 0 && *list)
		{
			strncpy(c->name, *list, sizeof(c->name));
			XFreeStringList(list);
		}
	}
	XFree(name.value);
}

void
unmanage(Client *c) {
	Client *nc;

	/* The server grab construct avoids race conditions. */
	XGrabServer(dpy);
	XSetErrorHandler(xerrordummy);

	detach(c);
	detachstack(c);
	if(sel == c) {
		for(nc = stack; nc && !isvisible(nc); nc = nc->snext);
		focus(nc);
	}

	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
	XDestroyWindow(dpy, c->twin);

	free(c->tags);
	free(c);

	XSync(dpy, False);
	XSetErrorHandler(xerror);
	XUngrabServer(dpy);
	arrange(NULL);
}