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