b046d1b7e5e89c5495226fb9c15c9d2857753c83
[~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 ** bspwm
18
19 *** bspwmrc
20 :PROPERTIES:
21 :header-args+: :tangle ~/.config/bspwm/bspwmrc :shebang "#!/bin/sh"
22 :END:
23
24 #+begin_src sh :tangle no
25 sxhkd &
26 sh ~/.fehbg &
27 xfce4-panel -d &
28 compton &
29 sleep 0.5 && pasystray --notify=all &
30
31 bspc monitor -d I II III IV V VI VII VIII IX X
32 #bspc monitor eDP-1 -d I II III IV V
33 #bspc monitor HDMI-1 -d VI VII VIII IX X
34
35 #bspc config border_width 2
36 #bspc config window_gap 8
37 bspc config window_gap 0
38
39 bspc config bottom_padding 26
40
41 bspc config split_ratio 0.52
42 bspc config borderless_monocle true
43 bspc config gapless_monocle true
44 bspc config click_to_focus button1
45 bspc config directional_focus_tightness low
46
47 #bspc rule -a Firefox desktop='^1' follow=on
48 bspc rule -a Nightly desktop='^1' follow=on
49 bspc rule -a Emacs desktop='^2' state=tiled follow=on
50 #bspc rule -a Chromium desktop='^4' follow=on
51 bspc rule -a URxvt state=floating
52 bspc rule -a URxvt:tiled state=tiled
53 bspc rule -a Connman-gtk state=floating
54 bspc rule -a Xfce4-panel state=floating
55 bspc rule -a TelegramDesktop state=floating
56 bspc rule -a Ec state=floating
57 bspc rule -a Pavucontrol state=floating
58 bspc rule -a Eog state=floating
59 bspc rule -a Seahorse state=floating
60 bspc rule -a mpv state=floating
61 bspc rule -a Evince state=floating
62 bspc rule -a Meld state=floating
63 bspc rule -a Autokey-gtk state=floating
64 bspc rule -a Mousepad state=floating
65 bspc rule -a Wrapper-1.0 state=floating
66 bspc rule -a File-roller state=floating
67 bspc rule -a Gnome-disks state=floating
68 bspc rule -a Termite state=floating
69 bspc rule -a Termite:tiled state=tiled
70 bspc rule -a Thunderbird:Calendar state=floating
71 bspc rule -a Audacity state=floating
72 bspc rule -a Proof state=floating # pvs x-show-proof
73 bspc rule -a Nm-connection-editor state=floating
74 bspc rule -a Wire state=floating
75 bspc rule -a discord state=floating
76 bspc rule -a X2goclient state=floating
77 bspc rule -a SimpleScreenRecorder state=floating
78 bspc rule -a Gimp state=floating
79 bspc rule -a Wrapper-2.0 state=floating
80 bspc rule -a Zathura state=tiled
81 #+end_src
82
83 *** sxhkdrc
84 :PROPERTIES:
85 :header-args+: :tangle ~/.config/sxhkd/sxhkdrc
86 :END:
87
88 #+begin_src conf :tangle no
89 #
90 # wm independent hotkeys
91 #
92
93 # terminal emulator
94 super + {_,shift} + Return
95 urxvt{_, -name tiled}
96
97 #super + {_,shift} + Return
98 # termite{_, --name=tiled}
99
100 # program launcher
101 super + space
102 rofi -show run -display-run '> ' -display-window ' 🗔 '
103
104 super + alt + space
105 xfce4-popup-whiskermenu
106
107 # window finder
108 super + backslash
109 rofi -show window -display-run '> ' -display-window ' 🗔 '
110
111 # password manager
112 alt + space
113 rofi-pass
114
115 # firefox
116 #super + r
117 # firefox
118
119 # chromium
120 #super + c
121 # chromium -incognito
122
123 # emacs
124 super + e
125 emacs
126
127 # make sxhkd reload its configuration files:
128 super + Escape
129 pkill -USR1 -x sxhkd
130
131 # volume {up,down}
132 XF86Audio{Raise,Lower}Volume
133 pamixer --allow-boost --{in,de}crease 5
134
135 # mute
136 XF86AudioMute
137 pamixer --toggle-mute
138
139 XF86AudioMicMute
140 pactl set-source-mute 1 toggle
141
142 # playback control
143 XF86Audio{Play,Prev,Next}
144 mpc {toggle,prev,next}
145
146 # lock the screen
147 super + shift + q
148 light-locker-command -l
149
150 # Toggle keyboard layout
151 super + F7
152 toggle-layout
153
154 # Toggle Xfce presentation mode
155 XF86LaunchB
156 toggle-presentation-mode
157
158 # monitor brightness
159 XF86MonBrightness{Up,Down}
160 light -{A,U} 5
161
162 super + apostrophe
163 rofi-light
164
165 # keyboard brightness
166 #XF86KbdBrightness{Up,Down}
167 # kbdlight {up,down}
168
169 XF86RotateWindows
170 toggle-tablet
171
172 #
173 # bspwm hotkeys
174 #
175
176 # quit bspwm normally
177 super + alt + Escape
178 bspc quit
179
180 # close and kill
181 super + {w,q}
182 bspc node -{c,k}
183
184 # alternate between the tiled and monocle layout
185 super + m
186 bspc desktop -l next
187
188 # send the newest marked node to the newest preselected node
189 super + y
190 bspc node newest.marked.local -n newest.!automatic.local
191
192 # swap the current node and the biggest node
193 super + g
194 bspc node -s biggest
195
196 #
197 # state/flags
198 #
199
200 # set the window state
201 super + {t,shift + t,s,f}
202 bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
203
204 # set the node flags
205 super + ctrl + {m,x,y,z}
206 bspc node -g {marked,locked,sticky,private}
207
208 #
209 # focus/swap
210 #
211
212 # focus the node in the given direction
213 super + {_,shift + }{h,j,k,l}
214 bspc node -{f,s} {west,south,north,east}
215
216 # focus the node for the given path jump
217 super + {p,b,comma,period}
218 bspc node -f @{parent,brother,first,second}
219
220 # focus the next/previous node in the current desktop
221 super + {_,shift + }c
222 bspc node -f {next,prev}.local
223
224 # focus the next/previous desktop in the current monitor
225 super + bracket{left,right}
226 bspc desktop -f {prev,next}.local
227
228 # send to next/prev desktop
229 super + shift + bracket{left,right}
230 bspc node -d {prev,next} --follow
231
232 # focus the last node/desktop
233 super + {grave,Tab}
234 bspc {node,desktop} -f last
235
236 # focus the older or newer node in the focus history
237 super + {o,i}
238 bspc wm -h off; \
239 bspc node {older,newer} -f; \
240 bspc wm -h on
241
242 # focus or send to the given desktop
243 super + {_,shift + }{1-9,0}
244 bspc {desktop -f,node -d} '^{1-9,10}'
245
246 #
247 # preselect
248 #
249
250 # preselect the direction
251 super + ctrl + {h,j,k,l}
252 bspc node -p {west,south,north,east}
253
254 # preselect the ratio
255 super + ctrl + {1-9}
256 bspc node -o 0.{1-9}
257
258 # cancel the preselection for the focused node
259 super + ctrl + space
260 bspc node -p cancel
261
262 # cancel the preselection for the focused desktop
263 super + ctrl + shift + space
264 bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
265
266 #
267 # move/resize
268 #
269
270 # expand a window by moving one of its side outward
271 super + alt + {h,j,k,l}
272 bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
273
274 # contract a window by moving one of its side inward
275 super + alt + shift + {h,j,k,l}
276 bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
277
278 # move a floating window
279 super + {Left,Down,Up,Right}
280 bspc node -v {-20 0,0 20,0 -20,20 0}
281
282 #alt + bracket{left,right}
283 # xdotool key --clearmodifiers ctrl+Page_{Up,Down}
284 #+end_src
285
286 ** compton
287 :PROPERTIES:
288 :header-args+: :tangle ~/.config/compton.conf
289 :END:
290
291 #+begin_src conf :tangle no
292 # Shadow
293 shadow = false; # Enabled client-side shadows on windows.
294 no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows.
295 no-dnd-shadow = true; # Don't draw shadows on DND windows.
296 clear-shadow = true; # Zero the part of the shadow's mask behind the
297 # window. Fix some weirdness with ARGB windows.
298 shadow-radius = 5; # The blur radius for shadows. (default 12)
299 shadow-offset-x = -5; # The left offset for shadows. (default -15)
300 shadow-offset-y = -5; # The top offset for shadows. (default -15)
301 # shadow-opacity = 0.7; # The translucency for shadows. (default .75)
302 # shadow-red = 0.0; # Red color value of shadow. (0.0 - 1.0, defaults to 0)
303 # shadow-green = 0.0; # Green color value of shadow. (0.0 - 1.0, defaults to 0)
304 # shadow-blue = 0.0; # Blue color value of shadow. (0.0 - 1.0, defaults to 0)
305 shadow-exclude = [ "n:e:Notification", "class_g = 'Chromium'", "class_g = 'Dmenu'", "class_g = 'Firefox' && argb" ]; # Exclude conditions for shadows.
306 # shadow-exclude = "n:e:Notification";
307 #shadow-exclude = [ "_GTK_FRAME_EXTENTS@:c" ] # Fix dual shadow on some gtk3 powered applications
308 shadow-ignore-shaped = true; # Avoid drawing shadow on all shaped windows
309 # (see also: --detect-rounded-corners)
310
311 # Opacity
312 menu-opacity = 1.0; # The opacity for menus. (default 1.0)
313 #inactive-opacity = 0.9; # Default opacity of inactive windows. (0.0 - 1.0)
314 # active-opacity = 0.8; # Default opacity for active windows. (0.0 - 1.0)
315 frame-opacity = 1.0; # Opacity of window titlebars and borders. (0.1 - 1.0)
316 # inactive-opacity-override = true; # Let inactive opacity set by 'inactive-opacity' overrides
317 # value of _NET_WM_OPACITY. Bad choice.
318 alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasing
319 # it may result in less X resource usage,
320 # Yet fading may look bad.
321 #inactive-dim = 0.5; # Dim inactive windows. (0.0 - 1.0)
322 #inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity.
323 # blur-background = true; # Blur background of transparent windows.
324 # Bad performance with X Render backend.
325 # GLX backend is preferred.
326 # blur-background-frame = true; # Blur background of opaque windows with transparent
327 # frames as well.
328 blur-background-fixed = true; # Do not let blur radius adjust based on window opacity.
329 blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
330 # Exclude conditions for background blur.
331
332 # Fading
333 fading = false; # Fade windows during opacity changes.
334 fade-delta = 3; # The time between steps in a fade in milliseconds. (default 10).
335 fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028).
336 fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03).
337 # no-fading-openclose = true; # Avoid fade windows in/out when opening/closing.
338 fade-exclude = [ ]; # Exclude conditions for fading.
339
340 # Other
341 backend = "glx" # Backend to use: "xrender" or "glx". GLX backend is typically
342 # much faster but depends on a sane driver.
343 mark-wmwin-focused = true; # Try to detect WM windows and mark them as active.
344 mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus).
345 use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
346 # instead of using FocusIn/Out events. Usually more reliable but
347 # depends on a EWMH-compliant WM.
348 detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore- shaped is on.
349 detect-client-opacity = true; # Detect _NET_WM_OPACITY on client windows, useful for window
350 # managers not passing _NET_WM_OPACITY of client windows to frame
351 # windows.
352 refresh-rate = 0; # For --sw-opti: Specify refresh rate of the screen. 0 for auto.
353 vsync = "drm"; # "none", "drm", "opengl", "opengl-oml", "opengl-swc", "opengl-mswc"
354 # See man page for more details.
355 dbe = false; # Enable DBE painting mode. Rarely needed.
356 paint-on-overlay = true; # Painting on X Composite overlay window. Recommended.
357 sw-opti = false; # Limit compton to repaint at most once every 1 / refresh_rate.
358 # Incompatible with certain VSync methods.
359 unredir-if-possible = false; # Unredirect all windows if a full-screen opaque window is
360 # detected, to maximize performance for full-screen windows.
361 focus-exclude = [ ]; # A list of conditions of windows that should always be considered
362 # focused.
363 detect-transient = true; # Use WM_TRANSIENT_FOR to group windows, and consider windows in
364 # the same group focused at the same time.
365 detect-client-leader = true; # Use WM_CLIENT_LEADER to group windows.
366 invert-color-include = [ ]; # Conditions for windows to be painted with inverted color.
367
368 # GLX backend # GLX backend fine-tune options. See man page for more info.
369 glx-no-stencil = true; # Recommended.
370 glx-copy-from-front = false; # Useful with --glx-swap-method,
371 # glx-use-copysubbuffermesa = true; # Recommended if it works. Breaks VSync.
372 # glx-no-rebind-pixmap = true; # Recommended if it works.
373 glx-no-rebind-pixmap = true; # Recommended if it works.
374 #glx-swap-method = "4"; # See man page.
375 glx-swap-method = "4"; # See man page.
376
377 # Window type settings
378 wintypes:
379 {
380 tooltip = { fade = true; shadow = false; opacity = 1; focus = true; };
381 menu = { shadow = false; };
382 dropdown_menu = { shadow = false; };
383 popup_menu = { shadow = false; };
384 utility = { shadow = false; };
385 # fade: Fade the particular type of windows.
386 # shadow: Give those windows shadow
387 # opacity: Default opacity for the type of windows.
388 # focus: Whether to always consider windows of this type focused.
389 };
390 #+end_src
391
392 ** dovecot
393 :PROPERTIES:
394 :header-args+: :tangle "/sudo::/etc/dovecot/dovecot.conf"
395 :END:
396
397 #+begin_src conf
398 protocols = imap
399
400 listen = 127.0.0.1
401 log_path = /var/log/dovecot.log
402 info_log_path = /var/log/dovecot-info.log
403
404 ssl = no
405 disable_plaintext_auth = no
406
407 auth_verbose = yes
408 auth_mechanisms = plain
409
410 passdb {
411 driver = passwd-file
412 args = /etc/dovecot/passwd
413 }
414
415 userdb {
416 driver = static
417 args = uid=amin gid=amin home=/home/amin/mail/%d/%n
418 default_fields = mail=maildir:/home/amin/mail/%d/%n/mail
419 }
420
421 # mail_home = /home/amin/mail/%d/%n
422 # mail_location = maildir:/home/amin/mail/%d/%n/mail:LAYOUT=fs:INBOX=/home/amin/mail/%d/%n/mail/Inbox
423
424 # namespace {
425 # inbox = yes
426 # separator = /
427 # }
428
429 mail_plugins = $mail_plugins fts fts_lucene
430
431 plugin {
432 fts = lucene
433 fts_lucene = whitespace_chars=@.
434 fts_autoindex = yes
435 }
436 #+end_src
437
438 ** Dunst
439 :PROPERTIES:
440 :header-args+: :tangle ~/.config/dunst/dunstrc
441 :END:
442
443 #+begin_src conf
444 [global]
445 #font = Ubuntu Mono 10.5
446 font = Inconsolata 11
447
448 # Path to default icons.
449 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/
450
451 icon_position = left
452 # <b>bold</b>
453 # <i>italic</i>
454 # <s>strikethrough<s/>
455 # <u>underline</u>
456 markup = full
457 # The format of the message. Possible variables are:
458 # %a appname
459 # %s summary
460 # %b body
461 # %i iconname (including its path)
462 # %I iconname (without its path)
463 # %p progress value if set ([ 0%] to [100%]) or nothing
464 # Markup is allowed
465 format = "<b>%s</b>\n%b"
466 # Sort messages by urgency
467 sort = yes
468 # Show how many messages are currently hidden (because of geometry)
469 indicate_hiddenl= no
470 # Alignment of message text.
471 # Possible values are "left", "center" and "right"
472 alignment = center
473 # The frequency with wich text that is longer than the notification
474 # window allows bounces back and forth.
475 # This option conflicts with 'word_wrap'.
476 # Set to 0 to disable
477 bounce_freq = 3
478 # show age of message if message is older than show_age_threshold seconds.
479 # set to -1 to disable
480 show_age_threshold = -1
481 # split notifications into multiple lines if they don't fit into geometry
482 word_wrap = yes
483 # ignore newlines '\n' in notifications
484 ignore_newline = no
485 # The geometry of the message window.
486 # geometry [{width}]x{height}][+/-{x}+/-{y}]
487 # The height is measured in number of notifications everything else in pixels. If the width
488 # is omitted but the height is given ("-geometry x2"), the message window
489 # expands over the whole screen (dmenu-like). If width is 0,
490 # the window expands to the longest message displayed.
491 # A positive x is measured from the left, a negative from the
492 # right side of the screen. Y is measured from the top and down respectevly.
493 # The width can be negative. In this case the actual width is the
494 # screen width minus the width defined in within the geometry option.
495 #geometry = "410x12-12+12"
496 #geometry = "0x0-30-30"
497 geometry = "260x12-30-30"
498 # The transparency of the window. range: [0; 100]
499 # This option will only work if a compositing windowmanager is present (e.g. xcompmgr, compiz, etc..)
500 transparency = 0
501 # Don't remove messages, if the user is idle (no mouse or keyboard input)
502 # for longer than idle_threshold seconds.
503 # Set to 0 to disable.
504 idle_threshold = 120
505 # Which monitor should the notifications be displayed on.
506 monitor = 0
507 # Display notification on focused monitor. Possible modes are:
508 # mouse: follow mouse pointer
509 # keyboard: follow window with keyboard focus
510 # none: don't follow anything
511 #
512 # "keyboard" needs a windowmanager that exports the _NET_ACTIVE_WINDOW property.
513 # This should be the case for almost all modern windowmanagers.
514 #
515 # If this option is set to mouse or keyboard, the monitor option will be
516 # ignored.
517 follow = keyboard
518 # should a notification popped up from history be sticky or
519 # timeout as if it would normally do.
520 sticky_history = yes
521 # The height of a single line. If the height is smaller than the font height,
522 # it will get raised to the font height.
523 # This adds empty space above and under the text.
524 line_height = 0
525
526 show_indicators = yes
527
528 # Draw a line of 'separatpr_height' pixel height between two notifications.
529 # Set to 0 to disable
530 separator_height = 3
531 # padding between text and separator
532 padding = 8
533 # horizontal padding
534 horizontal_padding = 8
535 # Define a color for the separator.
536 # possible values are:
537 # * auto: dunst tries to find a color fitting to the background
538 # * foreground: use the same color as the foreground
539 # * frame: use the same color as the frame.
540 # * anything else will be interpreted as a X color
541 separator_color = foreground
542 # print a notification on startup
543 # This is mainly for error detection, since dbus (re-)starts dunst
544 # automatically after a crash.
545 startup_notification = false
546 # dmenu path
547 #dmenu = /usr/bin/dmenu -p dunst:
548 dmenu = /usr/bin/rofi -dmenu -p dunst:
549 # browser for opening urls in context menu
550 browser = /usr/bin/firefox -new-tab
551 [frame]
552 width = 0
553 color = "#377222"
554 [shortcuts]
555 # shortcuts are specified as [modifier+][modifier+]...key
556 # available modifiers are 'ctrl', 'mod1' (the alt-key), 'mod2', 'mod3'
557 # and 'mod4' (windows-key)
558 # xev might be helpful to find names for keys
559 # close notification
560 close = ctrl+space
561 # close all notifications
562 close_all = ctrl+shift+space
563 # redisplay last message(s)
564 # On the US keyboard layout 'grave' is normally above TAB and left of '1'.
565 history = ctrl+shift+h
566 # context menu
567 context = ctrl+shift+period
568 [urgency_low]
569 # IMPORTANT: colors have to be defined in quotation marks.
570 # Otherwise the '#' and following would be interpreted as a comment.
571 background = "#1d2a30"
572 foreground = "#71c2af"
573 timeout = 3
574 [urgency_normal]
575 background = "#1d2a30"
576 foreground = "#71c2af"
577 timeout = 0
578 [urgency_critical]
579 background = "#1d2a30"
580 foreground = "#ff9982"
581 timeout = 0
582
583 # Every section that isn't one of the above is interpreted as a rules
584 # to override settings for certain messages.
585 # Messages can be matched by 'appname', 'summary', 'body' or 'icon'
586 # and you can override the 'timeout', 'urgency', 'foreground', 'background'
587 # and 'format'.
588 # Shell-like globbing will get expanded.
589 #
590 # SCRIPTING
591 # you can specify a script that gets run when the rule matches by setting
592 # the 'script' option.
593 # The script will be called as follows:
594 # script appname summary body icon urgency
595 # where urgency can be "LOW", "NORMAL" or "CRITICAL".
596 #
597 # NOTE: if you don't want a notification to be displayed, set the format to ""
598 # NOTE: It might be helpful to run dunst -print in a terminal in order to find
599 # fitting options for rules.
600 #[espeak]
601 # summary = "*"
602 # script = dunst_espeak.sh
603 #[script-test]
604 # summary = "*script*"
605 # script = dunst_test.sh
606 #[ignore]
607 ## This notification will not be displayed
608 # summary = "foobar"
609 # format = ""
610 #[signed_on]
611 # appname = Pidgin
612 # summary = "*signed on*"
613 # urgency = low
614 #
615 #[signed_off]
616 # appname = Pidgin
617 # summary = *signed off*
618 # urgency = low
619 #
620 #[says]
621 # appname = Pidgin
622 # summary = *says*
623 # urgency = critical
624 #
625 #[twitter]
626 # appname = Pidgin
627 # summary = *twitter.com*
628 # urgency = normal
629 #
630 [xfpm-backlight]
631 summary = *Brightness*
632 urgency = low
633 #+end_src
634
635 ** Fontconfig
636 :PROPERTIES:
637 :header-args+: :tangle ~/.config/fontconfig/fonts.conf :comments none
638 :END:
639
640 #+begin_src xml
641 <?xml version="1.0"?>
642 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
643 <fontconfig>
644 <match target="font">
645 <edit mode="assign" name="rgba">
646 <const>rgb</const>
647 </edit>
648 </match>
649 <match target="font">
650 <edit mode="assign" name="hinting">
651 <bool>true</bool>
652 </edit>
653 </match>
654 <match target="font">
655 <edit mode="assign" name="hintstyle">
656 <const>hintslight</const>
657 </edit>
658 </match>
659 <match target="font">
660 <edit mode="assign" name="antialias">
661 <bool>true</bool>
662 </edit>
663 </match>
664 <match target="font">
665 <edit mode="assign" name="lcdfilter">
666 <const>lcddefault</const>
667 </edit>
668 </match>
669 <dir>~/.fonts</dir>
670
671 <!-- Use Liberation Sans for Helvetica (instead of Nimbus Sans) -->
672 <alias binding="same">
673 <family>Helvetica</family>
674 <prefer>
675 <family>Liberation Sans</family>
676 </prefer>
677 </alias>
678 </fontconfig>
679 #+end_src
680
681 ** getmail
682
683 *** getmailrc
684 :PROPERTIES:
685 :header-args+: :tangle ~/.getmail/getmailrc
686 :END:
687
688 #+begin_src conf
689 [retriever]
690 type = SimplePOP3SSLRetriever
691 server = fencepost.gnu.org
692 username = bandali
693 password_command = ("gpg2", "--no-tty", "-q", "-d", "/home/amin/.passwd/gnu.gpg")
694 port = 995
695 use_apop = True
696
697 [destination]
698 type = Maildir
699 path = ~/mail/gnu/Inbox/
700
701 [options]
702 delete = True
703 #+end_src
704
705 *** getmail.service
706 :PROPERTIES:
707 :header-args+: :tangle ~/.config/systemd/user/getmail.service
708 :END:
709
710 #+begin_src conf :tangle no
711 [Unit]
712 Description=getmail service
713
714 [Service]
715 Type=oneshot
716 ExecStart=/usr/bin/getmail
717 StandardOutput=syslog
718 StandardError=syslog
719 #+end_src
720
721 *** getmail.timer
722 :PROPERTIES:
723 :header-args+: :tangle ~/.config/systemd/user/getmail.timer
724 :END:
725
726 #+begin_src conf :tangle no
727 [Unit]
728 Description=getmail timer
729
730 [Timer]
731 OnCalendar=*:0/30
732 Persistent=true
733 Unit=getmail.service
734
735 [Install]
736 WantedBy=timers.target
737 #+end_src
738
739 ** Git
740
741 *** gitconfig
742 :PROPERTIES:
743 :header-args+: :tangle ~/.gitconfig
744 :END:
745
746 **** user
747 #+begin_src conf
748 [user]
749 name = Amin Bandali
750 email = bandali@gnu.org
751 signingkey = BE6273738E616D6D1B3A08E8A21A020248816103
752 #+end_src
753
754 **** signing
755 #+begin_src conf
756 [commit]
757 gpgsign = true
758 # [format]
759 # signoff = true
760 #+end_src
761
762 **** core
763 #+begin_src conf
764 [core]
765 autocrlf = input # CRLF -> LF on commit
766 editor = emacsclient -t
767 excludesfile = ~/.gitignore_global
768 pager = "less"
769 #+end_src
770
771 **** gpg
772 #+begin_src conf
773 [gpg]
774 program = gpg2
775 #+end_src
776
777 **** alias
778 #+begin_src conf
779 [alias]
780 git = !exec git # handle nested git calls, e.g. git git status
781 aliases = config --get-regexp '^alias\\.'
782 a = add
783 s = status
784 sl = status --long
785 c = checkout
786 cb = checkout -b
787 b = branch
788 r = rebase
789 p = pull
790 pr = pull --rebase
791 ps = push
792 psf = push --force
793 nmam = "!f() { notmuch show --format=raw $1 | git am -; }; f"
794 nmam3 = "!f() { notmuch show --format=raw $1 | git am -3 -; }; f"
795 #+end_src
796
797 **** color
798 #+begin_src conf
799 [color]
800 ui = auto
801 [color "status"]
802 added = green bold
803 changed = red bold
804 untracked = red bold
805 [color "branch"]
806 current = green bold
807 remote = magenta bold
808 [color "diff"]
809 new = green bold
810 old = red bold
811 #+end_src
812
813 **** status
814 #+begin_src conf
815 [status]
816 # showUntrackedFiles = all
817 short=true
818 branch=true
819 #+end_src
820
821 **** github
822 #+begin_src conf
823 [github]
824 user = aminb
825 #+end_src
826
827 **** send-email
828 #+begin_src conf
829 [sendemail]
830 smtpuser = bandali
831 smtpserver = fencepost.gnu.org
832 smtpserverport = 587
833 smtpencryption = tls
834 annotate = yes
835 #+end_src
836
837 *** gitignore
838 :PROPERTIES:
839 :header-args+: :tangle ~/.gitignore_global
840 :END:
841
842 #+begin_src conf
843 *.orig
844 *.py[co]
845 *.sublime-workspace
846 *~
847 .DS_Store
848 *.elc
849 *-autoloads.el
850 #+end_src
851
852 ** GnuPG
853 :PROPERTIES:
854 :header-args+: :tangle ~/.gnupg/gpg-agent.conf
855 :END:
856
857 #+begin_src conf
858 default-cache-ttl 43200
859 max-cache-ttl 43200
860
861 default-cache-ttl-ssh 10800
862 max-cache-ttl-ssh 10800
863
864 # pinentry-program /usr/bin/pinentry-qt
865 #+end_src
866
867 ** GTK
868
869 *** gtk-2.0
870 :PROPERTIES:
871 :header-args+: :tangle ~/.gtkrc-2.0
872 :END:
873
874 #+begin_src conf
875 gtk-theme-name="Greybird"
876 gtk-icon-theme-name="Paper"
877 gtk-font-name="Ubuntu 10"
878 gtk-menu-images=0
879 # gtk-key-theme-name = "Emacs"
880 #+end_src
881
882 *** gtk-3.0
883 :PROPERTIES:
884 :header-args+: :tangle ~/.config/gtk-3.0/settings.ini
885 :END:
886
887 #+begin_src conf :tangle no
888 [Settings]
889 gtk-icon-theme-name = Paper
890 # gtk-theme-name = Adwaita
891
892 gtk-theme-name = Greybird
893 # gtk-theme-name = Arc-Darker
894 # gtk-theme-name = Numix-ArchBlue
895
896 gtk-font-name = Ubuntu 10
897 # gtk-key-theme-name = Emacs
898 #+end_src
899
900 ** [[https://github.com/Leinnan/i3gs][i3gs]]
901 :PROPERTIES:
902 :header-args+: :tangle ~/.config/i3gs/config
903 :END:
904
905 #+begin_src conf :comments none :tangle no
906 borders_width=0 0 2 0
907 separator_width=10
908
909 #[mpd]
910 #preset=MPD
911 #title=<span weight='heavy' fgcolor='#7FDBFF'> </span>
912 #borders_color=#7FDBFF
913
914 [ram]
915 preset=RAM
916 title=<span weight='heavy' fgcolor='#3D9970'> </span>
917 borders_color=#3D9970
918
919 #[cpu]
920 #preset=CPU
921 #title=<span weight='heavy' fgcolor='#2ECC40'> </span>
922 #borders_color=#2ECC40
923
924 #[hdd]
925 #preset=HDD
926 #title=<span weight='heavy' fgcolor='#01FF70'> </span>
927 #borders_color=#01FF70
928
929 [volume]
930 command=volume-info
931 title=<span weight='heavy' fgcolor='#7FDBFF'></span>
932 borders_color=#7FDBFF
933
934 [battery]
935 preset=BAT
936 command=battery-percentage-time
937 title=<span weight='heavy' fgcolor='#39CCCC'> </span>
938 borders_color=#39CCCC
939
940 [wifi]
941 preset=WIFI
942 title=<span weight='heavy' fgcolor='#01FF70'> </span>
943 borders_color=#01FF70
944
945 [date]
946 preset=DATE
947 command=date '+%-I:%M, %a %b %d '
948 title=<span weight='heavy' fgcolor='#FFDC00'> </span>
949 borders_color=#FFDC00
950 separator_width=0
951 #+end_src
952
953 ** i3status
954 :PROPERTIES:
955 :header-args+: :tangle ~/.config/i3status/config
956 :END:
957
958 #+begin_src conf :comments none
959 # i3status configuration file.
960 # see "man i3status" for documentation.
961
962 # It is important that this file is edited as UTF-8.
963 # The following line should contain a sharp s:
964 # ß
965 # If the above line is not correctly displayed, fix your editor first!
966
967 general {
968 colors = true
969 interval = 5
970 output_format = "i3bar"
971 }
972
973 # order += "ipv6"
974 order += "disk /"
975 order += "disk /data"
976 order += "wireless _first_"
977 order += "ethernet _first_"
978 order += "battery 0"
979 order += "volume master"
980 order += "load"
981 order += "tztime local"
982
983 wireless _first_ {
984 format_up = "W:%quality %essid %ip"
985 format_down = "W: down"
986 }
987
988 ethernet _first_ {
989 # if you use %speed, i3status requires root privileges
990 format_up = "E: %ip (%speed)"
991 format_down = "E: down"
992 }
993
994 battery 0 {
995 format = "%status %percentage %remaining (%consumption)"
996 path = "/sys/class/power_supply/BAT%d/uevent"
997 low_threshold = "10"
998 threshold_type = "percentage"
999 last_full_capacity = true
1000 integer_battery_capacity = true
1001 hide_seconds = true
1002 }
1003
1004 tztime local {
1005 format = "%-I:%M%P %a %b %d"
1006 }
1007
1008 volume master {
1009 format = "♪ %volume"
1010 format_muted = "🔇 %volume"
1011 device = "pulse"
1012 }
1013
1014 load {
1015 format = "%1min"
1016 }
1017
1018 disk "/" {
1019 format = "/ %avail"
1020 }
1021
1022 disk "/data" {
1023 format = "/data %avail"
1024 }
1025 #+end_src
1026
1027 ** isync
1028
1029 *** mbsyncrc
1030 :PROPERTIES:
1031 :header-args+: :tangle ~/.mbsyncrc
1032 :END:
1033
1034 #+begin_src conf
1035 # Global defaults
1036 CopyArrivalDate yes
1037 Create Both
1038
1039 ######
1040 IMAPAccount amin
1041 Host mail.aminb.org
1042 User amin@aminb.org
1043 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/amin.gpg"
1044 SSLType IMAPS
1045
1046 IMAPStore amin-remote
1047 Account amin
1048
1049 IMAPAccount amin-dovecot
1050 Host 127.0.0.1
1051 Port 143
1052 User amin@aminb.org
1053 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/amin-dovecot.gpg"
1054 SSLType None
1055
1056 IMAPStore amin-local
1057 Account amin-dovecot
1058
1059 Channel amin
1060 Master :amin-remote:
1061 Slave :amin-local:
1062 Patterns *
1063
1064 ######
1065 IMAPAccount uwaterloo
1066 Host connect.uwaterloo.ca
1067 User abandali
1068 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/uwaterloo.gpg"
1069 SSLType IMAPS
1070
1071 IMAPStore uwaterloo-remote
1072 Account uwaterloo
1073
1074 IMAPAccount uwaterloo-dovecot
1075 Host 127.0.0.1
1076 Port 143
1077 User abandali@uwaterloo.ca
1078 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/uwaterloo-dovecot.gpg"
1079 SSLType None
1080
1081 IMAPStore uwaterloo-local
1082 Account uwaterloo-dovecot
1083
1084 Channel uwaterloo
1085 Master :uwaterloo-remote:
1086 Slave :uwaterloo-local:
1087 Patterns *
1088 #+end_src
1089
1090 *** mbsync.service
1091 :PROPERTIES:
1092 :header-args+: :tangle ~/.config/systemd/user/mbsync.service
1093 :END:
1094
1095 #+begin_src conf :tangle no
1096 [Unit]
1097 Description=mbsync service
1098
1099 [Service]
1100 Type=oneshot
1101 ExecStart=/usr/bin/mbsync -Va
1102 StandardOutput=syslog
1103 StandardError=syslog
1104 #+end_src
1105
1106 *** mbsync.timer
1107 :PROPERTIES:
1108 :header-args+: :tangle ~/.config/systemd/user/mbsync.timer
1109 :END:
1110
1111 #+begin_src conf :tangle no
1112 [Unit]
1113 Description=mbsync timer
1114
1115 [Timer]
1116 OnCalendar=*:0/15
1117 Persistent=true
1118 Unit=mbsync.service
1119
1120 [Install]
1121 WantedBy=timers.target
1122 #+end_src
1123
1124 ** Latexmk
1125 :PROPERTIES:
1126 :header-args+: :tangle ~/.latexmkrc
1127 :END:
1128
1129 #+begin_src conf
1130 $pdf_previewer = "start zathura %O %S";
1131 $clean_ext = "aux out";
1132
1133 # $pdf_update_method = 4;
1134 # $pdf_update_command = "zathura %O %S";
1135
1136 # Synctex allows one to jump to from the PDF in Zathura to the source in Emacs
1137 # by Ctrl+click in the PDF.
1138 # Tell latexmk to use Zathura as a previewer, and run emacsclient as the Synctex
1139 # editor.
1140 # $pdf_previewer = 'exec zathura --synctex-forward -x \'emacsclient --no-wait +%{line} %{input}\' %O %S';
1141 #+end_src
1142
1143 ** libinput
1144
1145 Improve XPS 15 9560's touchpad experience.
1146
1147 # begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "plasma")) "/sudo::/etc/X11/xorg.conf.d/30-touchpad.conf")
1148 #+begin_src conf :tangle no
1149 Section "InputClass"
1150 Identifier "libinput touchpad catchall"
1151 Driver "libinput"
1152 MatchIsTouchpad "on"
1153 Option "ClickMethod" "clickfinger"
1154 Option "NaturalScrolling" "true"
1155 Option "Tapping" "on"
1156 Option "TappingButtonMap" "lrm"
1157 EndSection
1158 #+end_src
1159
1160 ** mpd
1161 :PROPERTIES:
1162 :header-args+: :tangle ~/.config/mpd/mpd.conf
1163 :END:
1164
1165 #+begin_src conf
1166 # An example configuration file for MPD.
1167 # Read the user manual for documentation: http://www.musicpd.org/doc/user/
1168
1169
1170 # Files and directories #######################################################
1171 #
1172 # This setting controls the top directory which MPD will search to discover the
1173 # available audio files and add them to the daemon's online database. This
1174 # setting defaults to the XDG directory, otherwise the music directory will be
1175 # be disabled and audio files will only be accepted over ipc socket (using
1176 # file:// protocol) or streaming files over an accepted protocol.
1177 #
1178 music_directory "~/usr/music"
1179 #
1180 # This setting sets the MPD internal playlist directory. The purpose of this
1181 # directory is storage for playlists created by MPD. The server will use
1182 # playlist files not created by the server but only if they are in the MPD
1183 # format. This setting defaults to playlist saving being disabled.
1184 #
1185 playlist_directory "~/.mpd/playlists"
1186 #
1187 # This setting sets the location of the MPD database. This file is used to
1188 # load the database at server start up and store the database while the
1189 # server is not up. This setting defaults to disabled which will allow
1190 # MPD to accept files over ipc socket (using file:// protocol) or streaming
1191 # files over an accepted protocol.
1192 #
1193 db_file "~/.mpd/database"
1194 #
1195 # These settings are the locations for the daemon log files for the daemon.
1196 # These logs are great for troubleshooting, depending on your log_level
1197 # settings.
1198 #
1199 # The special value "syslog" makes MPD use the local syslog daemon. This
1200 # setting defaults to logging to syslog, otherwise logging is disabled.
1201 #
1202 log_file "~/.mpd/log"
1203 #
1204 # This setting sets the location of the file which stores the process ID
1205 # for use of mpd --kill and some init scripts. This setting is disabled by
1206 # default and the pid file will not be stored.
1207 #
1208 pid_file "~/.mpd/pid"
1209 #
1210 # This setting sets the location of the file which contains information about
1211 # most variables to get MPD back into the same general shape it was in before
1212 # it was brought down. This setting is disabled by default and the server
1213 # state will be reset on server start up.
1214 #
1215 state_file "~/.mpd/state"
1216 #
1217 # The location of the sticker database. This is a database which
1218 # manages dynamic information attached to songs.
1219 #
1220 sticker_file "~/.mpd/sticker.sql"
1221 #
1222 ###############################################################################
1223
1224
1225 # General music daemon options ################################################
1226 #
1227 # This setting specifies the user that MPD will run as. MPD should never run as
1228 # root and you may use this setting to make MPD change its user ID after
1229 # initialization. This setting is disabled by default and MPD is run as the
1230 # current user.
1231 #
1232 #user "nobody"
1233 #
1234 # This setting specifies the group that MPD will run as. If not specified
1235 # primary group of user specified with "user" setting will be used (if set).
1236 # This is useful if MPD needs to be a member of group such as "audio" to
1237 # have permission to use sound card.
1238 #
1239 #group "nogroup"
1240 #
1241 # This setting sets the address for the daemon to listen on. Careful attention
1242 # should be paid if this is assigned to anything other then the default, any.
1243 # This setting can deny access to control of the daemon. Not effective if
1244 # systemd socket activiation is in use.
1245 #
1246 # For network
1247 #bind_to_address "any"
1248 #
1249 # And for Unix Socket
1250 #bind_to_address "~/.mpd/socket"
1251 #
1252 # This setting is the TCP port that is desired for the daemon to get assigned
1253 # to.
1254 #
1255 #port "6600"
1256 #
1257 # This setting controls the type of information which is logged. Available
1258 # setting arguments are "default", "secure" or "verbose". The "verbose" setting
1259 # argument is recommended for troubleshooting, though can quickly stretch
1260 # available resources on limited hardware storage.
1261 #
1262 #log_level "default"
1263 #
1264 # If you have a problem with your MP3s ending abruptly it is recommended that
1265 # you set this argument to "no" to attempt to fix the problem. If this solves
1266 # the problem, it is highly recommended to fix the MP3 files with vbrfix
1267 # (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
1268 # point gapless MP3 playback can be enabled.
1269 #
1270 #gapless_mp3_playback "yes"
1271 #
1272 # Setting "restore_paused" to "yes" puts MPD into pause mode instead
1273 # of starting playback after startup.
1274 #
1275 #restore_paused "no"
1276 #
1277 # This setting enables MPD to create playlists in a format usable by other
1278 # music players.
1279 #
1280 #save_absolute_paths_in_playlists "no"
1281 #
1282 # This setting defines a list of tag types that will be extracted during the
1283 # audio file discovery process. The complete list of possible values can be
1284 # found in the user manual.
1285 #metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
1286 #
1287 # This setting enables automatic update of MPD's database when files in
1288 # music_directory are changed.
1289 #
1290 #auto_update "yes"
1291 #
1292 # Limit the depth of the directories being watched, 0 means only watch
1293 # the music directory itself. There is no limit by default.
1294 #
1295 #auto_update_depth "3"
1296 #
1297 ###############################################################################
1298
1299
1300 # Symbolic link behavior ######################################################
1301 #
1302 # If this setting is set to "yes", MPD will discover audio files by following
1303 # symbolic links outside of the configured music_directory.
1304 #
1305 #follow_outside_symlinks "yes"
1306 #
1307 # If this setting is set to "yes", MPD will discover audio files by following
1308 # symbolic links inside of the configured music_directory.
1309 #
1310 #follow_inside_symlinks "yes"
1311 #
1312 ###############################################################################
1313
1314
1315 # Zeroconf / Avahi Service Discovery ##########################################
1316 #
1317 # If this setting is set to "yes", service information will be published with
1318 # Zeroconf / Avahi.
1319 #
1320 #zeroconf_enabled "yes"
1321 #
1322 # The argument to this setting will be the Zeroconf / Avahi unique name for
1323 # this MPD server on the network.
1324 #
1325 #zeroconf_name "Music Player"
1326 #
1327 ###############################################################################
1328
1329
1330 # Permissions #################################################################
1331 #
1332 # If this setting is set, MPD will require password authorization. The password
1333 # setting can be specified multiple times for different password profiles.
1334 #
1335 #password "password@read,add,control,admin"
1336 #
1337 # This setting specifies the permissions a user has who has not yet logged in.
1338 #
1339 #default_permissions "read,add,control,admin"
1340 #
1341 ###############################################################################
1342
1343
1344 # Database #######################################################################
1345 #
1346
1347 #database {
1348 # plugin "proxy"
1349 # host "other.mpd.host"
1350 # port "6600"
1351 #}
1352
1353 # Input #######################################################################
1354 #
1355
1356 input {
1357 plugin "curl"
1358 # proxy "proxy.isp.com:8080"
1359 # proxy_user "user"
1360 # proxy_password "password"
1361 }
1362
1363 #
1364 ###############################################################################
1365
1366 # Audio Output ################################################################
1367 #
1368
1369 audio_output {
1370 type "pulse"
1371 name "pulse audio"
1372 }
1373
1374 audio_output {
1375 type "fifo"
1376 name "my_fifo"
1377 path "/tmp/mpd.fifo"
1378 format "44100:16:2"
1379 }
1380
1381 # MPD supports various audio output types, as well as playing through multiple
1382 # audio outputs at the same time, through multiple audio_output settings
1383 # blocks. Setting this block is optional, though the server will only attempt
1384 # autodetection for one sound card.
1385 #
1386 # An example of an ALSA output:
1387 #
1388 #audio_output {
1389 # type "alsa"
1390 # name "My ALSA Device"
1391 ## device "hw:0,0" # optional
1392 ## mixer_type "hardware" # optional
1393 ## mixer_device "default" # optional
1394 ## mixer_control "PCM" # optional
1395 ## mixer_index "0" # optional
1396 #}
1397 #
1398 # An example of an OSS output:
1399 #
1400 #audio_output {
1401 # type "oss"
1402 # name "My OSS Device"
1403 ## device "/dev/dsp" # optional
1404 ## mixer_type "hardware" # optional
1405 ## mixer_device "/dev/mixer" # optional
1406 ## mixer_control "PCM" # optional
1407 #}
1408 #
1409 # An example of a shout output (for streaming to Icecast):
1410 #
1411 #audio_output {
1412 # type "shout"
1413 # encoder "vorbis" # optional
1414 # name "My Shout Stream"
1415 # host "localhost"
1416 # port "8000"
1417 # mount "/mpd.ogg"
1418 # password "hackme"
1419 # quality "5.0"
1420 # bitrate "128"
1421 # format "44100:16:1"
1422 ## protocol "icecast2" # optional
1423 ## user "source" # optional
1424 ## description "My Stream Description" # optional
1425 ## url "http://example.com" # optional
1426 ## genre "jazz" # optional
1427 ## public "no" # optional
1428 ## timeout "2" # optional
1429 ## mixer_type "software" # optional
1430 #}
1431 #
1432 # An example of a recorder output:
1433 #
1434 #audio_output {
1435 # type "recorder"
1436 # name "My recorder"
1437 # encoder "vorbis" # optional, vorbis or lame
1438 # path "/var/lib/mpd/recorder/mpd.ogg"
1439 ## quality "5.0" # do not define if bitrate is defined
1440 # bitrate "128" # do not define if quality is defined
1441 # format "44100:16:1"
1442 #}
1443 #
1444 # An example of a httpd output (built-in HTTP streaming server):
1445 #
1446 #audio_output {
1447 # type "httpd"
1448 # name "My HTTP Stream"
1449 # encoder "vorbis" # optional, vorbis or lame
1450 # port "8000"
1451 # bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
1452 ## quality "5.0" # do not define if bitrate is defined
1453 # bitrate "128" # do not define if quality is defined
1454 # format "44100:16:1"
1455 # max_clients "0" # optional 0=no limit
1456 #}
1457 #
1458 # An example of a pulseaudio output (streaming to a remote pulseaudio server)
1459 #
1460 #audio_output {
1461 # type "pulse"
1462 # name "My Pulse Output"
1463 ## server "remote_server" # optional
1464 ## sink "remote_server_sink" # optional
1465 #}
1466 #
1467 # An example of a winmm output (Windows multimedia API).
1468 #
1469 #audio_output {
1470 # type "winmm"
1471 # name "My WinMM output"
1472 ## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
1473 # or
1474 ## device "0" # optional
1475 ## mixer_type "hardware" # optional
1476 #}
1477 #
1478 # An example of an openal output.
1479 #
1480 #audio_output {
1481 # type "openal"
1482 # name "My OpenAL output"
1483 ## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
1484 #}
1485 #
1486 # An example of an sndio output.
1487 #
1488 #audio_output {
1489 # type "sndio"
1490 # name "sndio output"
1491 # mixer_type "software"
1492 #}
1493 #
1494 # An example of an OS X output:
1495 #
1496 #audio_output {
1497 # type "osx"
1498 # name "My OS X Device"
1499 ## device "Built-in Output" # optional
1500 ## channel_map "-1,-1,0,1" # optional
1501 #}
1502 #
1503 ## Example "pipe" output:
1504 #
1505 #audio_output {
1506 # type "pipe"
1507 # name "my pipe"
1508 # command "aplay -f cd 2>/dev/null"
1509 ## Or if you're want to use AudioCompress
1510 # command "AudioCompress -m | aplay -f cd 2>/dev/null"
1511 ## Or to send raw PCM stream through PCM:
1512 # command "nc example.org 8765"
1513 # format "44100:16:2"
1514 #}
1515 #
1516 ## An example of a null output (for no audio output):
1517 #
1518 #audio_output {
1519 # type "null"
1520 # name "My Null Output"
1521 # mixer_type "none" # optional
1522 #}
1523 #
1524 ###############################################################################
1525
1526
1527 # Normalization automatic volume adjustments ##################################
1528 #
1529 # This setting specifies the type of ReplayGain to use. This setting can have
1530 # the argument "off", "album", "track" or "auto". "auto" is a special mode that
1531 # chooses between "track" and "album" depending on the current state of
1532 # random playback. If random playback is enabled then "track" mode is used.
1533 # See <http://www.replaygain.org> for more details about ReplayGain.
1534 # This setting is off by default.
1535 #
1536 #replaygain "album"
1537 #
1538 # This setting sets the pre-amp used for files that have ReplayGain tags. By
1539 # default this setting is disabled.
1540 #
1541 #replaygain_preamp "0"
1542 #
1543 # This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
1544 # By default this setting is disabled.
1545 #
1546 #replaygain_missing_preamp "0"
1547 #
1548 # This setting enables or disables ReplayGain limiting.
1549 # MPD calculates actual amplification based on the ReplayGain tags
1550 # and replaygain_preamp / replaygain_missing_preamp setting.
1551 # If replaygain_limit is enabled MPD will never amplify audio signal
1552 # above its original level. If replaygain_limit is disabled such amplification
1553 # might occur. By default this setting is enabled.
1554 #
1555 #replaygain_limit "yes"
1556 #
1557 # This setting enables on-the-fly normalization volume adjustment. This will
1558 # result in the volume of all playing audio to be adjusted so the output has
1559 # equal "loudness". This setting is disabled by default.
1560 #
1561 #volume_normalization "no"
1562 #
1563 ###############################################################################
1564
1565 # Character Encoding ##########################################################
1566 #
1567 # If file or directory names do not display correctly for your locale then you
1568 # may need to modify this setting.
1569 #
1570 #filesystem_charset "UTF-8"
1571 #
1572 ###############################################################################
1573 #+end_src
1574
1575 ** msmtp
1576 :PROPERTIES:
1577 :header-args+: :tangle ~/.msmtprc
1578 :END:
1579
1580 #+begin_src conf
1581 # Set default values for all following accounts.
1582 defaults
1583 port 587
1584 tls on
1585 auth on
1586 #tls_trust_file /etc/ssl/certs/ca-certificates.crt
1587 logfile ~/.msmtp.log
1588
1589 # aminb
1590 account aminb
1591 host mail.aminb.org
1592 # use `msmtp -a aminb --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint
1593 tls_fingerprint C7:A4:2E:A3:11:FA:80:45:C4:29:D6:62:4D:73:DB:34:43:67:8F:16:F1:2E:54:43:06:1B:41:B6:A9:09:E0:37
1594 tls_starttls on
1595 from amin@aminb.org
1596 user amin@aminb.org
1597 passwordeval gpg2 --no-tty -q -d ~/.passwd/amin.gpg
1598
1599 # gnu
1600 account gnu
1601 host fencepost.gnu.org
1602 # use `msmtp -a gnu --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint
1603 tls_fingerprint 34:60:91:B5:71:5B:76:87:50:F3:83:13:26:0F:EE:75:42:83:93:9A:E2:AF:1E:87:72:02:C9:61:CE:28:1B:8E
1604 tls_starttls on
1605 from bandali@gnu.org
1606 user bandali
1607 passwordeval gpg2 --no-tty -q -d ~/.passwd/gnu.gpg
1608
1609 # gnu (old)
1610 account gnu-aminb : gnu
1611 from aminb@gnu.org
1612 account gnu-amin : gnu
1613 from amin@gnu.org
1614 account gnu-mab : gnu
1615 from mab@gnu.org
1616
1617 # uwaterloo
1618 account uwaterloo
1619 host connect.uwaterloo.ca
1620 tls_starttls on
1621 from abandali@uwaterloo.ca
1622 user abandali
1623 passwordeval gpg2 --no-tty -q -d ~/.passwd/uwaterloo.gpg
1624 tls_trust_file /etc/ssl/certs/ca-certificates.crt
1625
1626 # Set a default account
1627 account default : aminb
1628 #+end_src
1629
1630 ** ncmpcpp
1631
1632 *** config
1633 :PROPERTIES:
1634 :header-args+: :tangle ~/.ncmpcpp/config
1635 :END:
1636
1637 #+begin_src conf :tangle no
1638 ##############################################################
1639 ## This is the example configuration file. Copy it to ##
1640 ## $HOME/.ncmpcpp/config or $XDG_CONFIG_HOME/ncmpcpp/config ##
1641 ## and set up your preferences. ##
1642 ##############################################################
1643 #
1644 ##### directories ######
1645 ##
1646 ## Directory for storing ncmpcpp related files.
1647 ## Changing it is useful if you want to store
1648 ## everything somewhere else and provide command
1649 ## line setting for alternative location to config
1650 ## file which defines that while launching ncmpcpp.
1651 ##
1652 #
1653 ncmpcpp_directory = ~/.ncmpcpp
1654 #
1655 ##
1656 ## Directory for storing downloaded lyrics. It
1657 ## defaults to ~/.lyrics since other MPD clients
1658 ## (eg. ncmpc) also use that location.
1659 ##
1660 #
1661 #lyrics_directory = ~/.lyrics
1662 #
1663 ##### connection settings #####
1664 #
1665 #mpd_host = localhost
1666 #
1667 #mpd_port = 6600
1668 #
1669 #mpd_connection_timeout = 5
1670 #
1671 ## Needed for tag editor and file operations to work.
1672 ##
1673 mpd_music_dir = ~/usr/music
1674 #
1675 #mpd_crossfade_time = 5
1676 #
1677 ##### music visualizer #####
1678 ##
1679 ## Note: In order to make music visualizer work you'll
1680 ## need to use mpd fifo output, whose format parameter
1681 ## has to be set to 44100:16:1 for mono visualization
1682 ## or 44100:16:2 for stereo visualization. Example
1683 ## configuration (it has to be put into mpd.conf):
1684 ##
1685 ## audio_output {
1686 ## type "fifo"
1687 ## name "Visualizer feed"
1688 ## path "/tmp/mpd.fifo"
1689 ## format "44100:16:2"
1690 ## }
1691 ##
1692 #
1693 visualizer_fifo_path = /tmp/mpd.fifo
1694 #
1695 ##
1696 ## Note: Below parameter is needed for ncmpcpp
1697 ## to determine which output provides data for
1698 ## visualizer and thus allow syncing between
1699 ## visualization and sound as currently there
1700 ## are some problems with it.
1701 ##
1702 #
1703 visualizer_output_name = my fifo
1704 #
1705 ##
1706 ## If you set format to 44100:16:2, make it 'yes'.
1707 ##
1708 visualizer_in_stereo = yes
1709 #
1710 ##
1711 ## Multiply received samples by given value. Very
1712 ## useful for proper visualization of quiet music.
1713 ##
1714 #visualizer_sample_multiplier = 1
1715 #
1716 ##
1717 ## Note: Below parameter defines how often ncmpcpp
1718 ## has to "synchronize" visualizer and audio outputs.
1719 ## 30 seconds is optimal value, but if you experience
1720 ## synchronization problems, set it to lower value.
1721 ## Keep in mind that sane values start with >=10.
1722 ##
1723 #
1724 visualizer_sync_interval = 30
1725 #
1726 ##
1727 ## Note: To enable spectrum frequency visualization
1728 ## you need to compile ncmpcpp with fftw3 support.
1729 ##
1730 #
1731 ## Available values: spectrum, wave, wave_filled, ellipse.
1732 ##
1733 visualizer_type = spectrum
1734 #
1735 #visualizer_look = ●▮
1736 visualizer_look = "●•"
1737 #
1738 #visualizer_color = blue, cyan, green, yellow, magenta, red
1739 #
1740 ## Alternative subset of 256 colors for terminals that support it.
1741 ##
1742 #visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161
1743 #
1744 ##### system encoding #####
1745 ##
1746 ## ncmpcpp should detect your charset encoding
1747 ## but if it failed to do so, you can specify
1748 ## charset encoding you are using here.
1749 ##
1750 ## Note: You can see whether your ncmpcpp build
1751 ## supports charset detection by checking output
1752 ## of `ncmpcpp --version`.
1753 ##
1754 ## Note: Since MPD uses UTF-8 by default, setting
1755 ## this option makes sense only if your encoding
1756 ## is different.
1757 ##
1758 #
1759 #system_encoding = ""
1760 #
1761 ##### delays #####
1762 #
1763 ## Time of inactivity (in seconds) after playlist
1764 ## highlighting will be disabled (0 = always on).
1765 ##
1766 #playlist_disable_highlight_delay = 5
1767 #
1768 ## Defines how long messages are supposed to be visible.
1769 ##
1770 #message_delay_time = 5
1771 #
1772 ##### song format #####
1773 ##
1774 ## For a song format you can use:
1775 ##
1776 ## %l - length
1777 ## %f - filename
1778 ## %D - directory
1779 ## %a - artist
1780 ## %A - album artist
1781 ## %t - title
1782 ## %b - album
1783 ## %y - date
1784 ## %n - track number (01/12 -> 01)
1785 ## %N - full track info (01/12 -> 01/12)
1786 ## %g - genre
1787 ## %c - composer
1788 ## %p - performer
1789 ## %d - disc
1790 ## %C - comment
1791 ## %P - priority
1792 ## $R - begin right alignment
1793 ##
1794 ## If you want to make sure that a part of the format is displayed
1795 ## only when certain tags are present, you can archieve it by
1796 ## grouping them with brackets, e.g. '{%a - %t}' will be evaluated
1797 ## to 'ARTIST - TITLE' if both tags are present or '' otherwise.
1798 ## It is also possible to define a list of alternatives by providing
1799 ## several groups and separating them with '|', e.g. '{%t}|{%f}'
1800 ## will be evaluated to 'TITLE' or 'FILENAME' if the former is not
1801 ## present.
1802 ##
1803 ## Note: If you want to set limit on maximal length of a tag, just
1804 ## put the appropriate number between % and character that defines
1805 ## tag type, e.g. to make album take max. 20 terminal cells, use '%20b'.
1806 ##
1807 ## In addition, formats support markers used for text attributes.
1808 ## They are followed by character '$'. After that you can put:
1809 ##
1810 ## - 0 - default window color (discards all other colors)
1811 ## - 1 - black
1812 ## - 2 - red
1813 ## - 3 - green
1814 ## - 4 - yellow
1815 ## - 5 - blue
1816 ## - 6 - magenta
1817 ## - 7 - cyan
1818 ## - 8 - white
1819 ## - 9 - end of current color
1820 ## - b - bold text
1821 ## - u - underline text
1822 ## - r - reverse colors
1823 ## - a - use alternative character set
1824 ##
1825 ## If you don't want to use a non-color attribute anymore, just put it
1826 ## again, but this time insert character '/' between '$' and attribute
1827 ## character, e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag
1828 ## or filename with reversed colors.
1829 ##
1830 ## If you want to use 256 colors and/or background colors in formats
1831 ## (the naming scheme is described below in section about color
1832 ## definitions), it can be done with the syntax $(COLOR), e.g. to set
1833 ## the artist tag to one of the non-standard colors and make it have
1834 ## yellow background, you need to write $(197_yellow)%a$(end). Note
1835 ## that for standard colors this is interchangable with attributes
1836 ## listed above.
1837 ##
1838 ## Note: colors can be nested.
1839 ##
1840 #
1841 #song_list_format = {%a - }{%t}|{$8%f$9}$R{$3(%l)$9}
1842 #
1843 #song_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f}
1844 #
1845 #song_library_format = {%n - }{%t}|{%f}
1846 #
1847 #
1848 #alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
1849 #
1850 #alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
1851 #
1852 #now_playing_prefix = $b
1853 #
1854 #now_playing_suffix = $/b
1855 #
1856 #browser_playlist_prefix = "$2playlist$9 "
1857 #
1858 #selected_item_prefix = $6
1859 #
1860 #selected_item_suffix = $9
1861 #
1862 #modified_item_prefix = $3> $9
1863 #
1864 ##
1865 ## Note: attributes are not supported for the following variables.
1866 ##
1867 #song_window_title_format = {%a - }{%t}|{%f}
1868 ##
1869 ## Note: Below variables are used for sorting songs in browser.
1870 ## The sort mode determines how songs are sorted, and can be used
1871 ## in combination with a sort format to specify a custom sorting format.
1872 ## Available values for browser_sort_mode are "name", "mtime", "format"
1873 ## and "noop".
1874 ##
1875 #
1876 #browser_sort_mode = name
1877 #
1878 #browser_sort_format = {%a - }{%t}|{%f} {(%l)}
1879 #
1880 ##### columns settings #####
1881 ##
1882 ## syntax of song columns list format is "column column etc."
1883 ##
1884 ## - syntax for each column is:
1885 ##
1886 ## (width of the column)[color of the column]{displayed tag}
1887 ##
1888 ## Note: Width is by default in %, if you want a column to
1889 ## have fixed size, add 'f' after the value, e.g. (10)[white]{a}
1890 ## will be the column that take 10% of screen (so the real width
1891 ## will depend on actual screen size), whereas (10f)[white]{a}
1892 ## will take 10 terminal cells, no matter how wide the screen is.
1893 ##
1894 ## - color is optional (if you want the default one,
1895 ## leave the field empty).
1896 ##
1897 ## Note: You can give a column additional attributes by putting appropriate
1898 ## character after displayed tag character. Available attributes are:
1899 ##
1900 ## - r - column will be right aligned
1901 ## - E - if tag is empty, empty tag marker won't be displayed
1902 ##
1903 ## You can also:
1904 ##
1905 ## - give a column custom name by putting it after attributes,
1906 ## separated with character ':', e.g. {lr:Length} gives you
1907 ## right aligned column of lengths named "Length".
1908 ##
1909 ## - define sequence of tags, that have to be displayed in case
1910 ## predecessor is empty in a way similar to the one in classic
1911 ## song format, i.e. using '|' character, e.g. {a|c|p:Owner}
1912 ## creates column named "Owner" that tries to display artist
1913 ## tag and then composer and performer if previous ones are
1914 ## not available.
1915 ##
1916 #
1917 #song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
1918 #
1919 ##### various settings #####
1920 #
1921 ##
1922 ## Note: Custom command that will be executed each
1923 ## time song changes. Useful for notifications etc.
1924 ##
1925 #execute_on_song_change = ""
1926 #
1927 #playlist_show_mpd_host = no
1928 #
1929 #playlist_show_remaining_time = no
1930 #
1931 #playlist_shorten_total_times = no
1932 #
1933 #playlist_separate_albums = no
1934 #
1935 ##
1936 ## Note: Possible display modes: classic, columns.
1937 ##
1938 #playlist_display_mode = columns
1939 #
1940 #browser_display_mode = classic
1941 #
1942 #search_engine_display_mode = classic
1943 #
1944 #playlist_editor_display_mode = classic
1945 #
1946 #discard_colors_if_item_is_selected = yes
1947 #
1948 #incremental_seeking = yes
1949 #
1950 #seek_time = 1
1951 #
1952 #volume_change_step = 2
1953 #
1954 #autocenter_mode = no
1955 #
1956 #centered_cursor = no
1957 #
1958 ##
1959 ## Note: You can specify third character which will
1960 ## be used to build 'empty' part of progressbar.
1961 ##
1962 #progressbar_look = =>
1963 progressbar_look = "─╼╶"
1964 #progressbar_look = "─⊙╶"
1965 #
1966 #progressbar_boldness = yes
1967 #
1968 ## Available values: database, playlist.
1969 ##
1970 #default_place_to_search_in = database
1971 #
1972 ## Available values: classic, alternative.
1973 ##
1974 #user_interface = classic
1975 #
1976 #data_fetching_delay = yes
1977 #
1978 ## Available values: artist, album_artist, date, genre, composer, performer.
1979 ##
1980 #media_library_primary_tag = artist
1981 #
1982 ## Available values: wrapped, normal.
1983 ##
1984 #default_find_mode = wrapped
1985 #
1986 #default_tag_editor_pattern = %n - %t
1987 #
1988 #header_visibility = yes
1989 #
1990 #statusbar_visibility = yes
1991 #
1992 #titles_visibility = yes
1993 #
1994 #header_text_scrolling = yes
1995 #
1996 #cyclic_scrolling = no
1997 #
1998 #lines_scrolled = 2
1999 #
2000 #follow_now_playing_lyrics = no
2001 #
2002 #fetch_lyrics_for_current_song_in_background = no
2003 #
2004 #store_lyrics_in_song_dir = no
2005 #
2006 #generate_win32_compatible_filenames = yes
2007 #
2008 #allow_for_physical_item_deletion = no
2009 #
2010 ##
2011 ## Note: If you set this variable, ncmpcpp will try to
2012 ## get info from last.fm in language you set and if it
2013 ## fails, it will fall back to english. Otherwise it will
2014 ## use english the first time.
2015 ##
2016 ## Note: Language has to be expressed as an ISO 639 alpha-2 code.
2017 ##
2018 #lastfm_preferred_language = en
2019 #
2020 #show_hidden_files_in_local_browser = no
2021 #
2022 ##
2023 ## How shall screen switcher work?
2024 ##
2025 ## - "previous" - switch between the current and previous screen.
2026 ## - "screen1,...,screenN" - switch between given sequence of screens.
2027 ##
2028 ## Screens available for use: help, playlist, browser, search_engine,
2029 ## media_library, playlist_editor, tag_editor, outputs, visualizer, clock.
2030 ##
2031 #screen_switcher_mode = playlist, browser
2032 #
2033 ##
2034 ## Note: You can define startup screen
2035 ## by choosing screen from the list above.
2036 ##
2037 #startup_screen = playlist
2038 #
2039 ##
2040 ## Note: You can define startup slave screen
2041 ## by choosing screen from the list above or
2042 ## an empty value for no slave screen.
2043 ##
2044 #startup_slave_screen = ""
2045 #
2046 #startup_slave_screen_focus = no
2047 #
2048 ##
2049 ## Default width of locked screen (in %).
2050 ## Acceptable values are from 20 to 80.
2051 ##
2052 #
2053 #locked_screen_width_part = 50
2054 #
2055 #ask_for_locked_screen_width_part = yes
2056 #
2057 #jump_to_now_playing_song_at_start = yes
2058 #
2059 #ask_before_clearing_playlists = yes
2060 #
2061 #clock_display_seconds = no
2062 #
2063 #display_volume_level = yes
2064 #
2065 #display_bitrate = no
2066 #
2067 #display_remaining_time = no
2068 #
2069 ## Available values: none, basic, extended, perl.
2070 ##
2071 #regular_expressions = perl
2072 #
2073 ##
2074 ## Note: If below is enabled, ncmpcpp will ignore leading
2075 ## "The" word while sorting items in browser, tags in
2076 ## media library, etc.
2077 ##
2078 #ignore_leading_the = no
2079 #
2080 #block_search_constraints_change_if_items_found = yes
2081 #
2082 #mouse_support = yes
2083 #
2084 #mouse_list_scroll_whole_page = yes
2085 #
2086 #empty_tag_marker = <empty>
2087 #
2088 #tags_separator = " | "
2089 #
2090 #tag_editor_extended_numeration = no
2091 #
2092 #media_library_sort_by_mtime = no
2093 #
2094 #enable_window_title = yes
2095 #
2096 ##
2097 ## Note: You can choose default search mode for search
2098 ## engine. Available modes are:
2099 ##
2100 ## - 1 - use mpd built-in searching (no regexes, pattern matching)
2101 ## - 2 - use ncmpcpp searching (pattern matching with support for regexes,
2102 ## but if your mpd is on a remote machine, downloading big database
2103 ## to process it can take a while
2104 ## - 3 - match only exact values (this mode uses mpd function for searching
2105 ## in database and local one for searching in current playlist)
2106 ##
2107 #
2108 #search_engine_default_search_mode = 1
2109 #
2110 #external_editor = nano
2111 #
2112 ## Note: set to yes if external editor is a console application.
2113 ##
2114 #use_console_editor = yes
2115 #
2116 ##### colors definitions #####
2117 ##
2118 ## It is possible to set a background color by setting a color
2119 ## value "<foreground>_<background>", e.g. red_black will set
2120 ## foregound color to red and background color to black.
2121 ##
2122 ## In addition, for terminals that support 256 colors it
2123 ## is possible to set one of them by using a number in range
2124 ## [1, 256] instead of color name, e.g. numerical value
2125 ## corresponding to red_black is 2_1. To find out if the
2126 ## terminal supports 256 colors, run ncmpcpp and check out
2127 ## the bottom of the help screen for list of available colors
2128 ## and their numerical values.
2129 ##
2130 ## Note: due to technical limitations of ncurses, if 256 colors
2131 ## are used, it is possible to either use only the colors with
2132 ## default background color, or all pairs from 1_1 up to 254_127,
2133 ## depending on the ncurses version used.
2134 ##
2135 #
2136 #colors_enabled = yes
2137 #
2138 #empty_tag_color = cyan
2139 #
2140 #header_window_color = default
2141 #
2142 #volume_color = default
2143 #
2144 #state_line_color = default
2145 #
2146 #state_flags_color = default
2147 #
2148 #main_window_color = yellow
2149 #
2150 #color1 = white
2151 #
2152 #color2 = green
2153 #
2154 #main_window_highlight_color = yellow
2155 #
2156 #progressbar_color = black
2157 #
2158 #progressbar_elapsed_color = green
2159 #
2160 #statusbar_color = default
2161 #
2162 #alternative_ui_separator_color = black
2163 #
2164 #active_column_color = red
2165 #
2166 #window_border_color = green
2167 #
2168 #active_window_border = red
2169 #
2170 #+end_src
2171
2172 *** bindings
2173 :PROPERTIES:
2174 :header-args+: :tangle ~/.ncmpcpp/bindings
2175 :END:
2176
2177 #+begin_src conf :tangle no
2178 def_key "j"
2179 scroll_down
2180 def_key "k"
2181 scroll_up
2182
2183 def_key "ctrl-u"
2184 page_up
2185 def_key "ctrl-d"
2186 page_down
2187
2188 def_key "h"
2189 previous_column
2190 def_key "l"
2191 next_column
2192
2193 def_key "."
2194 show_lyrics
2195
2196 def_key "n"
2197 next_found_item
2198 def_key "N"
2199 previous_found_item
2200
2201 def_key "J"
2202 move_sort_order_down
2203 def_key "K"
2204 move_sort_order_up
2205 #+end_src
2206
2207 ** notmuch
2208
2209 *** notmuch-config
2210 :PROPERTIES:
2211 :header-args+: :tangle ~/.notmuch-config
2212 :END:
2213
2214 #+begin_src conf
2215 # .notmuch-config - Configuration file for the notmuch mail system
2216 #
2217 # For more information about notmuch, see https://notmuchmail.org
2218
2219 # Database configuration
2220 #
2221 # The only value supported here is 'path' which should be the top-level
2222 # directory where your mail currently exists and to where mail will be
2223 # delivered in the future. Files should be individual email messages.
2224 # Notmuch will store its database within a sub-directory of the path
2225 # configured here named ".notmuch".
2226 #
2227 [database]
2228 path=/home/amin/oldmail
2229
2230 # User configuration
2231 #
2232 # Here is where you can let notmuch know how you would like to be
2233 # addressed. Valid settings are
2234 #
2235 # name Your full name.
2236 # primary_email Your primary email address.
2237 # other_email A list (separated by ';') of other email addresses
2238 # at which you receive email.
2239 #
2240 # Notmuch will use the various email addresses configured here when
2241 # formatting replies. It will avoid including your own addresses in the
2242 # recipient list of replies, and will set the From address based on the
2243 # address to which the original email was addressed.
2244 #
2245 [user]
2246 name=Amin Bandali
2247 primary_email=amin@aminb.org
2248 other_email=bandali@gnu.org;abandali@uwaterloo.ca;
2249
2250 # Configuration for "notmuch new"
2251 #
2252 # The following options are supported here:
2253 #
2254 # tags A list (separated by ';') of the tags that will be
2255 # added to all messages incorporated by "notmuch new".
2256 #
2257 # ignore A list (separated by ';') of file and directory names
2258 # that will not be searched for messages by "notmuch new".
2259 #
2260 # NOTE: *Every* file/directory that goes by one of those
2261 # names will be ignored, independent of its depth/location
2262 # in the mail store.
2263 #
2264 [new]
2265 tags=new;
2266 #tags=unread;inbox;
2267 ignore=.uidvalidity;.mbsyncstate;/.*/dovecot*/
2268
2269 # Search configuration
2270 #
2271 # The following option is supported here:
2272 #
2273 # exclude_tags
2274 # A ;-separated list of tags that will be excluded from
2275 # search results by default. Using an excluded tag in a
2276 # query will override that exclusion.
2277 #
2278 [search]
2279 exclude_tags=deleted;spam;
2280
2281 # Maildir compatibility configuration
2282 #
2283 # The following option is supported here:
2284 #
2285 # synchronize_flags Valid values are true and false.
2286 #
2287 # If true, then the following maildir flags (in message filenames)
2288 # will be synchronized with the corresponding notmuch tags:
2289 #
2290 # Flag Tag
2291 # ---- -------
2292 # D draft
2293 # F flagged
2294 # P passed
2295 # R replied
2296 # S unread (added when 'S' flag is not present)
2297 #
2298 # The "notmuch new" command will notice flag changes in filenames
2299 # and update tags, while the "notmuch tag" and "notmuch restore"
2300 # commands will notice tag changes and update flags in filenames
2301 #
2302 [maildir]
2303 synchronize_flags=true
2304
2305 # Cryptography related configuration
2306 #
2307 # The following option is supported here:
2308 #
2309 # gpg_path
2310 # binary name or full path to invoke gpg.
2311 #
2312 [crypto]
2313 gpg_path=gpg
2314 #+end_src
2315
2316 *** pre-new hook
2317 :PROPERTIES:
2318 :header-args+: :tangle ~/mail/.notmuch/hooks/pre-new :shebang "#!/bin/sh"
2319 :END:
2320
2321 #+begin_src sh
2322 touch /tmp/gnusieve.log
2323 sieve-filter -eW -o postmaster_address=postmaster@aminb.org \
2324 -o mail_location=maildir:$MAILDIR/gnu:LAYOUT=fs:INBOX=$MAILDIR/gnu/Inbox ~/sieve/gnu.sieve INBOX delete &>>/tmp/gnusieve.log
2325 #+end_src
2326
2327 *** post-new hook
2328 :PROPERTIES:
2329 :header-args+: :tangle ~/mail/.notmuch/hooks/post-new :shebang "#!/bin/sh"
2330 :END:
2331
2332 #+begin_src sh
2333 # apply sent tag to messages sent by me
2334 notmuch tag -new +sent -- from:amin@aminb.org or from:bandali@gnu.org or from:aminb@gnu.org or from:amin@gnu.org or from:mab@gnu.org or from:abandali@uwaterloo.ca
2335
2336 # initial tagging
2337 notmuch tag -latest -- tag:latest
2338 notmuch tag +inbox +unread +latest -new -- tag:new
2339
2340
2341 # apply tags to lists
2342
2343 # <aminb>
2344 notmuch tag -inbox +lists/hackernewsletter -- folder:amin/lists/hackernewsletter
2345 notmuch tag -inbox +lists/haskell-weekly -- folder:amin/lists/haskell-weekly
2346
2347 notmuch tag -inbox +pay -- folder:amin/pay
2348 notmuch tag -inbox +banking -- folder:amin/banking
2349 notmuch tag -inbox +work -- folder:amin/work
2350 # </aminb>
2351
2352 # <uw>
2353 notmuch tag -inbox +uw/cs136 -- folder:uwaterloo/lists/cs136
2354 notmuch tag -inbox +uw/cs846 -- folder:uwaterloo/lists/cs846
2355 notmuch tag -inbox +uw/ece750 -- folder:uwaterloo/lists/ece750
2356 notmuch tag -inbox +uw/se212 -- folder:uwaterloo/lists/se212
2357 notmuch tag -inbox +uw/se463 -- folder:uwaterloo/lists/se463
2358
2359 notmuch tag -inbox +lists/alloytools -- folder:uwaterloo/lists/alloytools
2360 notmuch tag -inbox +lists/clvsingle -- folder:uwaterloo/lists/Clvsingle
2361 notmuch tag -inbox +lists/gsa -- folder:uwaterloo/lists/GSA
2362 notmuch tag -inbox +lists/math-grad -- folder:uwaterloo/lists/Math-grad
2363 notmuch tag -inbox +lists/scs-grads -- folder:uwaterloo/lists/scs-grads
2364 notmuch tag -inbox +lists/watform-students -- folder:uwaterloo/lists/Watform-students
2365 # </uw>
2366
2367 # <gnu>
2368 notmuch tag -inbox +l/emacs-devel -- folder:gnu/l/emacs-devel
2369 notmuch tag -inbox +l/emacs-orgmode -- folder:gnu/l/emacs-orgmode
2370 notmuch tag -inbox +l/emacsconf-discuss -- folder:gnu/l/emacsconf-discuss
2371 notmuch tag -inbox +l/fencepost-users -- folder:gnu/l/fencepost-users
2372 notmuch tag -inbox +l/guix-devel -- folder:gnu/l/guix-devel
2373 notmuch tag -inbox +l/guile-devel -- folder:gnu/l/guile-devel
2374 notmuch tag -inbox +l/help-gnu-emacs -- folder:gnu/l/help-gnu-emacs
2375 notmuch tag -inbox +l/info-gnu-emacs -- folder:gnu/l/info-gnu-emacs
2376 notmuch tag -inbox +l/www-commits -- folder:gnu/l/www-commits
2377 notmuch tag -inbox +l/www-discuss -- folder:gnu/l/www-discuss
2378 notmuch tag -inbox +webmasters -- folder:gnu/webmasters
2379
2380 notmuch tag -inbox +l/deepspec -- folder:gnu/l/deepspec
2381 notmuch tag -inbox +l/haskell-cafe -- folder:gnu/l/haskell-cafe
2382 notmuch tag -inbox +l/haskell-art -- folder:gnu/l/haskell-art
2383 notmuch tag -inbox +l/notmuch -- folder:gnu/l/notmuch
2384
2385 notmuch tag -inbox +l/~aminb/test-priv -- folder:gnu/l/~aminb/test-priv
2386 notmuch tag -inbox +l/~sircmpwn/sr.ht-admins -- folder:gnu/l/~sircmpwn/sr.ht-admins
2387 notmuch tag -inbox +l/~sircmpwn/sr.ht-announce -- folder:gnu/l/~sircmpwn/sr.ht-announce
2388 notmuch tag -inbox +l/~sircmpwn/sr.ht-dev -- folder:gnu/l/~sircmpwn/sr.ht-dev
2389 notmuch tag -inbox +l/~sircmpwn/sr.ht-discuss -- folder:gnu/l/~sircmpwn/sr.ht-discuss
2390 # </gnu>
2391
2392 notmuch tag -inbox -unread +archive/notmuch -- path:archive/notmuch/**
2393 notmuch tag -inbox -unread +archive/emacs-devel -- path:archive/emacs-devel/**
2394 #+end_src
2395
2396 *** notmuch.service
2397 :PROPERTIES:
2398 :header-args+: :tangle ~/.config/systemd/user/notmuch.service
2399 :END:
2400
2401 #+begin_src conf :tangle no
2402 [Unit]
2403 Description=notmuch service
2404
2405 [Service]
2406 Type=oneshot
2407 ExecStart=/usr/bin/notmuch new
2408 StandardOutput=syslog
2409 StandardError=syslog
2410 #+end_src
2411
2412 *** notmuch.timer
2413 :PROPERTIES:
2414 :header-args+: :tangle ~/.config/systemd/user/notmuch.timer
2415 :END:
2416
2417 #+begin_src conf :tangle no
2418 [Unit]
2419 Description=notmuch timer
2420
2421 [Timer]
2422 OnCalendar=*:0/5
2423 Persistent=true
2424 Unit=notmuch.service
2425
2426 [Install]
2427 WantedBy=timers.target
2428 #+end_src
2429
2430 ** offlineimap
2431
2432 *** offlineimaprc
2433 :PROPERTIES:
2434 :header-args+: :tangle ~/.offlineimaprc
2435 :END:
2436
2437 #+begin_src conf :tangle no
2438 [general]
2439 pythonfile = ~/.offlineimap.py
2440 accounts = Gmail, aminb
2441 maxsyncaccounts = 3
2442
2443 [Account Gmail]
2444 localrepository = GmailL
2445 remoterepository = GmailR
2446
2447 [Account aminb]
2448 localrepository = aminbL
2449 remoterepository = aminbR
2450
2451 [Repository GmailL]
2452 type = Maildir
2453 localfolders = ~/Maildir/Gmail
2454
2455 [Repository GmailR]
2456 type = IMAP
2457 remotehost = imap.gmail.com
2458 remoteusereval = mailuser("gmail")
2459 remotepasseval = mailpasswd("gmail")
2460 sslcacertfile = /etc/ssl/certs/ca-certificates.crt
2461 ssl = yes
2462 folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail'
2463 maxconnections = 1
2464 realdelete = no
2465
2466 [Repository aminbL]
2467 type = Maildir
2468 localfolders = ~/Maildir/aminb
2469
2470 [Repository aminbR]
2471 type = IMAP
2472 remotehost = mail.aminb.org
2473 remoteusereval = mailuser("aminb")
2474 remotepasseval = mailpasswd("aminb")
2475 sslcacertfile = /etc/ssl/certs/ca-certificates.crt
2476 ssl = yes
2477 folderfilter = lambda foldername: foldername not in 'dovecot.sieve'
2478 maxconnections = 1
2479 realdelete = no
2480 #+end_src
2481
2482 *** offlineimap.py
2483 :PROPERTIES:
2484 :header-args+: :tangle ~/.offlineimap.py
2485 :END:
2486
2487 #+begin_src python :tangle no
2488 import os
2489 import subprocess
2490
2491 def mailpasswd(acct):
2492 acct = os.path.basename(acct)
2493 path = "/home/amin/.passwd/%s.gpg" % acct
2494 args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path]
2495 try:
2496 return subprocess.check_output(args).strip()
2497 except subprocess.CalledProcessError:
2498 return ""
2499
2500 def mailuser(acct):
2501 acct = os.path.basename(acct)
2502 path = "/home/amin/.passwd/%s" % acct
2503 args = ["cat", path]
2504 try:
2505 return subprocess.check_output(args).strip()
2506 except subprocess.CalledProcessError:
2507 return ""
2508
2509 def prime_gpg_agent():
2510 ret = False
2511 i = 1
2512 while not ret:
2513 ret = (mailpasswd("prime") == "prime")
2514 if i > 2:
2515 from offlineimap.ui import getglobalui
2516 sys.stderr.write("Error reading in passwords. Terminating.\n")
2517 getglobalui().terminate()
2518 i += 1
2519 return ret
2520
2521 prime_gpg_agent()
2522 #+end_src
2523
2524 ** pigeonhole
2525 *** gnu.sieve
2526 :PROPERTIES:
2527 :header-args+: :tangle ~/sieve/gnu.sieve :comments none
2528 :END:
2529
2530 #+begin_src conf
2531 require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ];
2532
2533 if anyof (
2534 address :is "from" "webmasters@gnu.org",
2535 address :is "from" "webmasters-comment@gnu.org") {
2536 fileinto :create "webmasters";
2537 stop;
2538 }
2539
2540 include :personal "lists";
2541 #+end_src
2542
2543 *** lists.sieve
2544 :PROPERTIES:
2545 :header-args+: :tangle ~/sieve/lists.sieve :comments none
2546 :END:
2547
2548 #+begin_src conf
2549 require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags",
2550 "include" ];
2551
2552 if anyof (
2553 header :contains "list-id" "<emacs-devel.gnu.org>",
2554 header :contains "list-id" "<emacs-orgmode.gnu.org>",
2555 header :contains "list-id" "<emacsconf-discuss.gnu.org>",
2556 header :contains "list-id" "<fencepost-users.gnu.org>",
2557 header :contains "list-id" "<guix-devel.gnu.org>",
2558 header :contains "list-id" "<guile-devel.gnu.org>",
2559 header :contains "list-id" "<help-gnu-emacs.gnu.org>",
2560 header :contains "list-id" "<info-gnu-emacs.gnu.org>",
2561 header :contains "list-id" "<www-commits.gnu.org>",
2562 header :contains "list-id" "<www-discuss.gnu.org>",
2563 header :contains "list-id" "<deepspec.lists.cs.princeton.edu>",
2564 header :contains "list-id" "<haskell-cafe.haskell.org>",
2565 header :contains "list-id" "<haskell-art.we.lurk.org>",
2566 header :contains "list-id" "<notmuch.notmuchmail.org>") {
2567 if header :regex "list-id" "<([a-z_0-9-]+)[.@]" {
2568 set :lower "listname" "${1}";
2569 fileinto :create "l/${listname}";
2570 }
2571 }
2572
2573 if anyof (
2574 header :contains "list-id" "<~aminb/test-priv@lists.sr.ht>",
2575 header :contains "list-id" "<~sircmpwn/sr.ht-admins@lists.sr.ht>",
2576 header :contains "list-id" "<~sircmpwn/sr.ht-announce@lists.sr.ht>",
2577 header :contains "list-id" "<~sircmpwn/sr.ht-dev@lists.sr.ht>",
2578 header :contains "list-id" "<~sircmpwn/sr.ht-discuss@lists.sr.ht>") {
2579 if header :regex "list-id" "(~[a-z_0-9-]+)/([a-z_0-9.-]+)@" {
2580 set :lower "username" "${1}";
2581 set :lower "listname" "${2}";
2582 fileinto :create "l/${username}/${listname}";
2583 }
2584 }
2585 #+end_src
2586
2587 ** polybar
2588
2589 *** config
2590 :PROPERTIES:
2591 :header-args+: :tangle ~/.config/polybar/config
2592 :END:
2593
2594 #+begin_src conf :tangle no
2595 ;=====================================================
2596 ;
2597 ; To learn more about how to configure Polybar
2598 ; go to https://github.com/jaagr/polybar
2599 ;
2600 ; The README contains alot of information
2601 ;
2602 ;=====================================================
2603
2604 [colors]
2605 ;background = ${xrdb:color0:#222}
2606 background = #222
2607 background-alt = #444
2608 ;foreground = ${xrdb:color7:#222}
2609 foreground = #eee
2610 foreground-alt = #888
2611 primary = #ffb52a
2612 secondary = #e60053
2613 alert = #bd2c40
2614
2615 [bar/main]
2616 ;monitor = ${env:MONITOR:HDMI-1}
2617 width = 100%
2618 height = 27
2619 ;offset-x = 1%
2620 ;offset-y = 1%
2621 radius = 3.0
2622 fixed-center = true
2623
2624 background = ${colors.background}
2625 foreground = ${colors.foreground}
2626
2627 line-size = 3
2628 line-color = #f00
2629
2630 border-size = 4
2631 border-color = #00000000
2632
2633 padding-left = 0
2634 padding-right = 2
2635
2636 module-margin-left = 2
2637 module-margin-right = 2
2638
2639 font-0 = Ubuntu:fontformat=truetype:antialias=true:pixelsize=9;1
2640 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
2641 font-2 = Wuncon Siji:pixelsize=10;1
2642 font-3 = FontAwesome:pixelsize=10;1
2643
2644 modules-left = bspwm xwindow
2645 modules-center =
2646 modules-right = volume filesystem mail xkeyboard memory cpu temperature date powermenu
2647
2648 tray-position = right
2649 tray-padding = 1
2650 ;tray-transparent = true
2651 ;tray-background = #0063ff
2652 tray-maxsize = 18
2653
2654 wm-restack = bspwm
2655
2656 ;override-redirect = true
2657
2658 scroll-up = bspwm-desknext
2659 scroll-down = bspwm-deskprev
2660
2661 [module/xwindow]
2662 type = internal/xwindow
2663 label = %title:0:50:...%
2664
2665 [module/xkeyboard]
2666 type = internal/xkeyboard
2667 blacklist-0 = num lock
2668
2669 format-prefix = " "
2670 format-prefix-foreground = ${colors.foreground-alt}
2671 format-prefix-underline = ${colors.secondary}
2672
2673 label-layout = %layout%
2674 label-layout-underline = ${colors.secondary}
2675
2676 label-indicator-padding = 2
2677 label-indicator-margin = 1
2678 label-indicator-background = ${colors.secondary}
2679 label-indicator-underline = ${colors.secondary}
2680
2681 [module/filesystem]
2682 type = internal/fs
2683 interval = 25
2684
2685 mount-0 = /
2686
2687 label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
2688 label-unmounted = %mountpoint% not mounted
2689 label-unmounted-foreground = ${colors.foreground-alt}
2690
2691 [module/bspwm]
2692 type = internal/bspwm
2693
2694 label-focused = %index%
2695 label-focused-background = ${colors.background-alt}
2696 label-focused-underline= ${colors.primary}
2697 label-focused-padding = 2
2698
2699 label-occupied = %index%
2700 label-occupied-padding = 2
2701
2702 label-urgent = %index%!
2703 label-urgent-background = ${colors.alert}
2704 label-urgent-padding = 2
2705
2706 label-empty = %index%
2707 label-empty-foreground = ${colors.foreground-alt}
2708 label-empty-padding = 2
2709
2710 [module/i3]
2711 type = internal/i3
2712 format = <label-state> <label-mode>
2713 index-sort = true
2714 wrapping-scroll = false
2715
2716 ; Only show workspaces on the same output as the bar
2717 ;pin-workspaces = true
2718
2719 label-mode-padding = 2
2720 label-mode-foreground = #000
2721 label-mode-background = ${colors.primary}
2722
2723 ; focused = Active workspace on focused monitor
2724 label-focused = %index%
2725 label-focused-background = ${module/bspwm.label-focused-background}
2726 label-focused-underline = ${module/bspwm.label-focused-underline}
2727 label-focused-padding = ${module/bspwm.label-focused-padding}
2728
2729 ; unfocused = Inactive workspace on any monitor
2730 label-unfocused = %index%
2731 label-unfocused-padding = ${module/bspwm.label-occupied-padding}
2732
2733 ; visible = Active workspace on unfocused monitor
2734 label-visible = %index%
2735 label-visible-background = ${self.label-focused-background}
2736 label-visible-underline = ${self.label-focused-underline}
2737 label-visible-padding = ${self.label-focused-padding}
2738
2739 ; urgent = Workspace with urgency hint set
2740 label-urgent = %index%
2741 label-urgent-background = ${module/bspwm.label-urgent-background}
2742 label-urgent-padding = ${module/bspwm.label-urgent-padding}
2743
2744 [module/mpd]
2745 type = internal/mpd
2746 format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
2747
2748 icon-prev = 
2749 icon-stop = 
2750 icon-play = 
2751 icon-pause = 
2752 icon-next = 
2753
2754 label-song-maxlen = 25
2755 label-song-ellipsis = true
2756
2757 [module/xbacklight]
2758 type = internal/xbacklight
2759
2760 format = <label> <bar>
2761 label = BL
2762
2763 bar-width = 10
2764 bar-indicator = |
2765 bar-indicator-foreground = #ff
2766 bar-indicator-font = 2
2767 bar-fill = ─
2768 bar-fill-font = 2
2769 bar-fill-foreground = #9f78e1
2770 bar-empty = ─
2771 bar-empty-font = 2
2772 bar-empty-foreground = ${colors.foreground-alt}
2773
2774 [module/backlight-acpi]
2775 inherit = module/xbacklight
2776 type = internal/backlight
2777 ;card = intel_backlight
2778 card = mba6x_backlight
2779
2780 [module/cpu]
2781 type = internal/cpu
2782 interval = 2
2783 format-prefix = " "
2784 format-prefix-foreground = ${colors.foreground-alt}
2785 format-underline = #f90000
2786 label = %percentage%%
2787
2788 [module/memory]
2789 type = internal/memory
2790 interval = 2
2791 format-prefix = " "
2792 format-prefix-foreground = ${colors.foreground-alt}
2793 format-underline = #4bffdc
2794 label = %percentage_used%%
2795
2796 [module/wlan]
2797 type = internal/network
2798 interface =
2799 interval = 3.0
2800
2801 format-connected = <ramp-signal> <label-connected>
2802 format-connected-underline = #9f78e1
2803 label-connected = %essid%
2804
2805 format-disconnected =
2806 ;format-disconnected = <label-disconnected>
2807 ;format-disconnected-underline = ${self.format-connected-underline}
2808 ;label-disconnected = %ifname% disconnected
2809 ;label-disconnected-foreground = ${colors.foreground-alt}
2810
2811 ramp-signal-0 = 
2812 ramp-signal-1 = 
2813 ramp-signal-2 = 
2814 ramp-signal-3 = 
2815 ramp-signal-4 = 
2816 ramp-signal-foreground = ${colors.foreground-alt}
2817
2818 [module/eth]
2819 type = internal/network
2820 interface =
2821 interval = 3.0
2822
2823 format-connected-underline = #55aa55
2824 format-connected-prefix = " "
2825 format-connected-prefix-foreground = ${colors.foreground-alt}
2826 label-connected = %local_ip%
2827
2828 format-disconnected =
2829 ;format-disconnected = <label-disconnected>
2830 ;format-disconnected-underline = ${self.format-connected-underline}
2831 ;label-disconnected = %ifname% disconnected
2832 ;label-disconnected-foreground = ${colors.foreground-alt}
2833
2834 [module/date]
2835 type = internal/date
2836 interval = 5
2837
2838 date =
2839 date-alt = " %Y-%m-%d"
2840
2841 time = %H:%M
2842 time-alt = %H:%M:%S
2843
2844 format-prefix = 
2845 format-prefix-foreground = ${colors.foreground-alt}
2846 format-underline = #0a6cf5
2847
2848 label = %date% %time%
2849
2850 [module/volume]
2851 type = internal/volume
2852
2853 format-volume = <label-volume> <bar-volume>
2854 label-volume = vol
2855 label-volume-foreground = ${root.foreground}
2856
2857 format-muted-prefix = " "
2858 format-muted-foreground = ${colors.foreground-alt}
2859 label-muted = mute
2860
2861 bar-volume-width = 10
2862 bar-volume-foreground-0 = #55aa55
2863 bar-volume-foreground-1 = #55aa55
2864 bar-volume-foreground-2 = #55aa55
2865 bar-volume-foreground-3 = #55aa55
2866 bar-volume-foreground-4 = #55aa55
2867 bar-volume-foreground-5 = #f5a70a
2868 bar-volume-foreground-6 = #ff5555
2869 bar-volume-gradient = false
2870 bar-volume-indicator = |
2871 bar-volume-indicator-font = 2
2872 bar-volume-fill = ─
2873 bar-volume-fill-font = 2
2874 bar-volume-empty = ─
2875 bar-volume-empty-font = 2
2876 bar-volume-empty-foreground = ${colors.foreground-alt}
2877
2878 [module/battery]
2879 type = internal/battery
2880 battery = BAT0
2881 adapter = ADP1
2882 full-at = 64
2883
2884 format-charging = <animation-charging> <label-charging>
2885 format-charging-underline = #ffb52a
2886
2887 format-discharging = <ramp-capacity> <label-discharging>
2888 format-discharging-underline = ${self.format-charging-underline}
2889
2890 format-full-prefix = " "
2891 format-full-prefix-foreground = ${colors.foreground-alt}
2892 format-full-underline = ${self.format-charging-underline}
2893
2894 ramp-capacity-0 = 
2895 ramp-capacity-1 = 
2896 ramp-capacity-2 = 
2897 ramp-capacity-foreground = ${colors.foreground-alt}
2898
2899 animation-charging-0 = 
2900 animation-charging-1 = 
2901 animation-charging-2 = 
2902 animation-charging-foreground = ${colors.foreground-alt}
2903 animation-charging-framerate = 750
2904
2905 [module/temperature]
2906 type = internal/temperature
2907 thermal-zone = 1
2908 warn-temperature = 66
2909
2910 format = <ramp> <label>
2911 format-underline = #f50a4d
2912 format-warn = <ramp> <label-warn>
2913 format-warn-underline = ${self.format-underline}
2914
2915 label = %temperature%
2916 label-warn = %temperature%
2917 label-warn-foreground = ${colors.secondary}
2918
2919 ramp-0 = 
2920 ramp-1 = 
2921 ramp-2 = 
2922 ramp-foreground = ${colors.foreground-alt}
2923
2924 [module/powermenu]
2925 type = custom/menu
2926
2927 format-spacing = 1
2928
2929 label-open = 
2930 label-open-foreground = ${colors.secondary}
2931 label-close =  cancel
2932 label-close-foreground = ${colors.secondary}
2933 label-separator = |
2934 label-separator-foreground = ${colors.foreground-alt}
2935
2936 menu-0-0 = reboot
2937 menu-0-0-exec = menu-open-1
2938 menu-0-1 = power off
2939 menu-0-1-exec = menu-open-2
2940
2941 menu-1-0 = cancel
2942 menu-1-0-exec = menu-open-0
2943 menu-1-1 = reboot
2944 menu-1-1-exec = sudo reboot
2945
2946 menu-2-0 = power off
2947 menu-2-0-exec = sudo poweroff
2948 menu-2-1 = cancel
2949 menu-2-1-exec = menu-open-0
2950
2951 [module/mail]
2952 type = custom/script
2953 interval = 60
2954 format = <label>
2955 format-prefix = " "
2956 format-prefix-foreground = ${colors.foreground-alt}
2957 format-underline = #0a6cf5
2958 exec = notmuch count tag:unread
2959
2960 [settings]
2961 screenchange-reload = true
2962 ;compositing-background = xor
2963 ;compositing-background = screen
2964 ;compositing-foreground = source
2965 ;compositing-border = over
2966
2967 [global/wm]
2968 margin-top = 0
2969 margin-bottom = 0
2970
2971 ; vim:ft=dosini
2972 #+end_src
2973
2974 *** polybar-launch
2975 :PROPERTIES:
2976 :header-args+: :tangle ~/.local/bin/polybar-launch :shebang "#!/usr/bin/env sh"
2977 :END:
2978
2979 #+begin_src sh :tangle no
2980 # Terminate already running bar instances
2981 killall -q polybar
2982
2983 # Wait until the processes have been shut down
2984 while pgrep -x polybar >/dev/null; do sleep 1; done
2985
2986 # Launch main bar
2987 polybar main &
2988
2989 echo "Bars launched..."
2990 #+end_src
2991
2992 ** PowerTOP
2993 :PROPERTIES:
2994 :header-args+: :tangle "/sudo::/etc/systemd/system/powertop.service"
2995 :END:
2996
2997 #+begin_src conf
2998 [Unit]
2999 Description=Powertop tunings
3000
3001 [Service]
3002 ExecStart=/usr/bin/powertop --auto-tune
3003 RemainAfterExit=true
3004
3005 [Install]
3006 WantedBy=multi-user.target
3007 #+end_src
3008
3009 ** ranger
3010
3011 *** rc.conf
3012 :PROPERTIES:
3013 :header-args+: :tangle ~/.config/ranger/rc.conf
3014 :END:
3015
3016 #+begin_src conf :tangle no
3017 # ===================================================================
3018 # This file contains the default startup commands for ranger.
3019 # To change them, it is recommended to create the file
3020 # ~/.config/ranger/rc.conf and add your custom commands there.
3021 #
3022 # If you copy this whole file there, you may want to set the environment
3023 # variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
3024 #
3025 # The purpose of this file is mainly to define keybindings and settings.
3026 # For running more complex python code, please create a plugin in "plugins/" or
3027 # a command in "commands.py".
3028 #
3029 # Each line is a command that will be run before the user interface
3030 # is initialized. As a result, you can not use commands which rely
3031 # on the UI such as :delete or :mark.
3032 # ===================================================================
3033
3034 # ===================================================================
3035 # == Options
3036 # ===================================================================
3037
3038 # How many columns are there, and what are their relative widths?
3039 set column_ratios 1,3,4
3040
3041 # Which files should be hidden? (regular expression)
3042 set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
3043
3044 # Show hidden files? You can toggle this by typing 'zh'
3045 set show_hidden false
3046
3047 # Ask for a confirmation when running the "delete" command?
3048 # Valid values are "always" (default), "never", "multiple"
3049 # With "multiple", ranger will ask only if you delete multiple files at once.
3050 set confirm_on_delete multiple
3051
3052 # Which script is used to generate file previews?
3053 # ranger ships with scope.sh, a script that calls external programs (see
3054 # README for dependencies) to preview images, archives, etc.
3055 set preview_script ~/.config/ranger/scope.sh
3056
3057 # Use the external preview script or display simple plain text previews?
3058 set use_preview_script true
3059
3060 # Open all images in this directory when running certain image viewers
3061 # like feh or sxiv? You can still open selected files by marking them.
3062 set open_all_images true
3063
3064 # Be aware of version control systems and display information.
3065 set vcs_aware false
3066
3067 # State of the three backends git, hg, bzr. The possible states are
3068 # disabled, local (only show local info), enabled (show local and remote
3069 # information).
3070 set vcs_backend_git enabled
3071 set vcs_backend_hg disabled
3072 set vcs_backend_bzr disabled
3073
3074 # Preview images in full color with the external command "w3mimgpreview"?
3075 # This requires the console web browser "w3m" and a supported terminal.
3076 # It has been successfully tested with "xterm" and "urxvt" without tmux.
3077 set preview_images true
3078
3079 # Use a unicode "..." character to mark cut-off filenames?
3080 set unicode_ellipsis false
3081
3082 # Show dotfiles in the bookmark preview box?
3083 set show_hidden_bookmarks true
3084
3085 # Which colorscheme to use? These colorschemes are available by default:
3086 # default, jungle, snow
3087 set colorscheme default
3088
3089 # Preview files on the rightmost column?
3090 # And collapse (shrink) the last column if there is nothing to preview?
3091 set preview_files true
3092 set preview_directories true
3093 set collapse_preview true
3094
3095 # Save the console history on exit?
3096 set save_console_history true
3097
3098 # Draw the status bar on top of the browser window (default: bottom)
3099 set status_bar_on_top false
3100
3101 # Draw a progress bar in the status bar which displays the average state of all
3102 # currently running tasks which support progress bars?
3103 set draw_progress_bar_in_status_bar true
3104
3105 # Draw borders around columns?
3106 set draw_borders true
3107
3108 # Display the directory name in tabs?
3109 set dirname_in_tabs false
3110
3111 # Enable the mouse support?
3112 set mouse_enabled true
3113
3114 # Display the file size in the main column or status bar?
3115 set display_size_in_main_column true
3116 set display_size_in_status_bar true
3117
3118 # Display files tags in all columns or only in main column?
3119 set display_tags_in_all_columns true
3120
3121 # Set a title for the window?
3122 set update_title false
3123
3124 # Set the title to "ranger" in the tmux program?
3125 set update_tmux_title false
3126
3127 # Shorten the title if it gets long? The number defines how many
3128 # directories are displayed at once, 0 turns off this feature.
3129 set shorten_title 3
3130
3131 # Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
3132 set tilde_in_titlebar false
3133
3134 # How many directory-changes or console-commands should be kept in history?
3135 set max_history_size 20
3136 set max_console_history_size 50
3137
3138 # Try to keep so much space between the top/bottom border when scrolling:
3139 set scroll_offset 8
3140
3141 # Flush the input after each key hit? (Noticable when ranger lags)
3142 set flushinput true
3143
3144 # Padding on the right when there's no preview?
3145 # This allows you to click into the space to run the file.
3146 set padding_right true
3147
3148 # Save bookmarks (used with mX and `X) instantly?
3149 # This helps to synchronize bookmarks between multiple ranger
3150 # instances but leads to *slight* performance loss.
3151 # When false, bookmarks are saved when ranger is exited.
3152 set autosave_bookmarks true
3153
3154 # You can display the "real" cumulative size of directories by using the
3155 # command :get_cumulative_size or typing "dc". The size is expensive to
3156 # calculate and will not be updated automatically. You can choose
3157 # to update it automatically though by turning on this option:
3158 set autoupdate_cumulative_size false
3159
3160 # Turning this on makes sense for screen readers:
3161 set show_cursor false
3162
3163 # One of: size, basename, mtime, type
3164 set sort natural
3165
3166 # Additional sorting options
3167 set sort_reverse false
3168 set sort_case_insensitive true
3169 set sort_directories_first true
3170
3171 # Enable this if key combinations with the Alt Key don't work for you.
3172 # (Especially on xterm)
3173 set xterm_alt_key false
3174
3175 # ===================================================================
3176 # == Local Options
3177 # ===================================================================
3178 # You can set local options that only affect a single directory.
3179
3180 # Examples:
3181 # setlocal path=~/downloads sort mtime
3182
3183 # ===================================================================
3184 # == Command Aliases in the Console
3185 # ===================================================================
3186
3187 alias e edit
3188 alias q quit
3189 alias q! quitall
3190 alias qall quitall
3191 alias setl setlocal
3192
3193 alias filter scout -prt
3194 alias find scout -aet
3195 alias mark scout -mr
3196 alias unmark scout -Mr
3197 alias search scout -rs
3198 alias search_inc scout -rts
3199 alias travel scout -aefiklst
3200
3201 # ===================================================================
3202 # == Define keys for the browser
3203 # ===================================================================
3204
3205 # Basic
3206 map Q quit!
3207 map q quit
3208 copymap q ZZ ZQ
3209
3210 map R reload_cwd
3211 map <C-r> reset
3212 map <C-l> redraw_window
3213 map <C-c> abort
3214 map <esc> change_mode normal
3215
3216 map i display_file
3217 map ? help
3218 map W display_log
3219 map w taskview_open
3220 map S shell $SHELL
3221
3222 map : console
3223 map ; console
3224 map ! console shell
3225 map @ console -p6 shell %%s
3226 map # console shell -p
3227 map s console shell
3228 map r chain draw_possible_programs; console open_with
3229 map f console find
3230 map cd console cd
3231
3232 # Tagging / Marking
3233 map t tag_toggle
3234 map ut tag_remove
3235 map "<any> tag_toggle tag=%any
3236 map <Space> mark_files toggle=True
3237 map v mark_files all=True toggle=True
3238 map uv mark_files all=True val=False
3239 map V toggle_visual_mode
3240 map uV toggle_visual_mode reverse=True
3241
3242 # For the nostalgics: Midnight Commander bindings
3243 map <F1> help
3244 map <F3> display_file
3245 map <F4> edit
3246 map <F5> copy
3247 map <F6> cut
3248 map <F7> console mkdir
3249 map <F8> console delete
3250 map <F10> exit
3251
3252 # In case you work on a keyboard with dvorak layout
3253 map <UP> move up=1
3254 map <DOWN> move down=1
3255 map <LEFT> move left=1
3256 map <RIGHT> move right=1
3257 map <HOME> move to=0
3258 map <END> move to=-1
3259 map <PAGEDOWN> move down=1 pages=True
3260 map <PAGEUP> move up=1 pages=True
3261 map <CR> move right=1
3262 map <DELETE> console delete
3263 map <INSERT> console touch
3264
3265 # VIM-like
3266 copymap <UP> k
3267 copymap <DOWN> j
3268 copymap <LEFT> h
3269 copymap <RIGHT> l
3270 copymap <HOME> gg
3271 copymap <END> G
3272 copymap <PAGEDOWN> <C-F>
3273 copymap <PAGEUP> <C-B>
3274
3275 map J move down=0.5 pages=True
3276 map K move up=0.5 pages=True
3277 copymap J <C-D>
3278 copymap K <C-U>
3279
3280 # Jumping around
3281 map H history_go -1
3282 map L history_go 1
3283 map ] move_parent 1
3284 map [ move_parent -1
3285 map } traverse
3286
3287 map gh cd ~
3288 map ge cd /etc
3289 map gu cd /usr
3290 map gd cd /dev
3291 map gl cd -r .
3292 map gL cd -r %f
3293 map go cd /opt
3294 map gv cd /var
3295 map gm cd /media
3296 map gM cd /mnt
3297 map gs cd /srv
3298 map gr cd /
3299 map gR eval fm.cd(ranger.RANGERDIR)
3300 map g/ cd /
3301 map g? cd /usr/share/doc/ranger
3302
3303 # External Programs
3304 map E edit
3305 map du shell -p du --max-depth=1 -h --apparent-size
3306 map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
3307 map yp shell -d echo -n %d/%f | xsel -i
3308 map yd shell -d echo -n %d | xsel -i
3309 map yn shell -d echo -n %f | xsel -i
3310
3311 # Filesystem Operations
3312 map = chmod
3313
3314 map cw console rename
3315 map A eval fm.open_console('rename ' + fm.thisfile.basename)
3316 map I eval fm.open_console('rename ' + fm.thisfile.basename, position=7)
3317
3318 map pp paste
3319 map po paste overwrite=True
3320 map pl paste_symlink relative=False
3321 map pL paste_symlink relative=True
3322 map phl paste_hardlink
3323 map pht paste_hardlinked_subtree
3324
3325 map dd cut
3326 map ud uncut
3327 map da cut mode=add
3328 map dr cut mode=remove
3329
3330 map yy copy
3331 map uy uncut
3332 map ya copy mode=add
3333 map yr copy mode=remove
3334
3335 # Temporary workarounds
3336 map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
3337 map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
3338 map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
3339 map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
3340 map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
3341 map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
3342 map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
3343 map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
3344
3345 # Searching
3346 map / console search
3347 map n search_next
3348 map N search_next forward=False
3349 map ct search_next order=tag
3350 map cs search_next order=size
3351 map ci search_next order=mimetype
3352 map cc search_next order=ctime
3353 map cm search_next order=mtime
3354 map ca search_next order=atime
3355
3356 # Tabs
3357 map <C-n> tab_new ~
3358 map <C-w> tab_close
3359 map <TAB> tab_move 1
3360 map <S-TAB> tab_move -1
3361 map <A-Right> tab_move 1
3362 map <A-Left> tab_move -1
3363 map gt tab_move 1
3364 map gT tab_move -1
3365 map gn tab_new ~
3366 map gc tab_close
3367 map uq tab_restore
3368 map <a-1> tab_open 1
3369 map <a-2> tab_open 2
3370 map <a-3> tab_open 3
3371 map <a-4> tab_open 4
3372 map <a-5> tab_open 5
3373 map <a-6> tab_open 6
3374 map <a-7> tab_open 7
3375 map <a-8> tab_open 8
3376 map <a-9> tab_open 9
3377
3378 # Sorting
3379 map or toggle_option sort_reverse
3380 map os chain set sort=size; set sort_reverse=False
3381 map ob chain set sort=basename; set sort_reverse=False
3382 map on chain set sort=natural; set sort_reverse=False
3383 map om chain set sort=mtime; set sort_reverse=False
3384 map oc chain set sort=ctime; set sort_reverse=False
3385 map oa chain set sort=atime; set sort_reverse=False
3386 map ot chain set sort=type; set sort_reverse=False
3387
3388 map oS chain set sort=size; set sort_reverse=True
3389 map oB chain set sort=basename; set sort_reverse=True
3390 map oN chain set sort=natural; set sort_reverse=True
3391 map oM chain set sort=mtime; set sort_reverse=True
3392 map oC chain set sort=ctime; set sort_reverse=True
3393 map oA chain set sort=atime; set sort_reverse=True
3394 map oT chain set sort=type; set sort_reverse=True
3395
3396 map dc get_cumulative_size
3397
3398 # Settings
3399 map zc toggle_option collapse_preview
3400 map zd toggle_option sort_directories_first
3401 map zh toggle_option show_hidden
3402 map <C-h> toggle_option show_hidden
3403 map zi toggle_option flushinput
3404 map zm toggle_option mouse_enabled
3405 map zp toggle_option preview_files
3406 map zP toggle_option preview_directories
3407 map zs toggle_option sort_case_insensitive
3408 map zu toggle_option autoupdate_cumulative_size
3409 map zv toggle_option use_preview_script
3410 map zf console filter
3411
3412 # Bookmarks
3413 map `<any> enter_bookmark %any
3414 map '<any> enter_bookmark %any
3415 map m<any> set_bookmark %any
3416 map um<any> unset_bookmark %any
3417
3418 map m<bg> draw_bookmarks
3419 copymap m<bg> um<bg> `<bg> '<bg>
3420
3421 # Generate all the chmod bindings with some python help:
3422 eval for arg in "rwxXst": cmd("map +u{0} shell -d chmod u+{0} %s".format(arg))
3423 eval for arg in "rwxXst": cmd("map +g{0} shell -d chmod g+{0} %s".format(arg))
3424 eval for arg in "rwxXst": cmd("map +o{0} shell -d chmod o+{0} %s".format(arg))
3425 eval for arg in "rwxXst": cmd("map +a{0} shell -d chmod a+{0} %s".format(arg))
3426 eval for arg in "rwxXst": cmd("map +{0} shell -d chmod u+{0} %s".format(arg))
3427
3428 eval for arg in "rwxXst": cmd("map -u{0} shell -d chmod u-{0} %s".format(arg))
3429 eval for arg in "rwxXst": cmd("map -g{0} shell -d chmod g-{0} %s".format(arg))
3430 eval for arg in "rwxXst": cmd("map -o{0} shell -d chmod o-{0} %s".format(arg))
3431 eval for arg in "rwxXst": cmd("map -a{0} shell -d chmod a-{0} %s".format(arg))
3432 eval for arg in "rwxXst": cmd("map -{0} shell -d chmod u-{0} %s".format(arg))
3433
3434 # ===================================================================
3435 # == Define keys for the console
3436 # ===================================================================
3437 # Note: Unmapped keys are passed directly to the console.
3438
3439 # Basic
3440 cmap <tab> eval fm.ui.console.tab()
3441 cmap <s-tab> eval fm.ui.console.tab(-1)
3442 cmap <ESC> eval fm.ui.console.close()
3443 cmap <CR> eval fm.ui.console.execute()
3444 cmap <C-l> redraw_window
3445
3446 copycmap <ESC> <C-c>
3447 copycmap <CR> <C-j>
3448
3449 # Move around
3450 cmap <up> eval fm.ui.console.history_move(-1)
3451 cmap <down> eval fm.ui.console.history_move(1)
3452 cmap <left> eval fm.ui.console.move(left=1)
3453 cmap <right> eval fm.ui.console.move(right=1)
3454 cmap <home> eval fm.ui.console.move(right=0, absolute=True)
3455 cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
3456
3457 # Line Editing
3458 cmap <backspace> eval fm.ui.console.delete(-1)
3459 cmap <delete> eval fm.ui.console.delete(0)
3460 cmap <C-w> eval fm.ui.console.delete_word()
3461 cmap <C-k> eval fm.ui.console.delete_rest(1)
3462 cmap <C-u> eval fm.ui.console.delete_rest(-1)
3463 cmap <C-y> eval fm.ui.console.paste()
3464
3465 # And of course the emacs way
3466 copycmap <up> <C-p>
3467 copycmap <down> <C-n>
3468 copycmap <left> <C-b>
3469 copycmap <right> <C-f>
3470 copycmap <home> <C-a>
3471 copycmap <end> <C-e>
3472 copycmap <delete> <C-d>
3473 copycmap <backspace> <C-h>
3474
3475 # Note: There are multiple ways to express backspaces. <backspace> (code 263)
3476 # and <backspace2> (code 127). To be sure, use both.
3477 copycmap <backspace> <backspace2>
3478
3479 # This special expression allows typing in numerals:
3480 cmap <allow_quantifiers> false
3481
3482 # ===================================================================
3483 # == Pager Keybindings
3484 # ===================================================================
3485
3486 # Movement
3487 pmap <down> pager_move down=1
3488 pmap <up> pager_move up=1
3489 pmap <left> pager_move left=4
3490 pmap <right> pager_move right=4
3491 pmap <home> pager_move to=0
3492 pmap <end> pager_move to=-1
3493 pmap <pagedown> pager_move down=1.0 pages=True
3494 pmap <pageup> pager_move up=1.0 pages=True
3495 pmap <C-d> pager_move down=0.5 pages=True
3496 pmap <C-u> pager_move up=0.5 pages=True
3497
3498 copypmap <UP> k <C-p>
3499 copypmap <DOWN> j <C-n> <CR>
3500 copypmap <LEFT> h
3501 copypmap <RIGHT> l
3502 copypmap <HOME> g
3503 copypmap <END> G
3504 copypmap <C-d> d
3505 copypmap <C-u> u
3506 copypmap <PAGEDOWN> n f <C-F> <Space>
3507 copypmap <PAGEUP> p b <C-B>
3508
3509 # Basic
3510 pmap <ESC> pager_close
3511 copypmap <ESC> q Q i <F3>
3512 pmap E edit_file
3513
3514 # ===================================================================
3515 # == Taskview Keybindings
3516 # ===================================================================
3517
3518 # Movement
3519 tmap <up> taskview_move up=1
3520 tmap <down> taskview_move down=1
3521 tmap <home> taskview_move to=0
3522 tmap <end> taskview_move to=-1
3523 tmap <pagedown> taskview_move down=1.0 pages=True
3524 tmap <pageup> taskview_move up=1.0 pages=True
3525 tmap <C-d> taskview_move down=0.5 pages=True
3526 tmap <C-u> taskview_move up=0.5 pages=True
3527
3528 copytmap <UP> k <C-p>
3529 copytmap <DOWN> j <C-n> <CR>
3530 copytmap <HOME> g
3531 copytmap <END> G
3532 copytmap <C-u> u
3533 copytmap <PAGEDOWN> n f <C-F> <Space>
3534 copytmap <PAGEUP> p b <C-B>
3535
3536 # Changing priority and deleting tasks
3537 tmap J eval -q fm.ui.taskview.task_move(-1)
3538 tmap K eval -q fm.ui.taskview.task_move(0)
3539 tmap dd eval -q fm.ui.taskview.task_remove()
3540 tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
3541 tmap <pageup> eval -q fm.ui.taskview.task_move(0)
3542 tmap <delete> eval -q fm.ui.taskview.task_remove()
3543
3544 # Basic
3545 tmap <ESC> taskview_close
3546 copytmap <ESC> q Q w <C-c>
3547 #+end_src
3548
3549 *** scope.sh
3550 :PROPERTIES:
3551 :header-args+: :tangle ~/.config/ranger/scope.sh :shebang "#!/usr/bin/env sh"
3552 :END:
3553
3554 #+begin_src sh :tangle no
3555 # ranger supports enhanced previews. If the option "use_preview_script"
3556 # is set to True and this file exists, this script will be called and its
3557 # output is displayed in ranger. ANSI color codes are supported.
3558
3559 # NOTES: This script is considered a configuration file. If you upgrade
3560 # ranger, it will be left untouched. (You must update it yourself.)
3561 # Also, ranger disables STDIN here, so interactive scripts won't work properly
3562
3563 # Meanings of exit codes:
3564 # code | meaning | action of ranger
3565 # -----+------------+-------------------------------------------
3566 # 0 | success | success. display stdout as preview
3567 # 1 | no preview | failure. display no preview at all
3568 # 2 | plain text | display the plain content of the file
3569 # 3 | fix width | success. Don't reload when width changes
3570 # 4 | fix height | success. Don't reload when height changes
3571 # 5 | fix both | success. Don't ever reload
3572
3573 # Meaningful aliases for arguments:
3574 path="$1" # Full path of the selected file
3575 width="$2" # Width of the preview pane (number of fitting characters)
3576 height="$3" # Height of the preview pane (number of fitting characters)
3577
3578 maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln
3579
3580 # Find out something about the file:
3581 mimetype=$(file --mime-type -Lb "$path")
3582 extension=${path##*.}
3583
3584 # Functions:
3585 # runs a command and saves its output into $output. Useful if you need
3586 # the return value AND want to use the output in a pipe
3587 try() { output=$(eval '"$@"'); }
3588
3589 # writes the output of the previouosly used "try" command
3590 dump() { echo "$output"; }
3591
3592 # a common post-processing function used after most commands
3593 trim() { head -n "$maxln"; }
3594
3595 # wraps highlight to treat exit code 141 (killed by SIGPIPE) as success
3596 highlight() { command highlight "$@"; test $? = 0 -o $? = 141; }
3597
3598 case "$extension" in
3599 # Archive extensions:
3600 7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
3601 rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
3602 try als "$path" && { dump | trim; exit 0; }
3603 try acat "$path" && { dump | trim; exit 3; }
3604 try bsdtar -lf "$path" && { dump | trim; exit 0; }
3605 exit 1;;
3606 rar)
3607 try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;;
3608 # PDF documents:
3609 pdf)
3610 try pdftotext -l 10 -nopgbrk -q "$path" - && \
3611 { dump | trim | fmt -s -w $width; exit 0; } || exit 1;;
3612 # BitTorrent Files
3613 torrent)
3614 try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;;
3615 # HTML Pages:
3616 htm|html|xhtml)
3617 try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
3618 try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
3619 try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
3620 ;; # fall back to highlight/cat if the text browsers fail
3621 esac
3622
3623 case "$mimetype" in
3624 # Syntax highlight for text files:
3625 text/* | */xml)
3626 try highlight --out-format=ansi "$path" && { dump | trim; exit 5; } || exit 2;;
3627 # Ascii-previews of images:
3628 image/*)
3629 img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
3630 # Display information about media files:
3631 video/* | audio/*)
3632 exiftool "$path" && exit 5
3633 # Use sed to remove spaces so the output fits into the narrow window
3634 try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;;
3635 esac
3636
3637 exit 1
3638 #+end_src
3639
3640 ** redshift
3641 :PROPERTIES:
3642 :header-args+: :tangle ~/.config/redshift.conf :comments none
3643 :END:
3644
3645 #+begin_src conf
3646 ; Global settings for redshift
3647 [redshift]
3648 ; Set the day and night screen temperatures (Neutral is 6500K)
3649 ;temp-day=5700
3650 ;temp-night=3500
3651
3652 ;temp-day=6500
3653 temp-day=6200
3654 ;temp-night=4800
3655 ;temp-night=5000
3656 ;temp-night=4500
3657 temp-night=4000
3658
3659 ; Enable/Disable a smooth transition between day and night
3660 ; 0 will cause a direct change from day to night screen temperature.
3661 ; 1 will gradually increase or decrease the screen temperature.
3662 transition=1
3663
3664 ; Set the screen brightness. Default is 1.0.
3665 ;brightness=0.9
3666 ; It is also possible to use different settings for day and night
3667 ; since version 1.8.
3668 ;brightness-day=0.7
3669 ;brightness-night=0.4
3670 ; Set the screen gamma (for all colors, or each color channel
3671 ; individually)
3672 ;gamma=0.8
3673 ;gamma=1.0
3674 ;gamma=0.8:0.7:0.8
3675 ; This can also be set individually for day and night since
3676 ; version 1.10.
3677 ;gamma-day=0.8:0.7:0.8
3678 ;gamma-night=0.6
3679
3680 ; Set the location-provider: 'geoclue2' or 'manual'
3681 ; type 'redshift -l list' to see possible values.
3682 ; The location provider settings are in a different section.
3683 ;location-provider=manual
3684 location-provider=geoclue2
3685
3686 ; Set the adjustment-method: 'randr', 'vidmode'
3687 ; type 'redshift -m list' to see all possible values.
3688 ; 'randr' is the preferred method, 'vidmode' is an older API.
3689 ; but works in some cases when 'randr' does not.
3690 ; The adjustment method settings are in a different section.
3691 adjustment-method=randr
3692
3693 ; Configuration of the location-provider:
3694 ; type 'redshift -l PROVIDER:help' to see the settings.
3695 ; ex: 'redshift -l manual:help'
3696 ; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
3697 ; are negative numbers.
3698 ;[manual]
3699 ;lat=48.1
3700 ;lon=11.6
3701
3702 ; Configuration of the adjustment-method
3703 ; type 'redshift -m METHOD:help' to see the settings.
3704 ; ex: 'redshift -m randr:help'
3705 ; In this example, randr is configured to adjust screen 1.
3706 ; Note that the numbering starts from 0, so this is actually the
3707 ; second screen. If this option is not specified, Redshift will try
3708 ; to adjust _all_ screens.
3709 ;[randr]
3710 ;screen=1
3711 #+end_src
3712
3713 ** rofi
3714 :PROPERTIES:
3715 :header-args+: :tangle ~/.config/rofi/config
3716 :END:
3717
3718 #+begin_src conf
3719 ! rofi.font: Ubuntu Mono 13
3720 ! rofi.font: Inconsolata 16
3721 ! rofi.font: Iosevka 13
3722 ! rofi.font: Source Code Pro 11
3723 rofi.font: Source Code Pro 10.5
3724 rofi.modi: run,window
3725 ! rofi.width: 640
3726 rofi.width: 600
3727 !rofi.location: 2
3728 !rofi.yoffset: 200
3729 rofi.monitor: -1
3730 !rofi.lines: 10
3731
3732 !rofi.theme: /usr/share/rofi/themes//Arc.rasi
3733 !rofi.theme: /usr/share/rofi/themes//Paper.rasi
3734 !rofi.theme: /usr/share/rofi/themes//sidebar.rasi
3735
3736 rofi.theme: /usr/share/rofi/themes//gruvbox-light.rasi
3737 #+end_src
3738
3739 ** rofi-pass
3740 :PROPERTIES:
3741 :header-args+: :tangle ~/.config/rofi-pass/config
3742 :END:
3743
3744 #+begin_src conf
3745 # permanently set alternative root dir
3746 # root=/path/to/root
3747
3748 # rofi command. Make sure to have "$@" as last argument
3749 _rofi () {
3750 #rofi -no-auto-select -kb-accept-entry "!Return" -i -no-levenshtein-sort "$@"
3751 rofi -i -no-auto-select -kb-accept-entry "!Return" "$@"
3752 }
3753
3754 # xdotool needs the keyboard layout to be set using setxkbmap
3755 # You can do this in your autostart scripts (e.g. xinitrc)
3756
3757 # If for some reason, you cannot do this, you can set the command here.
3758 # and set fix_layout to true
3759 fix_layout=false
3760
3761 layout_cmd () {
3762 setxkbmap us
3763 }
3764
3765 # fields to be used
3766 URL_field='url'
3767 USERNAME_field='user'
3768 AUTOTYPE_field='autotype'
3769
3770 # delay to be used for :delay keyword
3771 delay=2
3772
3773 ## Programs to be used
3774 # Editor
3775 EDITOR='gvim -f'
3776
3777 # Browser
3778 BROWSER='chromium'
3779
3780 ## Misc settings
3781
3782 default_do='menu' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
3783 auto_enter='false'
3784 notify='false'
3785 default_autotype='user :tab pass'
3786
3787 # color of the help messages
3788 # leave empty for autodetection
3789 help_color="#4872FF"
3790
3791 # Clipboard settings
3792 # Possible options: primary, clipboard, both
3793 clip=primary
3794
3795 # Options for generating new password entries
3796 # default_user is also used for password files that have no user field.
3797 default_user=aminb
3798 default_user2=aminban
3799 password_length=30
3800
3801 # Custom Keybindings
3802 #autotype="Alt+1"
3803 autotype="Alt+m"
3804 type_user="Alt+2"
3805 type_pass="Alt+3"
3806 open_url="Alt+4"
3807 copy_name="Alt+u"
3808 copy_url="Alt+l"
3809 copy_pass="Alt+p"
3810 show="Alt+o"
3811 copy_entry="Alt+2"
3812 type_entry="Alt+1"
3813 copy_menu="Alt+c"
3814 action_menu="Alt+a"
3815 type_menu="Alt+t"
3816 help="Alt+h"
3817 switch="Alt+x"
3818 insert_pass="Alt+n"
3819 #+end_src
3820
3821 ** sway
3822
3823 *** main
3824 :PROPERTIES:
3825 :header-args+: :tangle ~/.config/sway/config
3826 :END:
3827
3828 #+begin_src conf
3829 ### Variables
3830 # super
3831 set $mod Mod4
3832 # alt
3833 set $mod2 Mod1
3834 set $left h
3835 set $down j
3836 set $up k
3837 set $right l
3838 set $term urxvt
3839 set $menu rofi -show run -display-run '> ' -display-window ' 🗔 '
3840
3841 ### Output configuration
3842 #
3843 # Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)
3844 output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
3845 #
3846 # Example configuration:
3847 #
3848 # output HDMI-A-1 resolution 1920x1080 position 1920,0
3849 #
3850 # You can get the names of your outputs by running: swaymsg -t get_outputs
3851
3852 ### Idle configuration
3853
3854 exec swayidle \
3855 timeout 120 '[ -f ~/.nosleep ] || swaymsg "output * dpms off"' \
3856 resume '[ -f ~/.nosleep ] || swaymsg "output * dpms on"' \
3857 before-sleep swaylock
3858
3859
3860 ### Key bindings
3861 #
3862 # Basics:
3863 #
3864 # start a terminal
3865 bindsym $mod+Return exec $term
3866
3867 # kill focused window
3868 bindsym $mod+Shift+q kill
3869
3870 # start your launcher
3871 bindsym $mod+d exec $menu
3872
3873 # password manager
3874 bindsym $mod2+space exec rofi-pass
3875
3876 # Drag floating windows by holding down $mod and left mouse button.
3877 # Resize them with right mouse button + $mod.
3878 # Despite the name, also works for non-floating windows.
3879 # Change normal to inverse to use left mouse button for resizing and right
3880 # mouse button for dragging.
3881 floating_modifier $mod normal
3882
3883 # reload the configuration file
3884 bindsym $mod+Shift+c reload
3885
3886 # exit sway (logs you out of your wayland session)
3887 bindsym $mod+Shift+e exit
3888
3889 bindsym $mod+apostrophe exec rofi-light # rofi-based brightness chooser
3890 bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness
3891 bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness
3892
3893 bindsym XF86AudioRaiseVolume exec pamixer --allow-boost --increase 5
3894 bindsym XF86AudioLowerVolume exec pamixer --allow-boost --decrease 5
3895 bindsym XF86AudioMute exec pamixer --toggle-mute
3896 bindsym XF86AudioMicMute exec pactl set-source-mute 1 toggle
3897
3898 # original sway workspace switch and window move
3899 bindsym $mod+bracketleft workspace prev
3900 bindsym $mod+bracketright workspace next
3901 bindsym $mod+braceleft move container to workspace prev
3902 bindsym $mod+braceright move container to workspace next
3903
3904 # bspwm-esque workspace switch and window move
3905 bindsym $mod2+bracketleft exec sway-ws-util switch prev
3906 bindsym $mod2+bracketright exec sway-ws-util switch next
3907 bindsym $mod2+braceleft exec sway-ws-util move prev follow
3908 bindsym $mod2+braceright exec sway-ws-util move next follow
3909 #
3910 # Moving around:
3911 #
3912 # Move your focus around
3913 bindsym $mod+$left focus left
3914 bindsym $mod+$down focus down
3915 bindsym $mod+$up focus up
3916 bindsym $mod+$right focus right
3917 # or use $mod+[up|down|left|right]
3918 bindsym $mod+Left focus left
3919 bindsym $mod+Down focus down
3920 bindsym $mod+Up focus up
3921 bindsym $mod+Right focus right
3922
3923 # _move_ the focused window with the same, but add Shift
3924 bindsym $mod+Shift+$left move left
3925 bindsym $mod+Shift+$down move down
3926 bindsym $mod+Shift+$up move up
3927 bindsym $mod+Shift+$right move right
3928 # ditto, with arrow keys
3929 bindsym $mod+Shift+Left move left
3930 bindsym $mod+Shift+Down move down
3931 bindsym $mod+Shift+Up move up
3932 bindsym $mod+Shift+Right move right
3933 #
3934 # Workspaces:
3935 #
3936 # switch to workspace
3937 bindsym $mod+1 workspace 1
3938 bindsym $mod+2 workspace 2
3939 bindsym $mod+3 workspace 3
3940 bindsym $mod+4 workspace 4
3941 bindsym $mod+5 workspace 5
3942 bindsym $mod+6 workspace 6
3943 bindsym $mod+7 workspace 7
3944 bindsym $mod+8 workspace 8
3945 bindsym $mod+9 workspace 9
3946 bindsym $mod+0 workspace 10
3947 # move focused container to workspace
3948 bindsym $mod+Shift+1 move container to workspace 1
3949 bindsym $mod+Shift+2 move container to workspace 2
3950 bindsym $mod+Shift+3 move container to workspace 3
3951 bindsym $mod+Shift+4 move container to workspace 4
3952 bindsym $mod+Shift+5 move container to workspace 5
3953 bindsym $mod+Shift+6 move container to workspace 6
3954 bindsym $mod+Shift+7 move container to workspace 7
3955 bindsym $mod+Shift+8 move container to workspace 8
3956 bindsym $mod+Shift+9 move container to workspace 9
3957 bindsym $mod+Shift+0 move container to workspace 10
3958 # Note: workspaces can have any name you want, not just numbers.
3959 # We just use 1-10 as the default.
3960 #
3961 # Layout stuff:
3962 #
3963 # You can "split" the current object of your focus with
3964 # $mod+b or $mod+v, for horizontal and vertical splits
3965 # respectively.
3966 bindsym $mod+b splith
3967 bindsym $mod+v splitv
3968
3969 # Switch the current container between different layout styles
3970 bindsym $mod+s layout stacking
3971 bindsym $mod+w layout tabbed
3972 bindsym $mod+e layout toggle split
3973
3974 # Make the current focus fullscreen
3975 bindsym $mod+f fullscreen
3976
3977 # Toggle the current focus between tiling and floating mode
3978 bindsym $mod+Shift+space floating toggle
3979
3980 # Swap focus between the tiling area and the floating area
3981 bindsym $mod+space focus mode_toggle
3982
3983 # move focus to the parent container
3984 bindsym $mod+a focus parent
3985 #
3986 # Scratchpad:
3987 #
3988 # Sway has a "scratchpad", which is a bag of holding for windows.
3989 # You can send windows there and get them back later.
3990
3991 # Move the currently focused window to the scratchpad
3992 bindsym $mod+Shift+minus move scratchpad
3993
3994 # Show the next scratchpad window or hide the focused scratchpad window.
3995 # If there are multiple scratchpad windows, this command cycles through them.
3996 bindsym $mod+minus scratchpad show
3997 #
3998 # Resizing containers:
3999 #
4000 mode "resize" {
4001 # left will shrink the containers width
4002 # right will grow the containers width
4003 # up will shrink the containers height
4004 # down will grow the containers height
4005 bindsym $left resize shrink width 10px
4006 bindsym $down resize grow height 10px
4007 bindsym $up resize shrink height 10px
4008 bindsym $right resize grow width 10px
4009
4010 # ditto, with arrow keys
4011 bindsym Left resize shrink width 10px
4012 bindsym Down resize grow height 10px
4013 bindsym Up resize shrink height 10px
4014 bindsym Right resize grow width 10px
4015
4016 # return to default mode
4017 bindsym Return mode "default"
4018 bindsym Escape mode "default"
4019 }
4020 bindsym $mod+Shift+r mode "resize"
4021
4022 #
4023 # Power button
4024 #
4025
4026 set $mode_system System (l)ock, (e)xit sway, (s)uspend, (h)ibernate, (r)eboot, (S)hutdown
4027 mode "$mode_system" {
4028 bindsym l exec swaylock, mode "default"
4029 bindsym e exec swaymsg exit, mode "default"
4030 bindsym s exec systemctl suspend, mode "default"
4031 bindsym h exec systemctl hibernate, mode "default"
4032 bindsym r exec systemctl reboot, mode "default"
4033 bindsym Shift+s exec systemctl poweroff -i, mode "default"
4034
4035 # back to normal: Enter, Escape, or q
4036 bindsym Return mode "default"
4037 bindsym Escape mode "default"
4038 bindsym q mode "default"
4039 }
4040 bindsym XF86PowerOff mode "$mode_system"
4041
4042 #
4043 # Presentation mode
4044 #
4045
4046 bindsym $mod+$mod2+p exec ([ ! -e ~/.nosleep ] && touch ~/.nosleep || rm ~/.nosleep) && killall -USR1 i3status
4047
4048 #
4049 # Notifications
4050 #
4051
4052 bindsym $mod+Shift+n mode notifications
4053 mode notifications {
4054 bindsym Return exec makoctl invoke; exec makoctl dismiss; mode default
4055 bindsym d exec makoctl dismiss; mode default
4056 bindsym Shift+d exec makoctl dismiss -a; mode default
4057
4058 bindsym Escape mode default
4059 bindsym q mode default
4060 }
4061
4062 #
4063 # Screenshotting
4064 #
4065
4066 bindsym $mod+Shift+s mode screenshot
4067 mode screenshot {
4068 bindsym a exec grim $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default
4069 bindsym r exec slurp | grim -g - $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default
4070
4071 bindsym Escape mode default
4072 bindsym q mode default
4073 }
4074
4075 #
4076 # Status Bar:
4077 #
4078 # Read `man 5 sway-bar` for more information about this section.
4079 bar {
4080 position bottom
4081 colors {
4082 statusline #ffffff
4083 background #323232
4084 inactive_workspace #32323200 #32323200 #5c5c5c
4085 }
4086 status_command i3status | my-i3status.py
4087 }
4088
4089 # font pango: benis uushi 9
4090 # font pango: Ubuntu Mono 11
4091 # font pango: Inconsolata 11
4092 font pango: DejaVu Sans Mono 9
4093 # font pango: Liberation Mono 9
4094
4095 exec xrdb .Xresources
4096 exec pgrep -x "systemd-inhibit" || \
4097 systemd-inhibit --what=handle-power-key --who=aminb \
4098 --why="Handle power button in sway" sleep infinity
4099 exec mako 2>&1 >/tmp/mako.log
4100 exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
4101
4102 include /etc/sway/config.d/*
4103 include ~/.config/sway/`hostname`
4104
4105 exec systemd-notify --ready || true
4106
4107 #+end_src
4108
4109 *** langa
4110 :PROPERTIES:
4111 :header-args+: :tangle ~/.config/sway/langa
4112 :END:
4113
4114 #+begin_src conf
4115 input "2:7:SynPS/2_Synaptics_TouchPad" {
4116 events disabled
4117 dwt enabled
4118 tap enabled
4119 natural_scroll enabled
4120 click_method clickfinger
4121 }
4122
4123 input "1:1:AT_Translated_Set_2_keyboard" {
4124 repeat_delay 200
4125 repeat_rate 45
4126 xkb_layout us_ab,ir
4127 xkb_options ctrl:nocaps,altwin:swap_alt_win,grp:shifts_toggle
4128 }
4129 #+end_src
4130
4131 *** shemshak
4132 :PROPERTIES:
4133 :header-args+: :tangle ~/.config/sway/shemshak
4134 :END:
4135
4136 #+begin_src conf
4137 input "1739:31251:DLL07BE:01_06CB:7A13_Touchpad" {
4138 dwt enabled
4139 tap enabled
4140 natural_scroll enabled
4141 middle_emulation enabled
4142 click_method clickfinger
4143 }
4144
4145 input "1:1:AT_Translated_Set_2_keyboard" {
4146 repeat_delay 200
4147 repeat_rate 45
4148 xkb_layout us,ir
4149 xkb_options ctrl:nocaps,altwin:swap_alt_win,ctrl:rctrl_ralt,grp:shifts_toggle
4150 }
4151 #+end_src
4152 ** swaylock
4153 :PROPERTIES:
4154 :header-args+: :tangle ~/.config/swaylock/config
4155 :END:
4156
4157 #+begin_src conf
4158 image=/home/amin/usr/pics/wp/wp2445784-blurred-wallpapers.jpg
4159 scaling=fill
4160 #+end_src
4161
4162 ** TLP
4163
4164 *** langa
4165
4166 #+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "langa")) "/sudo::/etc/default/tlp")
4167 # ------------------------------------------------------------------------------
4168 # tlp - Parameters for power saving
4169 # See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
4170
4171 # Hint: some features are disabled by default, remove the leading # to enable
4172 # them.
4173
4174 # Set to 0 to disable, 1 to enable TLP.
4175 TLP_ENABLE=1
4176
4177 # Operation mode when no power supply can be detected: AC, BAT.
4178 # Concerns some desktop and embedded hardware only.
4179 TLP_DEFAULT_MODE=AC
4180
4181 # Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
4182 # Hint: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC.
4183 TLP_PERSISTENT_DEFAULT=0
4184
4185 # Seconds laptop mode has to wait after the disk goes idle before doing a sync.
4186 # Non-zero value enables, zero disables laptop mode.
4187 DISK_IDLE_SECS_ON_AC=0
4188 DISK_IDLE_SECS_ON_BAT=2
4189
4190 # Dirty page values (timeouts in secs).
4191 MAX_LOST_WORK_SECS_ON_AC=15
4192 MAX_LOST_WORK_SECS_ON_BAT=60
4193
4194 # Hint: CPU parameters below are disabled by default, remove the leading #
4195 # to enable them, otherwise kernel default values are used.
4196
4197 # Select a CPU frequency scaling governor.
4198 # Intel Core i processor with intel_pstate driver:
4199 # powersave(*), performance.
4200 # Older hardware with acpi-cpufreq driver:
4201 # ondemand(*), powersave, performance, conservative, schedutil.
4202 # (*) is recommended.
4203 # Hint: use tlp-stat -p to show the active driver and available governors.
4204 # Important:
4205 # powersave for intel_pstate and ondemand for acpi-cpufreq are power
4206 # efficient for *almost all* workloads and therefore kernel and most
4207 # distributions have chosen them as defaults. If you still want to change,
4208 # you should know what you're doing! You *must* disable your distribution's
4209 # governor settings or conflicts will occur.
4210 #CPU_SCALING_GOVERNOR_ON_AC=powersave
4211 #CPU_SCALING_GOVERNOR_ON_BAT=powersave
4212
4213 # Set the min/max frequency available for the scaling governor.
4214 # Possible values strongly depend on your CPU. For available frequencies see
4215 # the output of tlp-stat -p.
4216 #CPU_SCALING_MIN_FREQ_ON_AC=0
4217 #CPU_SCALING_MAX_FREQ_ON_AC=0
4218 #CPU_SCALING_MIN_FREQ_ON_BAT=0
4219 #CPU_SCALING_MAX_FREQ_ON_BAT=0
4220
4221 # Set energy performance hints (HWP) for Intel P-state governor:
4222 # performance, balance_performance, default, balance_power, power
4223 # Values are given in order of increasing power saving.
4224 # Note: Intel Skylake or newer CPU and Kernel >= 4.10 required.
4225 CPU_HWP_ON_AC=balance_performance
4226 CPU_HWP_ON_BAT=balance_power
4227
4228 # Set Intel P-state performance: 0..100 (%).
4229 # Limit the max/min P-state to control the power dissipation of the CPU.
4230 # Values are stated as a percentage of the available performance.
4231 # Requires an Intel Core i processor with intel_pstate driver.
4232 #CPU_MIN_PERF_ON_AC=0
4233 #CPU_MAX_PERF_ON_AC=100
4234 #CPU_MIN_PERF_ON_BAT=0
4235 #CPU_MAX_PERF_ON_BAT=30
4236
4237 # Set the CPU "turbo boost" feature: 0=disable, 1=allow
4238 # Requires an Intel Core i processor.
4239 # Important:
4240 # - This may conflict with your distribution's governor settings
4241 # - A value of 1 does *not* activate boosting, it just allows it
4242 #CPU_BOOST_ON_AC=1
4243 #CPU_BOOST_ON_BAT=0
4244
4245 # Minimize number of used CPU cores/hyper-threads under light load conditions:
4246 # 0=disable, 1=enable.
4247 SCHED_POWERSAVE_ON_AC=0
4248 SCHED_POWERSAVE_ON_BAT=1
4249
4250 # Kernel NMI Watchdog:
4251 # 0=disable (default, saves power), 1=enable (for kernel debugging only).
4252 NMI_WATCHDOG=0
4253
4254 # Change CPU voltages aka "undervolting" - Kernel with PHC patch required.
4255 # Frequency voltage pairs are written to:
4256 # /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
4257 # CAUTION: only use this, if you thoroughly understand what you are doing!
4258 #PHC_CONTROLS="F:V F:V F:V F:V"
4259
4260 # Set CPU performance versus energy savings policy:
4261 # performance, balance-performance, default, balance-power, power.
4262 # Values are given in order of increasing power saving.
4263 # Requires kernel module msr and x86_energy_perf_policy from linux-tools.
4264 ENERGY_PERF_POLICY_ON_AC=performance
4265 ENERGY_PERF_POLICY_ON_BAT=balance-power
4266
4267 # Disk devices; separate multiple devices with spaces (default: sda).
4268 # Devices can be specified by disk ID also (lookup with: tlp diskid).
4269 DISK_DEVICES="sda sdb"
4270
4271 # Disk advanced power management level: 1..254, 255 (max saving, min, off).
4272 # Levels 1..127 may spin down the disk; 255 allowable on most drives.
4273 # Separate values for multiple disks with spaces. Use the special value 'keep'
4274 # to keep the hardware default for the particular disk.
4275 DISK_APM_LEVEL_ON_AC="254 254"
4276 DISK_APM_LEVEL_ON_BAT="128 128"
4277
4278 # Hard disk spin down timeout:
4279 # 0: spin down disabled
4280 # 1..240: timeouts from 5s to 20min (in units of 5s)
4281 # 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
4282 # See 'man hdparm' for details.
4283 # Separate values for multiple disks with spaces. Use the special value 'keep'
4284 # to keep the hardware default for the particular disk.
4285 #DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
4286 #DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
4287
4288 # Select IO scheduler for the disk devices: cfq, deadline, noop (Default: cfq).
4289 # Separate values for multiple disks with spaces. Use the special value 'keep'
4290 # to keep the kernel default scheduler for the particular disk.
4291 #DISK_IOSCHED="cfq cfq"
4292
4293 # AHCI link power management (ALPM) for disk devices:
4294 # min_power, med_power_with_dipm(*), medium_power, max_performance.
4295 # (*) Kernel >= 4.15 required, then recommended.
4296 # Multiple values separated with spaces are tried sequentially until success.
4297 SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
4298 SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
4299
4300 # Exclude host devices from AHCI link power management.
4301 # Separate multiple hosts with spaces.
4302 #SATA_LINKPWR_BLACKLIST="host1"
4303
4304 # Runtime Power Management for AHCI host and disks devices:
4305 # on=disable, auto=enable.
4306 # EXPERIMENTAL ** WARNING: auto will most likely cause system lockups/data loss.
4307 #AHCI_RUNTIME_PM_ON_AC=on
4308 #AHCI_RUNTIME_PM_ON_BAT=on
4309
4310 # Seconds of inactivity before disk is suspended.
4311 AHCI_RUNTIME_PM_TIMEOUT=15
4312
4313 # PCI Express Active State Power Management (PCIe ASPM):
4314 # default, performance, powersave.
4315 PCIE_ASPM_ON_AC=performance
4316 PCIE_ASPM_ON_BAT=powersave
4317
4318 # Radeon graphics clock speed (profile method): low, mid, high, auto, default;
4319 # auto = mid on BAT, high on AC; default = use hardware defaults.
4320 RADEON_POWER_PROFILE_ON_AC=high
4321 RADEON_POWER_PROFILE_ON_BAT=low
4322
4323 # Radeon dynamic power management method (DPM): battery, performance.
4324 RADEON_DPM_STATE_ON_AC=performance
4325 RADEON_DPM_STATE_ON_BAT=battery
4326
4327 # Radeon DPM performance level: auto, low, high; auto is recommended.
4328 RADEON_DPM_PERF_LEVEL_ON_AC=auto
4329 RADEON_DPM_PERF_LEVEL_ON_BAT=auto
4330
4331 # WiFi power saving mode: on=enable, off=disable; not supported by all adapters.
4332 WIFI_PWR_ON_AC=off
4333 WIFI_PWR_ON_BAT=on
4334
4335 # Disable wake on LAN: Y/N.
4336 WOL_DISABLE=Y
4337
4338 # Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
4339 # A value of 0 disables, >=1 enables power saving (recommended: 1).
4340 SOUND_POWER_SAVE_ON_AC=0
4341 SOUND_POWER_SAVE_ON_BAT=0
4342
4343 # Disable controller too (HDA only): Y/N.
4344 SOUND_POWER_SAVE_CONTROLLER=N
4345
4346 # Power off optical drive in UltraBay/MediaBay: 0=disable, 1=enable.
4347 # Drive can be powered on again by releasing (and reinserting) the eject lever
4348 # or by pressing the disc eject button on newer models.
4349 # Note: an UltraBay/MediaBay hard disk is never powered off.
4350 BAY_POWEROFF_ON_AC=0
4351 BAY_POWEROFF_ON_BAT=0
4352 # Optical drive device to power off (default sr0).
4353 BAY_DEVICE="sr0"
4354
4355 # Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable.
4356 RUNTIME_PM_ON_AC=on
4357 RUNTIME_PM_ON_BAT=auto
4358
4359 # Exclude PCI(e) device adresses the following list from Runtime PM
4360 # (separate with spaces). Use lspci to get the adresses (1st column).
4361 #RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
4362
4363 # Exclude PCI(e) devices assigned to the listed drivers from Runtime PM.
4364 # Default when unconfigured is "amdgpu nouveau nvidia radeon" which
4365 # prevents accidential power-on of dGPU in hybrid graphics setups.
4366 # Use "" to disable the feature completely.
4367 # Separate multiple drivers with spaces.
4368 #RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon"
4369
4370 # Set to 0 to disable, 1 to enable USB autosuspend feature.
4371 USB_AUTOSUSPEND=1
4372
4373 # Exclude listed devices from USB autosuspend (separate with spaces).
4374 # Use lsusb to get the ids.
4375 # Note: input devices (usbhid) are excluded automatically
4376 #USB_BLACKLIST="1111:2222 3333:4444"
4377
4378 # Bluetooth devices are excluded from USB autosuspend:
4379 # 0=do not exclude, 1=exclude.
4380 USB_BLACKLIST_BTUSB=0
4381
4382 # Phone devices are excluded from USB autosuspend:
4383 # 0=do not exclude, 1=exclude (enable charging).
4384 USB_BLACKLIST_PHONE=0
4385
4386 # Printers are excluded from USB autosuspend:
4387 # 0=do not exclude, 1=exclude.
4388 USB_BLACKLIST_PRINTER=1
4389
4390 # WWAN devices are excluded from USB autosuspend:
4391 # 0=do not exclude, 1=exclude.
4392 USB_BLACKLIST_WWAN=1
4393
4394 # Include listed devices into USB autosuspend even if already excluded
4395 # by the blacklists above (separate with spaces).
4396 # Use lsusb to get the ids.
4397 #USB_WHITELIST="1111:2222 3333:4444"
4398
4399 # Set to 1 to disable autosuspend before shutdown, 0 to do nothing
4400 # (workaround for USB devices that cause shutdown problems).
4401 #USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
4402
4403 # Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
4404 # on system startup: 0=disable, 1=enable.
4405 # Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
4406 # are ignored when this is enabled!
4407 #RESTORE_DEVICE_STATE_ON_STARTUP=0
4408 RESTORE_DEVICE_STATE_ON_STARTUP=0
4409
4410 # Radio devices to disable on startup: bluetooth, wifi, wwan.
4411 # Separate multiple devices with spaces.
4412 #DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
4413 DEVICES_TO_DISABLE_ON_STARTUP="bluetooth"
4414
4415 # Radio devices to enable on startup: bluetooth, wifi, wwan.
4416 # Separate multiple devices with spaces.
4417 #DEVICES_TO_ENABLE_ON_STARTUP="wifi"
4418
4419 # Radio devices to disable on shutdown: bluetooth, wifi, wwan.
4420 # (workaround for devices that are blocking shutdown).
4421 #DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
4422
4423 # Radio devices to enable on shutdown: bluetooth, wifi, wwan.
4424 # (to prevent other operating systems from missing radios).
4425 #DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
4426
4427 # Radio devices to enable on AC: bluetooth, wifi, wwan.
4428 #DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
4429
4430 # Radio devices to disable on battery: bluetooth, wifi, wwan.
4431 #DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
4432
4433 # Radio devices to disable on battery when not in use (not connected):
4434 # bluetooth, wifi, wwan.
4435 #DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
4436
4437 # Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
4438 # required). Charging starts when the remaining capacity falls below the
4439 # START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value.
4440 # Main / Internal battery (values in %)
4441 #START_CHARGE_THRESH_BAT0=75
4442 #STOP_CHARGE_THRESH_BAT0=80
4443 # Ultrabay / Slice / Replaceable battery (values in %)
4444 #START_CHARGE_THRESH_BAT1=75
4445 #STOP_CHARGE_THRESH_BAT1=80
4446
4447 # Restore charge thresholds when AC is unplugged: 0=disable, 1=enable.
4448 #RESTORE_THRESHOLDS_ON_BAT=1
4449
4450 # ------------------------------------------------------------------------------
4451 # tlp-rdw - Parameters for the radio device wizard
4452 # Possible devices: bluetooth, wifi, wwan.
4453
4454 # Hints:
4455 # - Parameters are disabled by default, remove the leading # to enable them
4456 # - Separate multiple radio devices with spaces
4457
4458 # Radio devices to disable on connect.
4459 #DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
4460 #DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
4461 #DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
4462
4463 # Radio devices to enable on disconnect.
4464 #DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
4465 #DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
4466 #DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
4467
4468 # Radio devices to enable/disable when docked.
4469 #DEVICES_TO_ENABLE_ON_DOCK=""
4470 #DEVICES_TO_DISABLE_ON_DOCK=""
4471
4472 # Radio devices to enable/disable when undocked.
4473 #DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
4474 #DEVICES_TO_DISABLE_ON_UNDOCK=""
4475 #+end_src
4476
4477 *** shemshak
4478
4479 #+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "shemshak")) "/sudo::/etc/default/tlp")
4480 # ------------------------------------------------------------------------------
4481 # tlp - Parameters for power saving
4482 # See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
4483
4484 # Hint: some features are disabled by default, remove the leading # to enable
4485 # them.
4486
4487 # Set to 0 to disable, 1 to enable TLP.
4488 TLP_ENABLE=1
4489
4490 # Operation mode when no power supply can be detected: AC, BAT.
4491 # Concerns some desktop and embedded hardware only.
4492 TLP_DEFAULT_MODE=AC
4493
4494 # Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
4495 # Hint: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC.
4496 TLP_PERSISTENT_DEFAULT=0
4497
4498 # Seconds laptop mode has to wait after the disk goes idle before doing a sync.
4499 # Non-zero value enables, zero disables laptop mode.
4500 DISK_IDLE_SECS_ON_AC=0
4501 DISK_IDLE_SECS_ON_BAT=2
4502
4503 # Dirty page values (timeouts in secs).
4504 MAX_LOST_WORK_SECS_ON_AC=15
4505 MAX_LOST_WORK_SECS_ON_BAT=60
4506
4507 # Hint: CPU parameters below are disabled by default, remove the leading #
4508 # to enable them, otherwise kernel default values are used.
4509
4510 # Select a CPU frequency scaling governor.
4511 # Intel Core i processor with intel_pstate driver:
4512 # powersave(*), performance.
4513 # Older hardware with acpi-cpufreq driver:
4514 # ondemand(*), powersave, performance, conservative, schedutil.
4515 # (*) is recommended.
4516 # Hint: use tlp-stat -p to show the active driver and available governors.
4517 # Important:
4518 # powersave for intel_pstate and ondemand for acpi-cpufreq are power
4519 # efficient for *almost all* workloads and therefore kernel and most
4520 # distributions have chosen them as defaults. If you still want to change,
4521 # you should know what you're doing! You *must* disable your distribution's
4522 # governor settings or conflicts will occur.
4523 #CPU_SCALING_GOVERNOR_ON_AC=powersave
4524 #CPU_SCALING_GOVERNOR_ON_BAT=powersave
4525
4526 # Set the min/max frequency available for the scaling governor.
4527 # Possible values strongly depend on your CPU. For available frequencies see
4528 # the output of tlp-stat -p.
4529 #CPU_SCALING_MIN_FREQ_ON_AC=0
4530 #CPU_SCALING_MAX_FREQ_ON_AC=0
4531 #CPU_SCALING_MIN_FREQ_ON_BAT=0
4532 #CPU_SCALING_MAX_FREQ_ON_BAT=0
4533
4534 # Set energy performance hints (HWP) for Intel P-state governor:
4535 # performance, balance_performance, default, balance_power, power
4536 # Values are given in order of increasing power saving.
4537 # Note: Intel Skylake or newer CPU and Kernel >= 4.10 required.
4538 CPU_HWP_ON_AC=balance_performance
4539 CPU_HWP_ON_BAT=balance_power
4540
4541 # Set Intel P-state performance: 0..100 (%).
4542 # Limit the max/min P-state to control the power dissipation of the CPU.
4543 # Values are stated as a percentage of the available performance.
4544 # Requires an Intel Core i processor with intel_pstate driver.
4545 #CPU_MIN_PERF_ON_AC=0
4546 #CPU_MAX_PERF_ON_AC=100
4547 #CPU_MIN_PERF_ON_BAT=0
4548 #CPU_MAX_PERF_ON_BAT=30
4549
4550 # Set the CPU "turbo boost" feature: 0=disable, 1=allow
4551 # Requires an Intel Core i processor.
4552 # Important:
4553 # - This may conflict with your distribution's governor settings
4554 # - A value of 1 does *not* activate boosting, it just allows it
4555 #CPU_BOOST_ON_AC=1
4556 #CPU_BOOST_ON_BAT=0
4557
4558 # Minimize number of used CPU cores/hyper-threads under light load conditions:
4559 # 0=disable, 1=enable.
4560 SCHED_POWERSAVE_ON_AC=0
4561 SCHED_POWERSAVE_ON_BAT=1
4562
4563 # Kernel NMI Watchdog:
4564 # 0=disable (default, saves power), 1=enable (for kernel debugging only).
4565 NMI_WATCHDOG=0
4566
4567 # Change CPU voltages aka "undervolting" - Kernel with PHC patch required.
4568 # Frequency voltage pairs are written to:
4569 # /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
4570 # CAUTION: only use this, if you thoroughly understand what you are doing!
4571 #PHC_CONTROLS="F:V F:V F:V F:V"
4572
4573 # Set CPU performance versus energy savings policy:
4574 # performance, balance-performance, default, balance-power, power.
4575 # Values are given in order of increasing power saving.
4576 # Requires kernel module msr and x86_energy_perf_policy from linux-tools.
4577 ENERGY_PERF_POLICY_ON_AC=performance
4578 ENERGY_PERF_POLICY_ON_BAT=balance-power
4579
4580 # Disk devices; separate multiple devices with spaces (default: sda).
4581 # Devices can be specified by disk ID also (lookup with: tlp diskid).
4582 DISK_DEVICES="sda sdb"
4583
4584 # Disk advanced power management level: 1..254, 255 (max saving, min, off).
4585 # Levels 1..127 may spin down the disk; 255 allowable on most drives.
4586 # Separate values for multiple disks with spaces. Use the special value 'keep'
4587 # to keep the hardware default for the particular disk.
4588 DISK_APM_LEVEL_ON_AC="254 254"
4589 DISK_APM_LEVEL_ON_BAT="128 128"
4590
4591 # Hard disk spin down timeout:
4592 # 0: spin down disabled
4593 # 1..240: timeouts from 5s to 20min (in units of 5s)
4594 # 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
4595 # See 'man hdparm' for details.
4596 # Separate values for multiple disks with spaces. Use the special value 'keep'
4597 # to keep the hardware default for the particular disk.
4598 #DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
4599 #DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
4600
4601 # Select IO scheduler for the disk devices: cfq, deadline, noop (Default: cfq).
4602 # Separate values for multiple disks with spaces. Use the special value 'keep'
4603 # to keep the kernel default scheduler for the particular disk.
4604 #DISK_IOSCHED="cfq cfq"
4605
4606 # AHCI link power management (ALPM) for disk devices:
4607 # min_power, med_power_with_dipm(*), medium_power, max_performance.
4608 # (*) Kernel >= 4.15 required, then recommended.
4609 # Multiple values separated with spaces are tried sequentially until success.
4610 SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
4611 SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
4612
4613 # Exclude host devices from AHCI link power management.
4614 # Separate multiple hosts with spaces.
4615 #SATA_LINKPWR_BLACKLIST="host1"
4616
4617 # Runtime Power Management for AHCI host and disks devices:
4618 # on=disable, auto=enable.
4619 # EXPERIMENTAL ** WARNING: auto will most likely cause system lockups/data loss.
4620 #AHCI_RUNTIME_PM_ON_AC=on
4621 #AHCI_RUNTIME_PM_ON_BAT=on
4622
4623 # Seconds of inactivity before disk is suspended.
4624 AHCI_RUNTIME_PM_TIMEOUT=15
4625
4626 # PCI Express Active State Power Management (PCIe ASPM):
4627 # default, performance, powersave.
4628 PCIE_ASPM_ON_AC=performance
4629 PCIE_ASPM_ON_BAT=powersave
4630
4631 # Radeon graphics clock speed (profile method): low, mid, high, auto, default;
4632 # auto = mid on BAT, high on AC; default = use hardware defaults.
4633 RADEON_POWER_PROFILE_ON_AC=high
4634 RADEON_POWER_PROFILE_ON_BAT=low
4635
4636 # Radeon dynamic power management method (DPM): battery, performance.
4637 RADEON_DPM_STATE_ON_AC=performance
4638 RADEON_DPM_STATE_ON_BAT=battery
4639
4640 # Radeon DPM performance level: auto, low, high; auto is recommended.
4641 RADEON_DPM_PERF_LEVEL_ON_AC=auto
4642 RADEON_DPM_PERF_LEVEL_ON_BAT=auto
4643
4644 # WiFi power saving mode: on=enable, off=disable; not supported by all adapters.
4645 WIFI_PWR_ON_AC=off
4646 WIFI_PWR_ON_BAT=on
4647
4648 # Disable wake on LAN: Y/N.
4649 WOL_DISABLE=Y
4650
4651 # Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
4652 # A value of 0 disables, >=1 enables power saving (recommended: 1).
4653 SOUND_POWER_SAVE_ON_AC=0
4654 SOUND_POWER_SAVE_ON_BAT=0
4655
4656 # Disable controller too (HDA only): Y/N.
4657 SOUND_POWER_SAVE_CONTROLLER=N
4658
4659 # Power off optical drive in UltraBay/MediaBay: 0=disable, 1=enable.
4660 # Drive can be powered on again by releasing (and reinserting) the eject lever
4661 # or by pressing the disc eject button on newer models.
4662 # Note: an UltraBay/MediaBay hard disk is never powered off.
4663 BAY_POWEROFF_ON_AC=0
4664 BAY_POWEROFF_ON_BAT=0
4665 # Optical drive device to power off (default sr0).
4666 BAY_DEVICE="sr0"
4667
4668 # Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable.
4669 RUNTIME_PM_ON_AC=on
4670 RUNTIME_PM_ON_BAT=auto
4671
4672 # Exclude PCI(e) device adresses the following list from Runtime PM
4673 # (separate with spaces). Use lspci to get the adresses (1st column).
4674 #RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
4675 RUNTIME_PM_BLACKLIST="01:00.0"
4676
4677 # Exclude PCI(e) devices assigned to the listed drivers from Runtime PM.
4678 # Default when unconfigured is "amdgpu nouveau nvidia radeon" which
4679 # prevents accidential power-on of dGPU in hybrid graphics setups.
4680 # Use "" to disable the feature completely.
4681 # Separate multiple drivers with spaces.
4682 #RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon"
4683
4684 # Set to 0 to disable, 1 to enable USB autosuspend feature.
4685 USB_AUTOSUSPEND=1
4686
4687 # Exclude listed devices from USB autosuspend (separate with spaces).
4688 # Use lsusb to get the ids.
4689 # Note: input devices (usbhid) are excluded automatically
4690 #USB_BLACKLIST="1111:2222 3333:4444"
4691
4692 # Bluetooth devices are excluded from USB autosuspend:
4693 # 0=do not exclude, 1=exclude.
4694 USB_BLACKLIST_BTUSB=0
4695
4696 # Phone devices are excluded from USB autosuspend:
4697 # 0=do not exclude, 1=exclude (enable charging).
4698 USB_BLACKLIST_PHONE=0
4699
4700 # Printers are excluded from USB autosuspend:
4701 # 0=do not exclude, 1=exclude.
4702 USB_BLACKLIST_PRINTER=1
4703
4704 # WWAN devices are excluded from USB autosuspend:
4705 # 0=do not exclude, 1=exclude.
4706 USB_BLACKLIST_WWAN=1
4707
4708 # Include listed devices into USB autosuspend even if already excluded
4709 # by the blacklists above (separate with spaces).
4710 # Use lsusb to get the ids.
4711 #USB_WHITELIST="1111:2222 3333:4444"
4712
4713 # Set to 1 to disable autosuspend before shutdown, 0 to do nothing
4714 # (workaround for USB devices that cause shutdown problems).
4715 #USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
4716
4717 # Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
4718 # on system startup: 0=disable, 1=enable.
4719 # Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
4720 # are ignored when this is enabled!
4721 #RESTORE_DEVICE_STATE_ON_STARTUP=0
4722 RESTORE_DEVICE_STATE_ON_STARTUP=1
4723
4724 # Radio devices to disable on startup: bluetooth, wifi, wwan.
4725 # Separate multiple devices with spaces.
4726 #DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
4727
4728 # Radio devices to enable on startup: bluetooth, wifi, wwan.
4729 # Separate multiple devices with spaces.
4730 #DEVICES_TO_ENABLE_ON_STARTUP="wifi"
4731
4732 # Radio devices to disable on shutdown: bluetooth, wifi, wwan.
4733 # (workaround for devices that are blocking shutdown).
4734 #DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
4735
4736 # Radio devices to enable on shutdown: bluetooth, wifi, wwan.
4737 # (to prevent other operating systems from missing radios).
4738 #DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
4739
4740 # Radio devices to enable on AC: bluetooth, wifi, wwan.
4741 #DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
4742
4743 # Radio devices to disable on battery: bluetooth, wifi, wwan.
4744 #DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
4745
4746 # Radio devices to disable on battery when not in use (not connected):
4747 # bluetooth, wifi, wwan.
4748 #DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
4749
4750 # Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
4751 # required). Charging starts when the remaining capacity falls below the
4752 # START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value.
4753 # Main / Internal battery (values in %)
4754 #START_CHARGE_THRESH_BAT0=75
4755 #STOP_CHARGE_THRESH_BAT0=80
4756 # Ultrabay / Slice / Replaceable battery (values in %)
4757 #START_CHARGE_THRESH_BAT1=75
4758 #STOP_CHARGE_THRESH_BAT1=80
4759
4760 # Restore charge thresholds when AC is unplugged: 0=disable, 1=enable.
4761 #RESTORE_THRESHOLDS_ON_BAT=1
4762
4763 # ------------------------------------------------------------------------------
4764 # tlp-rdw - Parameters for the radio device wizard
4765 # Possible devices: bluetooth, wifi, wwan.
4766
4767 # Hints:
4768 # - Parameters are disabled by default, remove the leading # to enable them
4769 # - Separate multiple radio devices with spaces
4770
4771 # Radio devices to disable on connect.
4772 #DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
4773 #DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
4774 #DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
4775
4776 # Radio devices to enable on disconnect.
4777 #DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
4778 #DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
4779 #DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
4780
4781 # Radio devices to enable/disable when docked.
4782 #DEVICES_TO_ENABLE_ON_DOCK=""
4783 #DEVICES_TO_DISABLE_ON_DOCK=""
4784
4785 # Radio devices to enable/disable when undocked.
4786 #DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
4787 #DEVICES_TO_DISABLE_ON_UNDOCK=""
4788 #+end_src
4789
4790 ** X
4791
4792 *** xprofile
4793 :PROPERTIES:
4794 :header-args+: :tangle ~/.xprofile
4795 :END:
4796
4797 =~/.xprofile= is similar in style to =~/.xinitrc=, but on the
4798 contrary, it's automatically sourced by LightDM, my display manager of
4799 choice.
4800
4801 #+begin_src sh :tangle no
4802 xset -b # disable bell
4803 xset r rate 200 45 # repeat delay (ms) and rate (repeats/sec)
4804
4805 # setxkbmap -option compose:ralt
4806
4807 setxkbmap -option ctrl:nocaps # turn capslock into control
4808 setxkbmap -option altwin:swap_alt_win # swap alt and super
4809
4810 if [ $(hostname) = "plasma" ]
4811 then
4812 setxkbmap -option ctrl:rctrl_ralt # turn right control into right alt
4813 fi
4814
4815 if [ $(hostname) = "enigma" ]
4816 then
4817 xmodmap -e "keycode 135 = Alt_R" # remap menu key to alt
4818 fi
4819
4820 light -Scrs "intel_backlight" 2
4821
4822 source $HOME/.zprofile
4823
4824 export _JAVA_AWT_WM_NONREPARENTING=1
4825 export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
4826
4827 if [ $(hostname) = "plasma" ]
4828 then
4829 unlock-def-gk.py &
4830 fi
4831
4832 bspwm &
4833 #+end_src
4834
4835 *** X resources
4836
4837 **** Xresources
4838 :PROPERTIES:
4839 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources")
4840 :END:
4841
4842 #+begin_src conf-xdefaults
4843 #include ".Xresources.d/fonts"
4844 ! #include ".Xresources.d/colors"
4845 #include ".Xresources.d/emacs"
4846 #include ".Xresources.d/rxvt-unicode"
4847 #+end_src
4848
4849 **** Xresources.d
4850
4851 ***** fonts
4852 :PROPERTIES:
4853 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/fonts")
4854 :END:
4855
4856 #+begin_src conf-xdefaults
4857 Xft.lcdfilter: lcddefault
4858 Xft.antialias: true
4859 Xft.autohint: 0
4860 Xft.hinting: true
4861 Xft.hintstyle: hintslight
4862 ! Xft.hintstyle: hintfull
4863 Xft.rgba: rgb
4864 Xft.dpi: 96
4865 #+end_src
4866
4867 ***** colors
4868 :PROPERTIES:
4869 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/colors")
4870 :END:
4871
4872 #+begin_src conf-xdefaults :tangle no
4873 #include "gruvbox-light.xresources"
4874 ! #include "gruvbox-dark.xresources"
4875 #include "gruvbox-urxvt256.xresources"
4876 #+end_src
4877
4878 #+begin_src conf-xdefaults :tangle no
4879 ! -----------------------------------------------------------------------------
4880 ! File: gruvbox-light.xresources
4881 ! Description: Retro groove colorscheme generalized
4882 ! Author: morhetz <morhetz@gmail.com>
4883 ! Source: https://github.com/morhetz/gruvbox-generalized
4884 ! Last Modified: 6 Sep 2014
4885 ! -----------------------------------------------------------------------------
4886
4887 ! hard contrast: *background: #f9f5d7
4888 *background: #fbf1c7
4889 ! soft contrast: *background: #f2e5bc
4890 *foreground: #3c3836
4891 ! Black + DarkGrey
4892 *color0: #fdf4c1
4893 *color8: #928374
4894 ! DarkRed + Red
4895 *color1: #cc241d
4896 *color9: #9d0006
4897 ! DarkGreen + Green
4898 *color2: #98971a
4899 *color10: #79740e
4900 ! DarkYellow + Yellow
4901 *color3: #d79921
4902 *color11: #b57614
4903 ! DarkBlue + Blue
4904 *color4: #458588
4905 *color12: #076678
4906 ! DarkMagenta + Magenta
4907 *color5: #b16286
4908 *color13: #8f3f71
4909 ! DarkCyan + Cyan
4910 *color6: #689d6a
4911 *color14: #427b58
4912 ! LightGrey + White
4913 *color7: #7c6f64
4914 *color15: #3c3836
4915 #+end_src
4916
4917 #+begin_src conf-xdefaults :tangle no
4918 ! -----------------------------------------------------------------------------
4919 ! File: gruvbox-dark.xresources
4920 ! Description: Retro groove colorscheme generalized
4921 ! Author: morhetz <morhetz@gmail.com>
4922 ! Source: https://github.com/morhetz/gruvbox-generalized
4923 ! Last Modified: 6 Sep 2014
4924 ! -----------------------------------------------------------------------------
4925
4926 ! hard contrast: *background: #1d2021
4927 *background: #282828
4928 ! soft contrast: *background: #32302f
4929 *foreground: #ebdbb2
4930 ! Black + DarkGrey
4931 *color0: #282828
4932 *color8: #928374
4933 ! DarkRed + Red
4934 *color1: #cc241d
4935 *color9: #fb4934
4936 ! DarkGreen + Green
4937 *color2: #98971a
4938 *color10: #b8bb26
4939 ! DarkYellow + Yellow
4940 *color3: #d79921
4941 *color11: #fabd2f
4942 ! DarkBlue + Blue
4943 *color4: #458588
4944 *color12: #83a598
4945 ! DarkMagenta + Magenta
4946 *color5: #b16286
4947 *color13: #d3869b
4948 ! DarkCyan + Cyan
4949 *color6: #689d6a
4950 *color14: #8ec07c
4951 ! LightGrey + White
4952 *color7: #a89984
4953 *color15: #ebdbb2
4954 #+end_src
4955
4956 #+begin_src conf-xdefaults :tangle no
4957 ! -----------------------------------------------------------------------------
4958 ! File: gruvbox-urxvt256.xresources
4959 ! Description: Retro groove colorscheme generalized
4960 ! Author: morhetz <morhetz@gmail.com>
4961 ! Source: https://github.com/morhetz/gruvbox-generalized
4962 ! Last Modified: 13 Dec 2013
4963 ! -----------------------------------------------------------------------------
4964
4965 URxvt.color24: #076678
4966 URxvt.color66: #427b58
4967 URxvt.color88: #9d0006
4968 URxvt.color96: #8f3f71
4969 URxvt.color100: #79740e
4970 URxvt.color108: #8ec07c
4971 URxvt.color109: #83a598
4972 URxvt.color130: #af3a03
4973 URxvt.color136: #b57614
4974 URxvt.color142: #b8bb26
4975 URxvt.color167: #fb4934
4976 URxvt.color175: #d3869b
4977 URxvt.color208: #fe8019
4978 URxvt.color214: #fabd2f
4979 URxvt.color223: #ebdbb2
4980 URxvt.color228: #f2e5bc
4981 URxvt.color229: #fbf1c7
4982 URxvt.color230: #f9f5d7
4983 URxvt.color234: #1d2021
4984 URxvt.color235: #282828
4985 URxvt.color236: #32302f
4986 URxvt.color237: #3c3836
4987 URxvt.color239: #504945
4988 URxvt.color241: #665c54
4989 URxvt.color243: #7c6f64
4990 URxvt.color244: #928374
4991 URxvt.color245: #928374
4992 URxvt.color246: #a89984
4993 URxvt.color248: #bdae93
4994 URxvt.color250: #d5c4a1
4995 #+end_src
4996
4997 ***** emacs
4998 :PROPERTIES:
4999 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/emacs")
5000 :END:
5001
5002 #+begin_src conf-xdefaults
5003 Emacs.menuBar: off
5004 Emacs.toolBar: off
5005 Emacs.verticalScrollBars: off
5006 Emacs.cursorBlink: off
5007 Emacs.FontBackend: xft,x
5008 ! Emacs.font: Ubuntu Mono-12
5009 ! Emacs.font: Triplicate T4C-11
5010 ! Emacs.font: Ubuntu Mono-10.5
5011 ! Emacs.font: Ubuntu Mono-12
5012 ! Emacs.font: Iosevka-11
5013
5014 ! Emacs.font: Fira Mono:size=15
5015 ! Emacs.font: DejaVu Sans Mono:size=15
5016 ! Emacs.font: Inconsolata:size=17
5017 ! Emacs.font: Inconsolata:size=16
5018 ! Emacs.font: Inconsolata LGC:size=14
5019 ! Emacs.font: Source Code Pro Medium-10.5
5020 Emacs.font: Source Code Pro:size=14
5021 ! Emacs.font: Ubuntu Mono:size=16
5022 ! Emacs.font: Iosevka:size=16
5023 #+end_src
5024
5025 ***** rxvt-unicode
5026 :PROPERTIES:
5027 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/rxvt-unicode")
5028 :END:
5029
5030 #+begin_src conf-xdefaults
5031 ! Font
5032 URxvt.font: xft:source code pro:pixelsize=14:antialias=true:hinting=true, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true
5033 URxvt.boldFont: xft:source code pro semibold:pixelsize=14:antialias=true:hinting=true:bold, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bold
5034 URxvt.italicFont: xft:source code pro italic:pixelsize=14:antialias=true:hinting=true:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:italic
5035 URxvt.bolditalicFont: xft:source code pro semibold italic:pixelsize=14:antialias=true:hinting=true:bold:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bolditalic
5036
5037 URxvt.xftAntialias: true
5038 URxvt.letterSpace: 0
5039
5040 URxvt.depth: 0
5041 URxvt.loginShell: true
5042 URxvt.saveLines: 100000
5043 URxvt.internalBorder: 3
5044 URxvt.lineSpace: 0
5045 URxvt.scrollBar: false
5046 URxvt.scrollStyle: rxvt
5047 URxvt*scrollTtyOutput: false
5048 URxvt*scrollWithBuffer: true
5049 URxvt*scrollTtyKeypress: true
5050 URxvt.keysym.Shift-Up: command:\033]720;1\007
5051 URxvt.keysym.Shift-Down: command:\033]721;1\007
5052
5053 URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
5054 URxvt.url-select.launcher: firefox
5055 URxvt.url-select.underline: true
5056 URxvt.keysym.M-u: perl:url-select:select_next
5057 URxvt.keysym.M-Escape: perl:keyboard-select:activate
5058 URxvt.keysym.M-s: perl:keyboard-select:search
5059 URxvt.url-launcher: /usr/bin/firefox
5060 URxvt.matcher.button: 1
5061 URxvt.iso14755: false
5062 URxvt.iso14755_53: false
5063 URxvt.keysym.M-c: perl:clipboard:copy
5064 URxvt.keysym.M-v: perl:clipboard:paste
5065 URxvt.keysym.C-A-V: perl:clipboard:paste_escaped
5066 URxvt.keysym.C-Up: font-size:increase
5067 URxvt.keysym.C-Down: font-size:decrease
5068 URxvt.keysym.C-S-Up: font-size:incglobal
5069 URxvt.keysym.C-S-Down: font-size:decglobal
5070 URxvt.keysym.C-equal: font-size:reset
5071 !URxvt.keysym.C-question: font-size:show
5072
5073 URxvt.iconFile: /usr/share/icons/Paper/48x48/apps/utilities-terminal.png
5074
5075 !urxvt*foreground: white
5076 !urxvt*background: black
5077
5078 !*color0: #2E3436
5079 !*color1: #a40000
5080 !*color2: #4E9A06
5081 !*color3: #C4A000
5082 !*color4: #3465A4
5083 !*color5: #75507B
5084 !*color6: #ce5c00
5085 !*color7: #babdb9
5086 !*color8: #555753
5087 !*color9: #EF2929
5088 !*color10: #8AE234
5089 !*color11: #FCE94F
5090 !*color12: #729FCF
5091 !*color13: #AD7FA8
5092 !*color14: #fcaf3e
5093 !*color15: #EEEEEC
5094
5095 !URxvt.foreground: #C8C8C8
5096 !URxvt.background: #FFFFFF
5097
5098 !! black
5099 !*color0: #2E3436
5100 !*color8: #555753
5101 !! red
5102 !*color1: #a40000
5103 !*color9: #EF2929
5104 !! green
5105 !*color2: #4E9A06
5106 !*color10: #8AE234
5107 !! yellow
5108 !*color3: #C4A000
5109 !*color11: #FCE94F
5110 !! blue
5111 !*color4: #3465A4
5112 !*color12: #729FCF
5113 !! purple
5114 !*color5: #75507B
5115 !*color13: #AD7FA8
5116 !! orange (replaces cyan)
5117 !*color6: #ce5c00
5118 !*color14: #fcaf3e
5119 !! white
5120 !*color7: #babdb9
5121 !*color15: #EEEEEC
5122
5123 ! Tango colour theme for rxvt-unicode
5124 URxvt.background: #FFFFFF
5125 URxvt.foreground: #000000
5126
5127 ! Black
5128 URxvt.color0: #2E3436
5129 URxvt.color8: #757773
5130
5131 ! Red
5132 URxvt.color1: #CC0000
5133 URxvt.color9: #EF2929
5134
5135 ! Green
5136 URxvt.color2: #4E9A06
5137 URxvt.color10: #8AE234
5138
5139 ! Yellow
5140 URxvt.color3: #C4A000
5141 URxvt.color11: #FCE94F
5142
5143 ! Blue
5144 URxvt.color4: #3465A4
5145 URxvt.color12: #729FCF
5146
5147 ! Magenta
5148 URxvt.color5: #75507B
5149 URxvt.color13: #AD7FA8
5150
5151 !! Cyan
5152 !URxvt.color6: #06989A
5153 !URxvt.color14: #34E2E2
5154 ! orange (replaces cyan)
5155 ,*color6: #ce5c00
5156 ,*color14: #fcaf3e
5157
5158 ! White
5159 URxvt.color7: #D3D7CF
5160 URxvt.color15: #EEEEEC
5161 #+end_src
5162
5163 *** xkb us_ab keyboard layout
5164
5165 #+begin_src conf :tangle "/sudo::/usr/share/X11/xkb/symbols/us_ab" :comments none
5166 default partial alphanumeric_keys
5167 xkb_symbols "us_ab" {
5168 include "us(basic)"
5169 name[Group1]= "English (US)(aminb)";
5170
5171 key <MENU> { [ Alt_R ] };
5172 };
5173 #+end_src
5174
5175 ** XDG
5176 :PROPERTIES:
5177 :header-args+: :tangle ~/.config/user-dirs.dirs
5178 :END:
5179
5180 #+begin_src conf
5181 XDG_DESKTOP_DIR="$HOME/Desktop"
5182 XDG_DOCUMENTS_DIR="$HOME/usr/docs"
5183 XDG_DOWNLOAD_DIR="$HOME/usr/dls"
5184 XDG_MUSIC_DIR="$HOME/usr/music"
5185 XDG_PICTURES_DIR="$HOME/usr/pics"
5186 XDG_PUBLICSHARE_DIR="$HOME/usr/Public"
5187 XDG_TEMPLATES_DIR="$HOME/usr/Templates"
5188 XDG_VIDEOS_DIR="$HOME/usr/vids"
5189 #+end_src
5190
5191 ** Zathura
5192 :PROPERTIES:
5193 :header-args+: :tangle ~/.config/zathura/zathurarc
5194 :END:
5195
5196 #+begin_src conf
5197 set smooth-scroll true
5198 set selection-clipboard clipboard
5199 set zoom-step 05
5200 set default-bg "#272727"
5201 set statusbar-bg "#272727"
5202 set inputbar-bg "#373737"
5203 #+end_src
5204
5205 ** Zsh
5206
5207 My zsh setup is built on [[https://github.com/zimfw/zimfw][Zim]]. Further, my zshrc references [[https://github.com/junegunn/fzf][fzf]],
5208 [[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]], and [[https://github.com/hlissner/zsh-autopair][zsh-autopair]]; so be sure to have them
5209 installed.
5210
5211 *** zimrc
5212 :PROPERTIES:
5213 :header-args+: :tangle ~/.zimrc
5214 :END:
5215
5216 #+begin_src sh
5217
5218
5219 #################
5220 # CORE SETTINGS #
5221 #################
5222
5223 #
5224 # Zim settings
5225 #
5226
5227 # Select what modules you would like enabled.
5228 # The second line of modules may depend on options set by modules in the first
5229 # line. These dependencies are noted on the respective module's README.md.
5230 zmodules=(directory environment git git-info history input ssh utility custom \
5231 syntax-highlighting history-substring-search prompt completion)
5232
5233
5234 ###################
5235 # MODULE SETTINGS #
5236 ###################
5237
5238 #
5239 # Prompt
5240 #
5241
5242 # Set your desired prompt here
5243 zprompt_theme='pure'
5244 #PURE_PROMPT_SYMBOL=λ
5245 #PURE_PROMPT_SYMBOL=δ
5246 PURE_PROMPT_SYMBOL=➜
5247
5248 #
5249 # Completion
5250 #
5251
5252 # set an optional host-specific filename for the completion cache file
5253 # if none is provided, the default '.zcompdump' is used.
5254 #zcompdump_file=".zcompdump-${HOST}-${ZSH_VERSION}"
5255
5256 #
5257 # Utility
5258 #
5259
5260 # Uncomment to enable command correction prompts
5261 # See: http://zsh.sourceforge.net/Doc/Release/Options.html#Input_002fOutput
5262 setopt CORRECT
5263
5264 #
5265 # Environment
5266 #
5267
5268 # Set the string below to the desired terminal title format string.
5269 # The terminal title is redrawn upon directory change, however, variables like
5270 # ${PWD} are only evaluated once. Use prompt expansion strings for dynamic data:
5271 # http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
5272 # The example below uses the following format: 'username@host:/current/directory'
5273 ztermtitle='%n@%m:%~'
5274
5275 #
5276 # Input
5277 #
5278
5279 # Uncomment to enable double-dot expansion.
5280 # This appends '../' to your input for each '.' you type after an initial '..'
5281 #zdouble_dot_expand='true'
5282
5283 #
5284 # Syntax-Highlighting
5285 #
5286
5287 # This determines what highlighters will be used with the syntax-highlighting module.
5288 # Documentation of the highlighters can be found here:
5289 # https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
5290 # For (u)rxvt, termite and gnome-terminal users,
5291 # removing the 'cursor' highlighter will fix the disappearing cursor problem
5292 #zhighlighters=(main brackets cursor)
5293 zhighlighters=(main brackets pattern)
5294
5295
5296 #
5297 # SSH
5298 #
5299
5300 # Load these ssh identities with the ssh module
5301 zssh_ids=(id_ed25519_bandali)
5302
5303
5304 #
5305 # Pacman
5306 #
5307
5308 # Set (optional) pacman front-end.
5309 zpacman_frontend='yay'
5310
5311 # Load any helper scripts as defined here
5312 #zpacman_helper=(aur)
5313 #+end_src
5314
5315 *** zlogin
5316 :PROPERTIES:
5317 :header-args+: :tangle ~/.zlogin
5318 :END:
5319
5320 #+begin_src sh
5321
5322
5323 #
5324 # User configuration sourced by login shells
5325 #
5326
5327 # Initialize zim
5328 [[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh
5329 #+end_src
5330
5331 *** zprofile
5332 :PROPERTIES:
5333 :header-args+: :tangle ~/.zprofile
5334 :END:
5335
5336 #+begin_src sh
5337 #PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
5338 #PATH=$HOME/.gem/ruby/2.4.0/bin:$PATH
5339 export PATH=$HOME/.local/bin:$HOME/.cabal/bin:$HOME/.cargo/bin:$HOME/.elan/bin:$PATH
5340 export XDG_CONFIG_HOME=$HOME/.config
5341 export XDG_DATA_HOME=$HOME/.local/share
5342 export XDG_DATA_DIRS=/usr/local/share:/usr/share
5343 export MAILDIR="$HOME/mail"
5344 export CVS_RSH=ssh
5345 #export MATHMODELS=$HOME/src/eiffel/mathmodels
5346 #export RUST_SRC_PATH=~/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
5347 #export PATH=$PATH:$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/
5348
5349 # Eiffel2Java stuff
5350 #export JAVA_HOME=/usr/lib/jvm/default
5351 #export CPATH=$CPATH:"$JAVA_HOME/include:$JAVA_HOME/include/linux"
5352 #export LIBRARY_PATH=$LIBRARY_PATH:"$JAVA_HOME/jre/lib/amd64/server"
5353 #export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$JAVA_HOME/jre/lib/amd64/server"
5354
5355 #export PATH="$HOME/usr/build/pvs:$PATH"
5356 #export SBCLISP_HOME=/usr/share/sbcl-source
5357 #export PVS_LIBRARY_PATH="$HOME/usr/build/pvs/nasalib"
5358
5359 export MOZ_USE_XINPUT2=1 # precise scrolling in firefox
5360
5361 #export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
5362 #export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
5363
5364 export NIXPKGS=$HOME/src/git/nixpkgs
5365
5366 if [ -e /home/amin/.nix-profile/etc/profile.d/nix.sh ]; then . /home/amin/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
5367 #+end_src
5368
5369 *** zshenv
5370 :PROPERTIES:
5371 :header-args+: :tangle ~/.zshenv
5372 :END:
5373
5374 #+begin_src sh
5375 # Ensure that a non-login, non-interactive shell has a defined environment.
5376 if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
5377 source "${ZDOTDIR:-$HOME}/.zprofile"
5378 fi
5379 #+end_src
5380
5381 *** zshrc
5382 :PROPERTIES:
5383 :header-args+: :tangle ~/.zshrc
5384 :END:
5385
5386 #+begin_src sh
5387 # Bash-like navigation
5388 #export WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
5389 #export WORDCHARS='*?-[]~=&;!#$%^(){}<>'
5390 export WORDCHARS='*?[]~=&;!#$%^(){}<>'
5391 #ZLE_SPACE_SUFFIX_CHARS=$'|&'
5392
5393 #disable -r time # disable shell reserved word
5394 #alias time='time -p' # -p for POSIX output
5395
5396 # rehash if last command was pacaur or pacman
5397 # (so that zsh picks up changes in $PATH immediately)
5398 TRAPUSR1() { rehash}; precmd() { [[ $history[$[ HISTCMD -1 ]] == *(pacaur|pacman)* ]] && killall -USR1 zsh }
5399
5400 #
5401 # User configuration sourced by interactive shells
5402 #
5403
5404 # Change default zim location
5405 export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
5406
5407 # Start zim
5408 [[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh
5409
5410 ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
5411 #ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'
5412
5413 setopt globdots
5414
5415 source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
5416 # source ~/.zsh/zsh-autopair/autopair.zsh
5417
5418
5419 ### fzf ###
5420
5421 source /usr/share/fzf/key-bindings.zsh
5422 source /usr/share/fzf/completion.zsh
5423
5424 # Accept history selection instead of putting it on
5425 # the command line
5426 fzf-history-widget-accept() {
5427 fzf-history-widget
5428 zle accept-line
5429 }
5430 #zle -N fzf-history-widget-accept
5431 #bindkey '^R' fzf-history-widget-accept
5432
5433 # alt+c preview
5434 export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
5435
5436 ### fzf ###
5437
5438
5439 # aliases
5440 alias mpv="mpv --ytdl-format mp4"
5441 alias mv="mv -iv"
5442 alias cp="cp -iv"
5443 alias scl=systemctl
5444 alias jcl=journalctl
5445 alias m="mbsync -a"
5446 alias best="youtube-dl -f best"
5447 alias sd="ssh deb"
5448 alias sf="ssh fp"
5449 alias sn="ssh nix"
5450
5451 aur() {
5452 cd ~/usr/build
5453 git clone https://aur.archlinux.org/${1}.git
5454 cd ${1}
5455 }
5456
5457 # i-beam cursor
5458 echo -e "\033[5 q"
5459 #echo -e "\033[6 q"
5460 #+end_src
5461
5462 * Scripts
5463
5464 This section contains various useful scripts and the ones used by the
5465 programs above. For instance, =toggle-tablet= for switching to and
5466 from tablet mode on my X220T, =toggle-presentation-mode= for toggling
5467 Xfce's presentation mode which keeps the screen awake, and
5468 =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
5469 exact brightness value.
5470
5471 ** battery-percentage-time
5472 :PROPERTIES:
5473 :header-args+: :tangle ~/.local/bin/battery-percentage-time :shebang "#!/bin/sh"
5474 :END:
5475
5476 #+begin_src sh :tangle no
5477 dbus_send() {
5478 label=$1
5479 dbus-send --print-reply=literal --system \
5480 --dest=org.freedesktop.UPower \
5481 /org/freedesktop/UPower/devices/battery_BAT0 \
5482 org.freedesktop.DBus.Properties.Get \
5483 string:org.freedesktop.UPower.Device \
5484 string:"${label}" | awk '{print $3}'
5485 }
5486
5487 perc=$(dbus_send 'Percentage')
5488 state=$(dbus_send 'State')
5489
5490 if [ "$state" -eq 2 ]; then # Discharging
5491 secs=$(dbus_send 'TimeToEmpty')
5492 elif [ "$state" -eq 1 ]; then # Charging
5493 secs=$(dbus_send 'TimeToFull')
5494 fi
5495
5496 printf '%s%%%%%2dh%02dm \n' "$perc" $((secs / 3600)) $((secs % 3600 / 60))
5497 #+end_src
5498
5499 ** my-i3status.py
5500 :PROPERTIES:
5501 :header-args+: :tangle ~/.local/bin/my-i3status.py :shebang "#!/usr/bin/env python2"
5502 :END:
5503
5504 #+begin_src python :comments none
5505 # -*- coding: utf-8 -*-
5506
5507 # This script is a simple wrapper which prefixes each i3status line with custom
5508 # information. It is based on:
5509 # https://github.com/i3/i3status/blob/master/contrib/wrapper.py
5510 #
5511 # In ~/.i3status.conf, add the following line:
5512 # output_format = "i3bar"
5513 # in the 'general' section.
5514 # Then, in ~/.config/i3/config or ~/.config/sway/config add:
5515 # status_command i3status | my-i3status.py
5516 # in the 'bar' section. Make sure my-i3status.py is in $PATH.
5517 #
5518 # © 2012 Valentin Haenel <valentin.haenel@gmx.de>
5519 # © 2018 Amin Bandali <bandali@gnu.org>
5520 #
5521 # This program is free software. It comes without any warranty, to the extent
5522 # permitted by applicable law. You can redistribute it and/or modify it under
5523 # the terms of the Do What The Fuck You Want To Public License (WTFPL), Version
5524 # 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
5525 # details.
5526
5527 import sys
5528 import json
5529 import os
5530
5531 def get_nosleep():
5532 """ Return true if ~/.nosleep exists. """
5533 return os.path.isfile(os.path.expanduser("~/.nosleep"))
5534
5535 def print_line(message):
5536 """ Non-buffered printing to stdout. """
5537 sys.stdout.write(message + '\n')
5538 sys.stdout.flush()
5539
5540 def read_line():
5541 """ Interrupted respecting reader for stdin. """
5542 # try reading a line, removing any extra whitespace
5543 try:
5544 line = sys.stdin.readline().strip()
5545 # i3status sends EOF, or an empty line
5546 if not line:
5547 sys.exit(3)
5548 return line
5549 # exit on ctrl-c
5550 except KeyboardInterrupt:
5551 sys.exit()
5552
5553 if __name__ == '__main__':
5554 # Skip the first line which contains the version header.
5555 print_line(read_line())
5556
5557 # The second line contains the start of the infinite array.
5558 print_line(read_line())
5559
5560 while True:
5561 line, prefix = read_line(), ''
5562 # ignore comma at start of lines
5563 if line.startswith(','):
5564 line, prefix = line[1:], ','
5565
5566 if get_nosleep():
5567 j = json.loads(line)
5568 # insert information into the start of the json, but could be anywhere
5569 j.insert(0, {'full_text' : '🖵 ', 'name' : 'nosleep'})
5570 # and echo back new encoded json
5571 print_line(prefix+json.dumps(j))
5572 else:
5573 print_line(prefix+line)
5574 #+end_src
5575
5576 ** rofi-light
5577 :PROPERTIES:
5578 :header-args+: :tangle ~/.local/bin/rofi-light :shebang "#!/bin/bash"
5579 :END:
5580
5581 #+begin_src bash
5582 cur=$(light -G)
5583 val=$(rofi -dmenu -mesg "light $cur" -p "light -S " -l 0 -width 12)
5584 light -S $val
5585 #+end_src
5586
5587 ** s (run sway)
5588 :PROPERTIES:
5589 :header-args+: :tangle ~/.local/bin/s :shebang "#!/bin/bash"
5590 :END:
5591
5592 #+begin_src bash
5593 export _JAVA_AWT_WM_NONREPARENTING=1
5594 export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
5595 light -Nr 2
5596 source $HOME/.zprofile
5597 sway
5598 #+end_src
5599
5600 ** sway-ws-util
5601 :PROPERTIES:
5602 :header-args+: :tangle ~/.local/bin/sway-ws-util :shebang "#!/bin/bash"
5603 :END:
5604
5605 #+begin_src bash
5606 curr_ws=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true).name')
5607 [[ $curr_ws -eq 1 ]] && prev_ws=10 || prev_ws=$((curr_ws-1))
5608 [[ $curr_ws -eq 10 ]] && next_ws=1 || next_ws=$((curr_ws+1))
5609 dest_ws=-1
5610 op=-1
5611
5612 if [ "$1" = "switch" ] || [ "$1" = "move" ]; then
5613 op="$1"
5614 if [ "$2" = "prev" ]; then
5615 dest_ws="$prev_ws"
5616 elif [ "$2" = "next" ]; then
5617 dest_ws="$next_ws"
5618 else
5619 echo "Usage: $0 $1 {prev|next} [follow]"
5620 exit 1
5621 fi
5622 else
5623 echo "Usage: $0 {switch|move} {prev|next} [follow]"
5624 exit 1
5625 fi
5626
5627 if [ "$op" = "switch" ]; then
5628 sway workspace "$dest_ws"
5629 elif [ "$op" = "move" ]; then
5630 sway move container to workspace "$dest_ws"
5631 if [ "$3" = "follow" ]; then
5632 sway workspace "$dest_ws"
5633 fi
5634 fi
5635 #+end_src
5636
5637 ** toggle-layout
5638 :PROPERTIES:
5639 :header-args+: :tangle ~/.local/bin/toggle-layout :shebang "#!/bin/bash"
5640 :END:
5641
5642 #+begin_src bash :tangle no
5643 lang="$(setxkbmap -print | grep xkb_symbols | cut -d'+' -f 2)"
5644
5645 if [ "$lang" = "us" ]; then
5646 setxkbmap ir
5647 else
5648 setxkbmap us
5649 # xmodmap $HOME/.Xmodmap
5650 fi
5651 #+end_src
5652
5653 ** toggle-presentation-mode
5654 :PROPERTIES:
5655 :header-args+: :tangle ~/.local/bin/toggle-presentation-mode :shebang "#!/bin/bash"
5656 :END:
5657
5658 #+begin_src bash :tangle no
5659 xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
5660 #+end_src
5661
5662 ** toggle-tablet
5663 :PROPERTIES:
5664 :header-args+: :tangle ~/.local/bin/toggle-tablet :shebang "#!/bin/bash"
5665 :END:
5666
5667 This script toggles between a 'normal' mode and a 'tablet' mode, doing
5668 a few things:
5669
5670 - rotates the screen using =xrandr=, so that rotating the physical
5671 display of my X220t would have the laptop's battery on the right
5672 hand side,
5673 - enables touch screen,
5674 - properly rotates the stylus pen and touch screen pointers, and
5675 - toggles between RGB and Vertical BGR sub-pixel order.
5676
5677 #+begin_src bash :tangle no
5678 case $(xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation) in
5679 0) # Screen is not rotated, we should rotate it right (90°)
5680 xrandr -o 3
5681 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 1
5682 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 1
5683 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 1
5684 xfconf-query -c xsettings -p /Xft/RGBA -s vbgr
5685 ;;
5686 1) # Currently top is rotated right, we should set it normal (0°)
5687 xrandr -o 0
5688 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 0
5689 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 0
5690 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 0
5691 xfconf-query -c xsettings -p /Xft/RGBA -s rgb
5692 ;;
5693 *)
5694 echo "Unknown result from 'xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation'" >&2
5695 exit 1
5696 ;;
5697 esac
5698 #+end_src
5699
5700 ** unlock-def-gk.py
5701 :PROPERTIES:
5702 :header-args+: :tangle ~/.local/bin/unlock-def-gk.py :shebang "#!/usr/bin/env python2"
5703 :END:
5704
5705 #+begin_src python :tangle no
5706 import gnomekeyring as gk
5707 # list_item_ids_sync('login')[0] == 1L
5708 gk.unlock_sync('Default_keyring',gk.item_get_info_sync('login',1L).get_secret())
5709 #+end_src
5710
5711 ** volume-info
5712 :PROPERTIES:
5713 :header-args+: :tangle ~/.local/bin/volume-info :shebang "#!/bin/sh"
5714 :END:
5715
5716 #+begin_src sh :tangle no
5717 cur_vol=$(pamixer --get-volume)
5718
5719 if [ $(pamixer --get-mute) = true ]; then
5720 printf 'mt \n' "$cur_vol"
5721 else
5722 printf '%02d \n' "$cur_vol"
5723 fi
5724 #+end_src
5725
5726 ** wp
5727
5728 My little wallpaper changer script.
5729
5730 *** wp
5731 :PROPERTIES:
5732 :header-args+: :tangle ~/.local/bin/wp :shebang "#!/bin/bash"
5733 :END:
5734
5735 #+begin_src bash :tangle no
5736 export DISPLAY=:0
5737
5738 case "$1" in
5739 "day")
5740 feh --bg-scale $HOME/usr/pics/island_day_by_arsenixc-d6ctqon.jpg
5741 ;;
5742 "night")
5743 feh --bg-scale $HOME/usr/pics/island_night_by_arsenixc-d6cz757.jpg
5744 ;;
5745 *)
5746 echo $"Usage: $0 {day|night}"
5747 exit 1
5748 esac
5749 #+end_src
5750
5751 *** wp-auto
5752 :PROPERTIES:
5753 :header-args+: :tangle ~/.local/bin/wp-auto :shebang "#!/bin/bash"
5754 :END:
5755
5756 #+begin_src bash :tangle no
5757 SED=$(which sed)
5758 ROFI=$(which rofi)
5759
5760 export DISPLAY=:0
5761 HOUR=$(date +%H)
5762
5763 if [ -z "${SED}" ]
5764 then
5765 echo "Did not find 'sed', script cannot continue."
5766 exit 1
5767 fi
5768 if [ -z "${ROFI}" ]
5769 then
5770 echo "Did not find rofi, there is no point to continue."
5771 exit 1
5772 fi
5773
5774 ###
5775 # Create if not exists, then removes #include of .theme file (if present) and add the selected theme to the end.
5776 # Repeated calls should leave the config clean-ish
5777 ###
5778 function set_theme()
5779 {
5780 CDIR="${HOME}/.config/rofi/"
5781 if [ ! -d "${CDIR}" ]
5782 then
5783 mkdir -p ${CDIR}
5784 fi
5785 if [ -f "${CDIR}/config" ]
5786 then
5787 ${SED} -i "/rofi\.theme: .*\.rasi$/d" "${CDIR}/config"
5788 fi
5789 echo "rofi.theme: ${1}" >> "${CDIR}/config"
5790
5791 }
5792
5793 if [ "$HOUR" -gt "19" ] || [ "$HOUR" -lt "7" ]
5794 then
5795 feh --bg-scale $HOME/usr/pics/island_night_by_arsenixc-d6cz757.jpg
5796 xrdb -merge $HOME/.Xresources.d/gruvbox-dark.xresources
5797 set_theme "/usr/share/rofi/themes//gruvbox-dark.rasi"
5798 else
5799 feh --bg-scale $HOME/usr/pics/island_day_by_arsenixc-d6ctqon.jpg
5800 xrdb -merge $HOME/.Xresources.d/gruvbox-light.xresources
5801 set_theme "/usr/share/rofi/themes//gruvbox-light.rasi"
5802 fi
5803 #+end_src
5804
5805 *** wp.service
5806 :PROPERTIES:
5807 :header-args+: :tangle ~/.config/systemd/user/wp.service
5808 :END:
5809
5810 #+begin_src conf :tangle no
5811 [Unit]
5812 Description=wallpaper service
5813
5814 [Service]
5815 Type=oneshot
5816 ExecStart=/usr/bin/bash -c %h/.local/bin/wp-auto
5817 #+end_src
5818
5819 *** wp.timer
5820 :PROPERTIES:
5821 :header-args+: :tangle ~/.config/systemd/user/wp.timer
5822 :END:
5823
5824 #+begin_src conf :tangle no
5825 [Unit]
5826 [Unit]
5827 Description=wallpaper timer
5828
5829 [Timer]
5830 OnCalendar=07,21:00
5831 Unit=wp.service
5832 Persistent=true
5833
5834 [Install]
5835 WantedBy=timers.target
5836 #+end_src
5837
5838 ** zathura-sync.sh
5839 :PROPERTIES:
5840 :header-args+: :tangle ~/.local/bin/zathura-sync.sh :shebang "#!/bin/sh"
5841 :END:
5842
5843 #+begin_src sh
5844 pos="$1"
5845 pdffile="$2"
5846 zathura --synctex-forward "$pos" "$pdffile" || \
5847 (
5848 zathura -x "emacsclient --eval '(progn (switch-to-buffer (file-name-nondirectory \"%{input}\")) (goto-line %{line}))'" "$pdffile" &
5849 sleep 1; zathura --synctex-forward "$pos" "$pdffile" )
5850 #+end_src
5851 ** Fun :)
5852
5853 *** eat-em
5854 :PROPERTIES:
5855 :header-args+: :tangle ~/.local/bin/eat-em :shebang "#!/bin/sh"
5856 :END:
5857
5858 #+begin_src sh
5859 # Original Posted at http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
5860 # [ESC] character in original post removed here.
5861
5862 # ANSI Color -- use these variables to easily have different color
5863 # and format output. Make sure to output the reset sequence after
5864 # colors (f = foreground, b = background), and use the 'off'
5865 # feature for anything you turn on.
5866
5867 initializeANSI()
5868 {
5869 esc="$(echo -en '\e')"
5870
5871 blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m"
5872 yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m"
5873 cyanf="${esc}[36m"; whitef="${esc}[37m"
5874
5875 blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m"
5876 yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m"
5877 cyanb="${esc}[46m"; whiteb="${esc}[47m"
5878
5879 boldon="${esc}[1m"; boldoff="${esc}[22m"
5880 italicson="${esc}[3m"; italicsoff="${esc}[23m"
5881 ulon="${esc}[4m"; uloff="${esc}[24m"
5882 invon="${esc}[7m"; invoff="${esc}[27m"
5883
5884 reset="${esc}[0m"
5885 }
5886
5887 # note in this first use that switching colors doesn't require a reset
5888 # first - the new color overrides the old one.
5889
5890 #clear
5891
5892 initializeANSI
5893
5894 cat << EOF
5895
5896 ${yellowf} ▄███████▄${reset} ${redf} ▄██████▄${reset} ${greenf} ▄██████▄${reset} ${bluef} ▄██████▄${reset} ${purplef} ▄██████▄${reset} ${cyanf} ▄██████▄${reset}
5897 ${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}
5898 ${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}
5899 ${yellowf}███████▄${reset} ${redf}████████████${reset} ${greenf}████████████${reset} ${bluef}████████████${reset} ${purplef}████████████${reset} ${cyanf}████████████${reset}
5900 ${yellowf}▀█████████▄▄${reset} ${redf}██▀██▀▀██▀██${reset} ${greenf}██▀██▀▀██▀██${reset} ${bluef}██▀██▀▀██▀██${reset} ${purplef}██▀██▀▀██▀██${reset} ${cyanf}██▀██▀▀██▀██${reset}
5901 ${yellowf} ▀███████▀${reset} ${redf}▀ ▀ ▀ ▀${reset} ${greenf}▀ ▀ ▀ ▀${reset} ${bluef}▀ ▀ ▀ ▀${reset} ${purplef}▀ ▀ ▀ ▀${reset} ${cyanf}▀ ▀ ▀ ▀${reset}
5902
5903 ${boldon}${yellowf} ▄███████▄ ${redf} ▄██████▄ ${greenf} ▄██████▄ ${bluef} ▄██████▄ ${purplef} ▄██████▄ ${cyanf} ▄██████▄${reset}
5904 ${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}
5905 ${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}
5906 ${boldon}${yellowf}███████▄ ${redf}████████████ ${greenf}████████████ ${bluef}████████████ ${purplef}████████████ ${cyanf}████████████${reset}
5907 ${boldon}${yellowf}▀█████████▄▄ ${redf}██▀██▀▀██▀██ ${greenf}██▀██▀▀██▀██ ${bluef}██▀██▀▀██▀██ ${purplef}██▀██▀▀██▀██ ${cyanf}██▀██▀▀██▀██${reset}
5908 ${boldon}${yellowf} ▀███████▀ ${redf}▀ ▀ ▀ ▀ ${greenf}▀ ▀ ▀ ▀ ${bluef}▀ ▀ ▀ ▀ ${purplef}▀ ▀ ▀ ▀ ${cyanf}▀ ▀ ▀ ▀${reset}
5909
5910 EOF
5911 #+end_src
5912
5913 *** invade-em
5914 :PROPERTIES:
5915 :header-args+: :tangle ~/.local/bin/invade-em :shebang "#!/bin/bash"
5916 :END:
5917
5918 #+begin_src bash
5919 #
5920 # ANSI color scheme script featuring Space Invaders
5921 #
5922 # Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
5923 # Modified by lolilolicon
5924 #
5925
5926 f=3 b=4
5927 for j in f b; do
5928 for i in {0..7}; do
5929 printf -v $j$i %b "\e[${!j}${i}m"
5930 done
5931 done
5932 bld=$'\e[1m'
5933 rst=$'\e[0m'
5934
5935 cat << EOF
5936
5937 $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
5938 $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
5939 $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst
5940 $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst
5941
5942 $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
5943 $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
5944 $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst
5945 $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst
5946
5947
5948 $f7▌$rst
5949
5950 $f7▌$rst
5951
5952 $f7 ▄█▄ $rst
5953 $f7▄█████████▄$rst
5954 $f7▀▀▀▀▀▀▀▀▀▀▀$rst
5955
5956 EOF
5957 #+end_src