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