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