97d7cc9de35bdc54edff3c8b96c285b2a955a5ed
[~bandali/configs] / rc.org
1 #+title: rc.org
2 #+property: header-args :comments link :mkdirp yes :results silent
3
4 * About
5
6 This org file contains the configuration files of pretty much every
7 program I use. The files are tangled (i.e. exported, or derived) from
8 this file using =org-babel=.
9
10 Note: This file is best viewed inside Emacs with org mode.
11
12 * Configs
13
14 This section contains the configuration files (dotfiles) of various
15 programs I use.
16
17 ** [[https://github.com/afewmail/afew][afew]]
18 :PROPERTIES:
19 :header-args+: :tangle ~/.config/afew/config
20 :END:
21
22 #+begin_quote
23 an initial tagging script for notmuch mail
24 #+end_quote
25
26 #+begin_src conf
27 # This is the default filter chain
28 [SpamFilter]
29 #[ClassifyingFilter]
30 [KillThreadsFilter]
31 #[ListMailsFilter]
32 [ArchiveSentMailsFilter]
33 sent_tag = sent
34 [InboxFilter]
35
36 #[Filter.1]
37 #query = 'folder:amin/lists/.haskell-cafe'
38 #tags = +lists;+lists/haskell-cafe
39 #message = lists/haskell-cafe
40
41 #[Filter.2]
42 #query = 'folder:amin/lists/.haskell-weekly'
43 #tags = +lists;+lists/haskell-weekly
44 #message = lists/haskell-weekly
45
46 #[Filter.3]
47 #query = 'folder:amin/lists/.hackernewsletter'
48 #tags = +lists;+lists/hackernewsletter
49 #message = lists/hackernewsletter
50
51
52 #[FolderNameFilter]
53 #folder_blacklist = Inbox
54 #maildir_separator = /.
55 #folder_transforms = Drafts:draft Junk:spam Trash:deleted Sent:sent Archive:archive lists/haskell-cafe:lists/haskell-cafe
56 #+end_src
57
58 ** bspwm
59
60 *** bspwmrc
61 :PROPERTIES:
62 :header-args+: :tangle ~/.config/bspwm/bspwmrc :shebang "#!/bin/sh"
63 :END:
64
65 #+begin_src sh
66 sxhkd &
67 sh ~/.fehbg &
68 xfce4-panel -d &
69 #compton &
70 sleep 0.5 && pasystray --notify=all &
71
72 bspc monitor -d I II III IV V VI VII VIII IX X
73 #bspc monitor eDP-1 -d I II III IV V
74 #bspc monitor HDMI-1 -d VI VII VIII IX X
75
76 #bspc config border_width 2
77 #bspc config window_gap 8
78 bspc config window_gap 0
79
80 bspc config bottom_padding 26
81
82 bspc config split_ratio 0.52
83 bspc config borderless_monocle true
84 bspc config gapless_monocle true
85 bspc config click_to_focus button1
86 bspc config directional_focus_tightness low
87
88 bspc rule -a Firefox desktop='^1' follow=on
89 bspc rule -a Nightly desktop='^1' follow=on
90 bspc rule -a Emacs desktop='^2' state=tiled follow=on
91 #bspc rule -a Chromium desktop='^4' follow=on
92 bspc rule -a URxvt state=floating
93 bspc rule -a URxvt:tiled state=tiled
94 bspc rule -a Connman-gtk state=floating
95 bspc rule -a Xfce4-panel state=floating
96 bspc rule -a TelegramDesktop state=floating
97 bspc rule -a Ec state=floating
98 bspc rule -a Pavucontrol state=floating
99 bspc rule -a Eog state=floating
100 bspc rule -a Seahorse state=floating
101 bspc rule -a mpv state=floating
102 bspc rule -a Evince state=floating
103 bspc rule -a Meld state=floating
104 bspc rule -a Autokey-gtk state=floating
105 bspc rule -a Mousepad state=floating
106 bspc rule -a Wrapper-1.0 state=floating
107 bspc rule -a File-roller state=floating
108 bspc rule -a Gnome-disks state=floating
109 bspc rule -a Termite state=floating
110 bspc rule -a Termite:tiled state=tiled
111 bspc rule -a Thunderbird:Calendar state=floating
112 bspc rule -a Audacity state=floating
113 bspc rule -a Proof state=floating # pvs x-show-proof
114 bspc rule -a Nm-connection-editor state=floating
115 bspc rule -a Wire state=floating
116 bspc rule -a discord state=floating
117 bspc rule -a X2goclient state=floating
118 bspc rule -a SimpleScreenRecorder state=floating
119 bspc rule -a Gimp state=floating
120 bspc rule -a Wrapper-2.0 state=floating
121 bspc rule -a Zathura state=tiled
122 #+end_src
123
124 *** sxhkdrc
125 :PROPERTIES:
126 :header-args+: :tangle ~/.config/sxhkd/sxhkdrc
127 :END:
128
129 #+begin_src conf
130 #
131 # wm independent hotkeys
132 #
133
134 # terminal emulator
135 super + {_,shift} + Return
136 urxvt{_, -name tiled}
137
138 #super + {_,shift} + Return
139 # termite{_, --name=tiled}
140
141 # program launcher
142 super + space
143 rofi -show run -display-run '> ' -display-window ' 🗔 '
144
145 super + alt + space
146 xfce4-popup-whiskermenu
147
148 # window finder
149 super + backslash
150 rofi -show window -display-run '> ' -display-window ' 🗔 '
151
152 # password manager
153 alt + space
154 rofi-pass
155
156 # firefox
157 #super + r
158 # firefox
159
160 # chromium
161 #super + c
162 # chromium -incognito
163
164 # emacs
165 super + e
166 emacs
167
168 # make sxhkd reload its configuration files:
169 super + Escape
170 pkill -USR1 -x sxhkd
171
172 # volume {up,down}
173 XF86Audio{Raise,Lower}Volume
174 pamixer --allow-boost --{in,de}crease 5
175
176 # mute
177 XF86AudioMute
178 pamixer --toggle-mute
179
180 # playback control
181 XF86Audio{Play,Prev,Next}
182 mpc {toggle,prev,next}
183
184 # lock the screen
185 super + shift + q
186 light-locker-command -l
187
188 # Toggle keyboard layout
189 super + F7
190 toggle-layout
191
192 # Toggle Xfce presentation mode
193 XF86LaunchB
194 toggle-presentation-mode
195
196 # monitor brightness
197 XF86MonBrightness{Up,Down}
198 light -{A,U} 5
199
200 super + apostrophe
201 rofi-light
202
203 # keyboard brightness
204 #XF86KbdBrightness{Up,Down}
205 # kbdlight {up,down}
206
207 #
208 # bspwm hotkeys
209 #
210
211 # quit bspwm normally
212 super + alt + Escape
213 bspc quit
214
215 # close and kill
216 super + {w,q}
217 bspc node -{c,k}
218
219 # alternate between the tiled and monocle layout
220 super + m
221 bspc desktop -l next
222
223 # send the newest marked node to the newest preselected node
224 super + y
225 bspc node newest.marked.local -n newest.!automatic.local
226
227 # swap the current node and the biggest node
228 super + g
229 bspc node -s biggest
230
231 #
232 # state/flags
233 #
234
235 # set the window state
236 super + {t,shift + t,s,f}
237 bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
238
239 # set the node flags
240 super + ctrl + {m,x,y,z}
241 bspc node -g {marked,locked,sticky,private}
242
243 #
244 # focus/swap
245 #
246
247 # focus the node in the given direction
248 super + {_,shift + }{h,j,k,l}
249 bspc node -{f,s} {west,south,north,east}
250
251 # focus the node for the given path jump
252 super + {p,b,comma,period}
253 bspc node -f @{parent,brother,first,second}
254
255 # focus the next/previous node in the current desktop
256 super + {_,shift + }c
257 bspc node -f {next,prev}.local
258
259 # focus the next/previous desktop in the current monitor
260 super + bracket{left,right}
261 bspc desktop -f {prev,next}.local
262
263 # send to next/prev desktop
264 super + shift + bracket{left,right}
265 bspc node -d {prev,next} --follow
266
267 # focus the last node/desktop
268 super + {grave,Tab}
269 bspc {node,desktop} -f last
270
271 # focus the older or newer node in the focus history
272 super + {o,i}
273 bspc wm -h off; \
274 bspc node {older,newer} -f; \
275 bspc wm -h on
276
277 # focus or send to the given desktop
278 super + {_,shift + }{1-9,0}
279 bspc {desktop -f,node -d} '^{1-9,10}'
280
281 #
282 # preselect
283 #
284
285 # preselect the direction
286 super + ctrl + {h,j,k,l}
287 bspc node -p {west,south,north,east}
288
289 # preselect the ratio
290 super + ctrl + {1-9}
291 bspc node -o 0.{1-9}
292
293 # cancel the preselection for the focused node
294 super + ctrl + space
295 bspc node -p cancel
296
297 # cancel the preselection for the focused desktop
298 super + ctrl + shift + space
299 bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
300
301 #
302 # move/resize
303 #
304
305 # expand a window by moving one of its side outward
306 super + alt + {h,j,k,l}
307 bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
308
309 # contract a window by moving one of its side inward
310 super + alt + shift + {h,j,k,l}
311 bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
312
313 # move a floating window
314 super + {Left,Down,Up,Right}
315 bspc node -v {-20 0,0 20,0 -20,20 0}
316
317 #alt + bracket{left,right}
318 # xdotool key --clearmodifiers ctrl+Page_{Up,Down}
319 #+end_src
320
321 ** compton
322 :PROPERTIES:
323 :header-args+: :tangle ~/.config/compton.conf
324 :END:
325
326 #+begin_src conf
327 # Shadow
328 shadow = false; # Enabled client-side shadows on windows.
329 no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows.
330 no-dnd-shadow = true; # Don't draw shadows on DND windows.
331 clear-shadow = true; # Zero the part of the shadow's mask behind the
332 # window. Fix some weirdness with ARGB windows.
333 shadow-radius = 5; # The blur radius for shadows. (default 12)
334 shadow-offset-x = -5; # The left offset for shadows. (default -15)
335 shadow-offset-y = -5; # The top offset for shadows. (default -15)
336 # shadow-opacity = 0.7; # The translucency for shadows. (default .75)
337 # shadow-red = 0.0; # Red color value of shadow. (0.0 - 1.0, defaults to 0)
338 # shadow-green = 0.0; # Green color value of shadow. (0.0 - 1.0, defaults to 0)
339 # shadow-blue = 0.0; # Blue color value of shadow. (0.0 - 1.0, defaults to 0)
340 shadow-exclude = [ "n:e:Notification", "class_g = 'Chromium'", "class_g = 'Dmenu'", "class_g = 'Firefox' && argb" ]; # Exclude conditions for shadows.
341 # shadow-exclude = "n:e:Notification";
342 #shadow-exclude = [ "_GTK_FRAME_EXTENTS@:c" ] # Fix dual shadow on some gtk3 powered applications
343 shadow-ignore-shaped = true; # Avoid drawing shadow on all shaped windows
344 # (see also: --detect-rounded-corners)
345
346 # Opacity
347 menu-opacity = 1.0; # The opacity for menus. (default 1.0)
348 #inactive-opacity = 0.9; # Default opacity of inactive windows. (0.0 - 1.0)
349 # active-opacity = 0.8; # Default opacity for active windows. (0.0 - 1.0)
350 frame-opacity = 1.0; # Opacity of window titlebars and borders. (0.1 - 1.0)
351 # inactive-opacity-override = true; # Let inactive opacity set by 'inactive-opacity' overrides
352 # value of _NET_WM_OPACITY. Bad choice.
353 alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasing
354 # it may result in less X resource usage,
355 # Yet fading may look bad.
356 #inactive-dim = 0.5; # Dim inactive windows. (0.0 - 1.0)
357 #inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity.
358 # blur-background = true; # Blur background of transparent windows.
359 # Bad performance with X Render backend.
360 # GLX backend is preferred.
361 # blur-background-frame = true; # Blur background of opaque windows with transparent
362 # frames as well.
363 blur-background-fixed = true; # Do not let blur radius adjust based on window opacity.
364 blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
365 # Exclude conditions for background blur.
366
367 # Fading
368 fading = false; # Fade windows during opacity changes.
369 fade-delta = 3; # The time between steps in a fade in milliseconds. (default 10).
370 fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028).
371 fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03).
372 # no-fading-openclose = true; # Avoid fade windows in/out when opening/closing.
373 fade-exclude = [ ]; # Exclude conditions for fading.
374
375 # Other
376 backend = "glx" # Backend to use: "xrender" or "glx". GLX backend is typically
377 # much faster but depends on a sane driver.
378 mark-wmwin-focused = true; # Try to detect WM windows and mark them as active.
379 mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus).
380 use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
381 # instead of using FocusIn/Out events. Usually more reliable but
382 # depends on a EWMH-compliant WM.
383 detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore- shaped is on.
384 detect-client-opacity = true; # Detect _NET_WM_OPACITY on client windows, useful for window
385 # managers not passing _NET_WM_OPACITY of client windows to frame
386 # windows.
387 refresh-rate = 0; # For --sw-opti: Specify refresh rate of the screen. 0 for auto.
388 vsync = "drm"; # "none", "drm", "opengl", "opengl-oml", "opengl-swc", "opengl-mswc"
389 # See man page for more details.
390 dbe = false; # Enable DBE painting mode. Rarely needed.
391 paint-on-overlay = true; # Painting on X Composite overlay window. Recommended.
392 sw-opti = false; # Limit compton to repaint at most once every 1 / refresh_rate.
393 # Incompatible with certain VSync methods.
394 unredir-if-possible = false; # Unredirect all windows if a full-screen opaque window is
395 # detected, to maximize performance for full-screen windows.
396 focus-exclude = [ ]; # A list of conditions of windows that should always be considered
397 # focused.
398 detect-transient = true; # Use WM_TRANSIENT_FOR to group windows, and consider windows in
399 # the same group focused at the same time.
400 detect-client-leader = true; # Use WM_CLIENT_LEADER to group windows.
401 invert-color-include = [ ]; # Conditions for windows to be painted with inverted color.
402
403 # GLX backend # GLX backend fine-tune options. See man page for more info.
404 glx-no-stencil = true; # Recommended.
405 glx-copy-from-front = false; # Useful with --glx-swap-method,
406 # glx-use-copysubbuffermesa = true; # Recommended if it works. Breaks VSync.
407 # glx-no-rebind-pixmap = true; # Recommended if it works.
408 glx-no-rebind-pixmap = true; # Recommended if it works.
409 #glx-swap-method = "4"; # See man page.
410 glx-swap-method = "4"; # See man page.
411
412 # Window type settings
413 wintypes:
414 {
415 tooltip = { fade = true; shadow = false; opacity = 1; focus = true; };
416 menu = { shadow = false; };
417 dropdown_menu = { shadow = false; };
418 popup_menu = { shadow = false; };
419 utility = { shadow = false; };
420 # fade: Fade the particular type of windows.
421 # shadow: Give those windows shadow
422 # opacity: Default opacity for the type of windows.
423 # focus: Whether to always consider windows of this type focused.
424 };
425 #+end_src
426
427 ** Dunst
428 :PROPERTIES:
429 :header-args+: :tangle ~/.config/dunst/dunstrc
430 :END:
431
432 #+begin_src conf
433 [global]
434 #font = Ubuntu Mono 10.5
435 font = Inconsolata 11
436
437 # Path to default icons.
438 icon_folders = /usr/share/icons/Moka/16x16/status/:/usr/share/icons/Moka/16x16/devices/:/usr/share/icons/Faba-Mono/16x16/status/:/usr/share/icons/Faba-Mono/16x16/devices/:/usr/share/icons/Moka/16x16/actions/:/usr/share/icons/Moka/16x16/categories/:/usr/share/icons/Moka/16x16/mimetypes/:/usr/share/icons/Moka/16x16/apps/:/usr/share/icons/Moka/16x16/places/:/usr/share/icons/Paper/16x16/status/
439
440 icon_position = left
441 # <b>bold</b>
442 # <i>italic</i>
443 # <s>strikethrough<s/>
444 # <u>underline</u>
445 markup = full
446 # The format of the message. Possible variables are:
447 # %a appname
448 # %s summary
449 # %b body
450 # %i iconname (including its path)
451 # %I iconname (without its path)
452 # %p progress value if set ([ 0%] to [100%]) or nothing
453 # Markup is allowed
454 format = "<b>%s</b>\n%b"
455 # Sort messages by urgency
456 sort = yes
457 # Show how many messages are currently hidden (because of geometry)
458 indicate_hiddenl= no
459 # Alignment of message text.
460 # Possible values are "left", "center" and "right"
461 alignment = center
462 # The frequency with wich text that is longer than the notification
463 # window allows bounces back and forth.
464 # This option conflicts with 'word_wrap'.
465 # Set to 0 to disable
466 bounce_freq = 3
467 # show age of message if message is older than show_age_threshold seconds.
468 # set to -1 to disable
469 show_age_threshold = -1
470 # split notifications into multiple lines if they don't fit into geometry
471 word_wrap = yes
472 # ignore newlines '\n' in notifications
473 ignore_newline = no
474 # The geometry of the message window.
475 # geometry [{width}]x{height}][+/-{x}+/-{y}]
476 # The height is measured in number of notifications everything else in pixels. If the width
477 # is omitted but the height is given ("-geometry x2"), the message window
478 # expands over the whole screen (dmenu-like). If width is 0,
479 # the window expands to the longest message displayed.
480 # A positive x is measured from the left, a negative from the
481 # right side of the screen. Y is measured from the top and down respectevly.
482 # The width can be negative. In this case the actual width is the
483 # screen width minus the width defined in within the geometry option.
484 #geometry = "410x12-12+12"
485 #geometry = "0x0-30-30"
486 geometry = "260x12-30-30"
487 # The transparency of the window. range: [0; 100]
488 # This option will only work if a compositing windowmanager is present (e.g. xcompmgr, compiz, etc..)
489 transparency = 0
490 # Don't remove messages, if the user is idle (no mouse or keyboard input)
491 # for longer than idle_threshold seconds.
492 # Set to 0 to disable.
493 idle_threshold = 120
494 # Which monitor should the notifications be displayed on.
495 monitor = 0
496 # Display notification on focused monitor. Possible modes are:
497 # mouse: follow mouse pointer
498 # keyboard: follow window with keyboard focus
499 # none: don't follow anything
500 #
501 # "keyboard" needs a windowmanager that exports the _NET_ACTIVE_WINDOW property.
502 # This should be the case for almost all modern windowmanagers.
503 #
504 # If this option is set to mouse or keyboard, the monitor option will be
505 # ignored.
506 follow = keyboard
507 # should a notification popped up from history be sticky or
508 # timeout as if it would normally do.
509 sticky_history = yes
510 # The height of a single line. If the height is smaller than the font height,
511 # it will get raised to the font height.
512 # This adds empty space above and under the text.
513 line_height = 0
514
515 show_indicators = yes
516
517 # Draw a line of 'separatpr_height' pixel height between two notifications.
518 # Set to 0 to disable
519 separator_height = 3
520 # padding between text and separator
521 padding = 8
522 # horizontal padding
523 horizontal_padding = 8
524 # Define a color for the separator.
525 # possible values are:
526 # * auto: dunst tries to find a color fitting to the background
527 # * foreground: use the same color as the foreground
528 # * frame: use the same color as the frame.
529 # * anything else will be interpreted as a X color
530 separator_color = foreground
531 # print a notification on startup
532 # This is mainly for error detection, since dbus (re-)starts dunst
533 # automatically after a crash.
534 startup_notification = false
535 # dmenu path
536 #dmenu = /usr/bin/dmenu -p dunst:
537 dmenu = /usr/bin/rofi -dmenu -p dunst:
538 # browser for opening urls in context menu
539 browser = /usr/bin/firefox -new-tab
540 [frame]
541 width = 0
542 color = "#377222"
543 [shortcuts]
544 # shortcuts are specified as [modifier+][modifier+]...key
545 # available modifiers are 'ctrl', 'mod1' (the alt-key), 'mod2', 'mod3'
546 # and 'mod4' (windows-key)
547 # xev might be helpful to find names for keys
548 # close notification
549 close = ctrl+space
550 # close all notifications
551 close_all = ctrl+shift+space
552 # redisplay last message(s)
553 # On the US keyboard layout 'grave' is normally above TAB and left of '1'.
554 history = ctrl+shift+h
555 # context menu
556 context = ctrl+shift+period
557 [urgency_low]
558 # IMPORTANT: colors have to be defined in quotation marks.
559 # Otherwise the '#' and following would be interpreted as a comment.
560 background = "#1d2a30"
561 foreground = "#71c2af"
562 timeout = 3
563 [urgency_normal]
564 background = "#1d2a30"
565 foreground = "#71c2af"
566 timeout = 0
567 [urgency_critical]
568 background = "#1d2a30"
569 foreground = "#ff9982"
570 timeout = 0
571
572 # Every section that isn't one of the above is interpreted as a rules
573 # to override settings for certain messages.
574 # Messages can be matched by 'appname', 'summary', 'body' or 'icon'
575 # and you can override the 'timeout', 'urgency', 'foreground', 'background'
576 # and 'format'.
577 # Shell-like globbing will get expanded.
578 #
579 # SCRIPTING
580 # you can specify a script that gets run when the rule matches by setting
581 # the 'script' option.
582 # The script will be called as follows:
583 # script appname summary body icon urgency
584 # where urgency can be "LOW", "NORMAL" or "CRITICAL".
585 #
586 # NOTE: if you don't want a notification to be displayed, set the format to ""
587 # NOTE: It might be helpful to run dunst -print in a terminal in order to find
588 # fitting options for rules.
589 #[espeak]
590 # summary = "*"
591 # script = dunst_espeak.sh
592 #[script-test]
593 # summary = "*script*"
594 # script = dunst_test.sh
595 #[ignore]
596 ## This notification will not be displayed
597 # summary = "foobar"
598 # format = ""
599 #[signed_on]
600 # appname = Pidgin
601 # summary = "*signed on*"
602 # urgency = low
603 #
604 #[signed_off]
605 # appname = Pidgin
606 # summary = *signed off*
607 # urgency = low
608 #
609 #[says]
610 # appname = Pidgin
611 # summary = *says*
612 # urgency = critical
613 #
614 #[twitter]
615 # appname = Pidgin
616 # summary = *twitter.com*
617 # urgency = normal
618 #
619 [xfpm-backlight]
620 summary = *Brightness*
621 urgency = low
622 #+end_src
623
624 ** Fontconfig
625 :PROPERTIES:
626 :header-args+: :tangle ~/.config/fontconfig/fonts.conf
627 :END:
628
629 #+begin_src xml
630 <?xml version="1.0"?>
631 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
632 <fontconfig>
633 <match target="font">
634 <edit mode="assign" name="rgba">
635 <const>rgb</const>
636 </edit>
637 </match>
638 <match target="font">
639 <edit mode="assign" name="hinting">
640 <bool>true</bool>
641 </edit>
642 </match>
643 <match target="font">
644 <edit mode="assign" name="hintstyle">
645 <const>hintslight</const>
646 </edit>
647 </match>
648 <match target="font">
649 <edit mode="assign" name="antialias">
650 <bool>true</bool>
651 </edit>
652 </match>
653 <match target="font">
654 <edit mode="assign" name="lcdfilter">
655 <const>lcddefault</const>
656 </edit>
657 </match>
658 <dir>~/.fonts</dir>
659
660 <!-- Use Liberation Sans for Helvetica (instead of Nimbus Sans) -->
661 <alias binding="same">
662 <family>Helvetica</family>
663 <accept>
664 <family>Liberation Sans</family>
665 </accept>
666 </alias>
667 </fontconfig>
668 #+end_src
669
670 ** Git
671
672 *** gitconfig
673 :PROPERTIES:
674 :header-args+: :tangle ~/.gitconfig
675 :END:
676
677 **** user
678 #+begin_src conf
679 [user]
680 name = Amin Bandali
681 email = amin@aminb.org
682 # signingkey = 4E05246AB0BF7FFB
683 #+end_src
684
685 **** signing
686 #+begin_src conf
687 # [commit]
688 # gpgsign = true
689 # [format]
690 # signoff = true
691 #+end_src
692
693 **** core
694 #+begin_src conf
695 [core]
696 autocrlf = input # CRLF -> LF on commit
697 editor = emacsclient -t
698 excludesfile = ~/.gitignore_global
699 pager = "less"
700 #+end_src
701
702 **** gpg
703 #+begin_src conf
704 [gpg]
705 program = gpg2
706 #+end_src
707
708 **** alias
709 #+begin_src conf
710 [alias]
711 git = !exec git # handle nested git calls, e.g. git git status
712 aliases = config --get-regexp '^alias\\.'
713 a = add
714 s = status
715 sl = status --long
716 c = checkout
717 cb = checkout -b
718 b = branch
719 r = rebase
720 p = pull
721 pr = pull --rebase
722 ps = push
723 psf = push --force
724 #+end_src
725
726 **** color
727 #+begin_src conf
728 [color]
729 ui = auto
730 [color "status"]
731 added = green bold
732 changed = red bold
733 untracked = red bold
734 [color "branch"]
735 current = green bold
736 remote = magenta bold
737 [color "diff"]
738 new = green bold
739 old = red bold
740 #+end_src
741
742 **** status
743 #+begin_src conf
744 [status]
745 # showUntrackedFiles = all
746 short=true
747 branch=true
748 #+end_src
749
750 **** github
751 #+begin_src conf
752 [github]
753 user = aminb
754 #+end_src
755
756 *** gitignore
757 :PROPERTIES:
758 :header-args+: :tangle ~/.gitignore_global
759 :END:
760
761 #+begin_src conf
762 *.orig
763 *.py[co]
764 *.sublime-workspace
765 *~
766 .DS_Store
767 *.elc
768 *-autoloads.el
769 #+end_src
770
771 ** Latexmk
772 :PROPERTIES:
773 :header-args+: :tangle ~/.latexmkrc
774 :END:
775
776 #+begin_src conf
777 $pdf_previewer = "start zathura %O %S";
778 $clean_ext = "aux out";
779
780 # $pdf_update_method = 4;
781 # $pdf_update_command = "zathura %O %S";
782
783 # Synctex allows one to jump to from the PDF in Zathura to the source in Emacs
784 # by Ctrl+click in the PDF.
785 # Tell latexmk to use Zathura as a previewer, and run emacsclient as the Synctex
786 # editor.
787 # $pdf_previewer = 'exec zathura --synctex-forward -x \'emacsclient --no-wait +%{line} %{input}\' %O %S';
788 #+end_src
789
790 ** getmail
791
792 *** getmailrc
793 :PROPERTIES:
794 :header-args+: :tangle ~/.getmail/getmailrc
795 :END:
796
797 #+begin_src conf
798 [retriever]
799 type = SimplePOP3SSLRetriever
800 server = fencepost.gnu.org
801 username = aminb
802 password_command = ("gpg2", "--no-tty", "-q", "-d", "~/.passwd/gnu.gpg")
803 port = 995
804 use_apop = True
805
806 [destination]
807 type = Maildir
808 path = ~/mail/gnu/Inbox/
809
810 [options]
811 delete = True
812 #+end_src
813
814 *** getmail.service
815 :PROPERTIES:
816 :header-args+: :tangle ~/.config/systemd/user/getmail.service
817 :END:
818
819 #+begin_src conf :tangle no
820 [Unit]
821 Description=getmail service
822
823 [Service]
824 Type=oneshot
825 ExecStart=/usr/bin/getmail
826 StandardOutput=syslog
827 StandardError=syslog
828 #+end_src
829
830 *** getmail.timer
831 :PROPERTIES:
832 :header-args+: :tangle ~/.config/systemd/user/getmail.timer
833 :END:
834
835 #+begin_src conf :tangle no
836 [Unit]
837 Description=getmail timer
838
839 [Timer]
840 OnCalendar=*:0/30
841 Persistent=true
842 Unit=getmail.service
843
844 [Install]
845 WantedBy=timers.target
846 #+end_src
847
848 ** GnuPG
849 :PROPERTIES:
850 :header-args+: :tangle ~/.gnupg/gpg-agent.conf
851 :END:
852
853 #+begin_src conf
854 default-cache-ttl 43200
855 max-cache-ttl 43200
856
857 default-cache-ttl-ssh 10800
858 max-cache-ttl-ssh 10800
859
860 # pinentry-program /usr/bin/pinentry-qt
861 #+end_src
862
863 ** GTK
864
865 *** gtk-2.0
866 :PROPERTIES:
867 :header-args+: :tangle ~/.gtkrc-2.0
868 :END:
869
870 #+begin_src conf
871 gtk-theme-name="Greybird"
872 gtk-icon-theme-name="Paper"
873 gtk-font-name="Ubuntu 10"
874 gtk-menu-images=0
875 # gtk-key-theme-name = "Emacs"
876 #+end_src
877
878 *** gtk-3.0
879 :PROPERTIES:
880 :header-args+: :tangle ~/.config/gtk-3.0/settings.ini
881 :END:
882
883 #+begin_src conf :tangle no
884 [Settings]
885 gtk-icon-theme-name = Paper
886 # gtk-theme-name = Adwaita
887
888 gtk-theme-name = Greybird
889 # gtk-theme-name = Arc-Darker
890 # gtk-theme-name = Numix-ArchBlue
891
892 gtk-font-name = Ubuntu 10
893 # gtk-key-theme-name = Emacs
894 #+end_src
895
896 ** isync
897
898 *** mbsyncrc
899 :PROPERTIES:
900 :header-args+: :tangle ~/.mbsyncrc
901 :END:
902
903 #+begin_src conf
904 # Global defaults
905 CopyArrivalDate yes
906
907 ######
908 IMAPAccount amin
909 Host nix.aminb.org
910 User amin@aminb.org
911 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/amin.gpg"
912 SSLType IMAPS
913
914 IMAPStore amin-remote
915 Account amin
916
917 MaildirStore amin-local
918 Path ~/mail/amin/
919 Inbox ~/mail/amin/Inbox
920 SubFolders Verbatim
921
922 Channel amin
923 Master :amin-remote:
924 Slave :amin-local:
925 Patterns * !dovecot*
926 Create Both
927 SyncState *
928
929 ######
930 IMAPAccount uwaterloo
931 Host connect.uwaterloo.ca
932 User mbandali
933 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/uwaterloo.gpg"
934 SSLType IMAPS
935
936 IMAPStore uwaterloo-remote
937 Account uwaterloo
938
939 MaildirStore uwaterloo-local
940 Path ~/mail/uwaterloo/
941 Inbox ~/mail/uwaterloo/Inbox
942 SubFolders Verbatim
943
944 Channel uwaterloo
945 Master :uwaterloo-remote:
946 Slave :uwaterloo-local:
947 Patterns * !dovecot*
948 Create Both
949 SyncState *
950 #+end_src
951
952 *** mbsync.service
953 :PROPERTIES:
954 :header-args+: :tangle ~/.config/systemd/user/mbsync.service
955 :END:
956
957 #+begin_src conf :tangle no
958 [Unit]
959 Description=mbsync service
960
961 [Service]
962 Type=oneshot
963 ExecStart=/usr/bin/mbsync -Va
964 StandardOutput=syslog
965 StandardError=syslog
966 #+end_src
967
968 *** mbsync.timer
969 :PROPERTIES:
970 :header-args+: :tangle ~/.config/systemd/user/mbsync.timer
971 :END:
972
973 #+begin_src conf :tangle no
974 [Unit]
975 Description=mbsync timer
976
977 [Timer]
978 OnCalendar=*:0/15
979 Persistent=true
980 Unit=mbsync.service
981
982 [Install]
983 WantedBy=timers.target
984 #+end_src
985
986 * Scripts
987
988 This section contains various useful scripts and the ones used by the
989 programs above. For instance, =toggle-tablet= for switching to and
990 from tablet mode on my X220T, =toggle-presentation-mode= for toggling
991 Xfce's presentation mode which keeps the screen awake, and
992 =rofi-light= a small utility that uses [[https://github.com/DaveDavenport/rofi][Rofi]] to ask and [[https://github.com/haikarainen/light][light]] to set an
993 exact brightness value.
994
995 ** rofi-light
996 :PROPERTIES:
997 :header-args+: :tangle ~/.local/bin/rofi-light :shebang "#!/bin/bash"
998 :END:
999
1000 #+begin_src bash
1001 cur=$(light -G)
1002 val=$(rofi -dmenu -mesg "light $cur" -p "light -S " -l 0 -width 8)
1003 light -S $val
1004 #+end_src
1005
1006 ** toggle-layout
1007 :PROPERTIES:
1008 :header-args+: :tangle ~/.local/bin/toggle-layout :shebang "#!/bin/bash"
1009 :END:
1010
1011 #+begin_src bash
1012 lang="$(setxkbmap -print | grep xkb_symbols | cut -d'+' -f 2)"
1013
1014 if [ "$lang" = "us" ]; then
1015 setxkbmap ir
1016 else
1017 setxkbmap us
1018 # xmodmap $HOME/.Xmodmap
1019 fi
1020 #+end_src
1021
1022 ** toggle-presentation-mode
1023 :PROPERTIES:
1024 :header-args+: :tangle ~/.local/bin/toggle-presentation-mode :shebang "#!/bin/bash"
1025 :END:
1026
1027 #+begin_src bash
1028 xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
1029 #+end_src
1030
1031 ** Fun :)
1032
1033 *** eat-em
1034 :PROPERTIES:
1035 :header-args+: :tangle ~/.local/bin/eat-em :shebang "#!/bin/sh"
1036 :END:
1037
1038 #+begin_src sh
1039 # Original Posted at http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
1040 # [ESC] character in original post removed here.
1041
1042 # ANSI Color -- use these variables to easily have different color
1043 # and format output. Make sure to output the reset sequence after
1044 # colors (f = foreground, b = background), and use the 'off'
1045 # feature for anything you turn on.
1046
1047 initializeANSI()
1048 {
1049 esc="$(echo -en '\e')"
1050
1051 blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m"
1052 yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m"
1053 cyanf="${esc}[36m"; whitef="${esc}[37m"
1054
1055 blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m"
1056 yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m"
1057 cyanb="${esc}[46m"; whiteb="${esc}[47m"
1058
1059 boldon="${esc}[1m"; boldoff="${esc}[22m"
1060 italicson="${esc}[3m"; italicsoff="${esc}[23m"
1061 ulon="${esc}[4m"; uloff="${esc}[24m"
1062 invon="${esc}[7m"; invoff="${esc}[27m"
1063
1064 reset="${esc}[0m"
1065 }
1066
1067 # note in this first use that switching colors doesn't require a reset
1068 # first - the new color overrides the old one.
1069
1070 #clear
1071
1072 initializeANSI
1073
1074 cat << EOF
1075
1076 ${yellowf} ▄███████▄${reset} ${redf} ▄██████▄${reset} ${greenf} ▄██████▄${reset} ${bluef} ▄██████▄${reset} ${purplef} ▄██████▄${reset} ${cyanf} ▄██████▄${reset}
1077 ${yellowf}▄█████████▀▀${reset} ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄${reset} ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄${reset} ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄${reset} ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄${reset} ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
1078 ${yellowf}███████▀${reset} ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███${reset} ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███${reset} ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███${reset} ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███${reset} ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
1079 ${yellowf}███████▄${reset} ${redf}████████████${reset} ${greenf}████████████${reset} ${bluef}████████████${reset} ${purplef}████████████${reset} ${cyanf}████████████${reset}
1080 ${yellowf}▀█████████▄▄${reset} ${redf}██▀██▀▀██▀██${reset} ${greenf}██▀██▀▀██▀██${reset} ${bluef}██▀██▀▀██▀██${reset} ${purplef}██▀██▀▀██▀██${reset} ${cyanf}██▀██▀▀██▀██${reset}
1081 ${yellowf} ▀███████▀${reset} ${redf}▀ ▀ ▀ ▀${reset} ${greenf}▀ ▀ ▀ ▀${reset} ${bluef}▀ ▀ ▀ ▀${reset} ${purplef}▀ ▀ ▀ ▀${reset} ${cyanf}▀ ▀ ▀ ▀${reset}
1082
1083 ${boldon}${yellowf} ▄███████▄ ${redf} ▄██████▄ ${greenf} ▄██████▄ ${bluef} ▄██████▄ ${purplef} ▄██████▄ ${cyanf} ▄██████▄${reset}
1084 ${boldon}${yellowf}▄█████████▀▀ ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄ ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄ ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄ ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄ ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
1085 ${boldon}${yellowf}███████▀ ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███ ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███ ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███ ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███ ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
1086 ${boldon}${yellowf}███████▄ ${redf}████████████ ${greenf}████████████ ${bluef}████████████ ${purplef}████████████ ${cyanf}████████████${reset}
1087 ${boldon}${yellowf}▀█████████▄▄ ${redf}██▀██▀▀██▀██ ${greenf}██▀██▀▀██▀██ ${bluef}██▀██▀▀██▀██ ${purplef}██▀██▀▀██▀██ ${cyanf}██▀██▀▀██▀██${reset}
1088 ${boldon}${yellowf} ▀███████▀ ${redf}▀ ▀ ▀ ▀ ${greenf}▀ ▀ ▀ ▀ ${bluef}▀ ▀ ▀ ▀ ${purplef}▀ ▀ ▀ ▀ ${cyanf}▀ ▀ ▀ ▀${reset}
1089
1090 EOF
1091 #+end_src
1092
1093 *** invade-em
1094 :PROPERTIES:
1095 :header-args+: :tangle ~/.local/bin/invade-em :shebang "#!/bin/bash"
1096 :END:
1097
1098 #+begin_src bash
1099 #
1100 # ANSI color scheme script featuring Space Invaders
1101 #
1102 # Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
1103 # Modified by lolilolicon
1104 #
1105
1106 f=3 b=4
1107 for j in f b; do
1108 for i in {0..7}; do
1109 printf -v $j$i %b "\e[${!j}${i}m"
1110 done
1111 done
1112 bld=$'\e[1m'
1113 rst=$'\e[0m'
1114
1115 cat << EOF
1116
1117 $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
1118 $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
1119 $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst
1120 $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst
1121
1122 $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
1123 $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
1124 $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst
1125 $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst
1126
1127
1128 $f7▌$rst
1129
1130 $f7▌$rst
1131
1132 $f7 ▄█▄ $rst
1133 $f7▄█████████▄$rst
1134 $f7▀▀▀▀▀▀▀▀▀▀▀$rst
1135
1136 EOF
1137 #+end_src