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