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