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