X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/blobdiff_plain/590276739114ee21891a9aab06a05938d80db544..695170a4c7ba5c076b3f1c58b66836f20d242fa0:/rc.org?ds=sidebyside diff --git a/rc.org b/rc.org index 478e3b8..baf1eee 100644 --- a/rc.org +++ b/rc.org @@ -14,47 +14,6 @@ Note: This file is best viewed inside Emacs with org mode. This section contains the configuration files (dotfiles) of various programs I use. -** [[https://github.com/afewmail/afew][afew]] -:PROPERTIES: -:header-args+: :tangle ~/.config/afew/config -:END: - -#+begin_quote -an initial tagging script for notmuch mail -#+end_quote - -#+begin_src conf -# This is the default filter chain -[SpamFilter] -#[ClassifyingFilter] -[KillThreadsFilter] -#[ListMailsFilter] -[ArchiveSentMailsFilter] -sent_tag = sent -[InboxFilter] - -#[Filter.1] -#query = 'folder:amin/lists/.haskell-cafe' -#tags = +lists;+lists/haskell-cafe -#message = lists/haskell-cafe - -#[Filter.2] -#query = 'folder:amin/lists/.haskell-weekly' -#tags = +lists;+lists/haskell-weekly -#message = lists/haskell-weekly - -#[Filter.3] -#query = 'folder:amin/lists/.hackernewsletter' -#tags = +lists;+lists/hackernewsletter -#message = lists/hackernewsletter - - -#[FolderNameFilter] -#folder_blacklist = Inbox -#maildir_separator = /. -#folder_transforms = Drafts:draft Junk:spam Trash:deleted Sent:sent Archive:archive lists/haskell-cafe:lists/haskell-cafe -#+end_src - ** bspwm *** bspwmrc @@ -66,7 +25,7 @@ sent_tag = sent sxhkd & sh ~/.fehbg & xfce4-panel -d & -#compton & +compton & sleep 0.5 && pasystray --notify=all & bspc monitor -d I II III IV V VI VII VIII IX X @@ -85,7 +44,7 @@ bspc config gapless_monocle true bspc config click_to_focus button1 bspc config directional_focus_tightness low -bspc rule -a Firefox desktop='^1' follow=on +#bspc rule -a Firefox desktop='^1' follow=on bspc rule -a Nightly desktop='^1' follow=on bspc rule -a Emacs desktop='^2' state=tiled follow=on #bspc rule -a Chromium desktop='^4' follow=on @@ -177,6 +136,9 @@ XF86Audio{Raise,Lower}Volume XF86AudioMute pamixer --toggle-mute +XF86AudioMicMute + pactl set-source-mute 1 toggle + # playback control XF86Audio{Play,Prev,Next} mpc {toggle,prev,next} @@ -204,6 +166,9 @@ super + apostrophe #XF86KbdBrightness{Up,Down} # kbdlight {up,down} +XF86RotateWindows + toggle-tablet + # # bspwm hotkeys # @@ -623,7 +588,7 @@ timeout = 0 ** Fontconfig :PROPERTIES: -:header-args+: :tangle ~/.config/fontconfig/fonts.conf +:header-args+: :tangle ~/.config/fontconfig/fonts.conf :comments none :END: #+begin_src xml @@ -787,6 +752,22 @@ $clean_ext = "aux out"; # $pdf_previewer = 'exec zathura --synctex-forward -x \'emacsclient --no-wait +%{line} %{input}\' %O %S'; #+end_src +** libinput + +Improve XPS 15 9560's touchpad experience. + +#+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "plasma")) "/sudo::/etc/X11/xorg.conf.d/30-touchpad.conf") +Section "InputClass" + Identifier "libinput touchpad catchall" + Driver "libinput" + MatchIsTouchpad "on" + Option "ClickMethod" "clickfinger" + Option "NaturalScrolling" "true" + Option "Tapping" "on" + Option "TappingButtonMap" "lrm" +EndSection +#+end_src + ** getmail *** getmailrc @@ -799,7 +780,7 @@ $clean_ext = "aux out"; type = SimplePOP3SSLRetriever server = fencepost.gnu.org username = aminb -password_command = ("gpg2", "--no-tty", "-q", "-d", "~/.passwd/gnu.gpg") +password_command = ("gpg2", "--no-tty", "-q", "-d", "/home/amin/.passwd/gnu.gpg") port = 995 use_apop = True @@ -1415,7 +1396,7 @@ logfile ~/.msmtp.log # aminb account aminb host nix.aminb.org -tls_fingerprint BB:98:B3:02:83:B0:E0:C3:49:3E:C2:B2:A8:60:62:78:03:B3:5D:B3:BD:B8:0A:39:BB:E4:B0:66:D1:CF:D1:6B +tls_fingerprint 65:DD:B8:32:D8:CD:F1:DC:B6:34:EE:35:04:18:AC:09:F3:1D:6D:20:F2:4A:E2:BD:64:48:B7:1F:90:BD:C4:BA tls_starttls on from amin@aminb.org user amin@aminb.org @@ -1424,7 +1405,7 @@ passwordeval gpg2 --no-tty -q -d ~/.passwd/amin.gpg # gnu account gnu host fencepost.gnu.org -tls_fingerprint 94:0E:37:EB:EA:44:5A:4B:B6:6F:16:3D:6C:7E:7E:44:2D:93:61:C1:FE:82:A8:29:5E:3C:12:4E:2D:BE:0E:2C +tls_fingerprint 95:B7:AC:05:37:97:F8:BE:0B:C0:71:4A:8A:4C:0B:A7:59:FD:2F:B8:93:C8:CC:B6:FF:82:83:90:CF:03:91:93 tls_starttls on from aminb@gnu.org user aminb @@ -2024,6 +2005,2537 @@ def_key "K" move_sort_order_up #+end_src +** notmuch + +*** notmuch-config +:PROPERTIES: +:header-args+: :tangle ~/.notmuch-config +:END: + +#+begin_src conf +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see https://notmuchmail.org + +# Database configuration +# +# The only value supported here is 'path' which should be the top-level +# directory where your mail currently exists and to where mail will be +# delivered in the future. Files should be individual email messages. +# Notmuch will store its database within a sub-directory of the path +# configured here named ".notmuch". +# +[database] +path=/home/amin/mail + +# User configuration +# +# Here is where you can let notmuch know how you would like to be +# addressed. Valid settings are +# +# name Your full name. +# primary_email Your primary email address. +# other_email A list (separated by ';') of other email addresses +# at which you receive email. +# +# Notmuch will use the various email addresses configured here when +# formatting replies. It will avoid including your own addresses in the +# recipient list of replies, and will set the From address based on the +# address to which the original email was addressed. +# +[user] +name=Amin Bandali +primary_email=amin@aminb.org +other_email=abandali@uwaterloo.ca;amin.bandali@uwaterloo.ca;aminb@gnu.org; + +# Configuration for "notmuch new" +# +# The following options are supported here: +# +# tags A list (separated by ';') of the tags that will be +# added to all messages incorporated by "notmuch new". +# +# ignore A list (separated by ';') of file and directory names +# that will not be searched for messages by "notmuch new". +# +# NOTE: *Every* file/directory that goes by one of those +# names will be ignored, independent of its depth/location +# in the mail store. +# +[new] +tags=new; +#tags=unread;inbox; +ignore=.uidvalidity;.mbsyncstate;/.*/dovecot*/ + +# Search configuration +# +# The following option is supported here: +# +# exclude_tags +# A ;-separated list of tags that will be excluded from +# search results by default. Using an excluded tag in a +# query will override that exclusion. +# +[search] +exclude_tags=deleted;spam; + +# Maildir compatibility configuration +# +# The following option is supported here: +# +# synchronize_flags Valid values are true and false. +# +# If true, then the following maildir flags (in message filenames) +# will be synchronized with the corresponding notmuch tags: +# +# Flag Tag +# ---- ------- +# D draft +# F flagged +# P passed +# R replied +# S unread (added when 'S' flag is not present) +# +# The "notmuch new" command will notice flag changes in filenames +# and update tags, while the "notmuch tag" and "notmuch restore" +# commands will notice tag changes and update flags in filenames +# +[maildir] +synchronize_flags=true + +# Cryptography related configuration +# +# The following option is supported here: +# +# gpg_path +# binary name or full path to invoke gpg. +# +[crypto] +gpg_path=gpg +#+end_src + +*** pre-new hook +:PROPERTIES: +:header-args+: :tangle ~/mail/.notmuch/hooks/pre-new :shebang "#!/bin/sh" +:END: + +#+begin_src sh +touch /tmp/gnusieve.log +sieve-filter -eW -o postmaster_address=postmaster@aminb.org \ + -o mail_location=maildir:$MAILDIR/gnu:LAYOUT=fs:INBOX=$MAILDIR/gnu/Inbox ~/sieve/gnu.sieve INBOX delete &>>/tmp/gnusieve.log +#+end_src + +*** post-new hook +:PROPERTIES: +:header-args+: :tangle ~/mail/.notmuch/hooks/post-new :shebang "#!/bin/sh" +:END: + +#+begin_src sh +# apply sent tag to messages sent by me +notmuch tag -new +sent -- from:amin@aminb.org or from:aminb@gnu.org or from:abandali@uwaterloo.ca or from:amin.bandali@uwaterloo.ca + +# initial tagging +notmuch tag +inbox +unread -new -- tag:new + +# apply tags to lists +notmuch tag -inbox +lists/haskell-weekly -- folder:amin/lists/haskell-weekly +notmuch tag -inbox +lists/hackernewsletter -- folder:amin/lists/hackernewsletter +notmuch tag -inbox +lists/emacs-devel -- folder:gnu/l/emacs-devel +notmuch tag -inbox +lists/guix-devel -- folder:gnu/l/guix-devel +notmuch tag -inbox +lists/guile-devel -- folder:gnu/l/guile-devel +notmuch tag -inbox +lists/info-gnu-emacs -- folder:gnu/l/info-gnu-emacs +notmuch tag -inbox +lists/help-gnu-emacs -- folder:gnu/l/help-gnu-emacs +notmuch tag -inbox +lists/www-commits -- folder:gnu/l/www-commits +notmuch tag -inbox +lists/www-discuss -- folder:gnu/l/www-discuss +notmuch tag -inbox +lists/fencepost-users -- folder:gnu/l/fencepost-users +notmuch tag -inbox +webmasters -- folder:gnu/webmasters +notmuch tag -inbox +lists/deepspec -- folder:gnu/l/deepspec +notmuch tag -inbox +lists/haskell-cafe -- folder:gnu/l/haskell-cafe +notmuch tag -inbox +lists/notmuch -- folder:gnu/l/notmuch +#+end_src + +*** notmuch.service +:PROPERTIES: +:header-args+: :tangle ~/.config/systemd/user/notmuch.service +:END: + +#+begin_src conf :tangle no +[Unit] +Description=notmuch service + +[Service] +Type=oneshot +ExecStart=/usr/bin/notmuch new +StandardOutput=syslog +StandardError=syslog +#+end_src + +*** notmuch.timer +:PROPERTIES: +:header-args+: :tangle ~/.config/systemd/user/notmuch.timer +:END: + +#+begin_src conf :tangle no +[Unit] +Description=notmuch timer + +[Timer] +OnCalendar=*:0/5 +Persistent=true +Unit=notmuch.service + +[Install] +WantedBy=timers.target +#+end_src + +** offlineimap + +*** offlineimaprc +:PROPERTIES: +:header-args+: :tangle ~/.offlineimaprc +:END: + +#+begin_src conf :tangle no +[general] +pythonfile = ~/.offlineimap.py +accounts = Gmail, aminb +maxsyncaccounts = 3 + +[Account Gmail] +localrepository = GmailL +remoterepository = GmailR + +[Account aminb] +localrepository = aminbL +remoterepository = aminbR + +[Repository GmailL] +type = Maildir +localfolders = ~/Maildir/Gmail + +[Repository GmailR] +type = IMAP +remotehost = imap.gmail.com +remoteusereval = mailuser("gmail") +remotepasseval = mailpasswd("gmail") +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +ssl = yes +folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail' +maxconnections = 1 +realdelete = no + +[Repository aminbL] +type = Maildir +localfolders = ~/Maildir/aminb + +[Repository aminbR] +type = IMAP +remotehost = mail.aminb.org +remoteusereval = mailuser("aminb") +remotepasseval = mailpasswd("aminb") +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +ssl = yes +folderfilter = lambda foldername: foldername not in 'dovecot.sieve' +maxconnections = 1 +realdelete = no +#+end_src + +*** offlineimap.py +:PROPERTIES: +:header-args+: :tangle ~/.offlineimap.py +:END: + +#+begin_src python :tangle no +import os +import subprocess + +def mailpasswd(acct): + acct = os.path.basename(acct) + path = "/home/amin/.passwd/%s.gpg" % acct + args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path] + try: + return subprocess.check_output(args).strip() + except subprocess.CalledProcessError: + return "" + +def mailuser(acct): + acct = os.path.basename(acct) + path = "/home/amin/.passwd/%s" % acct + args = ["cat", path] + try: + return subprocess.check_output(args).strip() + except subprocess.CalledProcessError: + return "" + +def prime_gpg_agent(): + ret = False + i = 1 + while not ret: + ret = (mailpasswd("prime") == "prime") + if i > 2: + from offlineimap.ui import getglobalui + sys.stderr.write("Error reading in passwords. Terminating.\n") + getglobalui().terminate() + i += 1 + return ret + +prime_gpg_agent() +#+end_src + +** pigeonhole +*** gnu.sieve +:PROPERTIES: +:header-args+: :tangle ~/sieve/gnu.sieve :comments none +:END: + +#+begin_src conf +require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ]; + +if anyof ( + address :is "from" "webmasters@gnu.org", + address :is "from" "webmasters-comment@gnu.org") { + fileinto :create "webmasters"; + stop; +} + +include :personal "lists"; +#+end_src + +*** lists.sieve +:PROPERTIES: +:header-args+: :tangle ~/sieve/lists.sieve :comments none +:END: + +#+begin_src conf +require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", + "include" ]; + +if anyof ( + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "") { + if header :regex "list-id" "<([a-z_0-9-]+)[.@]" { + set :lower "listname" "${1}"; + fileinto :create "l/${listname}"; + } +} +#+end_src + +** polybar + +*** config +:PROPERTIES: +:header-args+: :tangle ~/.config/polybar/config +:END: + +#+begin_src conf :tangle no +;===================================================== +; +; To learn more about how to configure Polybar +; go to https://github.com/jaagr/polybar +; +; The README contains alot of information +; +;===================================================== + +[colors] +;background = ${xrdb:color0:#222} +background = #222 +background-alt = #444 +;foreground = ${xrdb:color7:#222} +foreground = #eee +foreground-alt = #888 +primary = #ffb52a +secondary = #e60053 +alert = #bd2c40 + +[bar/main] +;monitor = ${env:MONITOR:HDMI-1} +width = 100% +height = 27 +;offset-x = 1% +;offset-y = 1% +radius = 3.0 +fixed-center = true + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3 +line-color = #f00 + +border-size = 4 +border-color = #00000000 + +padding-left = 0 +padding-right = 2 + +module-margin-left = 2 +module-margin-right = 2 + +font-0 = Ubuntu:fontformat=truetype:antialias=true:pixelsize=9;1 +font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-2 = Wuncon Siji:pixelsize=10;1 +font-3 = FontAwesome:pixelsize=10;1 + +modules-left = bspwm xwindow +modules-center = +modules-right = volume filesystem mail xkeyboard memory cpu temperature date powermenu + +tray-position = right +tray-padding = 1 +;tray-transparent = true +;tray-background = #0063ff +tray-maxsize = 18 + +wm-restack = bspwm + +;override-redirect = true + +scroll-up = bspwm-desknext +scroll-down = bspwm-deskprev + +[module/xwindow] +type = internal/xwindow +label = %title:0:50:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format-prefix = " " +format-prefix-foreground = ${colors.foreground-alt} +format-prefix-underline = ${colors.secondary} + +label-layout = %layout% +label-layout-underline = ${colors.secondary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.foreground-alt} + +[module/bspwm] +type = internal/bspwm + +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +label-occupied = %index% +label-occupied-padding = 2 + +label-urgent = %index%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +label-empty = %index% +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 2 + +[module/i3] +type = internal/i3 +format = +index-sort = true +wrapping-scroll = false + +; Only show workspaces on the same output as the bar +;pin-workspaces = true + +label-mode-padding = 2 +label-mode-foreground = #000 +label-mode-background = ${colors.primary} + +; focused = Active workspace on focused monitor +label-focused = %index% +label-focused-background = ${module/bspwm.label-focused-background} +label-focused-underline = ${module/bspwm.label-focused-underline} +label-focused-padding = ${module/bspwm.label-focused-padding} + +; unfocused = Inactive workspace on any monitor +label-unfocused = %index% +label-unfocused-padding = ${module/bspwm.label-occupied-padding} + +; visible = Active workspace on unfocused monitor +label-visible = %index% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +; urgent = Workspace with urgency hint set +label-urgent = %index% +label-urgent-background = ${module/bspwm.label-urgent-background} +label-urgent-padding = ${module/bspwm.label-urgent-padding} + +[module/mpd] +type = internal/mpd +format-online = + +icon-prev =  +icon-stop =  +icon-play =  +icon-pause =  +icon-next =  + +label-song-maxlen = 25 +label-song-ellipsis = true + +[module/xbacklight] +type = internal/xbacklight + +format =