Remove old Borg-specific Makefile
[~bandali/configs] / rc.org
1 #+title: rc.org
2 #+property: header-args :comments no :mkdirp yes :results silent
3
4 * About
5
6 This org file contains the configuration files of pretty much every
7 program I use. The files are tangled (i.e. exported, or derived) from
8 this file using =org-babel=.
9
10 Note: This file is best viewed inside Emacs with org mode.
11
12 * Configs
13
14 This section contains the configuration files (dotfiles) of various
15 programs I use besides GNU Emacs.
16
17 ** Fontconfig
18 :PROPERTIES:
19 :header-args+: :tangle ~/.config/fontconfig/fonts.conf
20 :END:
21
22 #+begin_src xml
23 <?xml version="1.0"?>
24 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
25 <fontconfig>
26 <match target="font">
27 <edit mode="assign" name="rgba">
28 <const>rgb</const>
29 </edit>
30 </match>
31 <match target="font">
32 <edit mode="assign" name="hinting">
33 <bool>true</bool>
34 </edit>
35 </match>
36 <match target="font">
37 <edit mode="assign" name="hintstyle">
38 <const>hintslight</const>
39 </edit>
40 </match>
41 <match target="font">
42 <edit mode="assign" name="antialias">
43 <bool>true</bool>
44 </edit>
45 </match>
46 <match target="font">
47 <edit mode="assign" name="lcdfilter">
48 <const>lcddefault</const>
49 </edit>
50 </match>
51 <dir>~/.fonts</dir>
52
53 <!-- Use Liberation Sans for Helvetica (instead of Nimbus Sans) -->
54 <alias binding="same">
55 <family>Helvetica</family>
56 <prefer>
57 <family>Liberation Sans</family>
58 </prefer>
59 </alias>
60 </fontconfig>
61 #+end_src
62
63 ** getmail
64 :PROPERTIES:
65 :header-args+: :tangle ~/.config/getmail/getmailrc
66 :END:
67
68 #+begin_src conf
69 [retriever]
70 type = SimplePOP3SSLRetriever
71 server = fencepost.gnu.org
72 username = bandali
73 password_command = ("gpg", "--no-tty", "-q", "-d", "/home/bandali/.passwd/gnu.gpg")
74 port = 995
75 use_apop = True
76
77 [destination]
78 type = Maildir
79 path = ~/mail/gnu.local/bandali/mail/
80
81 # [destination]
82 # type = MDA_external
83 # path = /usr/lib/dovecot/deliver
84 # arguments = ('-e', '-f', '%(sender)', '-d', 'bandali@gnu.local')
85
86 [options]
87 read_all = false
88 delete_after = 1
89 # delete = true
90 received = false
91 delivered_to = false
92 #+end_src
93
94 ** Git
95
96 *** config
97 :PROPERTIES:
98 :header-args+: :tangle ~/.config/git/config
99 :END:
100
101 #+begin_src conf
102 [user]
103 name = Amin Bandali
104 email = bandali@gnu.org
105 signingkey = BE6273738E616D6D1B3A08E8A21A020248816103
106
107 [commit]
108 gpgsign = true
109
110 # [format]
111 # signoff = true
112
113 [core]
114 autocrlf = input # CRLF -> LF on commit
115 editor = emacsclient -t
116 pager = "less"
117
118 [mailmap]
119 file = ~/.config/git/mailmap
120
121 [alias]
122 git = !exec git # handle nested git calls, e.g. git git status
123 aliases = config --get-regexp '^alias\\.'
124 a = add
125 s = status
126 sl = status --long
127 c = checkout
128 cb = checkout -b
129 b = branch
130 r = rebase
131 p = pull
132 pr = pull --rebase
133 ps = push
134 psf = push --force
135 nmam = "!f() { notmuch show --format=raw $1 | git am -; }; f"
136 nmam3 = "!f() { notmuch show --format=raw $1 | git am -3 -; }; f"
137
138 [color]
139 ui = auto
140 [color "status"]
141 added = green bold
142 changed = red bold
143 untracked = red bold
144 [color "branch"]
145 current = green bold
146 remote = magenta bold
147 [color "diff"]
148 new = green bold
149 old = red bold
150
151 # [status]
152 # # showUntrackedFiles = all
153 # short=true
154 # branch=true
155
156 [github]
157 user = notbandali
158
159 [sendemail]
160 smtpuser = bandali
161 smtpserver = fencepost.gnu.org
162 smtpserverport = 587
163 smtpencryption = tls
164 annotate = yes
165
166 [transfer]
167 fsckObjects = true
168 #+end_src
169
170 *** ignore
171 :PROPERTIES:
172 :header-args+: :tangle ~/.config/git/ignore
173 :END:
174
175 #+begin_src conf
176 *.orig
177 *.py[co]
178 *.sublime-workspace
179 *~
180 .DS_Store
181 *.elc
182 *-autoloads.el
183 TAGS
184 #+end_src
185
186 *** mailmap
187 :PROPERTIES:
188 :header-args+: :tangle ~/.config/git/mailmap
189 :END:
190
191 #+begin_src conf
192 <bandali@gnu.org> <mab@gnu.org>
193 <bandali@gnu.org> <amin@gnu.org>
194 <bandali@gnu.org> <aminb@gnu.org>
195 <bandali@gnu.org> <amin@aminb.org>
196 <bandali@gnu.org> <me@aminb.org>
197 #+end_src
198
199 ** GnuPG
200 :PROPERTIES:
201 :header-args+: :tangle ~/.gnupg/gpg-agent.conf
202 :END:
203
204 #+begin_src conf
205 default-cache-ttl 43200
206 max-cache-ttl 86400
207
208 default-cache-ttl-ssh 43200
209 max-cache-ttl-ssh 86400
210
211 pinentry-program /home/bandali/.guix-profile/bin/pinentry-emacs
212 allow-emacs-pinentry
213 allow-loopback-pinentry
214 #+end_src
215
216 ** GTK
217
218 *** GTK+ 2
219 :PROPERTIES:
220 :header-args+: :tangle ~/.gtkrc-2.0
221 :END:
222
223 #+begin_src conf
224 gtk-theme-name="Xfce"
225 # gtk-icon-theme-name="elementary Xfce darker"
226 gtk-font-name="Roboto 10"
227 # gtk-font-name="Source Code Variable 10"
228 gtk-menu-images=0
229 # gtk-key-theme-name = "Emacs"
230 #+end_src
231
232 *** GTK+ 3
233 :PROPERTIES:
234 :header-args+: :tangle ~/.config/gtk-3.0/settings.ini
235 :END:
236
237 #+begin_src conf
238 [Settings]
239 gtk-icon-theme-name = Adwaita
240 # gtk-theme-name = Adwaita
241
242 gtk-theme-name = Xfce
243 # gtk-theme-name = Arc-Darker
244 # gtk-theme-name = Numix-ArchBlue
245
246 gtk-font-name = Roboto 10
247 # gtk-font-name = Source Code Variable Medium 10
248 # gtk-key-theme-name = Emacs
249 #+end_src
250
251 ** Guix
252
253 *** Channels
254 :PROPERTIES:
255 :header-args+: :tangle ~/.config/guix/channels.scm
256 :END:
257
258 #+begin_src scheme
259 (list (channel
260 (name 'guix) ; https://git.savannah.gnu.org/git/guix.git
261 (url "file:///home/bandali/src/git/guix"))
262 (channel
263 (name 'guix-bandali) ; https://git.sr.ht/~bandali/guix-bandali
264 (url "file:///home/bandali/src/git/guix-bandali")))
265 #+end_src
266
267 *** Profile manifests
268
269 To install/update the packages of the default profile, use
270 #+begin_example
271 guix package -m $MY_GUIX_MANIFESTS/main.scm
272 #+end_example
273 and for other profiles, use
274 #+begin_example
275 guix package -m $MY_GUIX_MANIFESTS/name.scm -p $MY_GUIX_PROFILES/name/name
276 #+end_example
277 where =name= is the name of the profile (e.g. =doc=, =media=, ...).
278
279 **** doc
280 :PROPERTIES:
281 :header-args+: :tangle ~/.config/guix/manifest/doc.scm
282 :END:
283
284 #+begin_src scheme
285 (specifications->manifest
286 '("libreoffice"
287 "texlive-amsfonts"
288 "texlive-base"
289 "texlive-latex-listings"
290 ;; "texlive-palatino"
291 "texlive-xcolor"
292 ))
293 #+end_src
294
295 **** main
296 :PROPERTIES:
297 :header-args+: :tangle ~/.config/guix/manifest/main.scm
298 :END:
299
300 #+begin_src scheme
301 (specifications->manifest
302 '("alsa-utils"
303 "bash-completion"
304 "cpufrequtils"
305 "cpupower"
306 "cvs"
307 "dunst"
308 "emacs"
309 "emacs-alert"
310 "emacs-amx"
311 "emacs-async"
312 "emacs-biblio-git"
313 "emacs-boxquote"
314 "emacs-company"
315 "emacs-company-ebdb"
316 "emacs-crux"
317 "emacs-dash"
318 "emacs-debbugs"
319 "emacs-diff-hl"
320 "emacs-dmenu"
321 "emacs-doom-themes"
322 "emacs-ebdb"
323 "emacs-emmet-mode"
324 ;; "emacs-emojify"
325 "emacs-erc-hl-nicks"
326 "emacs-erc-scrolltoplace"
327 "emacs-eshell-up"
328 "emacs-exec-path-from-shell"
329 "emacs-expand-region"
330 "emacs-exwm"
331 "emacs-exwm-edit"
332 "emacs-flycheck"
333 "emacs-geiser"
334 ;; "emacs-gnus-harvest"
335 "emacs-guix"
336 "emacs-helpful"
337 "emacs-hl-todo"
338 "emacs-ivy"
339 "emacs-magit"
340 "emacs-message-x"
341 "emacs-minions"
342 ;; "emacs-multi-term"
343 "emacs-multiple-cursors"
344 "emacs-mwim"
345 ;; "emacs-next"
346 ;; "emacs-next-delight"
347 "emacs-no-littering"
348 "emacs-org"
349 "emacs-org-contrib"
350 "emacs-org-ref"
351 "emacs-orgalist"
352 "emacs-page-break-lines"
353 "emacs-pass"
354 "emacs-pinentry"
355 "emacs-projectile"
356 "emacs-shrink-path-git"
357 "emacs-smart-mode-line"
358 "emacs-typo"
359 "emacs-unkillable-scratch"
360 "emacs-use-package"
361 "emacs-web-mode"
362 "emacs-which-key"
363 "emacs-yasnippet"
364 "emacs-znc-git"
365 "font-adobe-source-code-pro"
366 "font-gnu-freefont-ttf"
367 "font-google-roboto"
368 "font-liberation"
369 "font-linuxlibertine"
370 "font-sil-gentium"
371 "font-tex-gyre"
372 ;; "font-ubuntu"
373 "font-vazir"
374 "getmail"
375 "gettext"
376 "git"
377 "git:send-email"
378 "gnupg"
379 "guile"
380 "haunt"
381 "htop"
382 "hunspell"
383 "hunspell-dict-en-ca"
384 "hunspell-dict-en-us"
385 "isync"
386 "light"
387 "msmtp"
388 "ncdu"
389 "notmuch"
390 "openjdk"
391 "openssh"
392 "openssl"
393 "pass-otp"
394 "password-store"
395 "pasystray"
396 "pinentry-emacs"
397 "poppler" ; for 'pdffonts'
398 "rofi"
399 "rofi-pass"
400 "rsync"
401 "rxvt-unicode"
402 "screen"
403 "scrot"
404 "setxkbmap"
405 "strace"
406 "thinkfan"
407 "unzip"
408 "wget"
409 "xdg-user-dirs"
410 ;; "xkbcomp"
411 "xmodmap"
412 "xrdb"
413 "xset"
414 "xsetroot"))
415 #+end_src
416
417 **** media
418 :PROPERTIES:
419 :header-args+: :tangle ~/.config/guix/manifest/media.scm
420 :END:
421
422 #+begin_src scheme
423 (specifications->manifest
424 '("audacity"
425 "gimp"
426 "inkscape"
427 "mpv"
428 "youtube-dl"))
429 #+end_src
430
431 **** web
432 :PROPERTIES:
433 :header-args+: :tangle ~/.config/guix/manifest/web.scm
434 :END:
435
436 #+begin_src scheme
437 (specifications->manifest
438 '("icecat"
439 "rtv"))
440 #+end_src
441
442 *** Systems
443
444 **** chaman
445 :PROPERTIES:
446 :header-args+: :tangle ~/.config/guix/system/chaman.scm
447 :END:
448
449 #+begin_src scheme
450 (use-modules (gnu)
451 (gnu packages certs) ; for nss-certs
452 (gnu packages emacs-xyz) ; for exwm
453 (gnu packages linux)) ; for powertop
454 (use-service-modules admin desktop mail networking pm ssh xorg)
455
456 (operating-system
457 (host-name "chaman")
458 (locale "en_CA.utf8")
459 (timezone "Canada/Eastern")
460 (keyboard-layout
461 (keyboard-layout "us" "basic"))
462 (bootloader
463 (bootloader-configuration
464 (bootloader grub-bootloader)
465 (target "/dev/sda")
466 (keyboard-layout keyboard-layout)))
467 (mapped-devices
468 (list (mapped-device
469 (source
470 (uuid "283da85e-2c84-47e6-a8ca-20f4e8efb806"))
471 (target "groot")
472 (type luks-device-mapping))
473 (mapped-device
474 (source
475 (uuid "017ddebc-c2c3-4a0a-bda4-d47ec0bc67f0"))
476 (target "data")
477 (type luks-device-mapping))))
478 (file-systems
479 (cons* (file-system
480 (mount-point "/")
481 (device "/dev/mapper/groot")
482 (type "ext4")
483 (dependencies mapped-devices))
484 (file-system
485 (mount-point "/data")
486 (device "/dev/mapper/data")
487 (type "ext4")
488 (dependencies mapped-devices))
489 %base-file-systems))
490 (users
491 (cons* (user-account
492 (name "bandali")
493 (group "users")
494 (home-directory "/home/bandali")
495 (supplementary-groups
496 '("wheel" "netdev" "audio" "video")))
497 %base-user-accounts))
498 (packages
499 (cons* nss-certs
500 emacs-exwm
501 %base-packages))
502 (services
503 (cons*
504 (service xfce-desktop-service-type)
505 (set-xorg-configuration
506 (xorg-configuration
507 (keyboard-layout keyboard-layout)))
508 (dovecot-service
509 #:config
510 (dovecot-configuration
511 ;; (log-path "/dev/stderr")
512 (protocols (list (protocol-configuration
513 (name "imap"))))
514 (ssl? "no")
515 (listen '("127.0.0.1"))
516 (disable-plaintext-auth? #f)
517 (auth-mechanisms '("plain"))
518 (postmaster-address "bandali@gnu.local")
519 (mail-location "maildir:/home/bandali/mail/%d/%n/mail")
520 (userdbs (list (userdb-configuration
521 (driver "static")
522 (args (list "uid=bandali" "gid=users" "home=/home/bandali/mail/%d/%n")))))
523 (passdbs (list (passdb-configuration
524 (driver "passwd-file")
525 (args (list "/data/dovecot-passwd")))))))
526 (service rottlog-service-type)
527 (service thermald-service-type)
528 (service tlp-service-type
529 (tlp-configuration
530 (cpu-boost-on-ac? #t)
531 (sound-power-save-on-bat 0)
532 (sound-power-save-controller? #f)
533 ;; (usb-blacklist "0e8f:00a8") ;for some reason doesn't seem to work
534 (usb-autosuspend? #f)))
535 (simple-service 'my-powertop-auto-tune activation-service-type
536 #~(zero? (system* #$(file-append powertop "/sbin/powertop")
537 "--auto-tune")))
538 (simple-service 'light-udev-rules udev-service-type (list light))
539 %desktop-services)))
540 #+end_src
541
542 ** isync
543 :PROPERTIES:
544 :header-args+: :tangle ~/.config/isync/mbsyncrc
545 :END:
546
547 #+begin_src conf
548 # Global defaults
549 CopyArrivalDate yes
550 Create Both
551 Expunge Both
552
553 ######
554 IMAPAccount shemshak
555 Host mail.shemshak.org
556 User bandali@shemshak.org
557 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/shemshak.gpg"
558 SSLType IMAPS
559
560 IMAPStore shemshak-remote
561 Account shemshak
562
563 IMAPAccount shemshak-local
564 Host 127.0.0.1
565 Port 143
566 User bandali@shemshak.local
567 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/shemshak-local.gpg"
568 SSLType None
569
570 IMAPStore shemshak-local
571 Account shemshak-local
572
573 Channel shemshak
574 Master :shemshak-remote:
575 Slave :shemshak-local:
576 Patterns *
577
578 ######
579 IMAPAccount gnub
580 Host mail.shemshak.org
581 User gnu@bndl.org
582 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/gnub.gpg"
583 SSLType IMAPS
584
585 IMAPStore gnub-remote
586 Account gnub
587
588 IMAPAccount gnub-local
589 Host 127.0.0.1
590 Port 143
591 User bandali@gnu.local
592 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/gnub-local.gpg"
593 SSLType None
594
595 IMAPStore gnub-local
596 Account gnub-local
597
598 Channel gnub
599 Master :gnub-remote:
600 Slave :gnub-local:
601 Patterns *
602
603 ######
604 IMAPAccount uwaterloo
605 Host connect.uwaterloo.ca
606 User abandali
607 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/uwaterloo.gpg"
608 SSLType IMAPS
609
610 IMAPStore uwaterloo-remote
611 Account uwaterloo
612
613 IMAPAccount uwaterloo-local
614 Host 127.0.0.1
615 Port 143
616 User abandali@uwaterloo.local
617 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/uwaterloo-local.gpg"
618 SSLType None
619
620 IMAPStore uwaterloo-local
621 Account uwaterloo-local
622
623 Channel uwaterloo
624 Master :uwaterloo-remote:
625 Slave :uwaterloo-local:
626 Patterns *
627
628 ######
629 IMAPAccount csclub
630 Host mail.csclub.uwaterloo.ca
631 User abandali
632 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/csclub.gpg"
633 SSLType IMAPS
634
635 IMAPStore csclub-remote
636 Account csclub
637
638 IMAPAccount csclub-local
639 Host 127.0.0.1
640 Port 143
641 User abandali@csclub.uwaterloo.local
642 PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/csclub-local.gpg"
643 SSLType None
644
645 IMAPStore csclub-local
646 Account csclub-local
647
648 Channel csclub
649 Master :csclub-remote:
650 Slave :csclub-local:
651 Patterns *
652 #+end_src
653
654 ** Latexmk
655 :PROPERTIES:
656 :header-args+: :tangle ~/.config/latexmk/latexmkrc
657 :END:
658
659 #+begin_src conf
660 $pdf_previewer = "start zathura %O %S";
661 $clean_ext = "aux out";
662
663 # $pdf_update_method = 4;
664 # $pdf_update_command = "zathura %O %S";
665
666 # Synctex allows one to jump to from the PDF in Zathura to the source in Emacs
667 # by Ctrl+click in the PDF.
668 # Tell latexmk to use Zathura as a previewer, and run emacsclient as the Synctex
669 # editor.
670 # $pdf_previewer = 'exec zathura --synctex-forward -x \'emacsclient --no-wait +%{line} %{input}\' %O %S';
671 #+end_src
672
673 ** mpd
674 :PROPERTIES:
675 :header-args+: :tangle ~/.config/mpd/mpd.conf
676 :END:
677
678 #+begin_src conf
679 # An example configuration file for MPD.
680 # Read the user manual for documentation: http://www.musicpd.org/doc/user/
681
682
683 # Files and directories #######################################################
684 #
685 # This setting controls the top directory which MPD will search to discover the
686 # available audio files and add them to the daemon's online database. This
687 # setting defaults to the XDG directory, otherwise the music directory will be
688 # be disabled and audio files will only be accepted over ipc socket (using
689 # file:// protocol) or streaming files over an accepted protocol.
690 #
691 music_directory "~/usr/music"
692 #
693 # This setting sets the MPD internal playlist directory. The purpose of this
694 # directory is storage for playlists created by MPD. The server will use
695 # playlist files not created by the server but only if they are in the MPD
696 # format. This setting defaults to playlist saving being disabled.
697 #
698 playlist_directory "~/.mpd/playlists"
699 #
700 # This setting sets the location of the MPD database. This file is used to
701 # load the database at server start up and store the database while the
702 # server is not up. This setting defaults to disabled which will allow
703 # MPD to accept files over ipc socket (using file:// protocol) or streaming
704 # files over an accepted protocol.
705 #
706 db_file "~/.mpd/database"
707 #
708 # These settings are the locations for the daemon log files for the daemon.
709 # These logs are great for troubleshooting, depending on your log_level
710 # settings.
711 #
712 # The special value "syslog" makes MPD use the local syslog daemon. This
713 # setting defaults to logging to syslog, otherwise logging is disabled.
714 #
715 log_file "~/.mpd/log"
716 #
717 # This setting sets the location of the file which stores the process ID
718 # for use of mpd --kill and some init scripts. This setting is disabled by
719 # default and the pid file will not be stored.
720 #
721 pid_file "~/.mpd/pid"
722 #
723 # This setting sets the location of the file which contains information about
724 # most variables to get MPD back into the same general shape it was in before
725 # it was brought down. This setting is disabled by default and the server
726 # state will be reset on server start up.
727 #
728 state_file "~/.mpd/state"
729 #
730 # The location of the sticker database. This is a database which
731 # manages dynamic information attached to songs.
732 #
733 sticker_file "~/.mpd/sticker.sql"
734 #
735 ###############################################################################
736
737
738 # General music daemon options ################################################
739 #
740 # This setting specifies the user that MPD will run as. MPD should never run as
741 # root and you may use this setting to make MPD change its user ID after
742 # initialization. This setting is disabled by default and MPD is run as the
743 # current user.
744 #
745 #user "nobody"
746 #
747 # This setting specifies the group that MPD will run as. If not specified
748 # primary group of user specified with "user" setting will be used (if set).
749 # This is useful if MPD needs to be a member of group such as "audio" to
750 # have permission to use sound card.
751 #
752 #group "nogroup"
753 #
754 # This setting sets the address for the daemon to listen on. Careful attention
755 # should be paid if this is assigned to anything other then the default, any.
756 # This setting can deny access to control of the daemon. Not effective if
757 # systemd socket activiation is in use.
758 #
759 # For network
760 #bind_to_address "any"
761 #
762 # And for Unix Socket
763 #bind_to_address "~/.mpd/socket"
764 #
765 # This setting is the TCP port that is desired for the daemon to get assigned
766 # to.
767 #
768 #port "6600"
769 #
770 # This setting controls the type of information which is logged. Available
771 # setting arguments are "default", "secure" or "verbose". The "verbose" setting
772 # argument is recommended for troubleshooting, though can quickly stretch
773 # available resources on limited hardware storage.
774 #
775 #log_level "default"
776 #
777 # If you have a problem with your MP3s ending abruptly it is recommended that
778 # you set this argument to "no" to attempt to fix the problem. If this solves
779 # the problem, it is highly recommended to fix the MP3 files with vbrfix
780 # (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
781 # point gapless MP3 playback can be enabled.
782 #
783 #gapless_mp3_playback "yes"
784 #
785 # Setting "restore_paused" to "yes" puts MPD into pause mode instead
786 # of starting playback after startup.
787 #
788 #restore_paused "no"
789 #
790 # This setting enables MPD to create playlists in a format usable by other
791 # music players.
792 #
793 #save_absolute_paths_in_playlists "no"
794 #
795 # This setting defines a list of tag types that will be extracted during the
796 # audio file discovery process. The complete list of possible values can be
797 # found in the user manual.
798 #metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
799 #
800 # This setting enables automatic update of MPD's database when files in
801 # music_directory are changed.
802 #
803 #auto_update "yes"
804 #
805 # Limit the depth of the directories being watched, 0 means only watch
806 # the music directory itself. There is no limit by default.
807 #
808 #auto_update_depth "3"
809 #
810 ###############################################################################
811
812
813 # Symbolic link behavior ######################################################
814 #
815 # If this setting is set to "yes", MPD will discover audio files by following
816 # symbolic links outside of the configured music_directory.
817 #
818 #follow_outside_symlinks "yes"
819 #
820 # If this setting is set to "yes", MPD will discover audio files by following
821 # symbolic links inside of the configured music_directory.
822 #
823 #follow_inside_symlinks "yes"
824 #
825 ###############################################################################
826
827
828 # Zeroconf / Avahi Service Discovery ##########################################
829 #
830 # If this setting is set to "yes", service information will be published with
831 # Zeroconf / Avahi.
832 #
833 #zeroconf_enabled "yes"
834 #
835 # The argument to this setting will be the Zeroconf / Avahi unique name for
836 # this MPD server on the network.
837 #
838 #zeroconf_name "Music Player"
839 #
840 ###############################################################################
841
842
843 # Permissions #################################################################
844 #
845 # If this setting is set, MPD will require password authorization. The password
846 # setting can be specified multiple times for different password profiles.
847 #
848 #password "password@read,add,control,admin"
849 #
850 # This setting specifies the permissions a user has who has not yet logged in.
851 #
852 #default_permissions "read,add,control,admin"
853 #
854 ###############################################################################
855
856
857 # Database #######################################################################
858 #
859
860 #database {
861 # plugin "proxy"
862 # host "other.mpd.host"
863 # port "6600"
864 #}
865
866 # Input #######################################################################
867 #
868
869 input {
870 plugin "curl"
871 # proxy "proxy.isp.com:8080"
872 # proxy_user "user"
873 # proxy_password "password"
874 }
875
876 #
877 ###############################################################################
878
879 # Audio Output ################################################################
880 #
881
882 audio_output {
883 type "pulse"
884 name "pulse audio"
885 }
886
887 audio_output {
888 type "fifo"
889 name "my_fifo"
890 path "/tmp/mpd.fifo"
891 format "44100:16:2"
892 }
893
894 # MPD supports various audio output types, as well as playing through multiple
895 # audio outputs at the same time, through multiple audio_output settings
896 # blocks. Setting this block is optional, though the server will only attempt
897 # autodetection for one sound card.
898 #
899 # An example of an ALSA output:
900 #
901 #audio_output {
902 # type "alsa"
903 # name "My ALSA Device"
904 ## device "hw:0,0" # optional
905 ## mixer_type "hardware" # optional
906 ## mixer_device "default" # optional
907 ## mixer_control "PCM" # optional
908 ## mixer_index "0" # optional
909 #}
910 #
911 # An example of an OSS output:
912 #
913 #audio_output {
914 # type "oss"
915 # name "My OSS Device"
916 ## device "/dev/dsp" # optional
917 ## mixer_type "hardware" # optional
918 ## mixer_device "/dev/mixer" # optional
919 ## mixer_control "PCM" # optional
920 #}
921 #
922 # An example of a shout output (for streaming to Icecast):
923 #
924 #audio_output {
925 # type "shout"
926 # encoder "vorbis" # optional
927 # name "My Shout Stream"
928 # host "localhost"
929 # port "8000"
930 # mount "/mpd.ogg"
931 # password "hackme"
932 # quality "5.0"
933 # bitrate "128"
934 # format "44100:16:1"
935 ## protocol "icecast2" # optional
936 ## user "source" # optional
937 ## description "My Stream Description" # optional
938 ## url "http://example.com" # optional
939 ## genre "jazz" # optional
940 ## public "no" # optional
941 ## timeout "2" # optional
942 ## mixer_type "software" # optional
943 #}
944 #
945 # An example of a recorder output:
946 #
947 #audio_output {
948 # type "recorder"
949 # name "My recorder"
950 # encoder "vorbis" # optional, vorbis or lame
951 # path "/var/lib/mpd/recorder/mpd.ogg"
952 ## quality "5.0" # do not define if bitrate is defined
953 # bitrate "128" # do not define if quality is defined
954 # format "44100:16:1"
955 #}
956 #
957 # An example of a httpd output (built-in HTTP streaming server):
958 #
959 #audio_output {
960 # type "httpd"
961 # name "My HTTP Stream"
962 # encoder "vorbis" # optional, vorbis or lame
963 # port "8000"
964 # bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
965 ## quality "5.0" # do not define if bitrate is defined
966 # bitrate "128" # do not define if quality is defined
967 # format "44100:16:1"
968 # max_clients "0" # optional 0=no limit
969 #}
970 #
971 # An example of a pulseaudio output (streaming to a remote pulseaudio server)
972 #
973 #audio_output {
974 # type "pulse"
975 # name "My Pulse Output"
976 ## server "remote_server" # optional
977 ## sink "remote_server_sink" # optional
978 #}
979 #
980 # An example of a winmm output (Windows multimedia API).
981 #
982 #audio_output {
983 # type "winmm"
984 # name "My WinMM output"
985 ## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
986 # or
987 ## device "0" # optional
988 ## mixer_type "hardware" # optional
989 #}
990 #
991 # An example of an openal output.
992 #
993 #audio_output {
994 # type "openal"
995 # name "My OpenAL output"
996 ## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
997 #}
998 #
999 # An example of an sndio output.
1000 #
1001 #audio_output {
1002 # type "sndio"
1003 # name "sndio output"
1004 # mixer_type "software"
1005 #}
1006 #
1007 # An example of an OS X output:
1008 #
1009 #audio_output {
1010 # type "osx"
1011 # name "My OS X Device"
1012 ## device "Built-in Output" # optional
1013 ## channel_map "-1,-1,0,1" # optional
1014 #}
1015 #
1016 ## Example "pipe" output:
1017 #
1018 #audio_output {
1019 # type "pipe"
1020 # name "my pipe"
1021 # command "aplay -f cd 2>/dev/null"
1022 ## Or if you're want to use AudioCompress
1023 # command "AudioCompress -m | aplay -f cd 2>/dev/null"
1024 ## Or to send raw PCM stream through PCM:
1025 # command "nc example.org 8765"
1026 # format "44100:16:2"
1027 #}
1028 #
1029 ## An example of a null output (for no audio output):
1030 #
1031 #audio_output {
1032 # type "null"
1033 # name "My Null Output"
1034 # mixer_type "none" # optional
1035 #}
1036 #
1037 ###############################################################################
1038
1039
1040 # Normalization automatic volume adjustments ##################################
1041 #
1042 # This setting specifies the type of ReplayGain to use. This setting can have
1043 # the argument "off", "album", "track" or "auto". "auto" is a special mode that
1044 # chooses between "track" and "album" depending on the current state of
1045 # random playback. If random playback is enabled then "track" mode is used.
1046 # See <http://www.replaygain.org> for more details about ReplayGain.
1047 # This setting is off by default.
1048 #
1049 #replaygain "album"
1050 #
1051 # This setting sets the pre-amp used for files that have ReplayGain tags. By
1052 # default this setting is disabled.
1053 #
1054 #replaygain_preamp "0"
1055 #
1056 # This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
1057 # By default this setting is disabled.
1058 #
1059 #replaygain_missing_preamp "0"
1060 #
1061 # This setting enables or disables ReplayGain limiting.
1062 # MPD calculates actual amplification based on the ReplayGain tags
1063 # and replaygain_preamp / replaygain_missing_preamp setting.
1064 # If replaygain_limit is enabled MPD will never amplify audio signal
1065 # above its original level. If replaygain_limit is disabled such amplification
1066 # might occur. By default this setting is enabled.
1067 #
1068 #replaygain_limit "yes"
1069 #
1070 # This setting enables on-the-fly normalization volume adjustment. This will
1071 # result in the volume of all playing audio to be adjusted so the output has
1072 # equal "loudness". This setting is disabled by default.
1073 #
1074 #volume_normalization "no"
1075 #
1076 ###############################################################################
1077
1078 # Character Encoding ##########################################################
1079 #
1080 # If file or directory names do not display correctly for your locale then you
1081 # may need to modify this setting.
1082 #
1083 #filesystem_charset "UTF-8"
1084 #
1085 ###############################################################################
1086 #+end_src
1087
1088 ** msmtp
1089 :PROPERTIES:
1090 :header-args+: :tangle ~/.config/msmtp/config
1091 :END:
1092
1093 #+begin_src conf
1094 # Set default values for all following accounts.
1095 defaults
1096 port 587
1097 tls on
1098 auth on
1099 #tls_trust_file /etc/ssl/certs/ca-certificates.crt
1100 logfile ~/.msmtp.log
1101
1102 account shemshak
1103 host mail.shemshak.org
1104 # use `msmtp -a shemshak --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint
1105 tls_fingerprint A9:B8:79:CE:47:F7:E8:EB:7B:0D:C5:3E:1E:35:72:A0:03:E3:A2:1A:A9:1C:24:34:6E:F9:9E:78:89:67:11:E3
1106 tls_starttls on
1107 from amin@shemshak.org
1108 user bandali@shemshak.org
1109 passwordeval gpg --no-tty -q -d ~/.passwd/shemshak.gpg
1110
1111 account bandali : shemshak
1112 from bandali@shemshak.org
1113 account aminb : shemshak
1114 from amin@aminb.org
1115 account bndl : shemshak
1116 from a@bndl.org
1117
1118 account gnu
1119 host fencepost.gnu.org
1120 # use `msmtp -a gnu --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint
1121 tls_fingerprint 36:A7:33:D0:57:25:BB:D8:A8:21:7B:A3:91:05:A9:4F:43:4E:87:AE:65:4B:0D:A4:A0:9A:08:89:AE:1F:A5:D7
1122 tls_starttls on
1123 from bandali@gnu.org
1124 user bandali
1125 passwordeval gpg --no-tty -q -d ~/.passwd/gnu.gpg
1126
1127 account gnu-mab : gnu
1128 from mab@gnu.org
1129 account gnu-aminb : gnu
1130 from aminb@gnu.org
1131 account gnu-amin : gnu
1132 from amin@gnu.org
1133
1134 account uwaterloo
1135 host connect.uwaterloo.ca
1136 tls_starttls on
1137 from abandali@uwaterloo.ca
1138 user abandali
1139 passwordeval gpg --no-tty -q -d ~/.passwd/uwaterloo.gpg
1140 tls_trust_file /etc/ssl/certs/ca-certificates.crt
1141
1142 account uwaterloo-friendly : uwaterloo
1143 from bandali@uwaterloo.ca
1144
1145 account csclub
1146 host mail.csclub.uwaterloo.ca
1147 tls_starttls on
1148 from abandali@csclub.uwaterloo.ca
1149 user abandali
1150 passwordeval gpg --no-tty -q -d ~/.passwd/csclub.gpg
1151 tls_trust_file /etc/ssl/certs/ca-certificates.crt
1152
1153 account csclub-friendly : csclub
1154 from bandali@csclub.uwaterloo.ca
1155
1156 account sfl
1157 host mail.savoirfairelinux.com
1158 tls on
1159 from amin.bandali@savoirfairelinux.com
1160 user amin.bandali
1161 passwordeval gpg --no-tty -q -d ~/.passwd/sfl.gpg
1162 tls_trust_file /etc/ssl/certs/ca-certificates.crt
1163
1164 # Set a default account
1165 account default : shemshak
1166 #+end_src
1167
1168 ** Readline
1169 :PROPERTIES:
1170 :header-args+: :tangle ~/.config/readline/inputrc
1171 :END:
1172
1173 #+begin_src conf
1174 set enable-bracketed-paste on
1175
1176 set colored-stats on
1177 set colored-completion-prefix on
1178 set completion-ignore-case on
1179 set menu-complete-display-prefix on
1180 set page-completions off
1181 set show-all-if-ambiguous on
1182 set show-all-if-unmodified on
1183 set visible-stats on
1184
1185 TAB: menu-complete
1186 "\e[Z": menu-complete-backward
1187
1188 "\e[A": history-search-backward
1189 "\e[B": history-search-forward
1190 #+end_src
1191
1192 ** rofi
1193 :PROPERTIES:
1194 :header-args+: :tangle ~/.config/rofi/config
1195 :END:
1196
1197 #+begin_src conf
1198 ! rofi.font: Ubuntu Mono 13
1199 ! rofi.font: Inconsolata 16
1200 ! rofi.font: Iosevka 13
1201 ! rofi.font: Source Code Pro 11
1202 rofi.font: Source Code Pro 10.5
1203 rofi.modi: run,window
1204 ! rofi.width: 640
1205 rofi.width: 600
1206 !rofi.location: 2
1207 !rofi.yoffset: 200
1208 rofi.monitor: -1
1209 !rofi.lines: 10
1210
1211 rofi.theme: ~/.guix-profile/share/rofi/themes/gruvbox-light-hard.rasi
1212 #+end_src
1213
1214 ** rofi-pass
1215 :PROPERTIES:
1216 :header-args+: :tangle ~/.config/rofi-pass/config
1217 :END:
1218
1219 #+begin_src conf
1220 # permanently set alternative root dir
1221 # root=/path/to/root
1222
1223 # rofi command. Make sure to have "$@" as last argument
1224 _rofi () {
1225 #rofi -no-auto-select -kb-accept-entry "!Return" -i -no-levenshtein-sort "$@"
1226 rofi -i -no-auto-select -kb-accept-entry "!Return" "$@"
1227 }
1228
1229 # xdotool needs the keyboard layout to be set using setxkbmap
1230 # You can do this in your autostart scripts (e.g. xinitrc)
1231
1232 # If for some reason, you cannot do this, you can set the command here.
1233 # and set fix_layout to true
1234 fix_layout=false
1235
1236 layout_cmd () {
1237 setxkbmap us
1238 }
1239
1240 # fields to be used
1241 URL_field='url'
1242 USERNAME_field='user'
1243 AUTOTYPE_field='autotype'
1244
1245 # delay to be used for :delay keyword
1246 delay=2
1247
1248 ## Programs to be used
1249 # Editor
1250 EDITOR='gvim -f'
1251
1252 # Browser
1253 BROWSER='chromium'
1254
1255 ## Misc settings
1256
1257 default_do='menu' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
1258 auto_enter='false'
1259 notify='false'
1260 default_autotype='user :tab pass'
1261
1262 # color of the help messages
1263 # leave empty for autodetection
1264 help_color="#4872FF"
1265
1266 # Clipboard settings
1267 # Possible options: primary, clipboard, both
1268 clip=primary
1269
1270 # Options for generating new password entries
1271 # default_user is also used for password files that have no user field.
1272 default_user=aminb
1273 default_user2=bandali
1274 password_length=30
1275
1276 # Custom Keybindings
1277 #autotype="Alt+1"
1278 autotype="Alt+m"
1279 type_user="Alt+2"
1280 type_pass="Alt+3"
1281 open_url="Alt+4"
1282 copy_name="Alt+u"
1283 copy_url="Alt+l"
1284 copy_pass="Alt+p"
1285 show="Alt+o"
1286 copy_entry="Alt+2"
1287 type_entry="Alt+1"
1288 copy_menu="Alt+c"
1289 action_menu="Alt+a"
1290 type_menu="Alt+t"
1291 help="Alt+h"
1292 switch="Alt+x"
1293 insert_pass="Alt+n"
1294 #+end_src
1295
1296 ** Screen
1297 :PROPERTIES:
1298 :header-args+: :tangle ~/.config/screen/screenrc
1299 :END:
1300
1301 #+begin_src screen
1302 startup_message off
1303 caption always "%{= kc}GNU Screen $USER@%H (load: %l)%-28=%{= .m}%D %d.%m.%Y %0c"
1304 #+end_src
1305
1306 ** Shell
1307
1308 *** GNU Bash
1309 :PROPERTIES:
1310 :header-args+: :tangle ~/.bashrc
1311 :END:
1312
1313 #+begin_src bash
1314 # Bash initialization for interactive non-login shells and
1315 # for remote shells (info "(bash) Bash Startup Files").
1316
1317 # Export 'SHELL' to child processes. Programs such as 'screen'
1318 # honor it and otherwise use /bin/sh.
1319 export SHELL
1320
1321 if [[ $- != *i* ]]
1322 then
1323 # We are being invoked from a non-interactive shell. If this
1324 # is an SSH session (as in "ssh host command"), source
1325 # /etc/profile so we get PATH and other essential variables.
1326 [[ -n "$SSH_CLIENT" ]] && source /etc/profile
1327
1328 # Don't do anything else.
1329 return
1330 fi
1331
1332 if [ -n "$IS_GUIX_SYSTEM" ]; then
1333 # Source the system-wide file.
1334 source /etc/bashrc
1335 fi
1336
1337 # from https://unix.stackexchange.com/a/55935
1338 b_prompt() {
1339 cwd=$(sed -e "s:$HOME:~:" -e "s:\(\.\?[^/]\)[^/]*/:\1/:g" <<<$PWD)
1340 printf $cwd
1341 }
1342
1343 if [ $(id -u) == "0" ]; then
1344 PS1='`printf "\[\e[1;31m\]\$\[\e[00m\]"` '
1345 else
1346 PS1='\$ '
1347 fi
1348 PS1="\u@\h:\w/`[ -n "$GUIX_ENVIRONMENT" ] && printf \" [env]\"`\n$PS1"
1349
1350 # set terminal title
1351 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: $(b_prompt)\007"'
1352
1353 # i-beam cursor
1354 # echo -e "\033[5 q" # blinking
1355 echo -e "\033[6 q" # non-blinking
1356
1357 # various bash tweaks
1358 # append to the history file, don't overwrite it
1359 shopt -s histappend
1360 shopt -s cmdhist
1361 # check the window size after each command and, if necessary,
1362 # update the values of LINES and COLUMNS.
1363 shopt -s checkwinsize
1364 # If set, the pattern "**" used in a pathname expansion context will
1365 # match all files and zero or more directories and subdirectories.
1366 #shopt -s globstar
1367 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
1368 HISTSIZE=
1369 HISTFILESIZE=
1370 # don't put duplicate lines or lines starting with space in the
1371 # history.
1372 HISTCONTROL=ignoreboth
1373 # ignore a few very common commands and don't add them to history
1374 HISTIGNORE='ls:l:s:g:[bf]g:history'
1375 HISTTIMEFORMAT='%F %T '
1376 stty stop ""
1377
1378 # aliases
1379 alias ls='ls -p --color=auto'
1380 alias l='ls -lh' # long format and human-readable sizes
1381 alias ll='l -A' # long format, all files
1382 alias dir='dir --color=auto'
1383 alias vdir='vdir --color=auto'
1384 alias grep='grep --color=auto'
1385 alias fgrep='fgrep --color=auto'
1386 alias egrep='egrep --color=auto'
1387 alias mpv="mpv --ytdl-format mp4"
1388 alias mv="mv -iv"
1389 alias cp="cp -iv"
1390 alias mbsync='mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc'
1391 alias getmail='getmail --getmaildir "$XDG_CONFIG_HOME"/getmail --rcfile getmailrc'
1392 alias m="mbsync csclub; mbsync uwaterloo; mbsync shemshak; mbsync gnub"
1393 alias best="youtube-dl -f best"
1394 alias e="$EDITOR"
1395 alias se="SUDO_EDITOR=\"emacsclient\" sudo -e"
1396
1397 aur() {
1398 cd ~/usr/builds
1399 [ -d ${1} ] || git clone https://aur.archlinux.org/${1}.git
1400 cd ${1}
1401 }
1402
1403 function t {
1404 cd $(mktemp -d /tmp/$1.XXXX)
1405 }
1406
1407 # separate alias definitions file, if exists
1408 if [ -f ~/.bash_aliases ]; then
1409 . ~/.bash_aliases
1410 fi
1411
1412 # enable programmable completion features (not needed if already
1413 # enabled in /etc/bash.bashrc and if /etc/profile sources
1414 # /etc/bash.bashrc).
1415 if ! shopt -oq posix; then
1416 if [ -f /usr/share/bash-completion/bash_completion ]; then
1417 . /usr/share/bash-completion/bash_completion
1418 elif [ -f /etc/bash_completion ]; then
1419 . /etc/bash_completion
1420 fi
1421 fi
1422
1423 # source Guix shell config dirs, for vte.sh and bash completions
1424 GUIX_PROFILES=("${HOME}/.guix-profile"
1425 "${HOME}/.config/guix/current")
1426 for profile in "${GUIX_PROFILES[@]}"; do
1427 for dir in "${profile}/etc/bash_completion.d" "${profile}/etc/profile.d"; do
1428 if [ -d "${dir}" ]; then
1429 for f in "${dir}"/*; do
1430 . $f
1431 done
1432 fi
1433 done
1434 done
1435 #+end_src
1436
1437 *** profile
1438 :PROPERTIES:
1439 :header-args+: :tangle ~/.profile
1440 :END:
1441
1442 #+begin_src sh
1443 # ~/.profile: executed by the command interpreter for login shells.
1444 # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
1445 # exists.
1446
1447 # source host-specific profile
1448 if [ -f "$HOME/.config/profiles/$(hostname)" ]; then
1449 . "$HOME/.config/profiles/$(hostname)"
1450 fi
1451
1452 export EDITOR="emacsclient -nw"
1453 export VISUAL="emcl"
1454
1455 PATH="$HOME/.cabal/bin:$HOME/.cargo/bin:$HOME/.elan/bin:$PATH"
1456 if [ -z "$IS_GUIX_SYSTEM" ]; then
1457 PATH="$HOME/.config/guix/current/bin${PATH:+:}$PATH"
1458 INFOPATH="$HOME/.config/guix/current/share/info${INFOPATH:+:}$INFOPATH"
1459 export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
1460 fi
1461 export PATH
1462 export INFOPATH
1463
1464 export MY_GUIX_MANIFESTS="$HOME/.config/guix/manifest"
1465 export MY_GUIX_PROFILES="$HOME/.config/guix/profile"
1466
1467 export XDG_CONFIG_HOME="$HOME/.config"
1468 export XDG_DATA_HOME="$HOME/.local/share"
1469
1470 if [ -f "$HOME/.config/user-dirs.dirs" ]; then
1471 set -a
1472 . "$HOME/.config/user-dirs.dirs"
1473 set +a
1474 fi
1475
1476 export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
1477 export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc
1478
1479 export MAILDIR="$HOME/mail"
1480 export CVS_RSH="ssh"
1481
1482 if [ -x "$(command -v go)" ]; then
1483 export GOPATH="$HOME/src/go"
1484 export PATH="$GOPATH/bin:$PATH"
1485 fi
1486
1487 # if running bash
1488 if [ -n "$BASH_VERSION" ]; then
1489 # include .bashrc if it exists
1490 if [ -f "$HOME/.bashrc" ]; then
1491 . "$HOME/.bashrc"
1492 fi
1493 fi
1494
1495 if [ -z "$IS_GUIX_SYSTEM" ]; then
1496 # if guix is installed
1497 if [ -x "$(command -v guix)" ]; then
1498 SSL_CERT_DIR="$HOME/.guix-profile/etc/ssl/certs"
1499 if [ -d "$SSL_CERT_DIR" -o -h "$SSL_CERT_DIR" ]; then
1500 export SSL_CERT_DIR
1501 export SSL_CERT_FILE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
1502 else
1503 printf "it seems you forgot to \`guix install nss-certs\'\n"
1504 fi
1505 GUIX_PROFILE="$HOME/.guix-profile"
1506 . "$GUIX_PROFILE/etc/profile"
1507 unset XDG_DATA_DIRS
1508 fi
1509 fi
1510
1511 for p in $MY_GUIX_PROFILES/*; do
1512 profile=$p/$(basename "$p")
1513 if [ -f "$profile"/etc/profile ]; then
1514 GUIX_PROFILE="$profile"
1515 . "$GUIX_PROFILE"/etc/profile
1516 fi
1517 unset profile
1518 done
1519
1520 export PATH="$HOME/usr/local/bin:$HOME/.local/bin:$PATH"
1521
1522 # start an ssh-agent (with guix's openssh)
1523 if [ -z "$IS_GUIX_SYSTEM" ]; then
1524 if ! pgrep -u "$USER" ssh-agent > /dev/null; then
1525 ssh-agent > ~/.ssh-agent-thing
1526 fi
1527 if [[ ! "$SSH_AUTH_SOCK" ]]; then
1528 eval "$(<~/.ssh-agent-thing)"
1529 fi
1530 fi
1531
1532 # footenote: when on a foreign distro and using Xfce, don't forget to
1533 # disable its auto-start of gpg- and ssh-agent, by issuing
1534 # xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
1535 # xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false
1536 # see https://docs.xfce.org/xfce/xfce4-session/advanced#ssh_and_gpg_agents
1537 # also, MATE does something similar with gnome-keyring-daemon:
1538 # http://william.shallum.net/random-notes/disabling-gnome-keyring-daemon-ssh-agent-on-mate-desktop
1539
1540 export PATH="$HOME/.cargo/bin:$PATH"
1541 #+end_src
1542
1543 *** per-host profiles
1544
1545 Host-specific profiles, sourced from =~/.profile=. Each
1546 =~/.config/profiles/HOST= file will be sourced on the machine with
1547 =hostname= of =HOST=.
1548
1549 **** chaman
1550 :PROPERTIES:
1551 :header-args+: :tangle ~/.config/profiles/chaman
1552 :END:
1553
1554 #+begin_src sh
1555 export IS_GUIX_SYSTEM=true
1556
1557 if [ -x "$(command -v xinput)" ]; then
1558 xinput --set-prop "TPPS/2 IBM TrackPoint" 'libinput Accel Speed' -0.4
1559 fi
1560
1561 setxkbmap \
1562 -layout us,ir \
1563 -option ctrl:nocaps \
1564 -option grp:shifts_toggle
1565
1566 xmodmap -e "keysym Menu = Super_R"
1567
1568 xsetroot -cursor_name left_ptr
1569 xset r rate 200 45
1570 xset b off
1571 #+end_src
1572
1573 **** darrud
1574 :PROPERTIES:
1575 :header-args+: :tangle ~/.config/profiles/darrud
1576 :END:
1577
1578 #+begin_src sh
1579 export INFOPATH="$HOME/usr/local/share/info${INFOPATH:+:}$INFOPATH"
1580 #+end_src
1581
1582 **** langa
1583 :PROPERTIES:
1584 :header-args+: :tangle ~/.config/profiles/langa
1585 :END:
1586
1587 #+begin_src sh
1588 export XDG_DATA_DIRS="/usr/share/mate:/usr/local/share/:/usr/share/"
1589 #+end_src
1590
1591 ** redshift
1592 :PROPERTIES:
1593 :header-args+: :tangle ~/.config/redshift.conf :comments none
1594 :END:
1595
1596 #+begin_src conf
1597 ; Global settings for redshift
1598 [redshift]
1599 ; Set the day and night screen temperatures (Neutral is 6500K)
1600 ;temp-day=5700
1601 ;temp-night=3500
1602
1603 ;temp-day=6500
1604 temp-day=6200
1605 ;temp-night=4800
1606 ;temp-night=5000
1607 ;temp-night=4500
1608 temp-night=4000
1609
1610 ; Enable/Disable a smooth transition between day and night
1611 ; 0 will cause a direct change from day to night screen temperature.
1612 ; 1 will gradually increase or decrease the screen temperature.
1613 transition=1
1614
1615 ; Set the screen brightness. Default is 1.0.
1616 ;brightness=0.9
1617 ; It is also possible to use different settings for day and night
1618 ; since version 1.8.
1619 ;brightness-day=0.7
1620 ;brightness-night=0.4
1621 ; Set the screen gamma (for all colors, or each color channel
1622 ; individually)
1623 ;gamma=0.8
1624 ;gamma=1.0
1625 ;gamma=0.8:0.7:0.8
1626 ; This can also be set individually for day and night since
1627 ; version 1.10.
1628 ;gamma-day=0.8:0.7:0.8
1629 ;gamma-night=0.6
1630
1631 ; Set the location-provider: 'geoclue2' or 'manual'
1632 ; type 'redshift -l list' to see possible values.
1633 ; The location provider settings are in a different section.
1634 ;location-provider=manual
1635 location-provider=geoclue2
1636
1637 ; Set the adjustment-method: 'randr', 'vidmode'
1638 ; type 'redshift -m list' to see all possible values.
1639 ; 'randr' is the preferred method, 'vidmode' is an older API.
1640 ; but works in some cases when 'randr' does not.
1641 ; The adjustment method settings are in a different section.
1642 adjustment-method=randr
1643
1644 ; Configuration of the location-provider:
1645 ; type 'redshift -l PROVIDER:help' to see the settings.
1646 ; ex: 'redshift -l manual:help'
1647 ; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
1648 ; are negative numbers.
1649 ;[manual]
1650 ;lat=48.1
1651 ;lon=11.6
1652
1653 ; Configuration of the adjustment-method
1654 ; type 'redshift -m METHOD:help' to see the settings.
1655 ; ex: 'redshift -m randr:help'
1656 ; In this example, randr is configured to adjust screen 1.
1657 ; Note that the numbering starts from 0, so this is actually the
1658 ; second screen. If this option is not specified, Redshift will try
1659 ; to adjust _all_ screens.
1660 ;[randr]
1661 ;screen=1
1662 #+end_src
1663
1664 ** signature
1665 :PROPERTIES:
1666 :header-args+: :tangle ~/.signature
1667 :END:
1668
1669 My email signature.
1670
1671 #+begin_src
1672 https://bndl.org
1673 Free Software activist | GNU maintainer & webmaster
1674 GPG: BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103
1675 #+end_src
1676
1677 ** systemd
1678
1679 Keep boot messages on tty1 (see [[https://wiki.archlinux.org/index.php/getty#Have_boot_messages_stay_on_tty1][here]])
1680
1681 #+begin_src conf :tangle /sudo::/etc/systemd/system/getty@tty1.service.d/noclear.conf
1682 [Service]
1683 TTYVTDisallocate=no
1684 #+end_src
1685
1686 ** TLP
1687
1688 *** darrud
1689
1690 #+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "darrud")) "/sudo::/etc/default/tlp")
1691 # ------------------------------------------------------------------------------
1692 # tlp - Parameters for power saving
1693 # See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
1694
1695 # Hint: some features are disabled by default, remove the leading # to enable
1696 # them.
1697
1698 # Set to 0 to disable, 1 to enable TLP.
1699 TLP_ENABLE=1
1700
1701 # Operation mode when no power supply can be detected: AC, BAT.
1702 # Concerns some desktop and embedded hardware only.
1703 TLP_DEFAULT_MODE=AC
1704
1705 # Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
1706 # Hint: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC.
1707 TLP_PERSISTENT_DEFAULT=0
1708
1709 # Seconds laptop mode has to wait after the disk goes idle before doing a sync.
1710 # Non-zero value enables, zero disables laptop mode.
1711 DISK_IDLE_SECS_ON_AC=0
1712 DISK_IDLE_SECS_ON_BAT=2
1713
1714 # Dirty page values (timeouts in secs).
1715 MAX_LOST_WORK_SECS_ON_AC=15
1716 MAX_LOST_WORK_SECS_ON_BAT=60
1717
1718 # Hint: CPU parameters below are disabled by default, remove the leading #
1719 # to enable them, otherwise kernel default values are used.
1720
1721 # Select a CPU frequency scaling governor.
1722 # Intel Core i processor with intel_pstate driver:
1723 # powersave(*), performance.
1724 # Older hardware with acpi-cpufreq driver:
1725 # ondemand(*), powersave, performance, conservative, schedutil.
1726 # (*) is recommended.
1727 # Hint: use tlp-stat -p to show the active driver and available governors.
1728 # Important:
1729 # powersave for intel_pstate and ondemand for acpi-cpufreq are power
1730 # efficient for *almost all* workloads and therefore kernel and most
1731 # distributions have chosen them as defaults. If you still want to change,
1732 # you should know what you're doing! You *must* disable your distribution's
1733 # governor settings or conflicts will occur.
1734 #CPU_SCALING_GOVERNOR_ON_AC=powersave
1735 #CPU_SCALING_GOVERNOR_ON_BAT=powersave
1736 CPU_SCALING_GOVERNOR_ON_AC=conservative
1737 CPU_SCALING_GOVERNOR_ON_BAT=conservative
1738
1739 # Set the min/max frequency available for the scaling governor.
1740 # Possible values strongly depend on your CPU. For available frequencies see
1741 # the output of tlp-stat -p.
1742 #CPU_SCALING_MIN_FREQ_ON_AC=0
1743 #CPU_SCALING_MAX_FREQ_ON_AC=0
1744 #CPU_SCALING_MIN_FREQ_ON_BAT=0
1745 #CPU_SCALING_MAX_FREQ_ON_BAT=0
1746
1747 # Set energy performance hints (HWP) for Intel P-state governor:
1748 # performance, balance_performance, default, balance_power, power
1749 # Values are given in order of increasing power saving.
1750 # Note: Intel Skylake or newer CPU and Kernel >= 4.10 required.
1751 CPU_HWP_ON_AC=balance_performance
1752 CPU_HWP_ON_BAT=balance_power
1753
1754 # Set Intel P-state performance: 0..100 (%).
1755 # Limit the max/min P-state to control the power dissipation of the CPU.
1756 # Values are stated as a percentage of the available performance.
1757 # Requires an Intel Core i processor with intel_pstate driver.
1758 #CPU_MIN_PERF_ON_AC=0
1759 #CPU_MAX_PERF_ON_AC=100
1760 #CPU_MIN_PERF_ON_BAT=0
1761 #CPU_MAX_PERF_ON_BAT=30
1762
1763 # Set the CPU "turbo boost" feature: 0=disable, 1=allow
1764 # Requires an Intel Core i processor.
1765 # Important:
1766 # - This may conflict with your distribution's governor settings
1767 # - A value of 1 does *not* activate boosting, it just allows it
1768 #CPU_BOOST_ON_AC=1
1769 #CPU_BOOST_ON_BAT=0
1770
1771 # Minimize number of used CPU cores/hyper-threads under light load conditions:
1772 # 0=disable, 1=enable.
1773 SCHED_POWERSAVE_ON_AC=0
1774 SCHED_POWERSAVE_ON_BAT=1
1775
1776 # Kernel NMI Watchdog:
1777 # 0=disable (default, saves power), 1=enable (for kernel debugging only).
1778 NMI_WATCHDOG=0
1779
1780 # Change CPU voltages aka "undervolting" - Kernel with PHC patch required.
1781 # Frequency voltage pairs are written to:
1782 # /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
1783 # CAUTION: only use this, if you thoroughly understand what you are doing!
1784 #PHC_CONTROLS="F:V F:V F:V F:V"
1785
1786 # Set CPU performance versus energy savings policy:
1787 # performance, balance-performance, default, balance-power, power.
1788 # Values are given in order of increasing power saving.
1789 # Requires kernel module msr and x86_energy_perf_policy from linux-tools.
1790 ENERGY_PERF_POLICY_ON_AC=performance
1791 ENERGY_PERF_POLICY_ON_BAT=balance-power
1792
1793 # Disk devices; separate multiple devices with spaces (default: sda).
1794 # Devices can be specified by disk ID also (lookup with: tlp diskid).
1795 DISK_DEVICES="sda sdb"
1796
1797 # Disk advanced power management level: 1..254, 255 (max saving, min, off).
1798 # Levels 1..127 may spin down the disk; 255 allowable on most drives.
1799 # Separate values for multiple disks with spaces. Use the special value 'keep'
1800 # to keep the hardware default for the particular disk.
1801 DISK_APM_LEVEL_ON_AC="254 254"
1802 DISK_APM_LEVEL_ON_BAT="128 128"
1803
1804 # Hard disk spin down timeout:
1805 # 0: spin down disabled
1806 # 1..240: timeouts from 5s to 20min (in units of 5s)
1807 # 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
1808 # See 'man hdparm' for details.
1809 # Separate values for multiple disks with spaces. Use the special value 'keep'
1810 # to keep the hardware default for the particular disk.
1811 #DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
1812 #DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
1813
1814 # Select IO scheduler for the disk devices: cfq, deadline, noop (Default: cfq).
1815 # Separate values for multiple disks with spaces. Use the special value 'keep'
1816 # to keep the kernel default scheduler for the particular disk.
1817 #DISK_IOSCHED="cfq cfq"
1818
1819 # AHCI link power management (ALPM) for disk devices:
1820 # min_power, med_power_with_dipm(*), medium_power, max_performance.
1821 # (*) Kernel >= 4.15 required, then recommended.
1822 # Multiple values separated with spaces are tried sequentially until success.
1823 SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
1824 SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
1825
1826 # Exclude host devices from AHCI link power management.
1827 # Separate multiple hosts with spaces.
1828 #SATA_LINKPWR_BLACKLIST="host1"
1829
1830 # Runtime Power Management for AHCI host and disks devices:
1831 # on=disable, auto=enable.
1832 # EXPERIMENTAL ** WARNING: auto will most likely cause system lockups/data loss.
1833 #AHCI_RUNTIME_PM_ON_AC=on
1834 #AHCI_RUNTIME_PM_ON_BAT=on
1835
1836 # Seconds of inactivity before disk is suspended.
1837 AHCI_RUNTIME_PM_TIMEOUT=15
1838
1839 # PCI Express Active State Power Management (PCIe ASPM):
1840 # default, performance, powersave.
1841 PCIE_ASPM_ON_AC=performance
1842 PCIE_ASPM_ON_BAT=powersave
1843
1844 # Radeon graphics clock speed (profile method): low, mid, high, auto, default;
1845 # auto = mid on BAT, high on AC; default = use hardware defaults.
1846 RADEON_POWER_PROFILE_ON_AC=high
1847 RADEON_POWER_PROFILE_ON_BAT=low
1848
1849 # Radeon dynamic power management method (DPM): battery, performance.
1850 RADEON_DPM_STATE_ON_AC=performance
1851 RADEON_DPM_STATE_ON_BAT=battery
1852
1853 # Radeon DPM performance level: auto, low, high; auto is recommended.
1854 RADEON_DPM_PERF_LEVEL_ON_AC=auto
1855 RADEON_DPM_PERF_LEVEL_ON_BAT=auto
1856
1857 # WiFi power saving mode: on=enable, off=disable; not supported by all adapters.
1858 WIFI_PWR_ON_AC=off
1859 WIFI_PWR_ON_BAT=on
1860
1861 # Disable wake on LAN: Y/N.
1862 WOL_DISABLE=Y
1863
1864 # Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
1865 # A value of 0 disables, >=1 enables power saving (recommended: 1).
1866 SOUND_POWER_SAVE_ON_AC=0
1867 SOUND_POWER_SAVE_ON_BAT=0
1868
1869 # Disable controller too (HDA only): Y/N.
1870 SOUND_POWER_SAVE_CONTROLLER=N
1871
1872 # Power off optical drive in UltraBay/MediaBay: 0=disable, 1=enable.
1873 # Drive can be powered on again by releasing (and reinserting) the eject lever
1874 # or by pressing the disc eject button on newer models.
1875 # Note: an UltraBay/MediaBay hard disk is never powered off.
1876 BAY_POWEROFF_ON_AC=0
1877 BAY_POWEROFF_ON_BAT=0
1878 # Optical drive device to power off (default sr0).
1879 BAY_DEVICE="sr0"
1880
1881 # Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable.
1882 RUNTIME_PM_ON_AC=on
1883 RUNTIME_PM_ON_BAT=auto
1884
1885 # Exclude PCI(e) device adresses the following list from Runtime PM
1886 # (separate with spaces). Use lspci to get the adresses (1st column).
1887 #RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
1888 RUNTIME_PM_BLACKLIST="01:00.0"
1889
1890 # Exclude PCI(e) devices assigned to the listed drivers from Runtime PM.
1891 # Default when unconfigured is "amdgpu nouveau nvidia radeon" which
1892 # prevents accidential power-on of dGPU in hybrid graphics setups.
1893 # Use "" to disable the feature completely.
1894 # Separate multiple drivers with spaces.
1895 #RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon"
1896
1897 # Set to 0 to disable, 1 to enable USB autosuspend feature.
1898 USB_AUTOSUSPEND=1
1899
1900 # Exclude listed devices from USB autosuspend (separate with spaces).
1901 # Use lsusb to get the ids.
1902 # Note: input devices (usbhid) are excluded automatically
1903 #USB_BLACKLIST="1111:2222 3333:4444"
1904
1905 # Bluetooth devices are excluded from USB autosuspend:
1906 # 0=do not exclude, 1=exclude.
1907 USB_BLACKLIST_BTUSB=0
1908
1909 # Phone devices are excluded from USB autosuspend:
1910 # 0=do not exclude, 1=exclude (enable charging).
1911 USB_BLACKLIST_PHONE=0
1912
1913 # Printers are excluded from USB autosuspend:
1914 # 0=do not exclude, 1=exclude.
1915 USB_BLACKLIST_PRINTER=1
1916
1917 # WWAN devices are excluded from USB autosuspend:
1918 # 0=do not exclude, 1=exclude.
1919 USB_BLACKLIST_WWAN=1
1920
1921 # Include listed devices into USB autosuspend even if already excluded
1922 # by the blacklists above (separate with spaces).
1923 # Use lsusb to get the ids.
1924 #USB_WHITELIST="1111:2222 3333:4444"
1925
1926 # Set to 1 to disable autosuspend before shutdown, 0 to do nothing
1927 # (workaround for USB devices that cause shutdown problems).
1928 #USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
1929
1930 # Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
1931 # on system startup: 0=disable, 1=enable.
1932 # Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
1933 # are ignored when this is enabled!
1934 #RESTORE_DEVICE_STATE_ON_STARTUP=0
1935 RESTORE_DEVICE_STATE_ON_STARTUP=1
1936
1937 # Radio devices to disable on startup: bluetooth, wifi, wwan.
1938 # Separate multiple devices with spaces.
1939 #DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
1940
1941 # Radio devices to enable on startup: bluetooth, wifi, wwan.
1942 # Separate multiple devices with spaces.
1943 #DEVICES_TO_ENABLE_ON_STARTUP="wifi"
1944
1945 # Radio devices to disable on shutdown: bluetooth, wifi, wwan.
1946 # (workaround for devices that are blocking shutdown).
1947 #DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
1948
1949 # Radio devices to enable on shutdown: bluetooth, wifi, wwan.
1950 # (to prevent other operating systems from missing radios).
1951 #DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
1952
1953 # Radio devices to enable on AC: bluetooth, wifi, wwan.
1954 #DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
1955
1956 # Radio devices to disable on battery: bluetooth, wifi, wwan.
1957 #DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
1958
1959 # Radio devices to disable on battery when not in use (not connected):
1960 # bluetooth, wifi, wwan.
1961 #DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
1962
1963 # Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
1964 # required). Charging starts when the remaining capacity falls below the
1965 # START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value.
1966 # Main / Internal battery (values in %)
1967 #START_CHARGE_THRESH_BAT0=75
1968 #STOP_CHARGE_THRESH_BAT0=80
1969 # Ultrabay / Slice / Replaceable battery (values in %)
1970 #START_CHARGE_THRESH_BAT1=75
1971 #STOP_CHARGE_THRESH_BAT1=80
1972
1973 # Restore charge thresholds when AC is unplugged: 0=disable, 1=enable.
1974 #RESTORE_THRESHOLDS_ON_BAT=1
1975
1976 # ------------------------------------------------------------------------------
1977 # tlp-rdw - Parameters for the radio device wizard
1978 # Possible devices: bluetooth, wifi, wwan.
1979
1980 # Hints:
1981 # - Parameters are disabled by default, remove the leading # to enable them
1982 # - Separate multiple radio devices with spaces
1983
1984 # Radio devices to disable on connect.
1985 #DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
1986 #DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
1987 #DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
1988
1989 # Radio devices to enable on disconnect.
1990 #DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
1991 #DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
1992 #DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
1993
1994 # Radio devices to enable/disable when docked.
1995 #DEVICES_TO_ENABLE_ON_DOCK=""
1996 #DEVICES_TO_DISABLE_ON_DOCK=""
1997
1998 # Radio devices to enable/disable when undocked.
1999 #DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
2000 #DEVICES_TO_DISABLE_ON_UNDOCK=""
2001 #+end_src
2002
2003 ** Tridactyl
2004 :PROPERTIES:
2005 :header-args+: :tangle ~/.config/tridactyl/tridactylrc
2006 :END:
2007
2008 #+begin_src conf
2009 bind n scrollline 2
2010 bind p scrollline -2
2011
2012 bind 0 scrollto 0 x
2013 bind - scrollto 100 x
2014
2015 bind P tabprev
2016 bind N tabnext
2017
2018 bind d scrollpage 0.5
2019 bind u scrollpage -0.5
2020 unbind <C-d>
2021 unbind <C-u>
2022
2023 bind x tabclose
2024 bind X undo
2025 bind <C-S> stop
2026
2027 bind gd tabduplicate
2028 bind gw tabdetach
2029
2030 bind O fillcmdline bmarks
2031
2032 bind ;<Space> fillcmdline_notrail
2033
2034 unbind <C-f>
2035
2036 set hintfiltermode vimperator-reflow
2037 set hintnames numeric
2038 set urlparenttrailingslash false
2039
2040 set browser abrowser
2041 " set newtab https://bandali.eu.org
2042
2043 seturl warrior.uwaterloo.ca noiframe true
2044
2045 " autocmd DocStart www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
2046 #+end_src
2047
2048 ** X
2049
2050 *** xinit
2051 :PROPERTIES:
2052 :header-args+: :tangle ~/.xinitrc
2053 :END:
2054
2055 #+begin_src sh
2056 [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
2057 #+end_src
2058
2059 *** X resources
2060
2061 #+begin_src conf-xdefaults :tangle (when (eq system-type 'gnu/linux) "~/.Xresources")
2062 #include ".Xresources.d/fonts"
2063 #include ".Xresources.d/emacs"
2064 #include ".Xresources.d/rxvt-unicode"
2065 #+end_src
2066
2067 **** emacs
2068 :PROPERTIES:
2069 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/emacs")
2070 :END:
2071
2072 #+begin_src conf-xdefaults
2073 Emacs.menuBar: off
2074 Emacs.toolBar: off
2075 Emacs.verticalScrollBars: off
2076 Emacs.cursorBlink: off
2077 Emacs.FontBackend: ftcrhb,x
2078 !Emacs.FontBackend: xft,x
2079 ! Emacs.font: Ubuntu Mono-12
2080 ! Emacs.font: Triplicate T4C-11
2081 ! Emacs.font: Ubuntu Mono-10.5
2082 ! Emacs.font: Ubuntu Mono-12
2083 ! Emacs.font: Iosevka-11
2084
2085 ! Emacs.font: Fira Mono:size=15
2086 ! Emacs.font: DejaVu Sans Mono:size=15
2087 ! Emacs.font: Inconsolata:size=17
2088 ! Emacs.font: Inconsolata:size=16
2089 ! Emacs.font: Inconsolata LGC:size=14
2090 ! Emacs.font: Source Code Pro Medium-10.5
2091 Emacs.font: Source Code Pro Medium:size=14
2092 !Emacs.font: Vazir:size=14
2093 ! Emacs.font: Ubuntu Mono:size=16
2094 ! Emacs.font: Iosevka:size=16
2095 #+end_src
2096
2097 **** fonts
2098 :PROPERTIES:
2099 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/fonts")
2100 :END:
2101
2102 #+begin_src conf-xdefaults
2103 Xft.lcdfilter: lcddefault
2104 Xft.antialias: true
2105 Xft.autohint: 0
2106 Xft.hinting: true
2107 Xft.hintstyle: hintslight
2108 ! Xft.hintstyle: hintfull
2109 Xft.rgba: rgb
2110 Xft.dpi: 96
2111 #+end_src
2112
2113 **** rxvt-unicode
2114 :PROPERTIES:
2115 :header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/rxvt-unicode")
2116 :END:
2117
2118 #+begin_src conf-xdefaults
2119 ! Font
2120 URxvt.font: xft:source code pro:pixelsize=14:antialias=true:hinting=true, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true
2121 URxvt.boldFont: xft:source code pro:semibold:pixelsize=14:antialias=true:hinting=true:bold, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bold
2122 URxvt.italicFont: xft:source code pro:italic:pixelsize=14:antialias=true:hinting=true:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:italic
2123 URxvt.bolditalicFont: xft:source code pro:semibold:italic:pixelsize=14:antialias=true:hinting=true:bold:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bolditalic
2124
2125 URxvt.xftAntialias: true
2126 URxvt.letterSpace: -1
2127
2128 !URxvt.depth: 0
2129 !URxvt.loginShell: true
2130 !URxvt*buffered: false
2131 URxvt.saveLines: 100000
2132 URxvt.internalBorder: 3
2133 URxvt.lineSpace: 0
2134 URxvt.scrollBar: false
2135 URxvt.scrollStyle: rxvt
2136 URxvt*scrollTtyOutput: false
2137 URxvt*scrollWithBuffer: true
2138 URxvt*scrollTtyKeypress: true
2139 URxvt.keysym.Shift-Up: command:\033]720;1\007
2140 URxvt.keysym.Shift-Down: command:\033]721;1\007
2141
2142 URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
2143 URxvt.url-select.launcher: firefox
2144 URxvt.url-select.underline: true
2145 URxvt.keysym.M-u: perl:url-select:select_next
2146 URxvt.keysym.M-Escape: perl:keyboard-select:activate
2147 URxvt.keysym.M-s: perl:keyboard-select:search
2148 URxvt.url-launcher: /usr/bin/abrowser
2149 URxvt.matcher.button: 1
2150 ! URxvt.iso14755: false
2151 ! URxvt.iso14755_53: false
2152 ! URxvt.keysym.M-c: perl:clipboard:copy
2153 ! URxvt.keysym.M-v: perl:clipboard:paste
2154 URxvt.keysym.M-c: eval:selection_to_clipboard
2155 URxvt.keysym.M-v: eval:paste_clipboard
2156 URxvt.keysym.C-A-V: perl:clipboard:paste_escaped
2157 ! URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard
2158 ! URxvt.keysym.Shift-Control-V: eval:paste_clipboard
2159 URxvt.keysym.C-Up: font-size:increase
2160 URxvt.keysym.C-Down: font-size:decrease
2161 URxvt.keysym.C-S-Up: font-size:incglobal
2162 URxvt.keysym.C-S-Down: font-size:decglobal
2163 URxvt.keysym.C-equal: font-size:reset
2164 !URxvt.keysym.C-question: font-size:show
2165
2166 !URxvt.iconFile: /usr/share/icons/elementary-xfce/apps/48/terminal.png
2167
2168 !urxvt*foreground: white
2169 !urxvt*background: black
2170
2171 !*color0: #2E3436
2172 !*color1: #a40000
2173 !*color2: #4E9A06
2174 !*color3: #C4A000
2175 !*color4: #3465A4
2176 !*color5: #75507B
2177 !*color6: #ce5c00
2178 !*color7: #babdb9
2179 !*color8: #555753
2180 !*color9: #EF2929
2181 !*color10: #8AE234
2182 !*color11: #FCE94F
2183 !*color12: #729FCF
2184 !*color13: #AD7FA8
2185 !*color14: #fcaf3e
2186 !*color15: #EEEEEC
2187
2188 !URxvt.foreground: #C8C8C8
2189 !URxvt.background: #FFFFFF
2190
2191 !! black
2192 !*color0: #2E3436
2193 !*color8: #555753
2194 !! red
2195 !*color1: #a40000
2196 !*color9: #EF2929
2197 !! green
2198 !*color2: #4E9A06
2199 !*color10: #8AE234
2200 !! yellow
2201 !*color3: #C4A000
2202 !*color11: #FCE94F
2203 !! blue
2204 !*color4: #3465A4
2205 !*color12: #729FCF
2206 !! purple
2207 !*color5: #75507B
2208 !*color13: #AD7FA8
2209 !! orange (replaces cyan)
2210 !*color6: #ce5c00
2211 !*color14: #fcaf3e
2212 !! white
2213 !*color7: #babdb9
2214 !*color15: #EEEEEC
2215
2216
2217 ! ! Solarized
2218 ! ! Base16 Solarized Light
2219 ! ! Scheme: Ethan Schoonover (http://ethanschoonover.com/solarized)
2220
2221 ! #define base00 #fdf6e3
2222 ! #define base01 #eee8d5
2223 ! #define base02 #93a1a1
2224 ! #define base03 #839496
2225 ! #define base04 #657b83
2226 ! #define base05 #586e75
2227 ! #define base06 #073642
2228 ! #define base07 #002b36
2229 ! #define base08 #dc322f
2230 ! #define base09 #cb4b16
2231 ! #define base0A #b58900
2232 ! #define base0B #859900
2233 ! #define base0C #2aa198
2234 ! #define base0D #268bd2
2235 ! #define base0E #6c71c4
2236 ! #define base0F #d33682
2237
2238 ! *foreground: base05
2239 ! #ifdef background_opacity
2240 ! *background: [background_opacity]base00
2241 ! #else
2242 ! *background: base00
2243 ! #endif
2244 ! *cursorColor: base05
2245
2246 ! *color0: base00
2247 ! *color1: base08
2248 ! *color2: base0B
2249 ! *color3: base0A
2250 ! *color4: base0D
2251 ! *color5: base0E
2252 ! *color6: base0C
2253 ! *color7: base05
2254
2255 ! *color8: base03
2256 ! *color9: base08
2257 ! *color10: base0B
2258 ! *color11: base0A
2259 ! *color12: base0D
2260 ! *color13: base0E
2261 ! *color14: base0C
2262 ! *color15: base07
2263
2264 ! ! Note: colors beyond 15 might not be loaded (e.g., xterm, urxvt),
2265 ! ! use 'shell' template to set these if necessary
2266 ! *color16: base09
2267 ! *color17: base0F
2268 ! *color18: base01
2269 ! *color19: base02
2270 ! *color20: base04
2271 ! *color21: base06
2272
2273
2274 ! Tango colour theme for rxvt-unicode
2275 URxvt.background: #FFFFFF
2276 URxvt.foreground: #000000
2277
2278 ! Black
2279 URxvt.color0: #2E3436
2280 URxvt.color8: #757773
2281
2282 ! Red
2283 URxvt.color1: #CC0000
2284 URxvt.color9: #EF2929
2285
2286 ! Green
2287 URxvt.color2: #4E9A06
2288 URxvt.color10: #8AE234
2289
2290 ! Yellow
2291 URxvt.color3: #C4A000
2292 URxvt.color11: #FCE94F
2293
2294 ! Blue
2295 URxvt.color4: #3465A4
2296 URxvt.color12: #729FCF
2297
2298 ! Magenta
2299 URxvt.color5: #75507B
2300 URxvt.color13: #AD7FA8
2301
2302 !! Cyan
2303 !URxvt.color6: #06989A
2304 !URxvt.color14: #34E2E2
2305 ! orange (replaces cyan)
2306 ,,*color6: #ce5c00
2307 ,,*color14: #fcaf3e
2308
2309 ! White
2310 URxvt.color7: #D3D7CF
2311 URxvt.color15: #EEEEEC
2312 #+end_src
2313
2314 *** ~/.xsession
2315 :PROPERTIES:
2316 :header-args+: :tangle ~/.xsession :tangle-mode (identity #o755)
2317 :END:
2318
2319 For custom session on Debian. See https://wiki.debian.org/Xsession.
2320
2321 #+begin_src sh
2322 if [ -f "$HOME/.xinitrc" ]; then
2323 . "$HOME/.xinitrc"
2324 fi
2325
2326 [ -f "/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd" ] && /usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd &
2327 [ -x "$(command -v light-locker)" ] && light-locker --lock-on-suspend &
2328 [ -x "$(command -v pasystray)" ] && pasystray -a &
2329 [ -x "$(command -v nm-applet)" ] && nm-applet &
2330 [ -x "$(command -v compton)" ] && compton &
2331 [ -x "$(command -v dunst)" ] && dunst &
2332 [ -x "$(command -v emacs)" ] && exec ssh-agent exwm -ib 0
2333 #+end_src
2334
2335 *** ~/.xsessionrc
2336 :PROPERTIES:
2337 :header-args+: :tangle ~/.xsessionrc
2338 :END:
2339
2340 #+begin_src sh
2341 if [ -f "$HOME/.profile" ]; then . "$HOME/.profile"; fi
2342 #+end_src
2343
2344 ** XDG
2345 :PROPERTIES:
2346 :header-args+: :tangle ~/.config/user-dirs.dirs
2347 :END:
2348
2349 #+begin_src conf
2350 XDG_DESKTOP_DIR="$HOME/Desktop"
2351 XDG_DOCUMENTS_DIR="$HOME/usr/doc"
2352 XDG_DOWNLOAD_DIR="$HOME/usr/dl"
2353 XDG_MUSIC_DIR="$HOME/usr/music"
2354 XDG_PICTURES_DIR="$HOME/usr/pic"
2355 XDG_PUBLICSHARE_DIR="$HOME/usr/pub"
2356 XDG_TEMPLATES_DIR="$HOME/usr/temp"
2357 XDG_VIDEOS_DIR="$HOME/usr/vid"
2358 #+end_src
2359
2360 ** zathura
2361 :PROPERTIES:
2362 :header-args+: :tangle ~/.config/zathura/zathurarc
2363 :END:
2364
2365 #+begin_src conf
2366 set smooth-scroll true
2367 set selection-clipboard clipboard
2368 set zoom-step 05
2369 set default-bg "#272727"
2370 set statusbar-bg "#272727"
2371 set inputbar-bg "#373737"
2372 set window-title-basename true
2373 set statusbar-home-tilde true
2374
2375 map <Return> scroll down
2376 map <A-Return> scroll up
2377
2378 map H jumplist backward
2379 map L jumplist forward
2380
2381 map [normal] i toggle_index
2382 map [index] i toggle_index
2383 map [index] q toggle_index
2384 #+end_src
2385
2386 * Scripts
2387
2388 This section contains various useful scripts including ones used by
2389 the programs above. For instance, =toggle-tablet= for switching to
2390 and from tablet mode on my X220T, =toggle-presentation-mode= for
2391 toggling Xfce's presentation mode which keeps the screen awake, and
2392 =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
2393 exact brightness value.
2394
2395 ** battery-percentage-time
2396 :PROPERTIES:
2397 :header-args+: :tangle ~/.local/bin/battery-percentage-time :shebang "#!/bin/sh"
2398 :END:
2399
2400 #+begin_src sh :tangle no
2401 dbus_send() {
2402 label=$1
2403 dbus-send --print-reply=literal --system \
2404 --dest=org.freedesktop.UPower \
2405 /org/freedesktop/UPower/devices/battery_BAT0 \
2406 org.freedesktop.DBus.Properties.Get \
2407 string:org.freedesktop.UPower.Device \
2408 string:"${label}" | awk '{print $3}'
2409 }
2410
2411 perc=$(dbus_send 'Percentage')
2412 state=$(dbus_send 'State')
2413
2414 if [ "$state" -eq 2 ]; then # Discharging
2415 secs=$(dbus_send 'TimeToEmpty')
2416 elif [ "$state" -eq 1 ]; then # Charging
2417 secs=$(dbus_send 'TimeToFull')
2418 fi
2419
2420 printf '%s%%%%%2dh%02dm \n' "$perc" $((secs / 3600)) $((secs % 3600 / 60))
2421 #+end_src
2422
2423 ** emcl
2424 :PROPERTIES:
2425 :header-args+: :tangle ~/.local/bin/emcl :shebang "#!/bin/sh"
2426 :END:
2427
2428 #+begin_src sh
2429 exec emacsclient --alternate-editor="" -c "$@"
2430 #+end_src
2431
2432 ** my-i3status
2433 :PROPERTIES:
2434 :header-args+: :tangle ~/.local/bin/my-i3status :shebang "#!/usr/bin/env python2"
2435 :END:
2436
2437 #+begin_src python
2438 # -*- coding: utf-8 -*-
2439
2440 # This script is a simple wrapper which prefixes each i3status line with custom
2441 # information. It is based on:
2442 # https://github.com/i3/i3status/blob/master/contrib/wrapper.py
2443 #
2444 # In ~/.i3status.conf, add the following line:
2445 # output_format = "i3bar"
2446 # in the 'general' section.
2447 # Then, in ~/.config/i3/config or ~/.config/sway/config add:
2448 # status_command i3status | my-i3status.py
2449 # in the 'bar' section. Make sure my-i3status.py is in $PATH.
2450 #
2451 # © 2012 Valentin Haenel <valentin.haenel@gmx.de>
2452 # © 2018 Amin Bandali <bandali@gnu.org>
2453 #
2454 # This program is free software. It comes without any warranty, to the extent
2455 # permitted by applicable law. You can redistribute it and/or modify it under
2456 # the terms of the Do What The Fuck You Want To Public License (WTFPL), Version
2457 # 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
2458 # details.
2459
2460 import sys
2461 import json
2462 import os
2463
2464 def get_nosleep():
2465 """ Return true if ~/.nosleep exists. """
2466 return os.path.isfile(os.path.expanduser("~/.nosleep"))
2467
2468 def print_line(message):
2469 """ Non-buffered printing to stdout. """
2470 sys.stdout.write(message + '\n')
2471 sys.stdout.flush()
2472
2473 def read_line():
2474 """ Interrupted respecting reader for stdin. """
2475 # try reading a line, removing any extra whitespace
2476 try:
2477 line = sys.stdin.readline().strip()
2478 # i3status sends EOF, or an empty line
2479 if not line:
2480 sys.exit(3)
2481 return line
2482 # exit on ctrl-c
2483 except KeyboardInterrupt:
2484 sys.exit()
2485
2486 if __name__ == '__main__':
2487 # Skip the first line which contains the version header.
2488 print_line(read_line())
2489
2490 # The second line contains the start of the infinite array.
2491 print_line(read_line())
2492
2493 while True:
2494 line, prefix = read_line(), ''
2495 # ignore comma at start of lines
2496 if line.startswith(','):
2497 line, prefix = line[1:], ','
2498
2499 if get_nosleep():
2500 j = json.loads(line)
2501 # insert information into the start of the json, but could be anywhere
2502 j.insert(0, {'full_text' : '•', 'name' : 'nosleep'})
2503 # and echo back new encoded json
2504 print_line(prefix+json.dumps(j))
2505 else:
2506 print_line(prefix+line)
2507 #+end_src
2508
2509 ** rofi-light
2510 :PROPERTIES:
2511 :header-args+: :tangle ~/.local/bin/rofi-light :shebang "#!/bin/sh"
2512 :END:
2513
2514 #+begin_src sh
2515 cur=$(light -G)
2516 val=$(rofi -dmenu -mesg "light $cur" -p "light -S " -l 0 -width 12)
2517 [ -n "$val" ] && light -S "$val"
2518 #+end_src
2519
2520 ** rofi-remmina
2521 :PROPERTIES:
2522 :header-args+: :tangle ~/.local/bin/rofi-remmina :shebang "#!/usr/bin/env python2"
2523 :END:
2524
2525 #+begin_src python
2526 import ConfigParser
2527 import os
2528 from subprocess import Popen, PIPE
2529
2530 remmina_dir = os.path.expanduser("~/.local/share/remmina")
2531
2532 fdict = dict()
2533
2534 for f in os.listdir(remmina_dir):
2535 fp = os.path.join(remmina_dir, f)
2536 c = ConfigParser.ConfigParser()
2537 c.read(fp)
2538 n = c.get('remmina', 'name')
2539 fdict[n] = fp
2540
2541 lines = max(min(15, len(fdict)), 1);
2542 width = len(max(fdict.keys(), key=len))
2543 rofi = Popen(["rofi", "-i", "-dmenu", \
2544 "-l", str(lines), "-width", str(width), \
2545 "-p", "connection"], stdout=PIPE, stdin=PIPE)
2546 selected = rofi.communicate("\n" \
2547 .join(fdict.keys()) \
2548 .encode("utf-8"))[0] \
2549 .decode("utf-8") \
2550 .strip()
2551 rofi.wait()
2552
2553 r = Popen(["remmina", "-c", fdict[selected]])
2554 r.wait()
2555 #+end_src
2556
2557 ** toggle-presentation-mode
2558 :PROPERTIES:
2559 :header-args+: :tangle ~/.local/bin/toggle-presentation-mode :shebang "#!/bin/sh"
2560 :END:
2561
2562 #+begin_src sh
2563 xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
2564 #+end_src
2565
2566 ** toggle-tablet
2567 :PROPERTIES:
2568 :header-args+: :tangle ~/.local/bin/toggle-tablet :shebang "#!/bin/sh"
2569 :END:
2570
2571 #+begin_src sh
2572 # This script toggles between a 'normal' mode and a 'tablet' mode, doing
2573 # a few things:
2574
2575 # - rotates the screen using =xrandr=, so that rotating the physical
2576 # display of my X220t would have the laptop's battery on the right
2577 # hand side,
2578 # - enables touch screen,
2579 # - properly rotates the stylus pen and touch screen pointers, and
2580 # - toggles between RGB and Vertical BGR sub-pixel order.
2581
2582 case $(xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation) in
2583 0) # Screen is not rotated, we should rotate it right (90°)
2584 xrandr -o 3
2585 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 1
2586 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 1
2587 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 1
2588 xfconf-query -c xsettings -p /Xft/RGBA -s vbgr
2589 ;;
2590 1) # Currently top is rotated right, we should set it normal (0°)
2591 xrandr -o 0
2592 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 0
2593 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 0
2594 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 0
2595 xfconf-query -c xsettings -p /Xft/RGBA -s rgb
2596 ;;
2597 ,*)
2598 echo "Unknown result from 'xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation'" >&2
2599 exit 1
2600 ;;
2601 esac
2602 #+end_src
2603
2604 ** volume-info
2605 :PROPERTIES:
2606 :header-args+: :tangle ~/.local/bin/volume-info :shebang "#!/bin/sh"
2607 :END:
2608
2609 #+begin_src sh
2610 cur_vol=$(pamixer --get-volume)
2611
2612 if [ $(pamixer --get-mute) = true ]; then
2613 printf 'mt \n' "$cur_vol"
2614 else
2615 printf '%02d \n' "$cur_vol"
2616 fi
2617 #+end_src
2618
2619 ** zathura-sync
2620 :PROPERTIES:
2621 :header-args+: :tangle ~/.local/bin/zathura-sync :shebang "#!/bin/sh"
2622 :END:
2623
2624 #+begin_src sh
2625 pos="$1"
2626 pdffile="$2"
2627 zathura --synctex-forward "$pos" "$pdffile" || \
2628 (
2629 zathura -x "emacsclient --eval '(progn (switch-to-buffer (file-name-nondirectory \"%{input}\")) (goto-line %{line}))'" "$pdffile" &
2630 sleep 1; zathura --synctex-forward "$pos" "$pdffile" )
2631 #+end_src