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