[emacs] gnus-posting-styles is good enough, no need for gnus-alias
[~bandali/configs] / rc.org
... / ...
CommitLineData
1#+title: rc.org
2#+property: header-args :comments link :mkdirp yes :results silent
3
4* About
5
6This org file contains the configuration files of pretty much every
7program I use. The files are tangled (i.e. exported, or derived) from
8this file using =org-babel=.
9
10Note: This file is best viewed inside Emacs with org mode.
11
12* Configs
13
14This section contains the configuration files (dotfiles) of various
15programs I use.
16
17** bspwm
18
19*** bspwmrc
20:PROPERTIES:
21:header-args+: :tangle ~/.config/bspwm/bspwmrc :shebang "#!/bin/sh"
22:END:
23
24#+begin_src sh :tangle no
25sxhkd &
26sh ~/.fehbg &
27xfce4-panel -d &
28compton &
29sleep 0.5 && pasystray --notify=all &
30
31bspc monitor -d I II III IV V VI VII VIII IX X
32#bspc monitor eDP-1 -d I II III IV V
33#bspc monitor HDMI-1 -d VI VII VIII IX X
34
35#bspc config border_width 2
36#bspc config window_gap 8
37bspc config window_gap 0
38
39bspc config bottom_padding 26
40
41bspc config split_ratio 0.52
42bspc config borderless_monocle true
43bspc config gapless_monocle true
44bspc config click_to_focus button1
45bspc config directional_focus_tightness low
46
47#bspc rule -a Firefox desktop='^1' follow=on
48bspc rule -a Nightly desktop='^1' follow=on
49bspc rule -a Emacs desktop='^2' state=tiled follow=on
50#bspc rule -a Chromium desktop='^4' follow=on
51bspc rule -a URxvt state=floating
52bspc rule -a URxvt:tiled state=tiled
53bspc rule -a Connman-gtk state=floating
54bspc rule -a Xfce4-panel state=floating
55bspc rule -a TelegramDesktop state=floating
56bspc rule -a Ec state=floating
57bspc rule -a Pavucontrol state=floating
58bspc rule -a Eog state=floating
59bspc rule -a Seahorse state=floating
60bspc rule -a mpv state=floating
61bspc rule -a Evince state=floating
62bspc rule -a Meld state=floating
63bspc rule -a Autokey-gtk state=floating
64bspc rule -a Mousepad state=floating
65bspc rule -a Wrapper-1.0 state=floating
66bspc rule -a File-roller state=floating
67bspc rule -a Gnome-disks state=floating
68bspc rule -a Termite state=floating
69bspc rule -a Termite:tiled state=tiled
70bspc rule -a Thunderbird:Calendar state=floating
71bspc rule -a Audacity state=floating
72bspc rule -a Proof state=floating # pvs x-show-proof
73bspc rule -a Nm-connection-editor state=floating
74bspc rule -a Wire state=floating
75bspc rule -a discord state=floating
76bspc rule -a X2goclient state=floating
77bspc rule -a SimpleScreenRecorder state=floating
78bspc rule -a Gimp state=floating
79bspc rule -a Wrapper-2.0 state=floating
80bspc rule -a Zathura state=tiled
81#+end_src
82
83*** sxhkdrc
84:PROPERTIES:
85:header-args+: :tangle ~/.config/sxhkd/sxhkdrc
86:END:
87
88#+begin_src conf :tangle no
89#
90# wm independent hotkeys
91#
92
93# terminal emulator
94super + {_,shift} + Return
95 urxvt{_, -name tiled}
96
97#super + {_,shift} + Return
98# termite{_, --name=tiled}
99
100# program launcher
101super + space
102 rofi -show run -display-run '> ' -display-window ' 🗔 '
103
104super + alt + space
105 xfce4-popup-whiskermenu
106
107# window finder
108super + backslash
109 rofi -show window -display-run '> ' -display-window ' 🗔 '
110
111# password manager
112alt + space
113 rofi-pass
114
115# firefox
116#super + r
117# firefox
118
119# chromium
120#super + c
121# chromium -incognito
122
123# emacs
124super + e
125 emacs
126
127# make sxhkd reload its configuration files:
128super + Escape
129 pkill -USR1 -x sxhkd
130
131# volume {up,down}
132XF86Audio{Raise,Lower}Volume
133 pamixer --allow-boost --{in,de}crease 5
134
135# mute
136XF86AudioMute
137 pamixer --toggle-mute
138
139XF86AudioMicMute
140 pactl set-source-mute 1 toggle
141
142# playback control
143XF86Audio{Play,Prev,Next}
144 mpc {toggle,prev,next}
145
146# lock the screen
147super + shift + q
148 light-locker-command -l
149
150# Toggle keyboard layout
151super + F7
152 toggle-layout
153
154# Toggle Xfce presentation mode
155XF86LaunchB
156 toggle-presentation-mode
157
158# monitor brightness
159XF86MonBrightness{Up,Down}
160 light -{A,U} 5
161
162super + apostrophe
163 rofi-light
164
165# keyboard brightness
166#XF86KbdBrightness{Up,Down}
167# kbdlight {up,down}
168
169XF86RotateWindows
170 toggle-tablet
171
172#
173# bspwm hotkeys
174#
175
176# quit bspwm normally
177super + alt + Escape
178 bspc quit
179
180# close and kill
181super + {w,q}
182 bspc node -{c,k}
183
184# alternate between the tiled and monocle layout
185super + m
186 bspc desktop -l next
187
188# send the newest marked node to the newest preselected node
189super + y
190 bspc node newest.marked.local -n newest.!automatic.local
191
192# swap the current node and the biggest node
193super + g
194 bspc node -s biggest
195
196#
197# state/flags
198#
199
200# set the window state
201super + {t,shift + t,s,f}
202 bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
203
204# set the node flags
205super + ctrl + {m,x,y,z}
206 bspc node -g {marked,locked,sticky,private}
207
208#
209# focus/swap
210#
211
212# focus the node in the given direction
213super + {_,shift + }{h,j,k,l}
214 bspc node -{f,s} {west,south,north,east}
215
216# focus the node for the given path jump
217super + {p,b,comma,period}
218 bspc node -f @{parent,brother,first,second}
219
220# focus the next/previous node in the current desktop
221super + {_,shift + }c
222 bspc node -f {next,prev}.local
223
224# focus the next/previous desktop in the current monitor
225super + bracket{left,right}
226 bspc desktop -f {prev,next}.local
227
228# send to next/prev desktop
229super + shift + bracket{left,right}
230 bspc node -d {prev,next} --follow
231
232# focus the last node/desktop
233super + {grave,Tab}
234 bspc {node,desktop} -f last
235
236# focus the older or newer node in the focus history
237super + {o,i}
238 bspc wm -h off; \
239 bspc node {older,newer} -f; \
240 bspc wm -h on
241
242# focus or send to the given desktop
243super + {_,shift + }{1-9,0}
244 bspc {desktop -f,node -d} '^{1-9,10}'
245
246#
247# preselect
248#
249
250# preselect the direction
251super + ctrl + {h,j,k,l}
252 bspc node -p {west,south,north,east}
253
254# preselect the ratio
255super + ctrl + {1-9}
256 bspc node -o 0.{1-9}
257
258# cancel the preselection for the focused node
259super + ctrl + space
260 bspc node -p cancel
261
262# cancel the preselection for the focused desktop
263super + ctrl + shift + space
264 bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
265
266#
267# move/resize
268#
269
270# expand a window by moving one of its side outward
271super + alt + {h,j,k,l}
272 bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
273
274# contract a window by moving one of its side inward
275super + alt + shift + {h,j,k,l}
276 bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
277
278# move a floating window
279super + {Left,Down,Up,Right}
280 bspc node -v {-20 0,0 20,0 -20,20 0}
281
282#alt + bracket{left,right}
283# xdotool key --clearmodifiers ctrl+Page_{Up,Down}
284#+end_src
285
286** compton
287:PROPERTIES:
288:header-args+: :tangle ~/.config/compton.conf
289:END:
290
291#+begin_src conf :tangle no
292# Shadow
293shadow = false; # Enabled client-side shadows on windows.
294no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows.
295no-dnd-shadow = true; # Don't draw shadows on DND windows.
296clear-shadow = true; # Zero the part of the shadow's mask behind the
297 # window. Fix some weirdness with ARGB windows.
298shadow-radius = 5; # The blur radius for shadows. (default 12)
299shadow-offset-x = -5; # The left offset for shadows. (default -15)
300shadow-offset-y = -5; # The top offset for shadows. (default -15)
301# shadow-opacity = 0.7; # The translucency for shadows. (default .75)
302# shadow-red = 0.0; # Red color value of shadow. (0.0 - 1.0, defaults to 0)
303# shadow-green = 0.0; # Green color value of shadow. (0.0 - 1.0, defaults to 0)
304# shadow-blue = 0.0; # Blue color value of shadow. (0.0 - 1.0, defaults to 0)
305shadow-exclude = [ "n:e:Notification", "class_g = 'Chromium'", "class_g = 'Dmenu'", "class_g = 'Firefox' && argb" ]; # Exclude conditions for shadows.
306# shadow-exclude = "n:e:Notification";
307#shadow-exclude = [ "_GTK_FRAME_EXTENTS@:c" ] # Fix dual shadow on some gtk3 powered applications
308shadow-ignore-shaped = true; # Avoid drawing shadow on all shaped windows
309 # (see also: --detect-rounded-corners)
310
311# Opacity
312menu-opacity = 1.0; # The opacity for menus. (default 1.0)
313#inactive-opacity = 0.9; # Default opacity of inactive windows. (0.0 - 1.0)
314# active-opacity = 0.8; # Default opacity for active windows. (0.0 - 1.0)
315frame-opacity = 1.0; # Opacity of window titlebars and borders. (0.1 - 1.0)
316# inactive-opacity-override = true; # Let inactive opacity set by 'inactive-opacity' overrides
317 # value of _NET_WM_OPACITY. Bad choice.
318alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasing
319 # it may result in less X resource usage,
320 # Yet fading may look bad.
321#inactive-dim = 0.5; # Dim inactive windows. (0.0 - 1.0)
322#inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity.
323# blur-background = true; # Blur background of transparent windows.
324 # Bad performance with X Render backend.
325 # GLX backend is preferred.
326# blur-background-frame = true; # Blur background of opaque windows with transparent
327 # frames as well.
328blur-background-fixed = true; # Do not let blur radius adjust based on window opacity.
329blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
330 # Exclude conditions for background blur.
331
332# Fading
333fading = false; # Fade windows during opacity changes.
334fade-delta = 3; # The time between steps in a fade in milliseconds. (default 10).
335fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028).
336fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03).
337# no-fading-openclose = true; # Avoid fade windows in/out when opening/closing.
338fade-exclude = [ ]; # Exclude conditions for fading.
339
340# Other
341backend = "glx" # Backend to use: "xrender" or "glx". GLX backend is typically
342 # much faster but depends on a sane driver.
343mark-wmwin-focused = true; # Try to detect WM windows and mark them as active.
344mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus).
345use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
346 # instead of using FocusIn/Out events. Usually more reliable but
347 # depends on a EWMH-compliant WM.
348detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore- shaped is on.
349detect-client-opacity = true; # Detect _NET_WM_OPACITY on client windows, useful for window
350 # managers not passing _NET_WM_OPACITY of client windows to frame
351 # windows.
352refresh-rate = 0; # For --sw-opti: Specify refresh rate of the screen. 0 for auto.
353vsync = "drm"; # "none", "drm", "opengl", "opengl-oml", "opengl-swc", "opengl-mswc"
354 # See man page for more details.
355dbe = false; # Enable DBE painting mode. Rarely needed.
356paint-on-overlay = true; # Painting on X Composite overlay window. Recommended.
357sw-opti = false; # Limit compton to repaint at most once every 1 / refresh_rate.
358 # Incompatible with certain VSync methods.
359unredir-if-possible = false; # Unredirect all windows if a full-screen opaque window is
360 # detected, to maximize performance for full-screen windows.
361focus-exclude = [ ]; # A list of conditions of windows that should always be considered
362 # focused.
363detect-transient = true; # Use WM_TRANSIENT_FOR to group windows, and consider windows in
364 # the same group focused at the same time.
365detect-client-leader = true; # Use WM_CLIENT_LEADER to group windows.
366invert-color-include = [ ]; # Conditions for windows to be painted with inverted color.
367
368# GLX backend # GLX backend fine-tune options. See man page for more info.
369glx-no-stencil = true; # Recommended.
370glx-copy-from-front = false; # Useful with --glx-swap-method,
371# glx-use-copysubbuffermesa = true; # Recommended if it works. Breaks VSync.
372# glx-no-rebind-pixmap = true; # Recommended if it works.
373glx-no-rebind-pixmap = true; # Recommended if it works.
374#glx-swap-method = "4"; # See man page.
375glx-swap-method = "4"; # See man page.
376
377# Window type settings
378wintypes:
379{
380 tooltip = { fade = true; shadow = false; opacity = 1; focus = true; };
381 menu = { shadow = false; };
382 dropdown_menu = { shadow = false; };
383 popup_menu = { shadow = false; };
384 utility = { shadow = false; };
385 # fade: Fade the particular type of windows.
386 # shadow: Give those windows shadow
387 # opacity: Default opacity for the type of windows.
388 # focus: Whether to always consider windows of this type focused.
389};
390#+end_src
391
392** dovecot
393:PROPERTIES:
394:header-args+: :tangle "/sudo::/etc/dovecot/dovecot.conf"
395:END:
396
397#+begin_src conf
398protocols = imap
399
400listen = 127.0.0.1
401log_path = /var/log/dovecot.log
402info_log_path = /var/log/dovecot-info.log
403
404ssl = no
405disable_plaintext_auth = no
406
407auth_verbose = yes
408auth_mechanisms = plain
409
410passdb {
411 driver = passwd-file
412 args = /etc/dovecot/passwd
413}
414
415userdb {
416 driver = static
417 args = uid=amin gid=amin home=/home/amin/mail/%d/%n
418 default_fields = mail=maildir:/home/amin/mail/%d/%n/mail
419}
420
421# mail_home = /home/amin/mail/%d/%n
422# mail_location = maildir:/home/amin/mail/%d/%n/mail:LAYOUT=fs:INBOX=/home/amin/mail/%d/%n/mail/Inbox
423
424# namespace {
425# inbox = yes
426# separator = /
427# }
428
429# mail_plugins = $mail_plugins fts fts_lucene
430
431# plugin {
432# fts = lucene
433# fts_lucene = whitespace_chars=@.
434# fts_autoindex = yes
435# }
436#+end_src
437
438** Dunst
439:PROPERTIES:
440:header-args+: :tangle ~/.config/dunst/dunstrc
441:END:
442
443#+begin_src conf
444[global]
445#font = Ubuntu Mono 10.5
446font = Inconsolata 11
447
448# Path to default icons.
449icon_folders = /usr/share/icons/Moka/16x16/status/:/usr/share/icons/Moka/16x16/devices/:/usr/share/icons/Faba-Mono/16x16/status/:/usr/share/icons/Faba-Mono/16x16/devices/:/usr/share/icons/Moka/16x16/actions/:/usr/share/icons/Moka/16x16/categories/:/usr/share/icons/Moka/16x16/mimetypes/:/usr/share/icons/Moka/16x16/apps/:/usr/share/icons/Moka/16x16/places/:/usr/share/icons/Paper/16x16/status/
450
451icon_position = left
452# <b>bold</b>
453# <i>italic</i>
454# <s>strikethrough<s/>
455# <u>underline</u>
456markup = full
457# The format of the message. Possible variables are:
458# %a appname
459# %s summary
460# %b body
461# %i iconname (including its path)
462# %I iconname (without its path)
463# %p progress value if set ([ 0%] to [100%]) or nothing
464# Markup is allowed
465format = "<b>%s</b>\n%b"
466# Sort messages by urgency
467sort = yes
468# Show how many messages are currently hidden (because of geometry)
469indicate_hiddenl= no
470# Alignment of message text.
471# Possible values are "left", "center" and "right"
472alignment = center
473# The frequency with wich text that is longer than the notification
474# window allows bounces back and forth.
475# This option conflicts with 'word_wrap'.
476# Set to 0 to disable
477bounce_freq = 3
478# show age of message if message is older than show_age_threshold seconds.
479# set to -1 to disable
480show_age_threshold = -1
481# split notifications into multiple lines if they don't fit into geometry
482word_wrap = yes
483# ignore newlines '\n' in notifications
484ignore_newline = no
485# The geometry of the message window.
486# geometry [{width}]x{height}][+/-{x}+/-{y}]
487# The height is measured in number of notifications everything else in pixels. If the width
488# is omitted but the height is given ("-geometry x2"), the message window
489# expands over the whole screen (dmenu-like). If width is 0,
490# the window expands to the longest message displayed.
491# A positive x is measured from the left, a negative from the
492# right side of the screen. Y is measured from the top and down respectevly.
493# The width can be negative. In this case the actual width is the
494# screen width minus the width defined in within the geometry option.
495#geometry = "410x12-12+12"
496#geometry = "0x0-30-30"
497geometry = "260x12-30-30"
498# The transparency of the window. range: [0; 100]
499# This option will only work if a compositing windowmanager is present (e.g. xcompmgr, compiz, etc..)
500transparency = 0
501# Don't remove messages, if the user is idle (no mouse or keyboard input)
502# for longer than idle_threshold seconds.
503# Set to 0 to disable.
504idle_threshold = 120
505# Which monitor should the notifications be displayed on.
506monitor = 0
507# Display notification on focused monitor. Possible modes are:
508# mouse: follow mouse pointer
509# keyboard: follow window with keyboard focus
510# none: don't follow anything
511#
512# "keyboard" needs a windowmanager that exports the _NET_ACTIVE_WINDOW property.
513# This should be the case for almost all modern windowmanagers.
514#
515# If this option is set to mouse or keyboard, the monitor option will be
516# ignored.
517follow = keyboard
518# should a notification popped up from history be sticky or
519# timeout as if it would normally do.
520sticky_history = yes
521# The height of a single line. If the height is smaller than the font height,
522# it will get raised to the font height.
523# This adds empty space above and under the text.
524line_height = 0
525
526show_indicators = yes
527
528# Draw a line of 'separatpr_height' pixel height between two notifications.
529# Set to 0 to disable
530separator_height = 3
531# padding between text and separator
532padding = 8
533# horizontal padding
534horizontal_padding = 8
535# Define a color for the separator.
536# possible values are:
537# * auto: dunst tries to find a color fitting to the background
538# * foreground: use the same color as the foreground
539# * frame: use the same color as the frame.
540# * anything else will be interpreted as a X color
541separator_color = foreground
542# print a notification on startup
543# This is mainly for error detection, since dbus (re-)starts dunst
544# automatically after a crash.
545startup_notification = false
546# dmenu path
547#dmenu = /usr/bin/dmenu -p dunst:
548dmenu = /usr/bin/rofi -dmenu -p dunst:
549# browser for opening urls in context menu
550browser = /usr/bin/firefox -new-tab
551[frame]
552width = 0
553color = "#377222"
554[shortcuts]
555# shortcuts are specified as [modifier+][modifier+]...key
556# available modifiers are 'ctrl', 'mod1' (the alt-key), 'mod2', 'mod3'
557# and 'mod4' (windows-key)
558# xev might be helpful to find names for keys
559# close notification
560close = ctrl+space
561# close all notifications
562close_all = ctrl+shift+space
563# redisplay last message(s)
564# On the US keyboard layout 'grave' is normally above TAB and left of '1'.
565history = ctrl+shift+h
566# context menu
567context = ctrl+shift+period
568[urgency_low]
569# IMPORTANT: colors have to be defined in quotation marks.
570# Otherwise the '#' and following would be interpreted as a comment.
571background = "#1d2a30"
572foreground = "#71c2af"
573timeout = 3
574[urgency_normal]
575background = "#1d2a30"
576foreground = "#71c2af"
577timeout = 0
578[urgency_critical]
579background = "#1d2a30"
580foreground = "#ff9982"
581timeout = 0
582
583# Every section that isn't one of the above is interpreted as a rules
584# to override settings for certain messages.
585# Messages can be matched by 'appname', 'summary', 'body' or 'icon'
586# and you can override the 'timeout', 'urgency', 'foreground', 'background'
587# and 'format'.
588# Shell-like globbing will get expanded.
589#
590# SCRIPTING
591# you can specify a script that gets run when the rule matches by setting
592# the 'script' option.
593# The script will be called as follows:
594# script appname summary body icon urgency
595# where urgency can be "LOW", "NORMAL" or "CRITICAL".
596#
597# NOTE: if you don't want a notification to be displayed, set the format to ""
598# NOTE: It might be helpful to run dunst -print in a terminal in order to find
599# fitting options for rules.
600#[espeak]
601# summary = "*"
602# script = dunst_espeak.sh
603#[script-test]
604# summary = "*script*"
605# script = dunst_test.sh
606#[ignore]
607## This notification will not be displayed
608# summary = "foobar"
609# format = ""
610#[signed_on]
611# appname = Pidgin
612# summary = "*signed on*"
613# urgency = low
614#
615#[signed_off]
616# appname = Pidgin
617# summary = *signed off*
618# urgency = low
619#
620#[says]
621# appname = Pidgin
622# summary = *says*
623# urgency = critical
624#
625#[twitter]
626# appname = Pidgin
627# summary = *twitter.com*
628# urgency = normal
629#
630[xfpm-backlight]
631 summary = *Brightness*
632 urgency = low
633#+end_src
634
635** Fontconfig
636:PROPERTIES:
637:header-args+: :tangle ~/.config/fontconfig/fonts.conf :comments none
638:END:
639
640#+begin_src xml
641<?xml version="1.0"?>
642<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
643<fontconfig>
644 <match target="font">
645 <edit mode="assign" name="rgba">
646 <const>rgb</const>
647 </edit>
648 </match>
649 <match target="font">
650 <edit mode="assign" name="hinting">
651 <bool>true</bool>
652 </edit>
653 </match>
654 <match target="font">
655 <edit mode="assign" name="hintstyle">
656 <const>hintslight</const>
657 </edit>
658 </match>
659 <match target="font">
660 <edit mode="assign" name="antialias">
661 <bool>true</bool>
662 </edit>
663 </match>
664 <match target="font">
665 <edit mode="assign" name="lcdfilter">
666 <const>lcddefault</const>
667 </edit>
668 </match>
669 <dir>~/.fonts</dir>
670
671 <!-- Use Liberation Sans for Helvetica (instead of Nimbus Sans) -->
672 <alias binding="same">
673 <family>Helvetica</family>
674 <prefer>
675 <family>Liberation Sans</family>
676 </prefer>
677</alias>
678</fontconfig>
679#+end_src
680
681** getmail
682
683*** getmailrc
684:PROPERTIES:
685:header-args+: :tangle ~/.getmail/getmailrc
686:END:
687
688#+begin_src conf
689[retriever]
690type = SimplePOP3SSLRetriever
691server = fencepost.gnu.org
692username = bandali
693password_command = ("gpg2", "--no-tty", "-q", "-d", "/home/amin/.passwd/gnu.gpg")
694port = 995
695use_apop = True
696
697[destination]
698type = Maildir
699path = ~/mail/gnu/Inbox/
700
701[options]
702delete = True
703#+end_src
704
705*** getmail.service
706:PROPERTIES:
707:header-args+: :tangle ~/.config/systemd/user/getmail.service
708:END:
709
710#+begin_src conf :tangle no
711[Unit]
712Description=getmail service
713
714[Service]
715Type=oneshot
716ExecStart=/usr/bin/getmail
717StandardOutput=syslog
718StandardError=syslog
719#+end_src
720
721*** getmail.timer
722:PROPERTIES:
723:header-args+: :tangle ~/.config/systemd/user/getmail.timer
724:END:
725
726#+begin_src conf :tangle no
727[Unit]
728Description=getmail timer
729
730[Timer]
731OnCalendar=*:0/30
732Persistent=true
733Unit=getmail.service
734
735[Install]
736WantedBy=timers.target
737#+end_src
738
739** Git
740
741*** gitconfig
742:PROPERTIES:
743:header-args+: :tangle ~/.gitconfig
744:END:
745
746**** user
747#+begin_src conf
748[user]
749 name = Amin Bandali
750 email = bandali@gnu.org
751 signingkey = BE6273738E616D6D1B3A08E8A21A020248816103
752#+end_src
753
754**** signing
755#+begin_src conf
756[commit]
757 gpgsign = true
758# [format]
759# signoff = true
760#+end_src
761
762**** core
763#+begin_src conf
764[core]
765 autocrlf = input # CRLF -> LF on commit
766 editor = emacsclient -t
767 excludesfile = ~/.gitignore_global
768 pager = "less"
769#+end_src
770
771**** gpg
772#+begin_src conf
773[gpg]
774 program = gpg2
775#+end_src
776
777**** alias
778#+begin_src conf
779[alias]
780 git = !exec git # handle nested git calls, e.g. git git status
781 aliases = config --get-regexp '^alias\\.'
782 a = add
783 s = status
784 sl = status --long
785 c = checkout
786 cb = checkout -b
787 b = branch
788 r = rebase
789 p = pull
790 pr = pull --rebase
791 ps = push
792 psf = push --force
793 nmam = "!f() { notmuch show --format=raw $1 | git am -; }; f"
794 nmam3 = "!f() { notmuch show --format=raw $1 | git am -3 -; }; f"
795#+end_src
796
797**** color
798#+begin_src conf
799[color]
800 ui = auto
801[color "status"]
802 added = green bold
803 changed = red bold
804 untracked = red bold
805[color "branch"]
806 current = green bold
807 remote = magenta bold
808[color "diff"]
809 new = green bold
810 old = red bold
811#+end_src
812
813**** status
814#+begin_src conf
815[status]
816 # showUntrackedFiles = all
817 short=true
818 branch=true
819#+end_src
820
821**** github
822#+begin_src conf
823[github]
824 user = aminb
825#+end_src
826
827**** send-email
828#+begin_src conf
829[sendemail]
830 smtpuser = bandali
831 smtpserver = fencepost.gnu.org
832 smtpserverport = 587
833 smtpencryption = tls
834 annotate = yes
835#+end_src
836
837*** gitignore
838:PROPERTIES:
839:header-args+: :tangle ~/.gitignore_global
840:END:
841
842#+begin_src conf
843*.orig
844*.py[co]
845*.sublime-workspace
846*~
847.DS_Store
848*.elc
849*-autoloads.el
850#+end_src
851
852** GnuPG
853:PROPERTIES:
854:header-args+: :tangle ~/.gnupg/gpg-agent.conf
855:END:
856
857#+begin_src conf
858default-cache-ttl 43200
859max-cache-ttl 43200
860
861default-cache-ttl-ssh 10800
862max-cache-ttl-ssh 10800
863
864# pinentry-program /usr/bin/pinentry-qt
865#+end_src
866
867** GTK
868
869*** gtk-2.0
870:PROPERTIES:
871:header-args+: :tangle ~/.gtkrc-2.0
872:END:
873
874#+begin_src conf
875gtk-theme-name="Greybird"
876gtk-icon-theme-name="Paper"
877gtk-font-name="Ubuntu 10"
878gtk-menu-images=0
879# gtk-key-theme-name = "Emacs"
880#+end_src
881
882*** gtk-3.0
883:PROPERTIES:
884:header-args+: :tangle ~/.config/gtk-3.0/settings.ini
885:END:
886
887#+begin_src conf :tangle no
888[Settings]
889gtk-icon-theme-name = Paper
890# gtk-theme-name = Adwaita
891
892gtk-theme-name = Greybird
893# gtk-theme-name = Arc-Darker
894# gtk-theme-name = Numix-ArchBlue
895
896gtk-font-name = Ubuntu 10
897# gtk-key-theme-name = Emacs
898#+end_src
899
900** [[https://github.com/Leinnan/i3gs][i3gs]]
901:PROPERTIES:
902:header-args+: :tangle ~/.config/i3gs/config
903:END:
904
905#+begin_src conf :comments none :tangle no
906borders_width=0 0 2 0
907separator_width=10
908
909#[mpd]
910#preset=MPD
911#title=<span weight='heavy' fgcolor='#7FDBFF'> </span>
912#borders_color=#7FDBFF
913
914[ram]
915preset=RAM
916title=<span weight='heavy' fgcolor='#3D9970'> </span>
917borders_color=#3D9970
918
919#[cpu]
920#preset=CPU
921#title=<span weight='heavy' fgcolor='#2ECC40'> </span>
922#borders_color=#2ECC40
923
924#[hdd]
925#preset=HDD
926#title=<span weight='heavy' fgcolor='#01FF70'> </span>
927#borders_color=#01FF70
928
929[volume]
930command=volume-info
931title=<span weight='heavy' fgcolor='#7FDBFF'></span>
932borders_color=#7FDBFF
933
934[battery]
935preset=BAT
936command=battery-percentage-time
937title=<span weight='heavy' fgcolor='#39CCCC'> </span>
938borders_color=#39CCCC
939
940[wifi]
941preset=WIFI
942title=<span weight='heavy' fgcolor='#01FF70'> </span>
943borders_color=#01FF70
944
945[date]
946preset=DATE
947command=date '+%-I:%M, %a %b %d '
948title=<span weight='heavy' fgcolor='#FFDC00'> </span>
949borders_color=#FFDC00
950separator_width=0
951#+end_src
952
953** i3status
954:PROPERTIES:
955:header-args+: :tangle ~/.config/i3status/config
956:END:
957
958#+begin_src conf :comments none
959# i3status configuration file.
960# see "man i3status" for documentation.
961
962# It is important that this file is edited as UTF-8.
963# The following line should contain a sharp s:
964# ß
965# If the above line is not correctly displayed, fix your editor first!
966
967general {
968 colors = true
969 interval = 5
970 output_format = "i3bar"
971}
972
973# order += "ipv6"
974order += "disk /"
975order += "disk /data"
976order += "wireless _first_"
977order += "ethernet _first_"
978order += "battery 0"
979order += "volume master"
980order += "load"
981order += "tztime local"
982
983wireless _first_ {
984 format_up = "W:%quality %essid %ip"
985 format_down = "W: down"
986}
987
988ethernet _first_ {
989 # if you use %speed, i3status requires root privileges
990 format_up = "E: %ip (%speed)"
991 format_down = "E: down"
992}
993
994battery 0 {
995 format = "%status %percentage %remaining (%consumption)"
996 path = "/sys/class/power_supply/BAT%d/uevent"
997 low_threshold = "10"
998 threshold_type = "percentage"
999 last_full_capacity = true
1000 integer_battery_capacity = true
1001 hide_seconds = true
1002}
1003
1004tztime local {
1005 format = "%-I:%M%P %a %b %d"
1006}
1007
1008volume master {
1009 format = "♪ %volume"
1010 format_muted = "🔇 %volume"
1011 device = "pulse"
1012}
1013
1014load {
1015 format = "%1min"
1016}
1017
1018disk "/" {
1019 format = "/ %avail"
1020}
1021
1022disk "/data" {
1023 format = "/data %avail"
1024}
1025#+end_src
1026
1027** isync
1028
1029*** mbsyncrc
1030:PROPERTIES:
1031:header-args+: :tangle ~/.mbsyncrc
1032:END:
1033
1034#+begin_src conf
1035# Global defaults
1036CopyArrivalDate yes
1037Create Both
1038
1039######
1040IMAPAccount amin
1041Host mail.aminb.org
1042User amin@aminb.org
1043PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/amin.gpg"
1044SSLType IMAPS
1045
1046IMAPStore amin-remote
1047Account amin
1048
1049IMAPAccount amin-dovecot
1050Host 127.0.0.1
1051Port 143
1052User amin@aminb.org
1053PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/amin-dovecot.gpg"
1054SSLType None
1055
1056IMAPStore amin-local
1057Account amin-dovecot
1058
1059Channel amin
1060Master :amin-remote:
1061Slave :amin-local:
1062Patterns *
1063
1064######
1065IMAPAccount uwaterloo
1066Host connect.uwaterloo.ca
1067User abandali
1068PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/uwaterloo.gpg"
1069SSLType IMAPS
1070
1071IMAPStore uwaterloo-remote
1072Account uwaterloo
1073
1074IMAPAccount uwaterloo-dovecot
1075Host 127.0.0.1
1076Port 143
1077User abandali@uwaterloo.ca
1078PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.passwd/uwaterloo-dovecot.gpg"
1079SSLType None
1080
1081IMAPStore uwaterloo-local
1082Account uwaterloo-dovecot
1083
1084Channel uwaterloo
1085Master :uwaterloo-remote:
1086Slave :uwaterloo-local:
1087Patterns *
1088#+end_src
1089
1090*** mbsync.service
1091:PROPERTIES:
1092:header-args+: :tangle ~/.config/systemd/user/mbsync.service
1093:END:
1094
1095#+begin_src conf :tangle no
1096[Unit]
1097Description=mbsync service
1098
1099[Service]
1100Type=oneshot
1101ExecStart=/usr/bin/mbsync -Va
1102StandardOutput=syslog
1103StandardError=syslog
1104#+end_src
1105
1106*** mbsync.timer
1107:PROPERTIES:
1108:header-args+: :tangle ~/.config/systemd/user/mbsync.timer
1109:END:
1110
1111#+begin_src conf :tangle no
1112[Unit]
1113Description=mbsync timer
1114
1115[Timer]
1116OnCalendar=*:0/15
1117Persistent=true
1118Unit=mbsync.service
1119
1120[Install]
1121WantedBy=timers.target
1122#+end_src
1123
1124** Latexmk
1125:PROPERTIES:
1126:header-args+: :tangle ~/.latexmkrc
1127:END:
1128
1129#+begin_src conf
1130$pdf_previewer = "start zathura %O %S";
1131$clean_ext = "aux out";
1132
1133# $pdf_update_method = 4;
1134# $pdf_update_command = "zathura %O %S";
1135
1136# Synctex allows one to jump to from the PDF in Zathura to the source in Emacs
1137# by Ctrl+click in the PDF.
1138# Tell latexmk to use Zathura as a previewer, and run emacsclient as the Synctex
1139# editor.
1140# $pdf_previewer = 'exec zathura --synctex-forward -x \'emacsclient --no-wait +%{line} %{input}\' %O %S';
1141#+end_src
1142
1143** libinput
1144
1145Improve XPS 15 9560's touchpad experience.
1146
1147# begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "plasma")) "/sudo::/etc/X11/xorg.conf.d/30-touchpad.conf")
1148#+begin_src conf :tangle no
1149Section "InputClass"
1150 Identifier "libinput touchpad catchall"
1151 Driver "libinput"
1152 MatchIsTouchpad "on"
1153 Option "ClickMethod" "clickfinger"
1154 Option "NaturalScrolling" "true"
1155 Option "Tapping" "on"
1156 Option "TappingButtonMap" "lrm"
1157EndSection
1158#+end_src
1159
1160** mpd
1161:PROPERTIES:
1162:header-args+: :tangle ~/.config/mpd/mpd.conf
1163:END:
1164
1165#+begin_src conf
1166# An example configuration file for MPD.
1167# Read the user manual for documentation: http://www.musicpd.org/doc/user/
1168
1169
1170# Files and directories #######################################################
1171#
1172# This setting controls the top directory which MPD will search to discover the
1173# available audio files and add them to the daemon's online database. This
1174# setting defaults to the XDG directory, otherwise the music directory will be
1175# be disabled and audio files will only be accepted over ipc socket (using
1176# file:// protocol) or streaming files over an accepted protocol.
1177#
1178music_directory "~/usr/music"
1179#
1180# This setting sets the MPD internal playlist directory. The purpose of this
1181# directory is storage for playlists created by MPD. The server will use
1182# playlist files not created by the server but only if they are in the MPD
1183# format. This setting defaults to playlist saving being disabled.
1184#
1185playlist_directory "~/.mpd/playlists"
1186#
1187# This setting sets the location of the MPD database. This file is used to
1188# load the database at server start up and store the database while the
1189# server is not up. This setting defaults to disabled which will allow
1190# MPD to accept files over ipc socket (using file:// protocol) or streaming
1191# files over an accepted protocol.
1192#
1193db_file "~/.mpd/database"
1194#
1195# These settings are the locations for the daemon log files for the daemon.
1196# These logs are great for troubleshooting, depending on your log_level
1197# settings.
1198#
1199# The special value "syslog" makes MPD use the local syslog daemon. This
1200# setting defaults to logging to syslog, otherwise logging is disabled.
1201#
1202log_file "~/.mpd/log"
1203#
1204# This setting sets the location of the file which stores the process ID
1205# for use of mpd --kill and some init scripts. This setting is disabled by
1206# default and the pid file will not be stored.
1207#
1208pid_file "~/.mpd/pid"
1209#
1210# This setting sets the location of the file which contains information about
1211# most variables to get MPD back into the same general shape it was in before
1212# it was brought down. This setting is disabled by default and the server
1213# state will be reset on server start up.
1214#
1215state_file "~/.mpd/state"
1216#
1217# The location of the sticker database. This is a database which
1218# manages dynamic information attached to songs.
1219#
1220sticker_file "~/.mpd/sticker.sql"
1221#
1222###############################################################################
1223
1224
1225# General music daemon options ################################################
1226#
1227# This setting specifies the user that MPD will run as. MPD should never run as
1228# root and you may use this setting to make MPD change its user ID after
1229# initialization. This setting is disabled by default and MPD is run as the
1230# current user.
1231#
1232#user "nobody"
1233#
1234# This setting specifies the group that MPD will run as. If not specified
1235# primary group of user specified with "user" setting will be used (if set).
1236# This is useful if MPD needs to be a member of group such as "audio" to
1237# have permission to use sound card.
1238#
1239#group "nogroup"
1240#
1241# This setting sets the address for the daemon to listen on. Careful attention
1242# should be paid if this is assigned to anything other then the default, any.
1243# This setting can deny access to control of the daemon. Not effective if
1244# systemd socket activiation is in use.
1245#
1246# For network
1247#bind_to_address "any"
1248#
1249# And for Unix Socket
1250#bind_to_address "~/.mpd/socket"
1251#
1252# This setting is the TCP port that is desired for the daemon to get assigned
1253# to.
1254#
1255#port "6600"
1256#
1257# This setting controls the type of information which is logged. Available
1258# setting arguments are "default", "secure" or "verbose". The "verbose" setting
1259# argument is recommended for troubleshooting, though can quickly stretch
1260# available resources on limited hardware storage.
1261#
1262#log_level "default"
1263#
1264# If you have a problem with your MP3s ending abruptly it is recommended that
1265# you set this argument to "no" to attempt to fix the problem. If this solves
1266# the problem, it is highly recommended to fix the MP3 files with vbrfix
1267# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
1268# point gapless MP3 playback can be enabled.
1269#
1270#gapless_mp3_playback "yes"
1271#
1272# Setting "restore_paused" to "yes" puts MPD into pause mode instead
1273# of starting playback after startup.
1274#
1275#restore_paused "no"
1276#
1277# This setting enables MPD to create playlists in a format usable by other
1278# music players.
1279#
1280#save_absolute_paths_in_playlists "no"
1281#
1282# This setting defines a list of tag types that will be extracted during the
1283# audio file discovery process. The complete list of possible values can be
1284# found in the user manual.
1285#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
1286#
1287# This setting enables automatic update of MPD's database when files in
1288# music_directory are changed.
1289#
1290#auto_update "yes"
1291#
1292# Limit the depth of the directories being watched, 0 means only watch
1293# the music directory itself. There is no limit by default.
1294#
1295#auto_update_depth "3"
1296#
1297###############################################################################
1298
1299
1300# Symbolic link behavior ######################################################
1301#
1302# If this setting is set to "yes", MPD will discover audio files by following
1303# symbolic links outside of the configured music_directory.
1304#
1305#follow_outside_symlinks "yes"
1306#
1307# If this setting is set to "yes", MPD will discover audio files by following
1308# symbolic links inside of the configured music_directory.
1309#
1310#follow_inside_symlinks "yes"
1311#
1312###############################################################################
1313
1314
1315# Zeroconf / Avahi Service Discovery ##########################################
1316#
1317# If this setting is set to "yes", service information will be published with
1318# Zeroconf / Avahi.
1319#
1320#zeroconf_enabled "yes"
1321#
1322# The argument to this setting will be the Zeroconf / Avahi unique name for
1323# this MPD server on the network.
1324#
1325#zeroconf_name "Music Player"
1326#
1327###############################################################################
1328
1329
1330# Permissions #################################################################
1331#
1332# If this setting is set, MPD will require password authorization. The password
1333# setting can be specified multiple times for different password profiles.
1334#
1335#password "password@read,add,control,admin"
1336#
1337# This setting specifies the permissions a user has who has not yet logged in.
1338#
1339#default_permissions "read,add,control,admin"
1340#
1341###############################################################################
1342
1343
1344# Database #######################################################################
1345#
1346
1347#database {
1348# plugin "proxy"
1349# host "other.mpd.host"
1350# port "6600"
1351#}
1352
1353# Input #######################################################################
1354#
1355
1356input {
1357 plugin "curl"
1358# proxy "proxy.isp.com:8080"
1359# proxy_user "user"
1360# proxy_password "password"
1361}
1362
1363#
1364###############################################################################
1365
1366# Audio Output ################################################################
1367#
1368
1369audio_output {
1370 type "pulse"
1371 name "pulse audio"
1372}
1373
1374audio_output {
1375 type "fifo"
1376 name "my_fifo"
1377 path "/tmp/mpd.fifo"
1378 format "44100:16:2"
1379}
1380
1381# MPD supports various audio output types, as well as playing through multiple
1382# audio outputs at the same time, through multiple audio_output settings
1383# blocks. Setting this block is optional, though the server will only attempt
1384# autodetection for one sound card.
1385#
1386# An example of an ALSA output:
1387#
1388#audio_output {
1389# type "alsa"
1390# name "My ALSA Device"
1391## device "hw:0,0" # optional
1392## mixer_type "hardware" # optional
1393## mixer_device "default" # optional
1394## mixer_control "PCM" # optional
1395## mixer_index "0" # optional
1396#}
1397#
1398# An example of an OSS output:
1399#
1400#audio_output {
1401# type "oss"
1402# name "My OSS Device"
1403## device "/dev/dsp" # optional
1404## mixer_type "hardware" # optional
1405## mixer_device "/dev/mixer" # optional
1406## mixer_control "PCM" # optional
1407#}
1408#
1409# An example of a shout output (for streaming to Icecast):
1410#
1411#audio_output {
1412# type "shout"
1413# encoder "vorbis" # optional
1414# name "My Shout Stream"
1415# host "localhost"
1416# port "8000"
1417# mount "/mpd.ogg"
1418# password "hackme"
1419# quality "5.0"
1420# bitrate "128"
1421# format "44100:16:1"
1422## protocol "icecast2" # optional
1423## user "source" # optional
1424## description "My Stream Description" # optional
1425## url "http://example.com" # optional
1426## genre "jazz" # optional
1427## public "no" # optional
1428## timeout "2" # optional
1429## mixer_type "software" # optional
1430#}
1431#
1432# An example of a recorder output:
1433#
1434#audio_output {
1435# type "recorder"
1436# name "My recorder"
1437# encoder "vorbis" # optional, vorbis or lame
1438# path "/var/lib/mpd/recorder/mpd.ogg"
1439## quality "5.0" # do not define if bitrate is defined
1440# bitrate "128" # do not define if quality is defined
1441# format "44100:16:1"
1442#}
1443#
1444# An example of a httpd output (built-in HTTP streaming server):
1445#
1446#audio_output {
1447# type "httpd"
1448# name "My HTTP Stream"
1449# encoder "vorbis" # optional, vorbis or lame
1450# port "8000"
1451# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
1452## quality "5.0" # do not define if bitrate is defined
1453# bitrate "128" # do not define if quality is defined
1454# format "44100:16:1"
1455# max_clients "0" # optional 0=no limit
1456#}
1457#
1458# An example of a pulseaudio output (streaming to a remote pulseaudio server)
1459#
1460#audio_output {
1461# type "pulse"
1462# name "My Pulse Output"
1463## server "remote_server" # optional
1464## sink "remote_server_sink" # optional
1465#}
1466#
1467# An example of a winmm output (Windows multimedia API).
1468#
1469#audio_output {
1470# type "winmm"
1471# name "My WinMM output"
1472## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
1473# or
1474## device "0" # optional
1475## mixer_type "hardware" # optional
1476#}
1477#
1478# An example of an openal output.
1479#
1480#audio_output {
1481# type "openal"
1482# name "My OpenAL output"
1483## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
1484#}
1485#
1486# An example of an sndio output.
1487#
1488#audio_output {
1489# type "sndio"
1490# name "sndio output"
1491# mixer_type "software"
1492#}
1493#
1494# An example of an OS X output:
1495#
1496#audio_output {
1497# type "osx"
1498# name "My OS X Device"
1499## device "Built-in Output" # optional
1500## channel_map "-1,-1,0,1" # optional
1501#}
1502#
1503## Example "pipe" output:
1504#
1505#audio_output {
1506# type "pipe"
1507# name "my pipe"
1508# command "aplay -f cd 2>/dev/null"
1509## Or if you're want to use AudioCompress
1510# command "AudioCompress -m | aplay -f cd 2>/dev/null"
1511## Or to send raw PCM stream through PCM:
1512# command "nc example.org 8765"
1513# format "44100:16:2"
1514#}
1515#
1516## An example of a null output (for no audio output):
1517#
1518#audio_output {
1519# type "null"
1520# name "My Null Output"
1521# mixer_type "none" # optional
1522#}
1523#
1524###############################################################################
1525
1526
1527# Normalization automatic volume adjustments ##################################
1528#
1529# This setting specifies the type of ReplayGain to use. This setting can have
1530# the argument "off", "album", "track" or "auto". "auto" is a special mode that
1531# chooses between "track" and "album" depending on the current state of
1532# random playback. If random playback is enabled then "track" mode is used.
1533# See <http://www.replaygain.org> for more details about ReplayGain.
1534# This setting is off by default.
1535#
1536#replaygain "album"
1537#
1538# This setting sets the pre-amp used for files that have ReplayGain tags. By
1539# default this setting is disabled.
1540#
1541#replaygain_preamp "0"
1542#
1543# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
1544# By default this setting is disabled.
1545#
1546#replaygain_missing_preamp "0"
1547#
1548# This setting enables or disables ReplayGain limiting.
1549# MPD calculates actual amplification based on the ReplayGain tags
1550# and replaygain_preamp / replaygain_missing_preamp setting.
1551# If replaygain_limit is enabled MPD will never amplify audio signal
1552# above its original level. If replaygain_limit is disabled such amplification
1553# might occur. By default this setting is enabled.
1554#
1555#replaygain_limit "yes"
1556#
1557# This setting enables on-the-fly normalization volume adjustment. This will
1558# result in the volume of all playing audio to be adjusted so the output has
1559# equal "loudness". This setting is disabled by default.
1560#
1561#volume_normalization "no"
1562#
1563###############################################################################
1564
1565# Character Encoding ##########################################################
1566#
1567# If file or directory names do not display correctly for your locale then you
1568# may need to modify this setting.
1569#
1570#filesystem_charset "UTF-8"
1571#
1572###############################################################################
1573#+end_src
1574
1575** msmtp
1576:PROPERTIES:
1577:header-args+: :tangle ~/.msmtprc
1578:END:
1579
1580#+begin_src conf
1581# Set default values for all following accounts.
1582defaults
1583port 587
1584tls on
1585auth on
1586#tls_trust_file /etc/ssl/certs/ca-certificates.crt
1587logfile ~/.msmtp.log
1588
1589# aminb
1590account aminb
1591host mail.aminb.org
1592# use `msmtp -a aminb --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint
1593tls_fingerprint C7:A4:2E:A3:11:FA:80:45:C4:29:D6:62:4D:73:DB:34:43:67:8F:16:F1:2E:54:43:06:1B:41:B6:A9:09:E0:37
1594tls_starttls on
1595from amin@aminb.org
1596user amin@aminb.org
1597passwordeval gpg2 --no-tty -q -d ~/.passwd/amin.gpg
1598
1599# gnu
1600account gnu
1601host fencepost.gnu.org
1602# use `msmtp -a gnu --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint
1603tls_fingerprint 34:60:91:B5:71:5B:76:87:50:F3:83:13:26:0F:EE:75:42:83:93:9A:E2:AF:1E:87:72:02:C9:61:CE:28:1B:8E
1604tls_starttls on
1605from bandali@gnu.org
1606user bandali
1607passwordeval gpg2 --no-tty -q -d ~/.passwd/gnu.gpg
1608
1609# gnu (old)
1610account gnu-aminb : gnu
1611from aminb@gnu.org
1612account gnu-amin : gnu
1613from amin@gnu.org
1614account gnu-mab : gnu
1615from mab@gnu.org
1616
1617# uwaterloo
1618account uwaterloo
1619host connect.uwaterloo.ca
1620tls_starttls on
1621from abandali@uwaterloo.ca
1622user abandali
1623passwordeval gpg2 --no-tty -q -d ~/.passwd/uwaterloo.gpg
1624tls_trust_file /etc/ssl/certs/ca-certificates.crt
1625
1626# Set a default account
1627account default : aminb
1628#+end_src
1629
1630** ncmpcpp
1631
1632*** config
1633:PROPERTIES:
1634:header-args+: :tangle ~/.ncmpcpp/config
1635:END:
1636
1637#+begin_src conf :tangle no
1638##############################################################
1639## This is the example configuration file. Copy it to ##
1640## $HOME/.ncmpcpp/config or $XDG_CONFIG_HOME/ncmpcpp/config ##
1641## and set up your preferences. ##
1642##############################################################
1643#
1644##### directories ######
1645##
1646## Directory for storing ncmpcpp related files.
1647## Changing it is useful if you want to store
1648## everything somewhere else and provide command
1649## line setting for alternative location to config
1650## file which defines that while launching ncmpcpp.
1651##
1652#
1653ncmpcpp_directory = ~/.ncmpcpp
1654#
1655##
1656## Directory for storing downloaded lyrics. It
1657## defaults to ~/.lyrics since other MPD clients
1658## (eg. ncmpc) also use that location.
1659##
1660#
1661#lyrics_directory = ~/.lyrics
1662#
1663##### connection settings #####
1664#
1665#mpd_host = localhost
1666#
1667#mpd_port = 6600
1668#
1669#mpd_connection_timeout = 5
1670#
1671## Needed for tag editor and file operations to work.
1672##
1673mpd_music_dir = ~/usr/music
1674#
1675#mpd_crossfade_time = 5
1676#
1677##### music visualizer #####
1678##
1679## Note: In order to make music visualizer work you'll
1680## need to use mpd fifo output, whose format parameter
1681## has to be set to 44100:16:1 for mono visualization
1682## or 44100:16:2 for stereo visualization. Example
1683## configuration (it has to be put into mpd.conf):
1684##
1685## audio_output {
1686## type "fifo"
1687## name "Visualizer feed"
1688## path "/tmp/mpd.fifo"
1689## format "44100:16:2"
1690## }
1691##
1692#
1693visualizer_fifo_path = /tmp/mpd.fifo
1694#
1695##
1696## Note: Below parameter is needed for ncmpcpp
1697## to determine which output provides data for
1698## visualizer and thus allow syncing between
1699## visualization and sound as currently there
1700## are some problems with it.
1701##
1702#
1703visualizer_output_name = my fifo
1704#
1705##
1706## If you set format to 44100:16:2, make it 'yes'.
1707##
1708visualizer_in_stereo = yes
1709#
1710##
1711## Multiply received samples by given value. Very
1712## useful for proper visualization of quiet music.
1713##
1714#visualizer_sample_multiplier = 1
1715#
1716##
1717## Note: Below parameter defines how often ncmpcpp
1718## has to "synchronize" visualizer and audio outputs.
1719## 30 seconds is optimal value, but if you experience
1720## synchronization problems, set it to lower value.
1721## Keep in mind that sane values start with >=10.
1722##
1723#
1724visualizer_sync_interval = 30
1725#
1726##
1727## Note: To enable spectrum frequency visualization
1728## you need to compile ncmpcpp with fftw3 support.
1729##
1730#
1731## Available values: spectrum, wave, wave_filled, ellipse.
1732##
1733visualizer_type = spectrum
1734#
1735#visualizer_look = ●▮
1736visualizer_look = "●•"
1737#
1738#visualizer_color = blue, cyan, green, yellow, magenta, red
1739#
1740## Alternative subset of 256 colors for terminals that support it.
1741##
1742#visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161
1743#
1744##### system encoding #####
1745##
1746## ncmpcpp should detect your charset encoding
1747## but if it failed to do so, you can specify
1748## charset encoding you are using here.
1749##
1750## Note: You can see whether your ncmpcpp build
1751## supports charset detection by checking output
1752## of `ncmpcpp --version`.
1753##
1754## Note: Since MPD uses UTF-8 by default, setting
1755## this option makes sense only if your encoding
1756## is different.
1757##
1758#
1759#system_encoding = ""
1760#
1761##### delays #####
1762#
1763## Time of inactivity (in seconds) after playlist
1764## highlighting will be disabled (0 = always on).
1765##
1766#playlist_disable_highlight_delay = 5
1767#
1768## Defines how long messages are supposed to be visible.
1769##
1770#message_delay_time = 5
1771#
1772##### song format #####
1773##
1774## For a song format you can use:
1775##
1776## %l - length
1777## %f - filename
1778## %D - directory
1779## %a - artist
1780## %A - album artist
1781## %t - title
1782## %b - album
1783## %y - date
1784## %n - track number (01/12 -> 01)
1785## %N - full track info (01/12 -> 01/12)
1786## %g - genre
1787## %c - composer
1788## %p - performer
1789## %d - disc
1790## %C - comment
1791## %P - priority
1792## $R - begin right alignment
1793##
1794## If you want to make sure that a part of the format is displayed
1795## only when certain tags are present, you can archieve it by
1796## grouping them with brackets, e.g. '{%a - %t}' will be evaluated
1797## to 'ARTIST - TITLE' if both tags are present or '' otherwise.
1798## It is also possible to define a list of alternatives by providing
1799## several groups and separating them with '|', e.g. '{%t}|{%f}'
1800## will be evaluated to 'TITLE' or 'FILENAME' if the former is not
1801## present.
1802##
1803## Note: If you want to set limit on maximal length of a tag, just
1804## put the appropriate number between % and character that defines
1805## tag type, e.g. to make album take max. 20 terminal cells, use '%20b'.
1806##
1807## In addition, formats support markers used for text attributes.
1808## They are followed by character '$'. After that you can put:
1809##
1810## - 0 - default window color (discards all other colors)
1811## - 1 - black
1812## - 2 - red
1813## - 3 - green
1814## - 4 - yellow
1815## - 5 - blue
1816## - 6 - magenta
1817## - 7 - cyan
1818## - 8 - white
1819## - 9 - end of current color
1820## - b - bold text
1821## - u - underline text
1822## - r - reverse colors
1823## - a - use alternative character set
1824##
1825## If you don't want to use a non-color attribute anymore, just put it
1826## again, but this time insert character '/' between '$' and attribute
1827## character, e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag
1828## or filename with reversed colors.
1829##
1830## If you want to use 256 colors and/or background colors in formats
1831## (the naming scheme is described below in section about color
1832## definitions), it can be done with the syntax $(COLOR), e.g. to set
1833## the artist tag to one of the non-standard colors and make it have
1834## yellow background, you need to write $(197_yellow)%a$(end). Note
1835## that for standard colors this is interchangable with attributes
1836## listed above.
1837##
1838## Note: colors can be nested.
1839##
1840#
1841#song_list_format = {%a - }{%t}|{$8%f$9}$R{$3(%l)$9}
1842#
1843#song_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f}
1844#
1845#song_library_format = {%n - }{%t}|{%f}
1846#
1847#
1848#alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
1849#
1850#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
1851#
1852#now_playing_prefix = $b
1853#
1854#now_playing_suffix = $/b
1855#
1856#browser_playlist_prefix = "$2playlist$9 "
1857#
1858#selected_item_prefix = $6
1859#
1860#selected_item_suffix = $9
1861#
1862#modified_item_prefix = $3> $9
1863#
1864##
1865## Note: attributes are not supported for the following variables.
1866##
1867#song_window_title_format = {%a - }{%t}|{%f}
1868##
1869## Note: Below variables are used for sorting songs in browser.
1870## The sort mode determines how songs are sorted, and can be used
1871## in combination with a sort format to specify a custom sorting format.
1872## Available values for browser_sort_mode are "name", "mtime", "format"
1873## and "noop".
1874##
1875#
1876#browser_sort_mode = name
1877#
1878#browser_sort_format = {%a - }{%t}|{%f} {(%l)}
1879#
1880##### columns settings #####
1881##
1882## syntax of song columns list format is "column column etc."
1883##
1884## - syntax for each column is:
1885##
1886## (width of the column)[color of the column]{displayed tag}
1887##
1888## Note: Width is by default in %, if you want a column to
1889## have fixed size, add 'f' after the value, e.g. (10)[white]{a}
1890## will be the column that take 10% of screen (so the real width
1891## will depend on actual screen size), whereas (10f)[white]{a}
1892## will take 10 terminal cells, no matter how wide the screen is.
1893##
1894## - color is optional (if you want the default one,
1895## leave the field empty).
1896##
1897## Note: You can give a column additional attributes by putting appropriate
1898## character after displayed tag character. Available attributes are:
1899##
1900## - r - column will be right aligned
1901## - E - if tag is empty, empty tag marker won't be displayed
1902##
1903## You can also:
1904##
1905## - give a column custom name by putting it after attributes,
1906## separated with character ':', e.g. {lr:Length} gives you
1907## right aligned column of lengths named "Length".
1908##
1909## - define sequence of tags, that have to be displayed in case
1910## predecessor is empty in a way similar to the one in classic
1911## song format, i.e. using '|' character, e.g. {a|c|p:Owner}
1912## creates column named "Owner" that tries to display artist
1913## tag and then composer and performer if previous ones are
1914## not available.
1915##
1916#
1917#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
1918#
1919##### various settings #####
1920#
1921##
1922## Note: Custom command that will be executed each
1923## time song changes. Useful for notifications etc.
1924##
1925#execute_on_song_change = ""
1926#
1927#playlist_show_mpd_host = no
1928#
1929#playlist_show_remaining_time = no
1930#
1931#playlist_shorten_total_times = no
1932#
1933#playlist_separate_albums = no
1934#
1935##
1936## Note: Possible display modes: classic, columns.
1937##
1938#playlist_display_mode = columns
1939#
1940#browser_display_mode = classic
1941#
1942#search_engine_display_mode = classic
1943#
1944#playlist_editor_display_mode = classic
1945#
1946#discard_colors_if_item_is_selected = yes
1947#
1948#incremental_seeking = yes
1949#
1950#seek_time = 1
1951#
1952#volume_change_step = 2
1953#
1954#autocenter_mode = no
1955#
1956#centered_cursor = no
1957#
1958##
1959## Note: You can specify third character which will
1960## be used to build 'empty' part of progressbar.
1961##
1962#progressbar_look = =>
1963progressbar_look = "─╼╶"
1964#progressbar_look = "─⊙╶"
1965#
1966#progressbar_boldness = yes
1967#
1968## Available values: database, playlist.
1969##
1970#default_place_to_search_in = database
1971#
1972## Available values: classic, alternative.
1973##
1974#user_interface = classic
1975#
1976#data_fetching_delay = yes
1977#
1978## Available values: artist, album_artist, date, genre, composer, performer.
1979##
1980#media_library_primary_tag = artist
1981#
1982## Available values: wrapped, normal.
1983##
1984#default_find_mode = wrapped
1985#
1986#default_tag_editor_pattern = %n - %t
1987#
1988#header_visibility = yes
1989#
1990#statusbar_visibility = yes
1991#
1992#titles_visibility = yes
1993#
1994#header_text_scrolling = yes
1995#
1996#cyclic_scrolling = no
1997#
1998#lines_scrolled = 2
1999#
2000#follow_now_playing_lyrics = no
2001#
2002#fetch_lyrics_for_current_song_in_background = no
2003#
2004#store_lyrics_in_song_dir = no
2005#
2006#generate_win32_compatible_filenames = yes
2007#
2008#allow_for_physical_item_deletion = no
2009#
2010##
2011## Note: If you set this variable, ncmpcpp will try to
2012## get info from last.fm in language you set and if it
2013## fails, it will fall back to english. Otherwise it will
2014## use english the first time.
2015##
2016## Note: Language has to be expressed as an ISO 639 alpha-2 code.
2017##
2018#lastfm_preferred_language = en
2019#
2020#show_hidden_files_in_local_browser = no
2021#
2022##
2023## How shall screen switcher work?
2024##
2025## - "previous" - switch between the current and previous screen.
2026## - "screen1,...,screenN" - switch between given sequence of screens.
2027##
2028## Screens available for use: help, playlist, browser, search_engine,
2029## media_library, playlist_editor, tag_editor, outputs, visualizer, clock.
2030##
2031#screen_switcher_mode = playlist, browser
2032#
2033##
2034## Note: You can define startup screen
2035## by choosing screen from the list above.
2036##
2037#startup_screen = playlist
2038#
2039##
2040## Note: You can define startup slave screen
2041## by choosing screen from the list above or
2042## an empty value for no slave screen.
2043##
2044#startup_slave_screen = ""
2045#
2046#startup_slave_screen_focus = no
2047#
2048##
2049## Default width of locked screen (in %).
2050## Acceptable values are from 20 to 80.
2051##
2052#
2053#locked_screen_width_part = 50
2054#
2055#ask_for_locked_screen_width_part = yes
2056#
2057#jump_to_now_playing_song_at_start = yes
2058#
2059#ask_before_clearing_playlists = yes
2060#
2061#clock_display_seconds = no
2062#
2063#display_volume_level = yes
2064#
2065#display_bitrate = no
2066#
2067#display_remaining_time = no
2068#
2069## Available values: none, basic, extended, perl.
2070##
2071#regular_expressions = perl
2072#
2073##
2074## Note: If below is enabled, ncmpcpp will ignore leading
2075## "The" word while sorting items in browser, tags in
2076## media library, etc.
2077##
2078#ignore_leading_the = no
2079#
2080#block_search_constraints_change_if_items_found = yes
2081#
2082#mouse_support = yes
2083#
2084#mouse_list_scroll_whole_page = yes
2085#
2086#empty_tag_marker = <empty>
2087#
2088#tags_separator = " | "
2089#
2090#tag_editor_extended_numeration = no
2091#
2092#media_library_sort_by_mtime = no
2093#
2094#enable_window_title = yes
2095#
2096##
2097## Note: You can choose default search mode for search
2098## engine. Available modes are:
2099##
2100## - 1 - use mpd built-in searching (no regexes, pattern matching)
2101## - 2 - use ncmpcpp searching (pattern matching with support for regexes,
2102## but if your mpd is on a remote machine, downloading big database
2103## to process it can take a while
2104## - 3 - match only exact values (this mode uses mpd function for searching
2105## in database and local one for searching in current playlist)
2106##
2107#
2108#search_engine_default_search_mode = 1
2109#
2110#external_editor = nano
2111#
2112## Note: set to yes if external editor is a console application.
2113##
2114#use_console_editor = yes
2115#
2116##### colors definitions #####
2117##
2118## It is possible to set a background color by setting a color
2119## value "<foreground>_<background>", e.g. red_black will set
2120## foregound color to red and background color to black.
2121##
2122## In addition, for terminals that support 256 colors it
2123## is possible to set one of them by using a number in range
2124## [1, 256] instead of color name, e.g. numerical value
2125## corresponding to red_black is 2_1. To find out if the
2126## terminal supports 256 colors, run ncmpcpp and check out
2127## the bottom of the help screen for list of available colors
2128## and their numerical values.
2129##
2130## Note: due to technical limitations of ncurses, if 256 colors
2131## are used, it is possible to either use only the colors with
2132## default background color, or all pairs from 1_1 up to 254_127,
2133## depending on the ncurses version used.
2134##
2135#
2136#colors_enabled = yes
2137#
2138#empty_tag_color = cyan
2139#
2140#header_window_color = default
2141#
2142#volume_color = default
2143#
2144#state_line_color = default
2145#
2146#state_flags_color = default
2147#
2148#main_window_color = yellow
2149#
2150#color1 = white
2151#
2152#color2 = green
2153#
2154#main_window_highlight_color = yellow
2155#
2156#progressbar_color = black
2157#
2158#progressbar_elapsed_color = green
2159#
2160#statusbar_color = default
2161#
2162#alternative_ui_separator_color = black
2163#
2164#active_column_color = red
2165#
2166#window_border_color = green
2167#
2168#active_window_border = red
2169#
2170#+end_src
2171
2172*** bindings
2173:PROPERTIES:
2174:header-args+: :tangle ~/.ncmpcpp/bindings
2175:END:
2176
2177#+begin_src conf :tangle no
2178def_key "j"
2179 scroll_down
2180def_key "k"
2181 scroll_up
2182
2183def_key "ctrl-u"
2184 page_up
2185def_key "ctrl-d"
2186 page_down
2187
2188def_key "h"
2189 previous_column
2190def_key "l"
2191 next_column
2192
2193def_key "."
2194 show_lyrics
2195
2196def_key "n"
2197 next_found_item
2198def_key "N"
2199 previous_found_item
2200
2201def_key "J"
2202 move_sort_order_down
2203def_key "K"
2204 move_sort_order_up
2205#+end_src
2206
2207** notmuch
2208
2209*** notmuch-config
2210:PROPERTIES:
2211:header-args+: :tangle ~/.notmuch-config
2212:END:
2213
2214#+begin_src conf
2215# .notmuch-config - Configuration file for the notmuch mail system
2216#
2217# For more information about notmuch, see https://notmuchmail.org
2218
2219# Database configuration
2220#
2221# The only value supported here is 'path' which should be the top-level
2222# directory where your mail currently exists and to where mail will be
2223# delivered in the future. Files should be individual email messages.
2224# Notmuch will store its database within a sub-directory of the path
2225# configured here named ".notmuch".
2226#
2227[database]
2228path=/home/amin/oldmail
2229
2230# User configuration
2231#
2232# Here is where you can let notmuch know how you would like to be
2233# addressed. Valid settings are
2234#
2235# name Your full name.
2236# primary_email Your primary email address.
2237# other_email A list (separated by ';') of other email addresses
2238# at which you receive email.
2239#
2240# Notmuch will use the various email addresses configured here when
2241# formatting replies. It will avoid including your own addresses in the
2242# recipient list of replies, and will set the From address based on the
2243# address to which the original email was addressed.
2244#
2245[user]
2246name=Amin Bandali
2247primary_email=amin@aminb.org
2248other_email=bandali@gnu.org;abandali@uwaterloo.ca;
2249
2250# Configuration for "notmuch new"
2251#
2252# The following options are supported here:
2253#
2254# tags A list (separated by ';') of the tags that will be
2255# added to all messages incorporated by "notmuch new".
2256#
2257# ignore A list (separated by ';') of file and directory names
2258# that will not be searched for messages by "notmuch new".
2259#
2260# NOTE: *Every* file/directory that goes by one of those
2261# names will be ignored, independent of its depth/location
2262# in the mail store.
2263#
2264[new]
2265tags=new;
2266#tags=unread;inbox;
2267ignore=.uidvalidity;.mbsyncstate;/.*/dovecot*/
2268
2269# Search configuration
2270#
2271# The following option is supported here:
2272#
2273# exclude_tags
2274# A ;-separated list of tags that will be excluded from
2275# search results by default. Using an excluded tag in a
2276# query will override that exclusion.
2277#
2278[search]
2279exclude_tags=deleted;spam;
2280
2281# Maildir compatibility configuration
2282#
2283# The following option is supported here:
2284#
2285# synchronize_flags Valid values are true and false.
2286#
2287# If true, then the following maildir flags (in message filenames)
2288# will be synchronized with the corresponding notmuch tags:
2289#
2290# Flag Tag
2291# ---- -------
2292# D draft
2293# F flagged
2294# P passed
2295# R replied
2296# S unread (added when 'S' flag is not present)
2297#
2298# The "notmuch new" command will notice flag changes in filenames
2299# and update tags, while the "notmuch tag" and "notmuch restore"
2300# commands will notice tag changes and update flags in filenames
2301#
2302[maildir]
2303synchronize_flags=true
2304
2305# Cryptography related configuration
2306#
2307# The following option is supported here:
2308#
2309# gpg_path
2310# binary name or full path to invoke gpg.
2311#
2312[crypto]
2313gpg_path=gpg
2314#+end_src
2315
2316*** pre-new hook
2317:PROPERTIES:
2318:header-args+: :tangle ~/mail/.notmuch/hooks/pre-new :shebang "#!/bin/sh"
2319:END:
2320
2321#+begin_src sh
2322touch /tmp/gnusieve.log
2323sieve-filter -eW -o postmaster_address=postmaster@aminb.org \
2324 -o mail_location=maildir:$MAILDIR/gnu:LAYOUT=fs:INBOX=$MAILDIR/gnu/Inbox ~/sieve/gnu.sieve INBOX delete &>>/tmp/gnusieve.log
2325#+end_src
2326
2327*** post-new hook
2328:PROPERTIES:
2329:header-args+: :tangle ~/mail/.notmuch/hooks/post-new :shebang "#!/bin/sh"
2330:END:
2331
2332#+begin_src sh
2333# apply sent tag to messages sent by me
2334notmuch tag -new +sent -- from:amin@aminb.org or from:bandali@gnu.org or from:aminb@gnu.org or from:amin@gnu.org or from:mab@gnu.org or from:abandali@uwaterloo.ca
2335
2336# initial tagging
2337notmuch tag -latest -- tag:latest
2338notmuch tag +inbox +unread +latest -new -- tag:new
2339
2340
2341# apply tags to lists
2342
2343# <aminb>
2344notmuch tag -inbox +lists/hackernewsletter -- folder:amin/lists/hackernewsletter
2345notmuch tag -inbox +lists/haskell-weekly -- folder:amin/lists/haskell-weekly
2346
2347notmuch tag -inbox +pay -- folder:amin/pay
2348notmuch tag -inbox +banking -- folder:amin/banking
2349notmuch tag -inbox +work -- folder:amin/work
2350# </aminb>
2351
2352# <uw>
2353notmuch tag -inbox +uw/cs136 -- folder:uwaterloo/lists/cs136
2354notmuch tag -inbox +uw/cs846 -- folder:uwaterloo/lists/cs846
2355notmuch tag -inbox +uw/ece750 -- folder:uwaterloo/lists/ece750
2356notmuch tag -inbox +uw/se212 -- folder:uwaterloo/lists/se212
2357notmuch tag -inbox +uw/se463 -- folder:uwaterloo/lists/se463
2358
2359notmuch tag -inbox +lists/alloytools -- folder:uwaterloo/lists/alloytools
2360notmuch tag -inbox +lists/clvsingle -- folder:uwaterloo/lists/Clvsingle
2361notmuch tag -inbox +lists/gsa -- folder:uwaterloo/lists/GSA
2362notmuch tag -inbox +lists/math-grad -- folder:uwaterloo/lists/Math-grad
2363notmuch tag -inbox +lists/scs-grads -- folder:uwaterloo/lists/scs-grads
2364notmuch tag -inbox +lists/watform-students -- folder:uwaterloo/lists/Watform-students
2365# </uw>
2366
2367# <gnu>
2368notmuch tag -inbox +l/emacs-devel -- folder:gnu/l/emacs-devel
2369notmuch tag -inbox +l/emacs-orgmode -- folder:gnu/l/emacs-orgmode
2370notmuch tag -inbox +l/emacsconf-discuss -- folder:gnu/l/emacsconf-discuss
2371notmuch tag -inbox +l/fencepost-users -- folder:gnu/l/fencepost-users
2372notmuch tag -inbox +l/guix-devel -- folder:gnu/l/guix-devel
2373notmuch tag -inbox +l/guile-devel -- folder:gnu/l/guile-devel
2374notmuch tag -inbox +l/help-gnu-emacs -- folder:gnu/l/help-gnu-emacs
2375notmuch tag -inbox +l/info-gnu-emacs -- folder:gnu/l/info-gnu-emacs
2376notmuch tag -inbox +l/www-commits -- folder:gnu/l/www-commits
2377notmuch tag -inbox +l/www-discuss -- folder:gnu/l/www-discuss
2378notmuch tag -inbox +webmasters -- folder:gnu/webmasters
2379
2380notmuch tag -inbox +l/deepspec -- folder:gnu/l/deepspec
2381notmuch tag -inbox +l/haskell-cafe -- folder:gnu/l/haskell-cafe
2382notmuch tag -inbox +l/haskell-art -- folder:gnu/l/haskell-art
2383notmuch tag -inbox +l/notmuch -- folder:gnu/l/notmuch
2384
2385notmuch tag -inbox +l/~aminb/test-priv -- folder:gnu/l/~aminb/test-priv
2386notmuch tag -inbox +l/~sircmpwn/sr.ht-admins -- folder:gnu/l/~sircmpwn/sr.ht-admins
2387notmuch tag -inbox +l/~sircmpwn/sr.ht-announce -- folder:gnu/l/~sircmpwn/sr.ht-announce
2388notmuch tag -inbox +l/~sircmpwn/sr.ht-dev -- folder:gnu/l/~sircmpwn/sr.ht-dev
2389notmuch tag -inbox +l/~sircmpwn/sr.ht-discuss -- folder:gnu/l/~sircmpwn/sr.ht-discuss
2390# </gnu>
2391
2392notmuch tag -inbox -unread +archive/notmuch -- path:archive/notmuch/**
2393notmuch tag -inbox -unread +archive/emacs-devel -- path:archive/emacs-devel/**
2394#+end_src
2395
2396*** notmuch.service
2397:PROPERTIES:
2398:header-args+: :tangle ~/.config/systemd/user/notmuch.service
2399:END:
2400
2401#+begin_src conf :tangle no
2402[Unit]
2403Description=notmuch service
2404
2405[Service]
2406Type=oneshot
2407ExecStart=/usr/bin/notmuch new
2408StandardOutput=syslog
2409StandardError=syslog
2410#+end_src
2411
2412*** notmuch.timer
2413:PROPERTIES:
2414:header-args+: :tangle ~/.config/systemd/user/notmuch.timer
2415:END:
2416
2417#+begin_src conf :tangle no
2418[Unit]
2419Description=notmuch timer
2420
2421[Timer]
2422OnCalendar=*:0/5
2423Persistent=true
2424Unit=notmuch.service
2425
2426[Install]
2427WantedBy=timers.target
2428#+end_src
2429
2430** offlineimap
2431
2432*** offlineimaprc
2433:PROPERTIES:
2434:header-args+: :tangle ~/.offlineimaprc
2435:END:
2436
2437#+begin_src conf :tangle no
2438[general]
2439pythonfile = ~/.offlineimap.py
2440accounts = Gmail, aminb
2441maxsyncaccounts = 3
2442
2443[Account Gmail]
2444localrepository = GmailL
2445remoterepository = GmailR
2446
2447[Account aminb]
2448localrepository = aminbL
2449remoterepository = aminbR
2450
2451[Repository GmailL]
2452type = Maildir
2453localfolders = ~/Maildir/Gmail
2454
2455[Repository GmailR]
2456type = IMAP
2457remotehost = imap.gmail.com
2458remoteusereval = mailuser("gmail")
2459remotepasseval = mailpasswd("gmail")
2460sslcacertfile = /etc/ssl/certs/ca-certificates.crt
2461ssl = yes
2462folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail'
2463maxconnections = 1
2464realdelete = no
2465
2466[Repository aminbL]
2467type = Maildir
2468localfolders = ~/Maildir/aminb
2469
2470[Repository aminbR]
2471type = IMAP
2472remotehost = mail.aminb.org
2473remoteusereval = mailuser("aminb")
2474remotepasseval = mailpasswd("aminb")
2475sslcacertfile = /etc/ssl/certs/ca-certificates.crt
2476ssl = yes
2477folderfilter = lambda foldername: foldername not in 'dovecot.sieve'
2478maxconnections = 1
2479realdelete = no
2480#+end_src
2481
2482*** offlineimap.py
2483:PROPERTIES:
2484:header-args+: :tangle ~/.offlineimap.py
2485:END:
2486
2487#+begin_src python :tangle no
2488import os
2489import subprocess
2490
2491def mailpasswd(acct):
2492 acct = os.path.basename(acct)
2493 path = "/home/amin/.passwd/%s.gpg" % acct
2494 args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path]
2495 try:
2496 return subprocess.check_output(args).strip()
2497 except subprocess.CalledProcessError:
2498 return ""
2499
2500def mailuser(acct):
2501 acct = os.path.basename(acct)
2502 path = "/home/amin/.passwd/%s" % acct
2503 args = ["cat", path]
2504 try:
2505 return subprocess.check_output(args).strip()
2506 except subprocess.CalledProcessError:
2507 return ""
2508
2509def prime_gpg_agent():
2510 ret = False
2511 i = 1
2512 while not ret:
2513 ret = (mailpasswd("prime") == "prime")
2514 if i > 2:
2515 from offlineimap.ui import getglobalui
2516 sys.stderr.write("Error reading in passwords. Terminating.\n")
2517 getglobalui().terminate()
2518 i += 1
2519 return ret
2520
2521prime_gpg_agent()
2522#+end_src
2523
2524** pigeonhole
2525*** gnu.sieve
2526:PROPERTIES:
2527:header-args+: :tangle ~/sieve/gnu.sieve :comments none
2528:END:
2529
2530#+begin_src conf
2531require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ];
2532
2533if anyof (
2534 address :is "from" "webmasters@gnu.org",
2535 address :is "from" "webmasters-comment@gnu.org") {
2536 fileinto :create "webmasters";
2537 stop;
2538}
2539
2540include :personal "lists";
2541#+end_src
2542
2543*** lists.sieve
2544:PROPERTIES:
2545:header-args+: :tangle ~/sieve/lists.sieve :comments none
2546:END:
2547
2548#+begin_src conf
2549require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags",
2550 "include" ];
2551
2552if anyof (
2553 header :contains "list-id" "<emacs-devel.gnu.org>",
2554 header :contains "list-id" "<emacs-orgmode.gnu.org>",
2555 header :contains "list-id" "<emacsconf-discuss.gnu.org>",
2556 header :contains "list-id" "<fencepost-users.gnu.org>",
2557 header :contains "list-id" "<guix-devel.gnu.org>",
2558 header :contains "list-id" "<guile-devel.gnu.org>",
2559 header :contains "list-id" "<help-gnu-emacs.gnu.org>",
2560 header :contains "list-id" "<info-gnu-emacs.gnu.org>",
2561 header :contains "list-id" "<www-commits.gnu.org>",
2562 header :contains "list-id" "<www-discuss.gnu.org>",
2563 header :contains "list-id" "<deepspec.lists.cs.princeton.edu>",
2564 header :contains "list-id" "<haskell-cafe.haskell.org>",
2565 header :contains "list-id" "<haskell-art.we.lurk.org>",
2566 header :contains "list-id" "<notmuch.notmuchmail.org>") {
2567 if header :regex "list-id" "<([a-z_0-9-]+)[.@]" {
2568 set :lower "listname" "${1}";
2569 fileinto :create "l/${listname}";
2570 }
2571}
2572
2573if anyof (
2574 header :contains "list-id" "<~aminb/test-priv@lists.sr.ht>",
2575 header :contains "list-id" "<~sircmpwn/sr.ht-admins@lists.sr.ht>",
2576 header :contains "list-id" "<~sircmpwn/sr.ht-announce@lists.sr.ht>",
2577 header :contains "list-id" "<~sircmpwn/sr.ht-dev@lists.sr.ht>",
2578 header :contains "list-id" "<~sircmpwn/sr.ht-discuss@lists.sr.ht>") {
2579 if header :regex "list-id" "(~[a-z_0-9-]+)/([a-z_0-9.-]+)@" {
2580 set :lower "username" "${1}";
2581 set :lower "listname" "${2}";
2582 fileinto :create "l/${username}/${listname}";
2583 }
2584}
2585#+end_src
2586
2587** polybar
2588
2589*** config
2590:PROPERTIES:
2591:header-args+: :tangle ~/.config/polybar/config
2592:END:
2593
2594#+begin_src conf :tangle no
2595;=====================================================
2596;
2597; To learn more about how to configure Polybar
2598; go to https://github.com/jaagr/polybar
2599;
2600; The README contains alot of information
2601;
2602;=====================================================
2603
2604[colors]
2605;background = ${xrdb:color0:#222}
2606background = #222
2607background-alt = #444
2608;foreground = ${xrdb:color7:#222}
2609foreground = #eee
2610foreground-alt = #888
2611primary = #ffb52a
2612secondary = #e60053
2613alert = #bd2c40
2614
2615[bar/main]
2616;monitor = ${env:MONITOR:HDMI-1}
2617width = 100%
2618height = 27
2619;offset-x = 1%
2620;offset-y = 1%
2621radius = 3.0
2622fixed-center = true
2623
2624background = ${colors.background}
2625foreground = ${colors.foreground}
2626
2627line-size = 3
2628line-color = #f00
2629
2630border-size = 4
2631border-color = #00000000
2632
2633padding-left = 0
2634padding-right = 2
2635
2636module-margin-left = 2
2637module-margin-right = 2
2638
2639font-0 = Ubuntu:fontformat=truetype:antialias=true:pixelsize=9;1
2640font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
2641font-2 = Wuncon Siji:pixelsize=10;1
2642font-3 = FontAwesome:pixelsize=10;1
2643
2644modules-left = bspwm xwindow
2645modules-center =
2646modules-right = volume filesystem mail xkeyboard memory cpu temperature date powermenu
2647
2648tray-position = right
2649tray-padding = 1
2650;tray-transparent = true
2651;tray-background = #0063ff
2652tray-maxsize = 18
2653
2654wm-restack = bspwm
2655
2656;override-redirect = true
2657
2658scroll-up = bspwm-desknext
2659scroll-down = bspwm-deskprev
2660
2661[module/xwindow]
2662type = internal/xwindow
2663label = %title:0:50:...%
2664
2665[module/xkeyboard]
2666type = internal/xkeyboard
2667blacklist-0 = num lock
2668
2669format-prefix = " "
2670format-prefix-foreground = ${colors.foreground-alt}
2671format-prefix-underline = ${colors.secondary}
2672
2673label-layout = %layout%
2674label-layout-underline = ${colors.secondary}
2675
2676label-indicator-padding = 2
2677label-indicator-margin = 1
2678label-indicator-background = ${colors.secondary}
2679label-indicator-underline = ${colors.secondary}
2680
2681[module/filesystem]
2682type = internal/fs
2683interval = 25
2684
2685mount-0 = /
2686
2687label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
2688label-unmounted = %mountpoint% not mounted
2689label-unmounted-foreground = ${colors.foreground-alt}
2690
2691[module/bspwm]
2692type = internal/bspwm
2693
2694label-focused = %index%
2695label-focused-background = ${colors.background-alt}
2696label-focused-underline= ${colors.primary}
2697label-focused-padding = 2
2698
2699label-occupied = %index%
2700label-occupied-padding = 2
2701
2702label-urgent = %index%!
2703label-urgent-background = ${colors.alert}
2704label-urgent-padding = 2
2705
2706label-empty = %index%
2707label-empty-foreground = ${colors.foreground-alt}
2708label-empty-padding = 2
2709
2710[module/i3]
2711type = internal/i3
2712format = <label-state> <label-mode>
2713index-sort = true
2714wrapping-scroll = false
2715
2716; Only show workspaces on the same output as the bar
2717;pin-workspaces = true
2718
2719label-mode-padding = 2
2720label-mode-foreground = #000
2721label-mode-background = ${colors.primary}
2722
2723; focused = Active workspace on focused monitor
2724label-focused = %index%
2725label-focused-background = ${module/bspwm.label-focused-background}
2726label-focused-underline = ${module/bspwm.label-focused-underline}
2727label-focused-padding = ${module/bspwm.label-focused-padding}
2728
2729; unfocused = Inactive workspace on any monitor
2730label-unfocused = %index%
2731label-unfocused-padding = ${module/bspwm.label-occupied-padding}
2732
2733; visible = Active workspace on unfocused monitor
2734label-visible = %index%
2735label-visible-background = ${self.label-focused-background}
2736label-visible-underline = ${self.label-focused-underline}
2737label-visible-padding = ${self.label-focused-padding}
2738
2739; urgent = Workspace with urgency hint set
2740label-urgent = %index%
2741label-urgent-background = ${module/bspwm.label-urgent-background}
2742label-urgent-padding = ${module/bspwm.label-urgent-padding}
2743
2744[module/mpd]
2745type = internal/mpd
2746format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
2747
2748icon-prev = 
2749icon-stop = 
2750icon-play = 
2751icon-pause = 
2752icon-next = 
2753
2754label-song-maxlen = 25
2755label-song-ellipsis = true
2756
2757[module/xbacklight]
2758type = internal/xbacklight
2759
2760format = <label> <bar>
2761label = BL
2762
2763bar-width = 10
2764bar-indicator = |
2765bar-indicator-foreground = #ff
2766bar-indicator-font = 2
2767bar-fill = ─
2768bar-fill-font = 2
2769bar-fill-foreground = #9f78e1
2770bar-empty = ─
2771bar-empty-font = 2
2772bar-empty-foreground = ${colors.foreground-alt}
2773
2774[module/backlight-acpi]
2775inherit = module/xbacklight
2776type = internal/backlight
2777;card = intel_backlight
2778card = mba6x_backlight
2779
2780[module/cpu]
2781type = internal/cpu
2782interval = 2
2783format-prefix = " "
2784format-prefix-foreground = ${colors.foreground-alt}
2785format-underline = #f90000
2786label = %percentage%%
2787
2788[module/memory]
2789type = internal/memory
2790interval = 2
2791format-prefix = " "
2792format-prefix-foreground = ${colors.foreground-alt}
2793format-underline = #4bffdc
2794label = %percentage_used%%
2795
2796[module/wlan]
2797type = internal/network
2798interface =
2799interval = 3.0
2800
2801format-connected = <ramp-signal> <label-connected>
2802format-connected-underline = #9f78e1
2803label-connected = %essid%
2804
2805format-disconnected =
2806;format-disconnected = <label-disconnected>
2807;format-disconnected-underline = ${self.format-connected-underline}
2808;label-disconnected = %ifname% disconnected
2809;label-disconnected-foreground = ${colors.foreground-alt}
2810
2811ramp-signal-0 = 
2812ramp-signal-1 = 
2813ramp-signal-2 = 
2814ramp-signal-3 = 
2815ramp-signal-4 = 
2816ramp-signal-foreground = ${colors.foreground-alt}
2817
2818[module/eth]
2819type = internal/network
2820interface =
2821interval = 3.0
2822
2823format-connected-underline = #55aa55
2824format-connected-prefix = " "
2825format-connected-prefix-foreground = ${colors.foreground-alt}
2826label-connected = %local_ip%
2827
2828format-disconnected =
2829;format-disconnected = <label-disconnected>
2830;format-disconnected-underline = ${self.format-connected-underline}
2831;label-disconnected = %ifname% disconnected
2832;label-disconnected-foreground = ${colors.foreground-alt}
2833
2834[module/date]
2835type = internal/date
2836interval = 5
2837
2838date =
2839date-alt = " %Y-%m-%d"
2840
2841time = %H:%M
2842time-alt = %H:%M:%S
2843
2844format-prefix = 
2845format-prefix-foreground = ${colors.foreground-alt}
2846format-underline = #0a6cf5
2847
2848label = %date% %time%
2849
2850[module/volume]
2851type = internal/volume
2852
2853format-volume = <label-volume> <bar-volume>
2854label-volume = vol
2855label-volume-foreground = ${root.foreground}
2856
2857format-muted-prefix = " "
2858format-muted-foreground = ${colors.foreground-alt}
2859label-muted = mute
2860
2861bar-volume-width = 10
2862bar-volume-foreground-0 = #55aa55
2863bar-volume-foreground-1 = #55aa55
2864bar-volume-foreground-2 = #55aa55
2865bar-volume-foreground-3 = #55aa55
2866bar-volume-foreground-4 = #55aa55
2867bar-volume-foreground-5 = #f5a70a
2868bar-volume-foreground-6 = #ff5555
2869bar-volume-gradient = false
2870bar-volume-indicator = |
2871bar-volume-indicator-font = 2
2872bar-volume-fill = ─
2873bar-volume-fill-font = 2
2874bar-volume-empty = ─
2875bar-volume-empty-font = 2
2876bar-volume-empty-foreground = ${colors.foreground-alt}
2877
2878[module/battery]
2879type = internal/battery
2880battery = BAT0
2881adapter = ADP1
2882full-at = 64
2883
2884format-charging = <animation-charging> <label-charging>
2885format-charging-underline = #ffb52a
2886
2887format-discharging = <ramp-capacity> <label-discharging>
2888format-discharging-underline = ${self.format-charging-underline}
2889
2890format-full-prefix = " "
2891format-full-prefix-foreground = ${colors.foreground-alt}
2892format-full-underline = ${self.format-charging-underline}
2893
2894ramp-capacity-0 = 
2895ramp-capacity-1 = 
2896ramp-capacity-2 = 
2897ramp-capacity-foreground = ${colors.foreground-alt}
2898
2899animation-charging-0 = 
2900animation-charging-1 = 
2901animation-charging-2 = 
2902animation-charging-foreground = ${colors.foreground-alt}
2903animation-charging-framerate = 750
2904
2905[module/temperature]
2906type = internal/temperature
2907thermal-zone = 1
2908warn-temperature = 66
2909
2910format = <ramp> <label>
2911format-underline = #f50a4d
2912format-warn = <ramp> <label-warn>
2913format-warn-underline = ${self.format-underline}
2914
2915label = %temperature%
2916label-warn = %temperature%
2917label-warn-foreground = ${colors.secondary}
2918
2919ramp-0 = 
2920ramp-1 = 
2921ramp-2 = 
2922ramp-foreground = ${colors.foreground-alt}
2923
2924[module/powermenu]
2925type = custom/menu
2926
2927format-spacing = 1
2928
2929label-open = 
2930label-open-foreground = ${colors.secondary}
2931label-close =  cancel
2932label-close-foreground = ${colors.secondary}
2933label-separator = |
2934label-separator-foreground = ${colors.foreground-alt}
2935
2936menu-0-0 = reboot
2937menu-0-0-exec = menu-open-1
2938menu-0-1 = power off
2939menu-0-1-exec = menu-open-2
2940
2941menu-1-0 = cancel
2942menu-1-0-exec = menu-open-0
2943menu-1-1 = reboot
2944menu-1-1-exec = sudo reboot
2945
2946menu-2-0 = power off
2947menu-2-0-exec = sudo poweroff
2948menu-2-1 = cancel
2949menu-2-1-exec = menu-open-0
2950
2951[module/mail]
2952type = custom/script
2953interval = 60
2954format = <label>
2955format-prefix = " "
2956format-prefix-foreground = ${colors.foreground-alt}
2957format-underline = #0a6cf5
2958exec = notmuch count tag:unread
2959
2960[settings]
2961screenchange-reload = true
2962;compositing-background = xor
2963;compositing-background = screen
2964;compositing-foreground = source
2965;compositing-border = over
2966
2967[global/wm]
2968margin-top = 0
2969margin-bottom = 0
2970
2971; vim:ft=dosini
2972#+end_src
2973
2974*** polybar-launch
2975:PROPERTIES:
2976:header-args+: :tangle ~/.local/bin/polybar-launch :shebang "#!/usr/bin/env sh"
2977:END:
2978
2979#+begin_src sh :tangle no
2980# Terminate already running bar instances
2981killall -q polybar
2982
2983# Wait until the processes have been shut down
2984while pgrep -x polybar >/dev/null; do sleep 1; done
2985
2986# Launch main bar
2987polybar main &
2988
2989echo "Bars launched..."
2990#+end_src
2991
2992** PowerTOP
2993:PROPERTIES:
2994:header-args+: :tangle "/sudo::/etc/systemd/system/powertop.service"
2995:END:
2996
2997#+begin_src conf
2998[Unit]
2999Description=Powertop tunings
3000
3001[Service]
3002ExecStart=/usr/bin/powertop --auto-tune
3003RemainAfterExit=true
3004
3005[Install]
3006WantedBy=multi-user.target
3007#+end_src
3008
3009** ranger
3010
3011*** rc.conf
3012:PROPERTIES:
3013:header-args+: :tangle ~/.config/ranger/rc.conf
3014:END:
3015
3016#+begin_src conf :tangle no
3017# ===================================================================
3018# This file contains the default startup commands for ranger.
3019# To change them, it is recommended to create the file
3020# ~/.config/ranger/rc.conf and add your custom commands there.
3021#
3022# If you copy this whole file there, you may want to set the environment
3023# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
3024#
3025# The purpose of this file is mainly to define keybindings and settings.
3026# For running more complex python code, please create a plugin in "plugins/" or
3027# a command in "commands.py".
3028#
3029# Each line is a command that will be run before the user interface
3030# is initialized. As a result, you can not use commands which rely
3031# on the UI such as :delete or :mark.
3032# ===================================================================
3033
3034# ===================================================================
3035# == Options
3036# ===================================================================
3037
3038# How many columns are there, and what are their relative widths?
3039set column_ratios 1,3,4
3040
3041# Which files should be hidden? (regular expression)
3042set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
3043
3044# Show hidden files? You can toggle this by typing 'zh'
3045set show_hidden false
3046
3047# Ask for a confirmation when running the "delete" command?
3048# Valid values are "always" (default), "never", "multiple"
3049# With "multiple", ranger will ask only if you delete multiple files at once.
3050set confirm_on_delete multiple
3051
3052# Which script is used to generate file previews?
3053# ranger ships with scope.sh, a script that calls external programs (see
3054# README for dependencies) to preview images, archives, etc.
3055set preview_script ~/.config/ranger/scope.sh
3056
3057# Use the external preview script or display simple plain text previews?
3058set use_preview_script true
3059
3060# Open all images in this directory when running certain image viewers
3061# like feh or sxiv? You can still open selected files by marking them.
3062set open_all_images true
3063
3064# Be aware of version control systems and display information.
3065set vcs_aware false
3066
3067# State of the three backends git, hg, bzr. The possible states are
3068# disabled, local (only show local info), enabled (show local and remote
3069# information).
3070set vcs_backend_git enabled
3071set vcs_backend_hg disabled
3072set vcs_backend_bzr disabled
3073
3074# Preview images in full color with the external command "w3mimgpreview"?
3075# This requires the console web browser "w3m" and a supported terminal.
3076# It has been successfully tested with "xterm" and "urxvt" without tmux.
3077set preview_images true
3078
3079# Use a unicode "..." character to mark cut-off filenames?
3080set unicode_ellipsis false
3081
3082# Show dotfiles in the bookmark preview box?
3083set show_hidden_bookmarks true
3084
3085# Which colorscheme to use? These colorschemes are available by default:
3086# default, jungle, snow
3087set colorscheme default
3088
3089# Preview files on the rightmost column?
3090# And collapse (shrink) the last column if there is nothing to preview?
3091set preview_files true
3092set preview_directories true
3093set collapse_preview true
3094
3095# Save the console history on exit?
3096set save_console_history true
3097
3098# Draw the status bar on top of the browser window (default: bottom)
3099set status_bar_on_top false
3100
3101# Draw a progress bar in the status bar which displays the average state of all
3102# currently running tasks which support progress bars?
3103set draw_progress_bar_in_status_bar true
3104
3105# Draw borders around columns?
3106set draw_borders true
3107
3108# Display the directory name in tabs?
3109set dirname_in_tabs false
3110
3111# Enable the mouse support?
3112set mouse_enabled true
3113
3114# Display the file size in the main column or status bar?
3115set display_size_in_main_column true
3116set display_size_in_status_bar true
3117
3118# Display files tags in all columns or only in main column?
3119set display_tags_in_all_columns true
3120
3121# Set a title for the window?
3122set update_title false
3123
3124# Set the title to "ranger" in the tmux program?
3125set update_tmux_title false
3126
3127# Shorten the title if it gets long? The number defines how many
3128# directories are displayed at once, 0 turns off this feature.
3129set shorten_title 3
3130
3131# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
3132set tilde_in_titlebar false
3133
3134# How many directory-changes or console-commands should be kept in history?
3135set max_history_size 20
3136set max_console_history_size 50
3137
3138# Try to keep so much space between the top/bottom border when scrolling:
3139set scroll_offset 8
3140
3141# Flush the input after each key hit? (Noticable when ranger lags)
3142set flushinput true
3143
3144# Padding on the right when there's no preview?
3145# This allows you to click into the space to run the file.
3146set padding_right true
3147
3148# Save bookmarks (used with mX and `X) instantly?
3149# This helps to synchronize bookmarks between multiple ranger
3150# instances but leads to *slight* performance loss.
3151# When false, bookmarks are saved when ranger is exited.
3152set autosave_bookmarks true
3153
3154# You can display the "real" cumulative size of directories by using the
3155# command :get_cumulative_size or typing "dc". The size is expensive to
3156# calculate and will not be updated automatically. You can choose
3157# to update it automatically though by turning on this option:
3158set autoupdate_cumulative_size false
3159
3160# Turning this on makes sense for screen readers:
3161set show_cursor false
3162
3163# One of: size, basename, mtime, type
3164set sort natural
3165
3166# Additional sorting options
3167set sort_reverse false
3168set sort_case_insensitive true
3169set sort_directories_first true
3170
3171# Enable this if key combinations with the Alt Key don't work for you.
3172# (Especially on xterm)
3173set xterm_alt_key false
3174
3175# ===================================================================
3176# == Local Options
3177# ===================================================================
3178# You can set local options that only affect a single directory.
3179
3180# Examples:
3181# setlocal path=~/downloads sort mtime
3182
3183# ===================================================================
3184# == Command Aliases in the Console
3185# ===================================================================
3186
3187alias e edit
3188alias q quit
3189alias q! quitall
3190alias qall quitall
3191alias setl setlocal
3192
3193alias filter scout -prt
3194alias find scout -aet
3195alias mark scout -mr
3196alias unmark scout -Mr
3197alias search scout -rs
3198alias search_inc scout -rts
3199alias travel scout -aefiklst
3200
3201# ===================================================================
3202# == Define keys for the browser
3203# ===================================================================
3204
3205# Basic
3206map Q quit!
3207map q quit
3208copymap q ZZ ZQ
3209
3210map R reload_cwd
3211map <C-r> reset
3212map <C-l> redraw_window
3213map <C-c> abort
3214map <esc> change_mode normal
3215
3216map i display_file
3217map ? help
3218map W display_log
3219map w taskview_open
3220map S shell $SHELL
3221
3222map : console
3223map ; console
3224map ! console shell
3225map @ console -p6 shell %%s
3226map # console shell -p
3227map s console shell
3228map r chain draw_possible_programs; console open_with
3229map f console find
3230map cd console cd
3231
3232# Tagging / Marking
3233map t tag_toggle
3234map ut tag_remove
3235map "<any> tag_toggle tag=%any
3236map <Space> mark_files toggle=True
3237map v mark_files all=True toggle=True
3238map uv mark_files all=True val=False
3239map V toggle_visual_mode
3240map uV toggle_visual_mode reverse=True
3241
3242# For the nostalgics: Midnight Commander bindings
3243map <F1> help
3244map <F3> display_file
3245map <F4> edit
3246map <F5> copy
3247map <F6> cut
3248map <F7> console mkdir
3249map <F8> console delete
3250map <F10> exit
3251
3252# In case you work on a keyboard with dvorak layout
3253map <UP> move up=1
3254map <DOWN> move down=1
3255map <LEFT> move left=1
3256map <RIGHT> move right=1
3257map <HOME> move to=0
3258map <END> move to=-1
3259map <PAGEDOWN> move down=1 pages=True
3260map <PAGEUP> move up=1 pages=True
3261map <CR> move right=1
3262map <DELETE> console delete
3263map <INSERT> console touch
3264
3265# VIM-like
3266copymap <UP> k
3267copymap <DOWN> j
3268copymap <LEFT> h
3269copymap <RIGHT> l
3270copymap <HOME> gg
3271copymap <END> G
3272copymap <PAGEDOWN> <C-F>
3273copymap <PAGEUP> <C-B>
3274
3275map J move down=0.5 pages=True
3276map K move up=0.5 pages=True
3277copymap J <C-D>
3278copymap K <C-U>
3279
3280# Jumping around
3281map H history_go -1
3282map L history_go 1
3283map ] move_parent 1
3284map [ move_parent -1
3285map } traverse
3286
3287map gh cd ~
3288map ge cd /etc
3289map gu cd /usr
3290map gd cd /dev
3291map gl cd -r .
3292map gL cd -r %f
3293map go cd /opt
3294map gv cd /var
3295map gm cd /media
3296map gM cd /mnt
3297map gs cd /srv
3298map gr cd /
3299map gR eval fm.cd(ranger.RANGERDIR)
3300map g/ cd /
3301map g? cd /usr/share/doc/ranger
3302
3303# External Programs
3304map E edit
3305map du shell -p du --max-depth=1 -h --apparent-size
3306map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
3307map yp shell -d echo -n %d/%f | xsel -i
3308map yd shell -d echo -n %d | xsel -i
3309map yn shell -d echo -n %f | xsel -i
3310
3311# Filesystem Operations
3312map = chmod
3313
3314map cw console rename
3315map A eval fm.open_console('rename ' + fm.thisfile.basename)
3316map I eval fm.open_console('rename ' + fm.thisfile.basename, position=7)
3317
3318map pp paste
3319map po paste overwrite=True
3320map pl paste_symlink relative=False
3321map pL paste_symlink relative=True
3322map phl paste_hardlink
3323map pht paste_hardlinked_subtree
3324
3325map dd cut
3326map ud uncut
3327map da cut mode=add
3328map dr cut mode=remove
3329
3330map yy copy
3331map uy uncut
3332map ya copy mode=add
3333map yr copy mode=remove
3334
3335# Temporary workarounds
3336map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
3337map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
3338map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
3339map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
3340map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
3341map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
3342map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
3343map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
3344
3345# Searching
3346map / console search
3347map n search_next
3348map N search_next forward=False
3349map ct search_next order=tag
3350map cs search_next order=size
3351map ci search_next order=mimetype
3352map cc search_next order=ctime
3353map cm search_next order=mtime
3354map ca search_next order=atime
3355
3356# Tabs
3357map <C-n> tab_new ~
3358map <C-w> tab_close
3359map <TAB> tab_move 1
3360map <S-TAB> tab_move -1
3361map <A-Right> tab_move 1
3362map <A-Left> tab_move -1
3363map gt tab_move 1
3364map gT tab_move -1
3365map gn tab_new ~
3366map gc tab_close
3367map uq tab_restore
3368map <a-1> tab_open 1
3369map <a-2> tab_open 2
3370map <a-3> tab_open 3
3371map <a-4> tab_open 4
3372map <a-5> tab_open 5
3373map <a-6> tab_open 6
3374map <a-7> tab_open 7
3375map <a-8> tab_open 8
3376map <a-9> tab_open 9
3377
3378# Sorting
3379map or toggle_option sort_reverse
3380map os chain set sort=size; set sort_reverse=False
3381map ob chain set sort=basename; set sort_reverse=False
3382map on chain set sort=natural; set sort_reverse=False
3383map om chain set sort=mtime; set sort_reverse=False
3384map oc chain set sort=ctime; set sort_reverse=False
3385map oa chain set sort=atime; set sort_reverse=False
3386map ot chain set sort=type; set sort_reverse=False
3387
3388map oS chain set sort=size; set sort_reverse=True
3389map oB chain set sort=basename; set sort_reverse=True
3390map oN chain set sort=natural; set sort_reverse=True
3391map oM chain set sort=mtime; set sort_reverse=True
3392map oC chain set sort=ctime; set sort_reverse=True
3393map oA chain set sort=atime; set sort_reverse=True
3394map oT chain set sort=type; set sort_reverse=True
3395
3396map dc get_cumulative_size
3397
3398# Settings
3399map zc toggle_option collapse_preview
3400map zd toggle_option sort_directories_first
3401map zh toggle_option show_hidden
3402map <C-h> toggle_option show_hidden
3403map zi toggle_option flushinput
3404map zm toggle_option mouse_enabled
3405map zp toggle_option preview_files
3406map zP toggle_option preview_directories
3407map zs toggle_option sort_case_insensitive
3408map zu toggle_option autoupdate_cumulative_size
3409map zv toggle_option use_preview_script
3410map zf console filter
3411
3412# Bookmarks
3413map `<any> enter_bookmark %any
3414map '<any> enter_bookmark %any
3415map m<any> set_bookmark %any
3416map um<any> unset_bookmark %any
3417
3418map m<bg> draw_bookmarks
3419copymap m<bg> um<bg> `<bg> '<bg>
3420
3421# Generate all the chmod bindings with some python help:
3422eval for arg in "rwxXst": cmd("map +u{0} shell -d chmod u+{0} %s".format(arg))
3423eval for arg in "rwxXst": cmd("map +g{0} shell -d chmod g+{0} %s".format(arg))
3424eval for arg in "rwxXst": cmd("map +o{0} shell -d chmod o+{0} %s".format(arg))
3425eval for arg in "rwxXst": cmd("map +a{0} shell -d chmod a+{0} %s".format(arg))
3426eval for arg in "rwxXst": cmd("map +{0} shell -d chmod u+{0} %s".format(arg))
3427
3428eval for arg in "rwxXst": cmd("map -u{0} shell -d chmod u-{0} %s".format(arg))
3429eval for arg in "rwxXst": cmd("map -g{0} shell -d chmod g-{0} %s".format(arg))
3430eval for arg in "rwxXst": cmd("map -o{0} shell -d chmod o-{0} %s".format(arg))
3431eval for arg in "rwxXst": cmd("map -a{0} shell -d chmod a-{0} %s".format(arg))
3432eval for arg in "rwxXst": cmd("map -{0} shell -d chmod u-{0} %s".format(arg))
3433
3434# ===================================================================
3435# == Define keys for the console
3436# ===================================================================
3437# Note: Unmapped keys are passed directly to the console.
3438
3439# Basic
3440cmap <tab> eval fm.ui.console.tab()
3441cmap <s-tab> eval fm.ui.console.tab(-1)
3442cmap <ESC> eval fm.ui.console.close()
3443cmap <CR> eval fm.ui.console.execute()
3444cmap <C-l> redraw_window
3445
3446copycmap <ESC> <C-c>
3447copycmap <CR> <C-j>
3448
3449# Move around
3450cmap <up> eval fm.ui.console.history_move(-1)
3451cmap <down> eval fm.ui.console.history_move(1)
3452cmap <left> eval fm.ui.console.move(left=1)
3453cmap <right> eval fm.ui.console.move(right=1)
3454cmap <home> eval fm.ui.console.move(right=0, absolute=True)
3455cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
3456
3457# Line Editing
3458cmap <backspace> eval fm.ui.console.delete(-1)
3459cmap <delete> eval fm.ui.console.delete(0)
3460cmap <C-w> eval fm.ui.console.delete_word()
3461cmap <C-k> eval fm.ui.console.delete_rest(1)
3462cmap <C-u> eval fm.ui.console.delete_rest(-1)
3463cmap <C-y> eval fm.ui.console.paste()
3464
3465# And of course the emacs way
3466copycmap <up> <C-p>
3467copycmap <down> <C-n>
3468copycmap <left> <C-b>
3469copycmap <right> <C-f>
3470copycmap <home> <C-a>
3471copycmap <end> <C-e>
3472copycmap <delete> <C-d>
3473copycmap <backspace> <C-h>
3474
3475# Note: There are multiple ways to express backspaces. <backspace> (code 263)
3476# and <backspace2> (code 127). To be sure, use both.
3477copycmap <backspace> <backspace2>
3478
3479# This special expression allows typing in numerals:
3480cmap <allow_quantifiers> false
3481
3482# ===================================================================
3483# == Pager Keybindings
3484# ===================================================================
3485
3486# Movement
3487pmap <down> pager_move down=1
3488pmap <up> pager_move up=1
3489pmap <left> pager_move left=4
3490pmap <right> pager_move right=4
3491pmap <home> pager_move to=0
3492pmap <end> pager_move to=-1
3493pmap <pagedown> pager_move down=1.0 pages=True
3494pmap <pageup> pager_move up=1.0 pages=True
3495pmap <C-d> pager_move down=0.5 pages=True
3496pmap <C-u> pager_move up=0.5 pages=True
3497
3498copypmap <UP> k <C-p>
3499copypmap <DOWN> j <C-n> <CR>
3500copypmap <LEFT> h
3501copypmap <RIGHT> l
3502copypmap <HOME> g
3503copypmap <END> G
3504copypmap <C-d> d
3505copypmap <C-u> u
3506copypmap <PAGEDOWN> n f <C-F> <Space>
3507copypmap <PAGEUP> p b <C-B>
3508
3509# Basic
3510pmap <ESC> pager_close
3511copypmap <ESC> q Q i <F3>
3512pmap E edit_file
3513
3514# ===================================================================
3515# == Taskview Keybindings
3516# ===================================================================
3517
3518# Movement
3519tmap <up> taskview_move up=1
3520tmap <down> taskview_move down=1
3521tmap <home> taskview_move to=0
3522tmap <end> taskview_move to=-1
3523tmap <pagedown> taskview_move down=1.0 pages=True
3524tmap <pageup> taskview_move up=1.0 pages=True
3525tmap <C-d> taskview_move down=0.5 pages=True
3526tmap <C-u> taskview_move up=0.5 pages=True
3527
3528copytmap <UP> k <C-p>
3529copytmap <DOWN> j <C-n> <CR>
3530copytmap <HOME> g
3531copytmap <END> G
3532copytmap <C-u> u
3533copytmap <PAGEDOWN> n f <C-F> <Space>
3534copytmap <PAGEUP> p b <C-B>
3535
3536# Changing priority and deleting tasks
3537tmap J eval -q fm.ui.taskview.task_move(-1)
3538tmap K eval -q fm.ui.taskview.task_move(0)
3539tmap dd eval -q fm.ui.taskview.task_remove()
3540tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
3541tmap <pageup> eval -q fm.ui.taskview.task_move(0)
3542tmap <delete> eval -q fm.ui.taskview.task_remove()
3543
3544# Basic
3545tmap <ESC> taskview_close
3546copytmap <ESC> q Q w <C-c>
3547#+end_src
3548
3549*** scope.sh
3550:PROPERTIES:
3551:header-args+: :tangle ~/.config/ranger/scope.sh :shebang "#!/usr/bin/env sh"
3552:END:
3553
3554#+begin_src sh :tangle no
3555# ranger supports enhanced previews. If the option "use_preview_script"
3556# is set to True and this file exists, this script will be called and its
3557# output is displayed in ranger. ANSI color codes are supported.
3558
3559# NOTES: This script is considered a configuration file. If you upgrade
3560# ranger, it will be left untouched. (You must update it yourself.)
3561# Also, ranger disables STDIN here, so interactive scripts won't work properly
3562
3563# Meanings of exit codes:
3564# code | meaning | action of ranger
3565# -----+------------+-------------------------------------------
3566# 0 | success | success. display stdout as preview
3567# 1 | no preview | failure. display no preview at all
3568# 2 | plain text | display the plain content of the file
3569# 3 | fix width | success. Don't reload when width changes
3570# 4 | fix height | success. Don't reload when height changes
3571# 5 | fix both | success. Don't ever reload
3572
3573# Meaningful aliases for arguments:
3574path="$1" # Full path of the selected file
3575width="$2" # Width of the preview pane (number of fitting characters)
3576height="$3" # Height of the preview pane (number of fitting characters)
3577
3578maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln
3579
3580# Find out something about the file:
3581mimetype=$(file --mime-type -Lb "$path")
3582extension=${path##*.}
3583
3584# Functions:
3585# runs a command and saves its output into $output. Useful if you need
3586# the return value AND want to use the output in a pipe
3587try() { output=$(eval '"$@"'); }
3588
3589# writes the output of the previouosly used "try" command
3590dump() { echo "$output"; }
3591
3592# a common post-processing function used after most commands
3593trim() { head -n "$maxln"; }
3594
3595# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success
3596highlight() { command highlight "$@"; test $? = 0 -o $? = 141; }
3597
3598case "$extension" in
3599 # Archive extensions:
3600 7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
3601 rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
3602 try als "$path" && { dump | trim; exit 0; }
3603 try acat "$path" && { dump | trim; exit 3; }
3604 try bsdtar -lf "$path" && { dump | trim; exit 0; }
3605 exit 1;;
3606 rar)
3607 try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;;
3608 # PDF documents:
3609 pdf)
3610 try pdftotext -l 10 -nopgbrk -q "$path" - && \
3611 { dump | trim | fmt -s -w $width; exit 0; } || exit 1;;
3612 # BitTorrent Files
3613 torrent)
3614 try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;;
3615 # HTML Pages:
3616 htm|html|xhtml)
3617 try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
3618 try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
3619 try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
3620 ;; # fall back to highlight/cat if the text browsers fail
3621esac
3622
3623case "$mimetype" in
3624 # Syntax highlight for text files:
3625 text/* | */xml)
3626 try highlight --out-format=ansi "$path" && { dump | trim; exit 5; } || exit 2;;
3627 # Ascii-previews of images:
3628 image/*)
3629 img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
3630 # Display information about media files:
3631 video/* | audio/*)
3632 exiftool "$path" && exit 5
3633 # Use sed to remove spaces so the output fits into the narrow window
3634 try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;;
3635esac
3636
3637exit 1
3638#+end_src
3639
3640** redshift
3641:PROPERTIES:
3642:header-args+: :tangle ~/.config/redshift.conf :comments none
3643:END:
3644
3645#+begin_src conf
3646; Global settings for redshift
3647[redshift]
3648; Set the day and night screen temperatures (Neutral is 6500K)
3649;temp-day=5700
3650;temp-night=3500
3651
3652;temp-day=6500
3653temp-day=6200
3654;temp-night=4800
3655;temp-night=5000
3656;temp-night=4500
3657temp-night=4000
3658
3659; Enable/Disable a smooth transition between day and night
3660; 0 will cause a direct change from day to night screen temperature.
3661; 1 will gradually increase or decrease the screen temperature.
3662transition=1
3663
3664; Set the screen brightness. Default is 1.0.
3665;brightness=0.9
3666; It is also possible to use different settings for day and night
3667; since version 1.8.
3668;brightness-day=0.7
3669;brightness-night=0.4
3670; Set the screen gamma (for all colors, or each color channel
3671; individually)
3672;gamma=0.8
3673;gamma=1.0
3674;gamma=0.8:0.7:0.8
3675; This can also be set individually for day and night since
3676; version 1.10.
3677;gamma-day=0.8:0.7:0.8
3678;gamma-night=0.6
3679
3680; Set the location-provider: 'geoclue2' or 'manual'
3681; type 'redshift -l list' to see possible values.
3682; The location provider settings are in a different section.
3683;location-provider=manual
3684location-provider=geoclue2
3685
3686; Set the adjustment-method: 'randr', 'vidmode'
3687; type 'redshift -m list' to see all possible values.
3688; 'randr' is the preferred method, 'vidmode' is an older API.
3689; but works in some cases when 'randr' does not.
3690; The adjustment method settings are in a different section.
3691adjustment-method=randr
3692
3693; Configuration of the location-provider:
3694; type 'redshift -l PROVIDER:help' to see the settings.
3695; ex: 'redshift -l manual:help'
3696; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
3697; are negative numbers.
3698;[manual]
3699;lat=48.1
3700;lon=11.6
3701
3702; Configuration of the adjustment-method
3703; type 'redshift -m METHOD:help' to see the settings.
3704; ex: 'redshift -m randr:help'
3705; In this example, randr is configured to adjust screen 1.
3706; Note that the numbering starts from 0, so this is actually the
3707; second screen. If this option is not specified, Redshift will try
3708; to adjust _all_ screens.
3709;[randr]
3710;screen=1
3711#+end_src
3712
3713** rofi
3714:PROPERTIES:
3715:header-args+: :tangle ~/.config/rofi/config
3716:END:
3717
3718#+begin_src conf
3719! rofi.font: Ubuntu Mono 13
3720! rofi.font: Inconsolata 16
3721! rofi.font: Iosevka 13
3722! rofi.font: Source Code Pro 11
3723rofi.font: Source Code Pro 10.5
3724rofi.modi: run,window
3725! rofi.width: 640
3726rofi.width: 600
3727!rofi.location: 2
3728!rofi.yoffset: 200
3729rofi.monitor: -1
3730!rofi.lines: 10
3731
3732!rofi.theme: /usr/share/rofi/themes//Arc.rasi
3733!rofi.theme: /usr/share/rofi/themes//Paper.rasi
3734!rofi.theme: /usr/share/rofi/themes//sidebar.rasi
3735
3736rofi.theme: /usr/share/rofi/themes//gruvbox-light.rasi
3737#+end_src
3738
3739** rofi-pass
3740:PROPERTIES:
3741:header-args+: :tangle ~/.config/rofi-pass/config
3742:END:
3743
3744#+begin_src conf
3745# permanently set alternative root dir
3746# root=/path/to/root
3747
3748# rofi command. Make sure to have "$@" as last argument
3749_rofi () {
3750 #rofi -no-auto-select -kb-accept-entry "!Return" -i -no-levenshtein-sort "$@"
3751 rofi -i -no-auto-select -kb-accept-entry "!Return" "$@"
3752}
3753
3754# xdotool needs the keyboard layout to be set using setxkbmap
3755# You can do this in your autostart scripts (e.g. xinitrc)
3756
3757# If for some reason, you cannot do this, you can set the command here.
3758# and set fix_layout to true
3759fix_layout=false
3760
3761layout_cmd () {
3762 setxkbmap us
3763}
3764
3765# fields to be used
3766URL_field='url'
3767USERNAME_field='user'
3768AUTOTYPE_field='autotype'
3769
3770# delay to be used for :delay keyword
3771delay=2
3772
3773## Programs to be used
3774# Editor
3775EDITOR='gvim -f'
3776
3777# Browser
3778BROWSER='chromium'
3779
3780## Misc settings
3781
3782default_do='menu' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
3783auto_enter='false'
3784notify='false'
3785default_autotype='user :tab pass'
3786
3787# color of the help messages
3788# leave empty for autodetection
3789help_color="#4872FF"
3790
3791# Clipboard settings
3792# Possible options: primary, clipboard, both
3793clip=primary
3794
3795# Options for generating new password entries
3796# default_user is also used for password files that have no user field.
3797default_user=aminb
3798default_user2=aminban
3799password_length=30
3800
3801# Custom Keybindings
3802#autotype="Alt+1"
3803autotype="Alt+m"
3804type_user="Alt+2"
3805type_pass="Alt+3"
3806open_url="Alt+4"
3807copy_name="Alt+u"
3808copy_url="Alt+l"
3809copy_pass="Alt+p"
3810show="Alt+o"
3811copy_entry="Alt+2"
3812type_entry="Alt+1"
3813copy_menu="Alt+c"
3814action_menu="Alt+a"
3815type_menu="Alt+t"
3816help="Alt+h"
3817switch="Alt+x"
3818insert_pass="Alt+n"
3819#+end_src
3820
3821** sway
3822
3823*** main
3824:PROPERTIES:
3825:header-args+: :tangle ~/.config/sway/config
3826:END:
3827
3828#+begin_src conf
3829### Variables
3830# super
3831set $mod Mod4
3832# alt
3833set $mod2 Mod1
3834set $left h
3835set $down j
3836set $up k
3837set $right l
3838set $term urxvt
3839set $menu rofi -show run -display-run '> ' -display-window ' 🗔 '
3840
3841### Output configuration
3842#
3843# Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)
3844output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
3845#
3846# Example configuration:
3847#
3848# output HDMI-A-1 resolution 1920x1080 position 1920,0
3849#
3850# You can get the names of your outputs by running: swaymsg -t get_outputs
3851
3852### Idle configuration
3853
3854exec swayidle \
3855 timeout 120 '[ -f ~/.nosleep ] || swaymsg "output * dpms off"' \
3856 resume '[ -f ~/.nosleep ] || swaymsg "output * dpms on"' \
3857 before-sleep swaylock
3858
3859
3860### Key bindings
3861#
3862# Basics:
3863#
3864 # start a terminal
3865 bindsym $mod+Return exec $term
3866
3867 # kill focused window
3868 bindsym $mod+Shift+q kill
3869
3870 # start your launcher
3871 bindsym $mod+d exec $menu
3872
3873 # password manager
3874 bindsym $mod2+space exec rofi-pass
3875
3876 # Drag floating windows by holding down $mod and left mouse button.
3877 # Resize them with right mouse button + $mod.
3878 # Despite the name, also works for non-floating windows.
3879 # Change normal to inverse to use left mouse button for resizing and right
3880 # mouse button for dragging.
3881 floating_modifier $mod normal
3882
3883 # reload the configuration file
3884 bindsym $mod+Shift+c reload
3885
3886 # exit sway (logs you out of your wayland session)
3887 bindsym $mod+Shift+e exit
3888
3889 bindsym $mod+apostrophe exec rofi-light # rofi-based brightness chooser
3890 bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness
3891 bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness
3892
3893 bindsym XF86AudioRaiseVolume exec pamixer --allow-boost --increase 5
3894 bindsym XF86AudioLowerVolume exec pamixer --allow-boost --decrease 5
3895 bindsym XF86AudioMute exec pamixer --toggle-mute
3896 bindsym XF86AudioMicMute exec pactl set-source-mute 1 toggle
3897
3898 # original sway workspace switch and window move
3899 bindsym $mod+bracketleft workspace prev
3900 bindsym $mod+bracketright workspace next
3901 bindsym $mod+braceleft move container to workspace prev
3902 bindsym $mod+braceright move container to workspace next
3903
3904 # bspwm-esque workspace switch and window move
3905 bindsym $mod2+bracketleft exec sway-ws-util switch prev
3906 bindsym $mod2+bracketright exec sway-ws-util switch next
3907 bindsym $mod2+braceleft exec sway-ws-util move prev follow
3908 bindsym $mod2+braceright exec sway-ws-util move next follow
3909#
3910# Moving around:
3911#
3912 # Move your focus around
3913 bindsym $mod+$left focus left
3914 bindsym $mod+$down focus down
3915 bindsym $mod+$up focus up
3916 bindsym $mod+$right focus right
3917 # or use $mod+[up|down|left|right]
3918 bindsym $mod+Left focus left
3919 bindsym $mod+Down focus down
3920 bindsym $mod+Up focus up
3921 bindsym $mod+Right focus right
3922
3923 # _move_ the focused window with the same, but add Shift
3924 bindsym $mod+Shift+$left move left
3925 bindsym $mod+Shift+$down move down
3926 bindsym $mod+Shift+$up move up
3927 bindsym $mod+Shift+$right move right
3928 # ditto, with arrow keys
3929 bindsym $mod+Shift+Left move left
3930 bindsym $mod+Shift+Down move down
3931 bindsym $mod+Shift+Up move up
3932 bindsym $mod+Shift+Right move right
3933#
3934# Workspaces:
3935#
3936 # switch to workspace
3937 bindsym $mod+1 workspace 1
3938 bindsym $mod+2 workspace 2
3939 bindsym $mod+3 workspace 3
3940 bindsym $mod+4 workspace 4
3941 bindsym $mod+5 workspace 5
3942 bindsym $mod+6 workspace 6
3943 bindsym $mod+7 workspace 7
3944 bindsym $mod+8 workspace 8
3945 bindsym $mod+9 workspace 9
3946 bindsym $mod+0 workspace 10
3947 # move focused container to workspace
3948 bindsym $mod+Shift+1 move container to workspace 1
3949 bindsym $mod+Shift+2 move container to workspace 2
3950 bindsym $mod+Shift+3 move container to workspace 3
3951 bindsym $mod+Shift+4 move container to workspace 4
3952 bindsym $mod+Shift+5 move container to workspace 5
3953 bindsym $mod+Shift+6 move container to workspace 6
3954 bindsym $mod+Shift+7 move container to workspace 7
3955 bindsym $mod+Shift+8 move container to workspace 8
3956 bindsym $mod+Shift+9 move container to workspace 9
3957 bindsym $mod+Shift+0 move container to workspace 10
3958 # Note: workspaces can have any name you want, not just numbers.
3959 # We just use 1-10 as the default.
3960#
3961# Layout stuff:
3962#
3963 # You can "split" the current object of your focus with
3964 # $mod+b or $mod+v, for horizontal and vertical splits
3965 # respectively.
3966 bindsym $mod+b splith
3967 bindsym $mod+v splitv
3968
3969 # Switch the current container between different layout styles
3970 bindsym $mod+s layout stacking
3971 bindsym $mod+w layout tabbed
3972 bindsym $mod+e layout toggle split
3973
3974 # Make the current focus fullscreen
3975 bindsym $mod+f fullscreen
3976
3977 # Toggle the current focus between tiling and floating mode
3978 bindsym $mod+Shift+space floating toggle
3979
3980 # Swap focus between the tiling area and the floating area
3981 bindsym $mod+space focus mode_toggle
3982
3983 # move focus to the parent container
3984 bindsym $mod+a focus parent
3985#
3986# Scratchpad:
3987#
3988 # Sway has a "scratchpad", which is a bag of holding for windows.
3989 # You can send windows there and get them back later.
3990
3991 # Move the currently focused window to the scratchpad
3992 bindsym $mod+Shift+minus move scratchpad
3993
3994 # Show the next scratchpad window or hide the focused scratchpad window.
3995 # If there are multiple scratchpad windows, this command cycles through them.
3996 bindsym $mod+minus scratchpad show
3997#
3998# Resizing containers:
3999#
4000mode "resize" {
4001 # left will shrink the containers width
4002 # right will grow the containers width
4003 # up will shrink the containers height
4004 # down will grow the containers height
4005 bindsym $left resize shrink width 10px
4006 bindsym $down resize grow height 10px
4007 bindsym $up resize shrink height 10px
4008 bindsym $right resize grow width 10px
4009
4010 # ditto, with arrow keys
4011 bindsym Left resize shrink width 10px
4012 bindsym Down resize grow height 10px
4013 bindsym Up resize shrink height 10px
4014 bindsym Right resize grow width 10px
4015
4016 # return to default mode
4017 bindsym Return mode "default"
4018 bindsym Escape mode "default"
4019}
4020bindsym $mod+Shift+r mode "resize"
4021
4022#
4023# Power button
4024#
4025
4026set $mode_system System (l)ock, (e)xit sway, (s)uspend, (h)ibernate, (r)eboot, (S)hutdown
4027mode "$mode_system" {
4028 bindsym l exec swaylock, mode "default"
4029 bindsym e exec swaymsg exit, mode "default"
4030 bindsym s exec systemctl suspend, mode "default"
4031 bindsym h exec systemctl hibernate, mode "default"
4032 bindsym r exec systemctl reboot, mode "default"
4033 bindsym Shift+s exec systemctl poweroff -i, mode "default"
4034
4035 # back to normal: Enter, Escape, or q
4036 bindsym Return mode "default"
4037 bindsym Escape mode "default"
4038 bindsym q mode "default"
4039}
4040bindsym XF86PowerOff mode "$mode_system"
4041
4042#
4043# Presentation mode
4044#
4045
4046bindsym $mod+$mod2+p exec ([ ! -e ~/.nosleep ] && touch ~/.nosleep || rm ~/.nosleep) && killall -USR1 i3status
4047
4048#
4049# Notifications
4050#
4051
4052bindsym $mod+Shift+n mode notifications
4053mode notifications {
4054 bindsym Return exec makoctl invoke; exec makoctl dismiss; mode default
4055 bindsym d exec makoctl dismiss; mode default
4056 bindsym Shift+d exec makoctl dismiss -a; mode default
4057
4058 bindsym Escape mode default
4059 bindsym q mode default
4060}
4061
4062#
4063# Screenshotting
4064#
4065
4066bindsym $mod+Shift+s mode screenshot
4067mode screenshot {
4068 bindsym a exec grim $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default
4069 bindsym r exec slurp | grim -g - $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default
4070
4071 bindsym Escape mode default
4072 bindsym q mode default
4073}
4074
4075#
4076# Status Bar:
4077#
4078# Read `man 5 sway-bar` for more information about this section.
4079bar {
4080 position bottom
4081 colors {
4082 statusline #ffffff
4083 background #323232
4084 inactive_workspace #32323200 #32323200 #5c5c5c
4085 }
4086 status_command i3status | my-i3status.py
4087}
4088
4089# font pango: benis uushi 9
4090# font pango: Ubuntu Mono 11
4091# font pango: Inconsolata 11
4092font pango: DejaVu Sans Mono 9
4093# font pango: Liberation Mono 9
4094
4095exec xrdb .Xresources
4096exec pgrep -x "systemd-inhibit" || \
4097 systemd-inhibit --what=handle-power-key --who=aminb \
4098 --why="Handle power button in sway" sleep infinity
4099exec mako 2>&1 >/tmp/mako.log
4100exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
4101
4102include /etc/sway/config.d/*
4103include ~/.config/sway/`hostname`
4104
4105exec systemd-notify --ready || true
4106
4107#+end_src
4108
4109*** langa
4110:PROPERTIES:
4111:header-args+: :tangle ~/.config/sway/langa
4112:END:
4113
4114#+begin_src conf
4115input "2:7:SynPS/2_Synaptics_TouchPad" {
4116 events disabled
4117 dwt enabled
4118 tap enabled
4119 natural_scroll enabled
4120 click_method clickfinger
4121}
4122
4123input "1:1:AT_Translated_Set_2_keyboard" {
4124 repeat_delay 200
4125 repeat_rate 45
4126 xkb_layout us_ab,ir
4127 xkb_options ctrl:nocaps,altwin:swap_alt_win,grp:shifts_toggle
4128}
4129#+end_src
4130
4131*** shemshak
4132:PROPERTIES:
4133:header-args+: :tangle ~/.config/sway/shemshak
4134:END:
4135
4136#+begin_src conf
4137input "1739:31251:DLL07BE:01_06CB:7A13_Touchpad" {
4138 dwt enabled
4139 tap enabled
4140 natural_scroll enabled
4141 middle_emulation enabled
4142 click_method clickfinger
4143}
4144
4145input "1:1:AT_Translated_Set_2_keyboard" {
4146 repeat_delay 200
4147 repeat_rate 45
4148 xkb_layout us,ir
4149 xkb_options ctrl:nocaps,altwin:swap_alt_win,ctrl:rctrl_ralt,grp:shifts_toggle
4150}
4151#+end_src
4152** swaylock
4153:PROPERTIES:
4154:header-args+: :tangle ~/.config/swaylock/config
4155:END:
4156
4157#+begin_src conf
4158image=/home/amin/usr/pics/wp/wp2445784-blurred-wallpapers.jpg
4159scaling=fill
4160#+end_src
4161
4162** TLP
4163
4164*** langa
4165
4166#+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "langa")) "/sudo::/etc/default/tlp")
4167# ------------------------------------------------------------------------------
4168# tlp - Parameters for power saving
4169# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
4170
4171# Hint: some features are disabled by default, remove the leading # to enable
4172# them.
4173
4174# Set to 0 to disable, 1 to enable TLP.
4175TLP_ENABLE=1
4176
4177# Operation mode when no power supply can be detected: AC, BAT.
4178# Concerns some desktop and embedded hardware only.
4179TLP_DEFAULT_MODE=AC
4180
4181# Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
4182# Hint: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC.
4183TLP_PERSISTENT_DEFAULT=0
4184
4185# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
4186# Non-zero value enables, zero disables laptop mode.
4187DISK_IDLE_SECS_ON_AC=0
4188DISK_IDLE_SECS_ON_BAT=2
4189
4190# Dirty page values (timeouts in secs).
4191MAX_LOST_WORK_SECS_ON_AC=15
4192MAX_LOST_WORK_SECS_ON_BAT=60
4193
4194# Hint: CPU parameters below are disabled by default, remove the leading #
4195# to enable them, otherwise kernel default values are used.
4196
4197# Select a CPU frequency scaling governor.
4198# Intel Core i processor with intel_pstate driver:
4199# powersave(*), performance.
4200# Older hardware with acpi-cpufreq driver:
4201# ondemand(*), powersave, performance, conservative, schedutil.
4202# (*) is recommended.
4203# Hint: use tlp-stat -p to show the active driver and available governors.
4204# Important:
4205# powersave for intel_pstate and ondemand for acpi-cpufreq are power
4206# efficient for *almost all* workloads and therefore kernel and most
4207# distributions have chosen them as defaults. If you still want to change,
4208# you should know what you're doing! You *must* disable your distribution's
4209# governor settings or conflicts will occur.
4210#CPU_SCALING_GOVERNOR_ON_AC=powersave
4211#CPU_SCALING_GOVERNOR_ON_BAT=powersave
4212
4213# Set the min/max frequency available for the scaling governor.
4214# Possible values strongly depend on your CPU. For available frequencies see
4215# the output of tlp-stat -p.
4216#CPU_SCALING_MIN_FREQ_ON_AC=0
4217#CPU_SCALING_MAX_FREQ_ON_AC=0
4218#CPU_SCALING_MIN_FREQ_ON_BAT=0
4219#CPU_SCALING_MAX_FREQ_ON_BAT=0
4220
4221# Set energy performance hints (HWP) for Intel P-state governor:
4222# performance, balance_performance, default, balance_power, power
4223# Values are given in order of increasing power saving.
4224# Note: Intel Skylake or newer CPU and Kernel >= 4.10 required.
4225CPU_HWP_ON_AC=balance_performance
4226CPU_HWP_ON_BAT=balance_power
4227
4228# Set Intel P-state performance: 0..100 (%).
4229# Limit the max/min P-state to control the power dissipation of the CPU.
4230# Values are stated as a percentage of the available performance.
4231# Requires an Intel Core i processor with intel_pstate driver.
4232#CPU_MIN_PERF_ON_AC=0
4233#CPU_MAX_PERF_ON_AC=100
4234#CPU_MIN_PERF_ON_BAT=0
4235#CPU_MAX_PERF_ON_BAT=30
4236
4237# Set the CPU "turbo boost" feature: 0=disable, 1=allow
4238# Requires an Intel Core i processor.
4239# Important:
4240# - This may conflict with your distribution's governor settings
4241# - A value of 1 does *not* activate boosting, it just allows it
4242#CPU_BOOST_ON_AC=1
4243#CPU_BOOST_ON_BAT=0
4244
4245# Minimize number of used CPU cores/hyper-threads under light load conditions:
4246# 0=disable, 1=enable.
4247SCHED_POWERSAVE_ON_AC=0
4248SCHED_POWERSAVE_ON_BAT=1
4249
4250# Kernel NMI Watchdog:
4251# 0=disable (default, saves power), 1=enable (for kernel debugging only).
4252NMI_WATCHDOG=0
4253
4254# Change CPU voltages aka "undervolting" - Kernel with PHC patch required.
4255# Frequency voltage pairs are written to:
4256# /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
4257# CAUTION: only use this, if you thoroughly understand what you are doing!
4258#PHC_CONTROLS="F:V F:V F:V F:V"
4259
4260# Set CPU performance versus energy savings policy:
4261# performance, balance-performance, default, balance-power, power.
4262# Values are given in order of increasing power saving.
4263# Requires kernel module msr and x86_energy_perf_policy from linux-tools.
4264ENERGY_PERF_POLICY_ON_AC=performance
4265ENERGY_PERF_POLICY_ON_BAT=balance-power
4266
4267# Disk devices; separate multiple devices with spaces (default: sda).
4268# Devices can be specified by disk ID also (lookup with: tlp diskid).
4269DISK_DEVICES="sda sdb"
4270
4271# Disk advanced power management level: 1..254, 255 (max saving, min, off).
4272# Levels 1..127 may spin down the disk; 255 allowable on most drives.
4273# Separate values for multiple disks with spaces. Use the special value 'keep'
4274# to keep the hardware default for the particular disk.
4275DISK_APM_LEVEL_ON_AC="254 254"
4276DISK_APM_LEVEL_ON_BAT="128 128"
4277
4278# Hard disk spin down timeout:
4279# 0: spin down disabled
4280# 1..240: timeouts from 5s to 20min (in units of 5s)
4281# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
4282# See 'man hdparm' for details.
4283# Separate values for multiple disks with spaces. Use the special value 'keep'
4284# to keep the hardware default for the particular disk.
4285#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
4286#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
4287
4288# Select IO scheduler for the disk devices: cfq, deadline, noop (Default: cfq).
4289# Separate values for multiple disks with spaces. Use the special value 'keep'
4290# to keep the kernel default scheduler for the particular disk.
4291#DISK_IOSCHED="cfq cfq"
4292
4293# AHCI link power management (ALPM) for disk devices:
4294# min_power, med_power_with_dipm(*), medium_power, max_performance.
4295# (*) Kernel >= 4.15 required, then recommended.
4296# Multiple values separated with spaces are tried sequentially until success.
4297SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
4298SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
4299
4300# Exclude host devices from AHCI link power management.
4301# Separate multiple hosts with spaces.
4302#SATA_LINKPWR_BLACKLIST="host1"
4303
4304# Runtime Power Management for AHCI host and disks devices:
4305# on=disable, auto=enable.
4306# EXPERIMENTAL ** WARNING: auto will most likely cause system lockups/data loss.
4307#AHCI_RUNTIME_PM_ON_AC=on
4308#AHCI_RUNTIME_PM_ON_BAT=on
4309
4310# Seconds of inactivity before disk is suspended.
4311AHCI_RUNTIME_PM_TIMEOUT=15
4312
4313# PCI Express Active State Power Management (PCIe ASPM):
4314# default, performance, powersave.
4315PCIE_ASPM_ON_AC=performance
4316PCIE_ASPM_ON_BAT=powersave
4317
4318# Radeon graphics clock speed (profile method): low, mid, high, auto, default;
4319# auto = mid on BAT, high on AC; default = use hardware defaults.
4320RADEON_POWER_PROFILE_ON_AC=high
4321RADEON_POWER_PROFILE_ON_BAT=low
4322
4323# Radeon dynamic power management method (DPM): battery, performance.
4324RADEON_DPM_STATE_ON_AC=performance
4325RADEON_DPM_STATE_ON_BAT=battery
4326
4327# Radeon DPM performance level: auto, low, high; auto is recommended.
4328RADEON_DPM_PERF_LEVEL_ON_AC=auto
4329RADEON_DPM_PERF_LEVEL_ON_BAT=auto
4330
4331# WiFi power saving mode: on=enable, off=disable; not supported by all adapters.
4332WIFI_PWR_ON_AC=off
4333WIFI_PWR_ON_BAT=on
4334
4335# Disable wake on LAN: Y/N.
4336WOL_DISABLE=Y
4337
4338# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
4339# A value of 0 disables, >=1 enables power saving (recommended: 1).
4340SOUND_POWER_SAVE_ON_AC=0
4341SOUND_POWER_SAVE_ON_BAT=0
4342
4343# Disable controller too (HDA only): Y/N.
4344SOUND_POWER_SAVE_CONTROLLER=N
4345
4346# Power off optical drive in UltraBay/MediaBay: 0=disable, 1=enable.
4347# Drive can be powered on again by releasing (and reinserting) the eject lever
4348# or by pressing the disc eject button on newer models.
4349# Note: an UltraBay/MediaBay hard disk is never powered off.
4350BAY_POWEROFF_ON_AC=0
4351BAY_POWEROFF_ON_BAT=0
4352# Optical drive device to power off (default sr0).
4353BAY_DEVICE="sr0"
4354
4355# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable.
4356RUNTIME_PM_ON_AC=on
4357RUNTIME_PM_ON_BAT=auto
4358
4359# Exclude PCI(e) device adresses the following list from Runtime PM
4360# (separate with spaces). Use lspci to get the adresses (1st column).
4361#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
4362
4363# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM.
4364# Default when unconfigured is "amdgpu nouveau nvidia radeon" which
4365# prevents accidential power-on of dGPU in hybrid graphics setups.
4366# Use "" to disable the feature completely.
4367# Separate multiple drivers with spaces.
4368#RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon"
4369
4370# Set to 0 to disable, 1 to enable USB autosuspend feature.
4371USB_AUTOSUSPEND=1
4372
4373# Exclude listed devices from USB autosuspend (separate with spaces).
4374# Use lsusb to get the ids.
4375# Note: input devices (usbhid) are excluded automatically
4376#USB_BLACKLIST="1111:2222 3333:4444"
4377
4378# Bluetooth devices are excluded from USB autosuspend:
4379# 0=do not exclude, 1=exclude.
4380USB_BLACKLIST_BTUSB=0
4381
4382# Phone devices are excluded from USB autosuspend:
4383# 0=do not exclude, 1=exclude (enable charging).
4384USB_BLACKLIST_PHONE=0
4385
4386# Printers are excluded from USB autosuspend:
4387# 0=do not exclude, 1=exclude.
4388USB_BLACKLIST_PRINTER=1
4389
4390# WWAN devices are excluded from USB autosuspend:
4391# 0=do not exclude, 1=exclude.
4392USB_BLACKLIST_WWAN=1
4393
4394# Include listed devices into USB autosuspend even if already excluded
4395# by the blacklists above (separate with spaces).
4396# Use lsusb to get the ids.
4397#USB_WHITELIST="1111:2222 3333:4444"
4398
4399# Set to 1 to disable autosuspend before shutdown, 0 to do nothing
4400# (workaround for USB devices that cause shutdown problems).
4401#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
4402
4403# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
4404# on system startup: 0=disable, 1=enable.
4405# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
4406# are ignored when this is enabled!
4407#RESTORE_DEVICE_STATE_ON_STARTUP=0
4408RESTORE_DEVICE_STATE_ON_STARTUP=0
4409
4410# Radio devices to disable on startup: bluetooth, wifi, wwan.
4411# Separate multiple devices with spaces.
4412#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
4413DEVICES_TO_DISABLE_ON_STARTUP="bluetooth"
4414
4415# Radio devices to enable on startup: bluetooth, wifi, wwan.
4416# Separate multiple devices with spaces.
4417#DEVICES_TO_ENABLE_ON_STARTUP="wifi"
4418
4419# Radio devices to disable on shutdown: bluetooth, wifi, wwan.
4420# (workaround for devices that are blocking shutdown).
4421#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
4422
4423# Radio devices to enable on shutdown: bluetooth, wifi, wwan.
4424# (to prevent other operating systems from missing radios).
4425#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
4426
4427# Radio devices to enable on AC: bluetooth, wifi, wwan.
4428#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
4429
4430# Radio devices to disable on battery: bluetooth, wifi, wwan.
4431#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
4432
4433# Radio devices to disable on battery when not in use (not connected):
4434# bluetooth, wifi, wwan.
4435#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
4436
4437# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
4438# required). Charging starts when the remaining capacity falls below the
4439# START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value.
4440# Main / Internal battery (values in %)
4441#START_CHARGE_THRESH_BAT0=75
4442#STOP_CHARGE_THRESH_BAT0=80
4443# Ultrabay / Slice / Replaceable battery (values in %)
4444#START_CHARGE_THRESH_BAT1=75
4445#STOP_CHARGE_THRESH_BAT1=80
4446
4447# Restore charge thresholds when AC is unplugged: 0=disable, 1=enable.
4448#RESTORE_THRESHOLDS_ON_BAT=1
4449
4450# ------------------------------------------------------------------------------
4451# tlp-rdw - Parameters for the radio device wizard
4452# Possible devices: bluetooth, wifi, wwan.
4453
4454# Hints:
4455# - Parameters are disabled by default, remove the leading # to enable them
4456# - Separate multiple radio devices with spaces
4457
4458# Radio devices to disable on connect.
4459#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
4460#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
4461#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
4462
4463# Radio devices to enable on disconnect.
4464#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
4465#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
4466#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
4467
4468# Radio devices to enable/disable when docked.
4469#DEVICES_TO_ENABLE_ON_DOCK=""
4470#DEVICES_TO_DISABLE_ON_DOCK=""
4471
4472# Radio devices to enable/disable when undocked.
4473#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
4474#DEVICES_TO_DISABLE_ON_UNDOCK=""
4475#+end_src
4476
4477*** shemshak
4478
4479#+begin_src conf :tangle (when (and (eq system-type 'gnu/linux) (string= (system-name) "shemshak")) "/sudo::/etc/default/tlp")
4480# ------------------------------------------------------------------------------
4481# tlp - Parameters for power saving
4482# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
4483
4484# Hint: some features are disabled by default, remove the leading # to enable
4485# them.
4486
4487# Set to 0 to disable, 1 to enable TLP.
4488TLP_ENABLE=1
4489
4490# Operation mode when no power supply can be detected: AC, BAT.
4491# Concerns some desktop and embedded hardware only.
4492TLP_DEFAULT_MODE=AC
4493
4494# Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
4495# Hint: use in conjunction with TLP_DEFAULT_MODE=BAT for BAT settings on AC.
4496TLP_PERSISTENT_DEFAULT=0
4497
4498# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
4499# Non-zero value enables, zero disables laptop mode.
4500DISK_IDLE_SECS_ON_AC=0
4501DISK_IDLE_SECS_ON_BAT=2
4502
4503# Dirty page values (timeouts in secs).
4504MAX_LOST_WORK_SECS_ON_AC=15
4505MAX_LOST_WORK_SECS_ON_BAT=60
4506
4507# Hint: CPU parameters below are disabled by default, remove the leading #
4508# to enable them, otherwise kernel default values are used.
4509
4510# Select a CPU frequency scaling governor.
4511# Intel Core i processor with intel_pstate driver:
4512# powersave(*), performance.
4513# Older hardware with acpi-cpufreq driver:
4514# ondemand(*), powersave, performance, conservative, schedutil.
4515# (*) is recommended.
4516# Hint: use tlp-stat -p to show the active driver and available governors.
4517# Important:
4518# powersave for intel_pstate and ondemand for acpi-cpufreq are power
4519# efficient for *almost all* workloads and therefore kernel and most
4520# distributions have chosen them as defaults. If you still want to change,
4521# you should know what you're doing! You *must* disable your distribution's
4522# governor settings or conflicts will occur.
4523#CPU_SCALING_GOVERNOR_ON_AC=powersave
4524#CPU_SCALING_GOVERNOR_ON_BAT=powersave
4525
4526# Set the min/max frequency available for the scaling governor.
4527# Possible values strongly depend on your CPU. For available frequencies see
4528# the output of tlp-stat -p.
4529#CPU_SCALING_MIN_FREQ_ON_AC=0
4530#CPU_SCALING_MAX_FREQ_ON_AC=0
4531#CPU_SCALING_MIN_FREQ_ON_BAT=0
4532#CPU_SCALING_MAX_FREQ_ON_BAT=0
4533
4534# Set energy performance hints (HWP) for Intel P-state governor:
4535# performance, balance_performance, default, balance_power, power
4536# Values are given in order of increasing power saving.
4537# Note: Intel Skylake or newer CPU and Kernel >= 4.10 required.
4538CPU_HWP_ON_AC=balance_performance
4539CPU_HWP_ON_BAT=balance_power
4540
4541# Set Intel P-state performance: 0..100 (%).
4542# Limit the max/min P-state to control the power dissipation of the CPU.
4543# Values are stated as a percentage of the available performance.
4544# Requires an Intel Core i processor with intel_pstate driver.
4545#CPU_MIN_PERF_ON_AC=0
4546#CPU_MAX_PERF_ON_AC=100
4547#CPU_MIN_PERF_ON_BAT=0
4548#CPU_MAX_PERF_ON_BAT=30
4549
4550# Set the CPU "turbo boost" feature: 0=disable, 1=allow
4551# Requires an Intel Core i processor.
4552# Important:
4553# - This may conflict with your distribution's governor settings
4554# - A value of 1 does *not* activate boosting, it just allows it
4555#CPU_BOOST_ON_AC=1
4556#CPU_BOOST_ON_BAT=0
4557
4558# Minimize number of used CPU cores/hyper-threads under light load conditions:
4559# 0=disable, 1=enable.
4560SCHED_POWERSAVE_ON_AC=0
4561SCHED_POWERSAVE_ON_BAT=1
4562
4563# Kernel NMI Watchdog:
4564# 0=disable (default, saves power), 1=enable (for kernel debugging only).
4565NMI_WATCHDOG=0
4566
4567# Change CPU voltages aka "undervolting" - Kernel with PHC patch required.
4568# Frequency voltage pairs are written to:
4569# /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
4570# CAUTION: only use this, if you thoroughly understand what you are doing!
4571#PHC_CONTROLS="F:V F:V F:V F:V"
4572
4573# Set CPU performance versus energy savings policy:
4574# performance, balance-performance, default, balance-power, power.
4575# Values are given in order of increasing power saving.
4576# Requires kernel module msr and x86_energy_perf_policy from linux-tools.
4577ENERGY_PERF_POLICY_ON_AC=performance
4578ENERGY_PERF_POLICY_ON_BAT=balance-power
4579
4580# Disk devices; separate multiple devices with spaces (default: sda).
4581# Devices can be specified by disk ID also (lookup with: tlp diskid).
4582DISK_DEVICES="sda sdb"
4583
4584# Disk advanced power management level: 1..254, 255 (max saving, min, off).
4585# Levels 1..127 may spin down the disk; 255 allowable on most drives.
4586# Separate values for multiple disks with spaces. Use the special value 'keep'
4587# to keep the hardware default for the particular disk.
4588DISK_APM_LEVEL_ON_AC="254 254"
4589DISK_APM_LEVEL_ON_BAT="128 128"
4590
4591# Hard disk spin down timeout:
4592# 0: spin down disabled
4593# 1..240: timeouts from 5s to 20min (in units of 5s)
4594# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
4595# See 'man hdparm' for details.
4596# Separate values for multiple disks with spaces. Use the special value 'keep'
4597# to keep the hardware default for the particular disk.
4598#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
4599#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
4600
4601# Select IO scheduler for the disk devices: cfq, deadline, noop (Default: cfq).
4602# Separate values for multiple disks with spaces. Use the special value 'keep'
4603# to keep the kernel default scheduler for the particular disk.
4604#DISK_IOSCHED="cfq cfq"
4605
4606# AHCI link power management (ALPM) for disk devices:
4607# min_power, med_power_with_dipm(*), medium_power, max_performance.
4608# (*) Kernel >= 4.15 required, then recommended.
4609# Multiple values separated with spaces are tried sequentially until success.
4610SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
4611SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
4612
4613# Exclude host devices from AHCI link power management.
4614# Separate multiple hosts with spaces.
4615#SATA_LINKPWR_BLACKLIST="host1"
4616
4617# Runtime Power Management for AHCI host and disks devices:
4618# on=disable, auto=enable.
4619# EXPERIMENTAL ** WARNING: auto will most likely cause system lockups/data loss.
4620#AHCI_RUNTIME_PM_ON_AC=on
4621#AHCI_RUNTIME_PM_ON_BAT=on
4622
4623# Seconds of inactivity before disk is suspended.
4624AHCI_RUNTIME_PM_TIMEOUT=15
4625
4626# PCI Express Active State Power Management (PCIe ASPM):
4627# default, performance, powersave.
4628PCIE_ASPM_ON_AC=performance
4629PCIE_ASPM_ON_BAT=powersave
4630
4631# Radeon graphics clock speed (profile method): low, mid, high, auto, default;
4632# auto = mid on BAT, high on AC; default = use hardware defaults.
4633RADEON_POWER_PROFILE_ON_AC=high
4634RADEON_POWER_PROFILE_ON_BAT=low
4635
4636# Radeon dynamic power management method (DPM): battery, performance.
4637RADEON_DPM_STATE_ON_AC=performance
4638RADEON_DPM_STATE_ON_BAT=battery
4639
4640# Radeon DPM performance level: auto, low, high; auto is recommended.
4641RADEON_DPM_PERF_LEVEL_ON_AC=auto
4642RADEON_DPM_PERF_LEVEL_ON_BAT=auto
4643
4644# WiFi power saving mode: on=enable, off=disable; not supported by all adapters.
4645WIFI_PWR_ON_AC=off
4646WIFI_PWR_ON_BAT=on
4647
4648# Disable wake on LAN: Y/N.
4649WOL_DISABLE=Y
4650
4651# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
4652# A value of 0 disables, >=1 enables power saving (recommended: 1).
4653SOUND_POWER_SAVE_ON_AC=0
4654SOUND_POWER_SAVE_ON_BAT=0
4655
4656# Disable controller too (HDA only): Y/N.
4657SOUND_POWER_SAVE_CONTROLLER=N
4658
4659# Power off optical drive in UltraBay/MediaBay: 0=disable, 1=enable.
4660# Drive can be powered on again by releasing (and reinserting) the eject lever
4661# or by pressing the disc eject button on newer models.
4662# Note: an UltraBay/MediaBay hard disk is never powered off.
4663BAY_POWEROFF_ON_AC=0
4664BAY_POWEROFF_ON_BAT=0
4665# Optical drive device to power off (default sr0).
4666BAY_DEVICE="sr0"
4667
4668# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable.
4669RUNTIME_PM_ON_AC=on
4670RUNTIME_PM_ON_BAT=auto
4671
4672# Exclude PCI(e) device adresses the following list from Runtime PM
4673# (separate with spaces). Use lspci to get the adresses (1st column).
4674#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
4675RUNTIME_PM_BLACKLIST="01:00.0"
4676
4677# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM.
4678# Default when unconfigured is "amdgpu nouveau nvidia radeon" which
4679# prevents accidential power-on of dGPU in hybrid graphics setups.
4680# Use "" to disable the feature completely.
4681# Separate multiple drivers with spaces.
4682#RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon"
4683
4684# Set to 0 to disable, 1 to enable USB autosuspend feature.
4685USB_AUTOSUSPEND=1
4686
4687# Exclude listed devices from USB autosuspend (separate with spaces).
4688# Use lsusb to get the ids.
4689# Note: input devices (usbhid) are excluded automatically
4690#USB_BLACKLIST="1111:2222 3333:4444"
4691
4692# Bluetooth devices are excluded from USB autosuspend:
4693# 0=do not exclude, 1=exclude.
4694USB_BLACKLIST_BTUSB=0
4695
4696# Phone devices are excluded from USB autosuspend:
4697# 0=do not exclude, 1=exclude (enable charging).
4698USB_BLACKLIST_PHONE=0
4699
4700# Printers are excluded from USB autosuspend:
4701# 0=do not exclude, 1=exclude.
4702USB_BLACKLIST_PRINTER=1
4703
4704# WWAN devices are excluded from USB autosuspend:
4705# 0=do not exclude, 1=exclude.
4706USB_BLACKLIST_WWAN=1
4707
4708# Include listed devices into USB autosuspend even if already excluded
4709# by the blacklists above (separate with spaces).
4710# Use lsusb to get the ids.
4711#USB_WHITELIST="1111:2222 3333:4444"
4712
4713# Set to 1 to disable autosuspend before shutdown, 0 to do nothing
4714# (workaround for USB devices that cause shutdown problems).
4715#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
4716
4717# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
4718# on system startup: 0=disable, 1=enable.
4719# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
4720# are ignored when this is enabled!
4721#RESTORE_DEVICE_STATE_ON_STARTUP=0
4722RESTORE_DEVICE_STATE_ON_STARTUP=1
4723
4724# Radio devices to disable on startup: bluetooth, wifi, wwan.
4725# Separate multiple devices with spaces.
4726#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
4727
4728# Radio devices to enable on startup: bluetooth, wifi, wwan.
4729# Separate multiple devices with spaces.
4730#DEVICES_TO_ENABLE_ON_STARTUP="wifi"
4731
4732# Radio devices to disable on shutdown: bluetooth, wifi, wwan.
4733# (workaround for devices that are blocking shutdown).
4734#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
4735
4736# Radio devices to enable on shutdown: bluetooth, wifi, wwan.
4737# (to prevent other operating systems from missing radios).
4738#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
4739
4740# Radio devices to enable on AC: bluetooth, wifi, wwan.
4741#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
4742
4743# Radio devices to disable on battery: bluetooth, wifi, wwan.
4744#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
4745
4746# Radio devices to disable on battery when not in use (not connected):
4747# bluetooth, wifi, wwan.
4748#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
4749
4750# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
4751# required). Charging starts when the remaining capacity falls below the
4752# START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value.
4753# Main / Internal battery (values in %)
4754#START_CHARGE_THRESH_BAT0=75
4755#STOP_CHARGE_THRESH_BAT0=80
4756# Ultrabay / Slice / Replaceable battery (values in %)
4757#START_CHARGE_THRESH_BAT1=75
4758#STOP_CHARGE_THRESH_BAT1=80
4759
4760# Restore charge thresholds when AC is unplugged: 0=disable, 1=enable.
4761#RESTORE_THRESHOLDS_ON_BAT=1
4762
4763# ------------------------------------------------------------------------------
4764# tlp-rdw - Parameters for the radio device wizard
4765# Possible devices: bluetooth, wifi, wwan.
4766
4767# Hints:
4768# - Parameters are disabled by default, remove the leading # to enable them
4769# - Separate multiple radio devices with spaces
4770
4771# Radio devices to disable on connect.
4772#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
4773#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
4774#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
4775
4776# Radio devices to enable on disconnect.
4777#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
4778#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
4779#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
4780
4781# Radio devices to enable/disable when docked.
4782#DEVICES_TO_ENABLE_ON_DOCK=""
4783#DEVICES_TO_DISABLE_ON_DOCK=""
4784
4785# Radio devices to enable/disable when undocked.
4786#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
4787#DEVICES_TO_DISABLE_ON_UNDOCK=""
4788#+end_src
4789
4790** X
4791
4792*** xprofile
4793:PROPERTIES:
4794:header-args+: :tangle ~/.xprofile
4795:END:
4796
4797=~/.xprofile= is similar in style to =~/.xinitrc=, but on the
4798contrary, it's automatically sourced by LightDM, my display manager of
4799choice.
4800
4801#+begin_src sh :tangle no
4802xset -b # disable bell
4803xset r rate 200 45 # repeat delay (ms) and rate (repeats/sec)
4804
4805# setxkbmap -option compose:ralt
4806
4807setxkbmap -option ctrl:nocaps # turn capslock into control
4808setxkbmap -option altwin:swap_alt_win # swap alt and super
4809
4810if [ $(hostname) = "plasma" ]
4811then
4812 setxkbmap -option ctrl:rctrl_ralt # turn right control into right alt
4813fi
4814
4815if [ $(hostname) = "enigma" ]
4816then
4817 xmodmap -e "keycode 135 = Alt_R" # remap menu key to alt
4818fi
4819
4820light -Scrs "intel_backlight" 2
4821
4822source $HOME/.zprofile
4823
4824export _JAVA_AWT_WM_NONREPARENTING=1
4825export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
4826
4827if [ $(hostname) = "plasma" ]
4828then
4829 unlock-def-gk.py &
4830fi
4831
4832bspwm &
4833#+end_src
4834
4835*** X resources
4836
4837**** Xresources
4838:PROPERTIES:
4839:header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources")
4840:END:
4841
4842#+begin_src conf-xdefaults
4843#include ".Xresources.d/fonts"
4844! #include ".Xresources.d/colors"
4845#include ".Xresources.d/emacs"
4846#include ".Xresources.d/rxvt-unicode"
4847#+end_src
4848
4849**** Xresources.d
4850
4851***** fonts
4852:PROPERTIES:
4853:header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/fonts")
4854:END:
4855
4856#+begin_src conf-xdefaults
4857Xft.lcdfilter: lcddefault
4858Xft.antialias: true
4859Xft.autohint: 0
4860Xft.hinting: true
4861Xft.hintstyle: hintslight
4862! Xft.hintstyle: hintfull
4863Xft.rgba: rgb
4864Xft.dpi: 96
4865#+end_src
4866
4867***** colors
4868:PROPERTIES:
4869:header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/colors")
4870:END:
4871
4872#+begin_src conf-xdefaults :tangle no
4873#include "gruvbox-light.xresources"
4874! #include "gruvbox-dark.xresources"
4875#include "gruvbox-urxvt256.xresources"
4876#+end_src
4877
4878#+begin_src conf-xdefaults :tangle no
4879! -----------------------------------------------------------------------------
4880! File: gruvbox-light.xresources
4881! Description: Retro groove colorscheme generalized
4882! Author: morhetz <morhetz@gmail.com>
4883! Source: https://github.com/morhetz/gruvbox-generalized
4884! Last Modified: 6 Sep 2014
4885! -----------------------------------------------------------------------------
4886
4887! hard contrast: *background: #f9f5d7
4888*background: #fbf1c7
4889! soft contrast: *background: #f2e5bc
4890*foreground: #3c3836
4891! Black + DarkGrey
4892*color0: #fdf4c1
4893*color8: #928374
4894! DarkRed + Red
4895*color1: #cc241d
4896*color9: #9d0006
4897! DarkGreen + Green
4898*color2: #98971a
4899*color10: #79740e
4900! DarkYellow + Yellow
4901*color3: #d79921
4902*color11: #b57614
4903! DarkBlue + Blue
4904*color4: #458588
4905*color12: #076678
4906! DarkMagenta + Magenta
4907*color5: #b16286
4908*color13: #8f3f71
4909! DarkCyan + Cyan
4910*color6: #689d6a
4911*color14: #427b58
4912! LightGrey + White
4913*color7: #7c6f64
4914*color15: #3c3836
4915#+end_src
4916
4917#+begin_src conf-xdefaults :tangle no
4918! -----------------------------------------------------------------------------
4919! File: gruvbox-dark.xresources
4920! Description: Retro groove colorscheme generalized
4921! Author: morhetz <morhetz@gmail.com>
4922! Source: https://github.com/morhetz/gruvbox-generalized
4923! Last Modified: 6 Sep 2014
4924! -----------------------------------------------------------------------------
4925
4926! hard contrast: *background: #1d2021
4927*background: #282828
4928! soft contrast: *background: #32302f
4929*foreground: #ebdbb2
4930! Black + DarkGrey
4931*color0: #282828
4932*color8: #928374
4933! DarkRed + Red
4934*color1: #cc241d
4935*color9: #fb4934
4936! DarkGreen + Green
4937*color2: #98971a
4938*color10: #b8bb26
4939! DarkYellow + Yellow
4940*color3: #d79921
4941*color11: #fabd2f
4942! DarkBlue + Blue
4943*color4: #458588
4944*color12: #83a598
4945! DarkMagenta + Magenta
4946*color5: #b16286
4947*color13: #d3869b
4948! DarkCyan + Cyan
4949*color6: #689d6a
4950*color14: #8ec07c
4951! LightGrey + White
4952*color7: #a89984
4953*color15: #ebdbb2
4954#+end_src
4955
4956#+begin_src conf-xdefaults :tangle no
4957! -----------------------------------------------------------------------------
4958! File: gruvbox-urxvt256.xresources
4959! Description: Retro groove colorscheme generalized
4960! Author: morhetz <morhetz@gmail.com>
4961! Source: https://github.com/morhetz/gruvbox-generalized
4962! Last Modified: 13 Dec 2013
4963! -----------------------------------------------------------------------------
4964
4965URxvt.color24: #076678
4966URxvt.color66: #427b58
4967URxvt.color88: #9d0006
4968URxvt.color96: #8f3f71
4969URxvt.color100: #79740e
4970URxvt.color108: #8ec07c
4971URxvt.color109: #83a598
4972URxvt.color130: #af3a03
4973URxvt.color136: #b57614
4974URxvt.color142: #b8bb26
4975URxvt.color167: #fb4934
4976URxvt.color175: #d3869b
4977URxvt.color208: #fe8019
4978URxvt.color214: #fabd2f
4979URxvt.color223: #ebdbb2
4980URxvt.color228: #f2e5bc
4981URxvt.color229: #fbf1c7
4982URxvt.color230: #f9f5d7
4983URxvt.color234: #1d2021
4984URxvt.color235: #282828
4985URxvt.color236: #32302f
4986URxvt.color237: #3c3836
4987URxvt.color239: #504945
4988URxvt.color241: #665c54
4989URxvt.color243: #7c6f64
4990URxvt.color244: #928374
4991URxvt.color245: #928374
4992URxvt.color246: #a89984
4993URxvt.color248: #bdae93
4994URxvt.color250: #d5c4a1
4995#+end_src
4996
4997***** emacs
4998:PROPERTIES:
4999:header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/emacs")
5000:END:
5001
5002#+begin_src conf-xdefaults
5003Emacs.menuBar: off
5004Emacs.toolBar: off
5005Emacs.verticalScrollBars: off
5006Emacs.cursorBlink: off
5007Emacs.FontBackend: xft,x
5008! Emacs.font: Ubuntu Mono-12
5009! Emacs.font: Triplicate T4C-11
5010! Emacs.font: Ubuntu Mono-10.5
5011! Emacs.font: Ubuntu Mono-12
5012! Emacs.font: Iosevka-11
5013
5014! Emacs.font: Fira Mono:size=15
5015! Emacs.font: DejaVu Sans Mono:size=15
5016! Emacs.font: Inconsolata:size=17
5017! Emacs.font: Inconsolata:size=16
5018! Emacs.font: Inconsolata LGC:size=14
5019! Emacs.font: Source Code Pro Medium-10.5
5020Emacs.font: Source Code Pro:size=14
5021! Emacs.font: Ubuntu Mono:size=16
5022! Emacs.font: Iosevka:size=16
5023#+end_src
5024
5025***** rxvt-unicode
5026:PROPERTIES:
5027:header-args+: :tangle (when (eq system-type 'gnu/linux) "~/.Xresources.d/rxvt-unicode")
5028:END:
5029
5030#+begin_src conf-xdefaults
5031! Font
5032URxvt.font: xft:source code pro:pixelsize=14:antialias=true:hinting=true, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true
5033URxvt.boldFont: xft:source code pro semibold:pixelsize=14:antialias=true:hinting=true:bold, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:bold
5034URxvt.italicFont: xft:source code pro italic:pixelsize=14:antialias=true:hinting=true:italic, xft:dejavu sans mono:pixelsize=15:antialias=true:hinting=true:italic
5035URxvt.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
5036
5037URxvt.xftAntialias: true
5038URxvt.letterSpace: 0
5039
5040URxvt.depth: 0
5041URxvt.loginShell: true
5042URxvt.saveLines: 100000
5043URxvt.internalBorder: 3
5044URxvt.lineSpace: 0
5045URxvt.scrollBar: false
5046URxvt.scrollStyle: rxvt
5047URxvt*scrollTtyOutput: false
5048URxvt*scrollWithBuffer: true
5049URxvt*scrollTtyKeypress: true
5050URxvt.keysym.Shift-Up: command:\033]720;1\007
5051URxvt.keysym.Shift-Down: command:\033]721;1\007
5052
5053URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
5054URxvt.url-select.launcher: firefox
5055URxvt.url-select.underline: true
5056URxvt.keysym.M-u: perl:url-select:select_next
5057URxvt.keysym.M-Escape: perl:keyboard-select:activate
5058URxvt.keysym.M-s: perl:keyboard-select:search
5059URxvt.url-launcher: /usr/bin/firefox
5060URxvt.matcher.button: 1
5061URxvt.iso14755: false
5062URxvt.iso14755_53: false
5063URxvt.keysym.M-c: perl:clipboard:copy
5064URxvt.keysym.M-v: perl:clipboard:paste
5065URxvt.keysym.C-A-V: perl:clipboard:paste_escaped
5066URxvt.keysym.C-Up: font-size:increase
5067URxvt.keysym.C-Down: font-size:decrease
5068URxvt.keysym.C-S-Up: font-size:incglobal
5069URxvt.keysym.C-S-Down: font-size:decglobal
5070URxvt.keysym.C-equal: font-size:reset
5071!URxvt.keysym.C-question: font-size:show
5072
5073URxvt.iconFile: /usr/share/icons/Paper/48x48/apps/utilities-terminal.png
5074
5075!urxvt*foreground: white
5076!urxvt*background: black
5077
5078!*color0: #2E3436
5079!*color1: #a40000
5080!*color2: #4E9A06
5081!*color3: #C4A000
5082!*color4: #3465A4
5083!*color5: #75507B
5084!*color6: #ce5c00
5085!*color7: #babdb9
5086!*color8: #555753
5087!*color9: #EF2929
5088!*color10: #8AE234
5089!*color11: #FCE94F
5090!*color12: #729FCF
5091!*color13: #AD7FA8
5092!*color14: #fcaf3e
5093!*color15: #EEEEEC
5094
5095!URxvt.foreground: #C8C8C8
5096!URxvt.background: #FFFFFF
5097
5098!! black
5099!*color0: #2E3436
5100!*color8: #555753
5101!! red
5102!*color1: #a40000
5103!*color9: #EF2929
5104!! green
5105!*color2: #4E9A06
5106!*color10: #8AE234
5107!! yellow
5108!*color3: #C4A000
5109!*color11: #FCE94F
5110!! blue
5111!*color4: #3465A4
5112!*color12: #729FCF
5113!! purple
5114!*color5: #75507B
5115!*color13: #AD7FA8
5116!! orange (replaces cyan)
5117!*color6: #ce5c00
5118!*color14: #fcaf3e
5119!! white
5120!*color7: #babdb9
5121!*color15: #EEEEEC
5122
5123! Tango colour theme for rxvt-unicode
5124URxvt.background: #FFFFFF
5125URxvt.foreground: #000000
5126
5127! Black
5128URxvt.color0: #2E3436
5129URxvt.color8: #757773
5130
5131! Red
5132URxvt.color1: #CC0000
5133URxvt.color9: #EF2929
5134
5135! Green
5136URxvt.color2: #4E9A06
5137URxvt.color10: #8AE234
5138
5139! Yellow
5140URxvt.color3: #C4A000
5141URxvt.color11: #FCE94F
5142
5143! Blue
5144URxvt.color4: #3465A4
5145URxvt.color12: #729FCF
5146
5147! Magenta
5148URxvt.color5: #75507B
5149URxvt.color13: #AD7FA8
5150
5151!! Cyan
5152!URxvt.color6: #06989A
5153!URxvt.color14: #34E2E2
5154! orange (replaces cyan)
5155,*color6: #ce5c00
5156,*color14: #fcaf3e
5157
5158! White
5159URxvt.color7: #D3D7CF
5160URxvt.color15: #EEEEEC
5161#+end_src
5162
5163*** xkb us_ab keyboard layout
5164
5165#+begin_src conf :tangle "/sudo::/usr/share/X11/xkb/symbols/us_ab" :comments none
5166default partial alphanumeric_keys
5167xkb_symbols "us_ab" {
5168 include "us(basic)"
5169 name[Group1]= "English (US)(aminb)";
5170
5171 key <MENU> { [ Alt_R ] };
5172};
5173#+end_src
5174
5175** XDG
5176:PROPERTIES:
5177:header-args+: :tangle ~/.config/user-dirs.dirs
5178:END:
5179
5180#+begin_src conf
5181XDG_DESKTOP_DIR="$HOME/Desktop"
5182XDG_DOCUMENTS_DIR="$HOME/usr/docs"
5183XDG_DOWNLOAD_DIR="$HOME/usr/dls"
5184XDG_MUSIC_DIR="$HOME/usr/music"
5185XDG_PICTURES_DIR="$HOME/usr/pics"
5186XDG_PUBLICSHARE_DIR="$HOME/usr/Public"
5187XDG_TEMPLATES_DIR="$HOME/usr/Templates"
5188XDG_VIDEOS_DIR="$HOME/usr/vids"
5189#+end_src
5190
5191** Zathura
5192:PROPERTIES:
5193:header-args+: :tangle ~/.config/zathura/zathurarc
5194:END:
5195
5196#+begin_src conf
5197set smooth-scroll true
5198set selection-clipboard clipboard
5199set zoom-step 05
5200set default-bg "#272727"
5201set statusbar-bg "#272727"
5202set inputbar-bg "#373737"
5203#+end_src
5204
5205** Zsh
5206
5207My zsh setup is built on [[https://github.com/zimfw/zimfw][Zim]]. Further, my zshrc references [[https://github.com/junegunn/fzf][fzf]],
5208[[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]], and [[https://github.com/hlissner/zsh-autopair][zsh-autopair]]; so be sure to have them
5209installed.
5210
5211*** zimrc
5212:PROPERTIES:
5213:header-args+: :tangle ~/.zimrc
5214:END:
5215
5216#+begin_src sh
5217
5218
5219#################
5220# CORE SETTINGS #
5221#################
5222
5223#
5224# Zim settings
5225#
5226
5227# Select what modules you would like enabled.
5228# The second line of modules may depend on options set by modules in the first
5229# line. These dependencies are noted on the respective module's README.md.
5230zmodules=(directory environment git git-info history input ssh utility custom \
5231 syntax-highlighting history-substring-search prompt completion)
5232
5233
5234###################
5235# MODULE SETTINGS #
5236###################
5237
5238#
5239# Prompt
5240#
5241
5242# Set your desired prompt here
5243zprompt_theme='pure'
5244#PURE_PROMPT_SYMBOL=λ
5245#PURE_PROMPT_SYMBOL=δ
5246PURE_PROMPT_SYMBOL=➜
5247
5248#
5249# Completion
5250#
5251
5252# set an optional host-specific filename for the completion cache file
5253# if none is provided, the default '.zcompdump' is used.
5254#zcompdump_file=".zcompdump-${HOST}-${ZSH_VERSION}"
5255
5256#
5257# Utility
5258#
5259
5260# Uncomment to enable command correction prompts
5261# See: http://zsh.sourceforge.net/Doc/Release/Options.html#Input_002fOutput
5262setopt CORRECT
5263
5264#
5265# Environment
5266#
5267
5268# Set the string below to the desired terminal title format string.
5269# The terminal title is redrawn upon directory change, however, variables like
5270# ${PWD} are only evaluated once. Use prompt expansion strings for dynamic data:
5271# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
5272# The example below uses the following format: 'username@host:/current/directory'
5273ztermtitle='%n@%m:%~'
5274
5275#
5276# Input
5277#
5278
5279# Uncomment to enable double-dot expansion.
5280# This appends '../' to your input for each '.' you type after an initial '..'
5281#zdouble_dot_expand='true'
5282
5283#
5284# Syntax-Highlighting
5285#
5286
5287# This determines what highlighters will be used with the syntax-highlighting module.
5288# Documentation of the highlighters can be found here:
5289# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
5290# For (u)rxvt, termite and gnome-terminal users,
5291# removing the 'cursor' highlighter will fix the disappearing cursor problem
5292#zhighlighters=(main brackets cursor)
5293zhighlighters=(main brackets pattern)
5294
5295
5296#
5297# SSH
5298#
5299
5300# Load these ssh identities with the ssh module
5301zssh_ids=(id_ed25519_bandali)
5302
5303
5304#
5305# Pacman
5306#
5307
5308# Set (optional) pacman front-end.
5309zpacman_frontend='yay'
5310
5311# Load any helper scripts as defined here
5312#zpacman_helper=(aur)
5313#+end_src
5314
5315*** zlogin
5316:PROPERTIES:
5317:header-args+: :tangle ~/.zlogin
5318:END:
5319
5320#+begin_src sh
5321
5322
5323#
5324# User configuration sourced by login shells
5325#
5326
5327# Initialize zim
5328[[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh
5329#+end_src
5330
5331*** zprofile
5332:PROPERTIES:
5333:header-args+: :tangle ~/.zprofile
5334:END:
5335
5336#+begin_src sh
5337#PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
5338#PATH=$HOME/.gem/ruby/2.4.0/bin:$PATH
5339export PATH=$HOME/.local/bin:$HOME/.cabal/bin:$HOME/.cargo/bin:$HOME/.elan/bin:$PATH
5340export XDG_CONFIG_HOME=$HOME/.config
5341export XDG_DATA_HOME=$HOME/.local/share
5342export XDG_DATA_DIRS=/usr/local/share:/usr/share
5343export MAILDIR="$HOME/mail"
5344export CVS_RSH=ssh
5345#export MATHMODELS=$HOME/src/eiffel/mathmodels
5346#export RUST_SRC_PATH=~/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
5347#export PATH=$PATH:$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/
5348
5349# Eiffel2Java stuff
5350#export JAVA_HOME=/usr/lib/jvm/default
5351#export CPATH=$CPATH:"$JAVA_HOME/include:$JAVA_HOME/include/linux"
5352#export LIBRARY_PATH=$LIBRARY_PATH:"$JAVA_HOME/jre/lib/amd64/server"
5353#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$JAVA_HOME/jre/lib/amd64/server"
5354
5355#export PATH="$HOME/usr/build/pvs:$PATH"
5356#export SBCLISP_HOME=/usr/share/sbcl-source
5357#export PVS_LIBRARY_PATH="$HOME/usr/build/pvs/nasalib"
5358
5359export MOZ_USE_XINPUT2=1 # precise scrolling in firefox
5360
5361#export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
5362#export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
5363
5364export NIXPKGS=$HOME/src/git/nixpkgs
5365
5366if [ -e /home/amin/.nix-profile/etc/profile.d/nix.sh ]; then . /home/amin/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
5367#+end_src
5368
5369*** zshenv
5370:PROPERTIES:
5371:header-args+: :tangle ~/.zshenv
5372:END:
5373
5374#+begin_src sh
5375# Ensure that a non-login, non-interactive shell has a defined environment.
5376if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
5377 source "${ZDOTDIR:-$HOME}/.zprofile"
5378fi
5379#+end_src
5380
5381*** zshrc
5382:PROPERTIES:
5383:header-args+: :tangle ~/.zshrc
5384:END:
5385
5386#+begin_src sh
5387# Bash-like navigation
5388#export WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
5389#export WORDCHARS='*?-[]~=&;!#$%^(){}<>'
5390export WORDCHARS='*?[]~=&;!#$%^(){}<>'
5391#ZLE_SPACE_SUFFIX_CHARS=$'|&'
5392
5393#disable -r time # disable shell reserved word
5394#alias time='time -p' # -p for POSIX output
5395
5396# rehash if last command was pacaur or pacman
5397# (so that zsh picks up changes in $PATH immediately)
5398TRAPUSR1() { rehash}; precmd() { [[ $history[$[ HISTCMD -1 ]] == *(pacaur|pacman)* ]] && killall -USR1 zsh }
5399
5400#
5401# User configuration sourced by interactive shells
5402#
5403
5404# Change default zim location
5405export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
5406
5407# Start zim
5408[[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh
5409
5410ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
5411#ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'
5412
5413setopt globdots
5414
5415source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
5416# source ~/.zsh/zsh-autopair/autopair.zsh
5417
5418
5419### fzf ###
5420
5421source /usr/share/fzf/key-bindings.zsh
5422source /usr/share/fzf/completion.zsh
5423
5424# Accept history selection instead of putting it on
5425# the command line
5426fzf-history-widget-accept() {
5427 fzf-history-widget
5428 zle accept-line
5429}
5430#zle -N fzf-history-widget-accept
5431#bindkey '^R' fzf-history-widget-accept
5432
5433# alt+c preview
5434export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
5435
5436### fzf ###
5437
5438
5439# aliases
5440alias mpv="mpv --ytdl-format mp4"
5441alias mv="mv -iv"
5442alias cp="cp -iv"
5443alias scl=systemctl
5444alias jcl=journalctl
5445alias m="mbsync -a"
5446alias best="youtube-dl -f best"
5447alias sd="ssh deb"
5448alias sf="ssh fp"
5449alias sn="ssh nix"
5450
5451aur() {
5452 cd ~/usr/build
5453 git clone https://aur.archlinux.org/${1}.git
5454 cd ${1}
5455}
5456
5457# i-beam cursor
5458echo -e "\033[5 q"
5459#echo -e "\033[6 q"
5460#+end_src
5461
5462* Scripts
5463
5464This section contains various useful scripts and the ones used by the
5465programs above. For instance, =toggle-tablet= for switching to and
5466from tablet mode on my X220T, =toggle-presentation-mode= for toggling
5467Xfce's presentation mode which keeps the screen awake, and
5468=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
5469exact brightness value.
5470
5471** battery-percentage-time
5472:PROPERTIES:
5473:header-args+: :tangle ~/.local/bin/battery-percentage-time :shebang "#!/bin/sh"
5474:END:
5475
5476#+begin_src sh :tangle no
5477dbus_send() {
5478 label=$1
5479 dbus-send --print-reply=literal --system \
5480 --dest=org.freedesktop.UPower \
5481 /org/freedesktop/UPower/devices/battery_BAT0 \
5482 org.freedesktop.DBus.Properties.Get \
5483 string:org.freedesktop.UPower.Device \
5484 string:"${label}" | awk '{print $3}'
5485}
5486
5487perc=$(dbus_send 'Percentage')
5488state=$(dbus_send 'State')
5489
5490if [ "$state" -eq 2 ]; then # Discharging
5491 secs=$(dbus_send 'TimeToEmpty')
5492elif [ "$state" -eq 1 ]; then # Charging
5493 secs=$(dbus_send 'TimeToFull')
5494fi
5495
5496printf '%s%%%%%2dh%02dm \n' "$perc" $((secs / 3600)) $((secs % 3600 / 60))
5497#+end_src
5498
5499** my-i3status.py
5500:PROPERTIES:
5501:header-args+: :tangle ~/.local/bin/my-i3status.py :shebang "#!/usr/bin/env python2"
5502:END:
5503
5504#+begin_src python :comments none
5505# -*- coding: utf-8 -*-
5506
5507# This script is a simple wrapper which prefixes each i3status line with custom
5508# information. It is based on:
5509# https://github.com/i3/i3status/blob/master/contrib/wrapper.py
5510#
5511# In ~/.i3status.conf, add the following line:
5512# output_format = "i3bar"
5513# in the 'general' section.
5514# Then, in ~/.config/i3/config or ~/.config/sway/config add:
5515# status_command i3status | my-i3status.py
5516# in the 'bar' section. Make sure my-i3status.py is in $PATH.
5517#
5518# © 2012 Valentin Haenel <valentin.haenel@gmx.de>
5519# © 2018 Amin Bandali <bandali@gnu.org>
5520#
5521# This program is free software. It comes without any warranty, to the extent
5522# permitted by applicable law. You can redistribute it and/or modify it under
5523# the terms of the Do What The Fuck You Want To Public License (WTFPL), Version
5524# 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
5525# details.
5526
5527import sys
5528import json
5529import os
5530
5531def get_nosleep():
5532 """ Return true if ~/.nosleep exists. """
5533 return os.path.isfile(os.path.expanduser("~/.nosleep"))
5534
5535def print_line(message):
5536 """ Non-buffered printing to stdout. """
5537 sys.stdout.write(message + '\n')
5538 sys.stdout.flush()
5539
5540def read_line():
5541 """ Interrupted respecting reader for stdin. """
5542 # try reading a line, removing any extra whitespace
5543 try:
5544 line = sys.stdin.readline().strip()
5545 # i3status sends EOF, or an empty line
5546 if not line:
5547 sys.exit(3)
5548 return line
5549 # exit on ctrl-c
5550 except KeyboardInterrupt:
5551 sys.exit()
5552
5553if __name__ == '__main__':
5554 # Skip the first line which contains the version header.
5555 print_line(read_line())
5556
5557 # The second line contains the start of the infinite array.
5558 print_line(read_line())
5559
5560 while True:
5561 line, prefix = read_line(), ''
5562 # ignore comma at start of lines
5563 if line.startswith(','):
5564 line, prefix = line[1:], ','
5565
5566 if get_nosleep():
5567 j = json.loads(line)
5568 # insert information into the start of the json, but could be anywhere
5569 j.insert(0, {'full_text' : '🖵 ', 'name' : 'nosleep'})
5570 # and echo back new encoded json
5571 print_line(prefix+json.dumps(j))
5572 else:
5573 print_line(prefix+line)
5574#+end_src
5575
5576** rofi-light
5577:PROPERTIES:
5578:header-args+: :tangle ~/.local/bin/rofi-light :shebang "#!/bin/bash"
5579:END:
5580
5581#+begin_src bash
5582cur=$(light -G)
5583val=$(rofi -dmenu -mesg "light $cur" -p "light -S " -l 0 -width 12)
5584light -S $val
5585#+end_src
5586
5587** s (run sway)
5588:PROPERTIES:
5589:header-args+: :tangle ~/.local/bin/s :shebang "#!/bin/bash"
5590:END:
5591
5592#+begin_src bash
5593export _JAVA_AWT_WM_NONREPARENTING=1
5594export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
5595light -Nr 2
5596source $HOME/.zprofile
5597sway
5598#+end_src
5599
5600** sway-ws-util
5601:PROPERTIES:
5602:header-args+: :tangle ~/.local/bin/sway-ws-util :shebang "#!/bin/bash"
5603:END:
5604
5605#+begin_src bash
5606curr_ws=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true).name')
5607[[ $curr_ws -eq 1 ]] && prev_ws=10 || prev_ws=$((curr_ws-1))
5608[[ $curr_ws -eq 10 ]] && next_ws=1 || next_ws=$((curr_ws+1))
5609dest_ws=-1
5610op=-1
5611
5612if [ "$1" = "switch" ] || [ "$1" = "move" ]; then
5613 op="$1"
5614 if [ "$2" = "prev" ]; then
5615 dest_ws="$prev_ws"
5616 elif [ "$2" = "next" ]; then
5617 dest_ws="$next_ws"
5618 else
5619 echo "Usage: $0 $1 {prev|next} [follow]"
5620 exit 1
5621 fi
5622else
5623 echo "Usage: $0 {switch|move} {prev|next} [follow]"
5624 exit 1
5625fi
5626
5627if [ "$op" = "switch" ]; then
5628 sway workspace "$dest_ws"
5629elif [ "$op" = "move" ]; then
5630 sway move container to workspace "$dest_ws"
5631 if [ "$3" = "follow" ]; then
5632 sway workspace "$dest_ws"
5633 fi
5634fi
5635#+end_src
5636
5637** toggle-layout
5638:PROPERTIES:
5639:header-args+: :tangle ~/.local/bin/toggle-layout :shebang "#!/bin/bash"
5640:END:
5641
5642#+begin_src bash :tangle no
5643lang="$(setxkbmap -print | grep xkb_symbols | cut -d'+' -f 2)"
5644
5645if [ "$lang" = "us" ]; then
5646 setxkbmap ir
5647else
5648 setxkbmap us
5649 # xmodmap $HOME/.Xmodmap
5650fi
5651#+end_src
5652
5653** toggle-presentation-mode
5654:PROPERTIES:
5655:header-args+: :tangle ~/.local/bin/toggle-presentation-mode :shebang "#!/bin/bash"
5656:END:
5657
5658#+begin_src bash :tangle no
5659xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
5660#+end_src
5661
5662** toggle-tablet
5663:PROPERTIES:
5664:header-args+: :tangle ~/.local/bin/toggle-tablet :shebang "#!/bin/bash"
5665:END:
5666
5667This script toggles between a 'normal' mode and a 'tablet' mode, doing
5668a few things:
5669
5670- rotates the screen using =xrandr=, so that rotating the physical
5671 display of my X220t would have the laptop's battery on the right
5672 hand side,
5673- enables touch screen,
5674- properly rotates the stylus pen and touch screen pointers, and
5675- toggles between RGB and Vertical BGR sub-pixel order.
5676
5677#+begin_src bash :tangle no
5678case $(xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation) in
5679 0) # Screen is not rotated, we should rotate it right (90°)
5680 xrandr -o 3
5681 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 1
5682 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 1
5683 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 1
5684 xfconf-query -c xsettings -p /Xft/RGBA -s vbgr
5685 ;;
5686 1) # Currently top is rotated right, we should set it normal (0°)
5687 xrandr -o 0
5688 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 0
5689 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 0
5690 xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 0
5691 xfconf-query -c xsettings -p /Xft/RGBA -s rgb
5692 ;;
5693 *)
5694 echo "Unknown result from 'xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation'" >&2
5695 exit 1
5696 ;;
5697esac
5698#+end_src
5699
5700** unlock-def-gk.py
5701:PROPERTIES:
5702:header-args+: :tangle ~/.local/bin/unlock-def-gk.py :shebang "#!/usr/bin/env python2"
5703:END:
5704
5705#+begin_src python :tangle no
5706import gnomekeyring as gk
5707# list_item_ids_sync('login')[0] == 1L
5708gk.unlock_sync('Default_keyring',gk.item_get_info_sync('login',1L).get_secret())
5709#+end_src
5710
5711** volume-info
5712:PROPERTIES:
5713:header-args+: :tangle ~/.local/bin/volume-info :shebang "#!/bin/sh"
5714:END:
5715
5716#+begin_src sh :tangle no
5717cur_vol=$(pamixer --get-volume)
5718
5719if [ $(pamixer --get-mute) = true ]; then
5720 printf 'mt \n' "$cur_vol"
5721else
5722 printf '%02d \n' "$cur_vol"
5723fi
5724#+end_src
5725
5726** wp
5727
5728My little wallpaper changer script.
5729
5730*** wp
5731:PROPERTIES:
5732:header-args+: :tangle ~/.local/bin/wp :shebang "#!/bin/bash"
5733:END:
5734
5735#+begin_src bash :tangle no
5736export DISPLAY=:0
5737
5738case "$1" in
5739 "day")
5740 feh --bg-scale $HOME/usr/pics/island_day_by_arsenixc-d6ctqon.jpg
5741 ;;
5742 "night")
5743 feh --bg-scale $HOME/usr/pics/island_night_by_arsenixc-d6cz757.jpg
5744 ;;
5745 *)
5746 echo $"Usage: $0 {day|night}"
5747 exit 1
5748esac
5749#+end_src
5750
5751*** wp-auto
5752:PROPERTIES:
5753:header-args+: :tangle ~/.local/bin/wp-auto :shebang "#!/bin/bash"
5754:END:
5755
5756#+begin_src bash :tangle no
5757SED=$(which sed)
5758ROFI=$(which rofi)
5759
5760export DISPLAY=:0
5761HOUR=$(date +%H)
5762
5763if [ -z "${SED}" ]
5764then
5765 echo "Did not find 'sed', script cannot continue."
5766 exit 1
5767fi
5768if [ -z "${ROFI}" ]
5769then
5770 echo "Did not find rofi, there is no point to continue."
5771 exit 1
5772fi
5773
5774###
5775# Create if not exists, then removes #include of .theme file (if present) and add the selected theme to the end.
5776# Repeated calls should leave the config clean-ish
5777###
5778function set_theme()
5779{
5780 CDIR="${HOME}/.config/rofi/"
5781 if [ ! -d "${CDIR}" ]
5782 then
5783 mkdir -p ${CDIR}
5784 fi
5785 if [ -f "${CDIR}/config" ]
5786 then
5787 ${SED} -i "/rofi\.theme: .*\.rasi$/d" "${CDIR}/config"
5788 fi
5789 echo "rofi.theme: ${1}" >> "${CDIR}/config"
5790
5791}
5792
5793if [ "$HOUR" -gt "19" ] || [ "$HOUR" -lt "7" ]
5794 then
5795 feh --bg-scale $HOME/usr/pics/island_night_by_arsenixc-d6cz757.jpg
5796 xrdb -merge $HOME/.Xresources.d/gruvbox-dark.xresources
5797 set_theme "/usr/share/rofi/themes//gruvbox-dark.rasi"
5798 else
5799 feh --bg-scale $HOME/usr/pics/island_day_by_arsenixc-d6ctqon.jpg
5800 xrdb -merge $HOME/.Xresources.d/gruvbox-light.xresources
5801 set_theme "/usr/share/rofi/themes//gruvbox-light.rasi"
5802fi
5803#+end_src
5804
5805*** wp.service
5806:PROPERTIES:
5807:header-args+: :tangle ~/.config/systemd/user/wp.service
5808:END:
5809
5810#+begin_src conf :tangle no
5811[Unit]
5812Description=wallpaper service
5813
5814[Service]
5815Type=oneshot
5816ExecStart=/usr/bin/bash -c %h/.local/bin/wp-auto
5817#+end_src
5818
5819*** wp.timer
5820:PROPERTIES:
5821:header-args+: :tangle ~/.config/systemd/user/wp.timer
5822:END:
5823
5824#+begin_src conf :tangle no
5825[Unit]
5826[Unit]
5827Description=wallpaper timer
5828
5829[Timer]
5830OnCalendar=07,21:00
5831Unit=wp.service
5832Persistent=true
5833
5834[Install]
5835WantedBy=timers.target
5836#+end_src
5837
5838** zathura-sync.sh
5839:PROPERTIES:
5840:header-args+: :tangle ~/.local/bin/zathura-sync.sh :shebang "#!/bin/sh"
5841:END:
5842
5843#+begin_src sh
5844pos="$1"
5845pdffile="$2"
5846zathura --synctex-forward "$pos" "$pdffile" || \
5847 (
5848 zathura -x "emacsclient --eval '(progn (switch-to-buffer (file-name-nondirectory \"%{input}\")) (goto-line %{line}))'" "$pdffile" &
5849 sleep 1; zathura --synctex-forward "$pos" "$pdffile" )
5850#+end_src
5851** Fun :)
5852
5853*** eat-em
5854:PROPERTIES:
5855:header-args+: :tangle ~/.local/bin/eat-em :shebang "#!/bin/sh"
5856:END:
5857
5858#+begin_src sh
5859# Original Posted at http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
5860# [ESC] character in original post removed here.
5861
5862# ANSI Color -- use these variables to easily have different color
5863# and format output. Make sure to output the reset sequence after
5864# colors (f = foreground, b = background), and use the 'off'
5865# feature for anything you turn on.
5866
5867initializeANSI()
5868{
5869 esc="$(echo -en '\e')"
5870
5871 blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m"
5872 yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m"
5873 cyanf="${esc}[36m"; whitef="${esc}[37m"
5874
5875 blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m"
5876 yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m"
5877 cyanb="${esc}[46m"; whiteb="${esc}[47m"
5878
5879 boldon="${esc}[1m"; boldoff="${esc}[22m"
5880 italicson="${esc}[3m"; italicsoff="${esc}[23m"
5881 ulon="${esc}[4m"; uloff="${esc}[24m"
5882 invon="${esc}[7m"; invoff="${esc}[27m"
5883
5884 reset="${esc}[0m"
5885}
5886
5887# note in this first use that switching colors doesn't require a reset
5888# first - the new color overrides the old one.
5889
5890#clear
5891
5892initializeANSI
5893
5894cat << EOF
5895
5896 ${yellowf} ▄███████▄${reset} ${redf} ▄██████▄${reset} ${greenf} ▄██████▄${reset} ${bluef} ▄██████▄${reset} ${purplef} ▄██████▄${reset} ${cyanf} ▄██████▄${reset}
5897 ${yellowf}▄█████████▀▀${reset} ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄${reset} ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄${reset} ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄${reset} ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄${reset} ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
5898 ${yellowf}███████▀${reset} ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███${reset} ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███${reset} ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███${reset} ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███${reset} ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
5899 ${yellowf}███████▄${reset} ${redf}████████████${reset} ${greenf}████████████${reset} ${bluef}████████████${reset} ${purplef}████████████${reset} ${cyanf}████████████${reset}
5900 ${yellowf}▀█████████▄▄${reset} ${redf}██▀██▀▀██▀██${reset} ${greenf}██▀██▀▀██▀██${reset} ${bluef}██▀██▀▀██▀██${reset} ${purplef}██▀██▀▀██▀██${reset} ${cyanf}██▀██▀▀██▀██${reset}
5901 ${yellowf} ▀███████▀${reset} ${redf}▀ ▀ ▀ ▀${reset} ${greenf}▀ ▀ ▀ ▀${reset} ${bluef}▀ ▀ ▀ ▀${reset} ${purplef}▀ ▀ ▀ ▀${reset} ${cyanf}▀ ▀ ▀ ▀${reset}
5902
5903 ${boldon}${yellowf} ▄███████▄ ${redf} ▄██████▄ ${greenf} ▄██████▄ ${bluef} ▄██████▄ ${purplef} ▄██████▄ ${cyanf} ▄██████▄${reset}
5904 ${boldon}${yellowf}▄█████████▀▀ ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄ ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄ ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄ ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄ ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
5905 ${boldon}${yellowf}███████▀ ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███ ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███ ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███ ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███ ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
5906 ${boldon}${yellowf}███████▄ ${redf}████████████ ${greenf}████████████ ${bluef}████████████ ${purplef}████████████ ${cyanf}████████████${reset}
5907 ${boldon}${yellowf}▀█████████▄▄ ${redf}██▀██▀▀██▀██ ${greenf}██▀██▀▀██▀██ ${bluef}██▀██▀▀██▀██ ${purplef}██▀██▀▀██▀██ ${cyanf}██▀██▀▀██▀██${reset}
5908 ${boldon}${yellowf} ▀███████▀ ${redf}▀ ▀ ▀ ▀ ${greenf}▀ ▀ ▀ ▀ ${bluef}▀ ▀ ▀ ▀ ${purplef}▀ ▀ ▀ ▀ ${cyanf}▀ ▀ ▀ ▀${reset}
5909
5910EOF
5911#+end_src
5912
5913*** invade-em
5914:PROPERTIES:
5915:header-args+: :tangle ~/.local/bin/invade-em :shebang "#!/bin/bash"
5916:END:
5917
5918#+begin_src bash
5919#
5920# ANSI color scheme script featuring Space Invaders
5921#
5922# Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
5923# Modified by lolilolicon
5924#
5925
5926f=3 b=4
5927for j in f b; do
5928 for i in {0..7}; do
5929 printf -v $j$i %b "\e[${!j}${i}m"
5930 done
5931done
5932bld=$'\e[1m'
5933rst=$'\e[0m'
5934
5935cat << EOF
5936
5937 $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
5938 $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
5939 $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst
5940 $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst
5941
5942 $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
5943 $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
5944 $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst
5945 $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst
5946
5947
5948 $f7▌$rst
5949
5950 $f7▌$rst
5951
5952 $f7 ▄█▄ $rst
5953 $f7▄█████████▄$rst
5954 $f7▀▀▀▀▀▀▀▀▀▀▀$rst
5955
5956EOF
5957#+end_src