Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
2364 lines (2129 sloc) 59.2 KB

rc.org

Intro

This is where I keep the bulk of my dotfiles (that aren’t emacs or zsh). If it seems like a bit of a mess to keep it all in one place, note that this is much more readable in org format than in rendered markdown.

Contents

Config

bashrc

:header-args+: :tangle ~/.bashrc
# source ~/.profile >& /dev/null
# [ -z "$EMACS" ] && exec fish
# exec fish

bspwm

bspwmrc

:header-args+: :tangle ~/.config/bspwm/bspwmrc :shebang “#!/bin/sh”
xsetroot -cursor_name left_ptr
killall -q sxhkd; sxhkd &

killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
polybar simple &
ln -sf /tmp/polybar_mqueue.$! /tmp/ipc-polybar-simple
pgrep emacs || emacs --daemon &
killall -q udiskie; udiskie &
nitrogen --restore &
killall unclutter; unclutter &
# killall xautolock; xautolock -corners ---- -time 10 -locker "slock" &
killall xss-lock; xss-lock -- slock &
killall xcape; xcape -e 'Control_L=Escape' &
killall syncthing; syncthing -no-browser &
killall autocutsel; autocutsel -selection CLIPBOARD -fork &
autocutsel -selection PRIMARY -fork &

xset r rate 300 50 &

# bspc config initial_polarity     second_child
bspc config focus_follows_pointer  true
bspc config external_rules_command "$HOME/.config/bspwm/rules.scm"

bspc monitor -d 1 2 3 4 5 6 7 8 9

bspc config border_width   5
# bspc config window_gap     30
# bspc config left_padding   30
# bspc config bottom_padding 30
# bspc config right_padding  30
bspc config window_gap     0
bspc config left_padding   0
bspc config bottom_padding 0
bspc config right_padding  0
bspc config top_padding    0;

bspc config focused_border_color "#928374"
bspc config normal_border_color  "#504945"

bspc rule -a Nitrogen    state=floating
bspc rule -a Screenkey   manage=off
bspc rule -a Pavucontrol state=floating
bspc rule -a Pcmanfm     state=floating
bspc rule -a Zathura     state=tiled
bspc rule -a Civ5XP      state=fullscreen

killall st; st -T st-float -e tmux &

rules

:header-args+: :tangle ~/.config/bspwm/rules.scm :shebang “#!/usr/bin/csi -s”
(import (chicken io)
        (chicken process)
        (chicken process-context)
        (chicken string))

(define args (command-line-arguments))
(define wid (car args))
(define class (cadr args))
(define instance (caddr args))
(define title (string-chomp (call-with-input-pipe
                             (string-append "xtitle " wid)
                             (lambda (out) (read-string #f out)))))

(cond ((substring-index "emacs" instance)
       (display "state=tiled desktop=^2"))
      ((substring-index "_erc__floating_" instance)
       (with-output-to-file "/tmp/erc-float"
         (lambda () (display wid) (newline)))
       (display "state=floating hidden=on sticky=on")
       (system (string-append "wmctrl -i -r " wid " -e '0,120,770,1085,560'")))
      ((substring-index "_eshell__floating_" instance)
       (with-output-to-file "/tmp/esh-float"
         (lambda () (display wid) (newline)))
       (display "state=floating hidden=on sticky=on")
       (system (string-append "wmctrl -i -r " wid " -e '0,0,40,2550,540'")))
      ((equal? instance "st-256color")
       (when (equal? title "htop")
         (display "state=floating"))
       (when (equal? title "st-float")
         (with-output-to-file "/tmp/st-float"
           (lambda () (display wid) (newline)))
         (display "state=floating hidden=on sticky=on")
         (system (string-append "wmctrl -i -r " wid " -e '0,1350,770,1085,540'")))))

sxhkdrc

:header-args+: :tangle ~/.config/sxhkd/sxhkdrc
#
# wm independent hotkeys
#

# terminal emulator
super + Return
    emacsclient --eval '(d/eshell-floating)' && \
    id=$(</tmp/esh-float) && \
    bspc node $id --flag hidden && \
    bspc node -f $id

super + space
    emacsclient --eval '(d/erc-floating)' && \
    id=$(</tmp/erc-float) && \
    bspc node $id --flag hidden && \
    bspc node -f $id

super + d
    j4-dmenu-desktop


super + z
    id=$(</tmp/st-float) && \
    bspc node $id --flag hidden && \
    bspc node -f $id
# program launcher

alt + space
    dmenu_run

# passwords
super + p
    passmenu

# make sxhkd reload its configuration files:
super + Escape
    pkill -USR1 -x sxhkd

#
# bspwm hotkeys
#

# quit bspwm normally
super + shift + period
    wm-exit-rofi

super + shift + p
   ~/.config/bspwm/bspwmrc

# close and kill
super + {_,shift + }apostrophe
    bspc node -{c,k}

# alternate between the tiled and monocle layout
super + m
    bspc desktop -l next

# if the current node is automatic, send it to the last manual, otherwise pull
# the last leaf
super + y
    bspc query -N -n focused.automatic && \
    bspc node -n last.!automatic || bspc node last.leaf -n focused

# swap the current node and the biggest node
super + g
    bspc node -s biggest.local

# rotate
super + r
    bspc node @/ -R 90

super + R
    bspc node @/ -R -90
#
# state/flags
#

# set the window state
super + {period,u,f}
    bspc node -t {tiled,~fullscreen,~floating}

# set the node flags
super + ctrl + {x,y,z}
    bspc node -g {locked,sticky,private}


# focus/swap
#

# focus the node in the given direction
super + {_,shift + }{h,t,n,s}
    bspc node -{f,s} {west,south,north,east}

# focus the node for the given path jump
# super + {p,b,comma,period}
#     bspc node -f @{parent,brother,first,second}

# focus the next/previous node in the current desktop
super + {_,shift + }c
    bspc node -f {next,prev}.local

# focus the next/previous desktop in the current monitor
super + bracket{left,right}
    bspc desktop -f {prev,next}.local

# focus the last node/desktop
super + {grave,Tab}
    bspc {node,desktop} -f last

# focus the older or newer node in the focus history
super + {o,i}
    bspc wm -h off; \
    bspc node {older,newer} -f; \
    bspc wm -h on

# focus or send to the given desktop
super + {_,shift + }{1-9,0}
    bspc {desktop -f,node -d} '^{1-9,10}'

#
# preselect
#

# preselect the direction
super + ctrl + {h,t,n,s}
    bspc node -p {west,south,north,east}

# preselect the ratio
super + ctrl + {1-9}
    bspc node -o 0.{1-9}

# move into preselection
super + l
    bspc node -n last.!automatic.local

# cancel the preselection for the focused node
super + ctrl + space
    bspc node -p cancel

# cancel the preselection for the focused desktop
super + ctrl + shift + space
    bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel

#
# move/resize
#

# expand a window by moving one of its side outward
super + alt + {h,t,n,s}
    bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}

# contract a window by moving one of its side inward
super + alt + shift + {h,t,n,s}
    bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}

# move a floating window
super + {Left,Down,Up,Right}
    bspc node -v {-20 0,0 20,0 -20,20 0}

XF86MonBrightnessUp
    xbacklight -inc 5
XF86MonBrightnessDown
    xbacklight -dec 5
# Print
#     scrot ~/pic/scrot/%Y-%m-%d_%H:%M:%S.png && notify-send "Screenshot!"
# XF86LaunchB
#     scrot -s ~/Pictures/Screenshots/%Y-%m-%d_%H:%M:%S.png
# shift + XF86LaunchB
#     scrot -ub ~/Pictures/Screenshots/%Y-%m-%d_%H:%M:%S.png
# XF86KbdBrightnessDown
#     ~/bin/blocks/kbdbacklight -
# XF86KbdBrightnessUp
#     ~/bin/blocks/kbdbacklight +
# XF86AudioPrev
#     playerctl previous
# XF86AudioNext
#     playerctl next
# XF86AudioPlay
#     playerctl play-pause
super + F1
    playerctl play-pause
super + F2
    playerctl previous
super + F3
    playerctl next
XF86AudioMute
    amixer -D pulse sset Master toggle
XF86AudioLowerVolume
    amixer -D pulse sset Master 5%-
XF86AudioRaiseVolume
    amixer -D pulse sset Master 5%+
XF86AudioMicMute
    amixer set Capture toggle
XF86Display
    slock

compton.conf

:header-args+: :tangle ~/.config/compton.conf
# Shadow
shadow = true;
# no-dnd-shadow = true;
# no-dock-shadow = true;
clear-shadow = true;
detect-rounded-corners = true;
shadow-radius = 10;
# shadow-offset-x = -96;
# shadow-offset-y = -60;
# shadow-opacity = .8;
shadow-offset-x = -15;
shadow-offset-y = -15;
shadow-opacity = .8;
shadow-ignore-shaped = false;
shadow-exclude = [
    "name = 'Notification'",
    "name = 'screenkey'",
# workaround for conky until it provides window properties:
    "override_redirect = 1 && !WM_CLASS@:s",
#   "class_g ?= 'Dunst'",
# disable shadows for hidden windows:
    "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
    "_GTK_FRAME_EXTENTS@:c",
# disables shadows on sticky windows:
#   "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'",
# disables shadows on i3 frames
    "class_g ?= 'i3-frame'"
];

# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;

menu-opacity = 0.95;
# inactive-opacity = 0.8;
inactive-opacity = 1;
active-opacity = 1;
alpha-step = 0.01;
inactive-dim = .4;
blur-background = false;
blur-kern = "3x3box";

fading = true;
fade-delta = 3;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-exclude = [ ];

backend = "xrender";
mark-wmwin-focused = true;
mark-ovredir-focused = false;
detect-client-opacity = true;
unredir-if-possible = true;
refresh-rate = 0;
vsync = "none";
dbe = false;
paint-on-overlay = true;
focus-exclude = [
"class_g = 'Cairo-clock'",
"_NET_WM_NAME@:s = 'rofi'",
"_NET_WM_NAME@:s = 'screenkey'",
"name *?= 'i3lock'"
];

detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
glx-copy-from-front = false;
glx-swap-method = "undefined";

opacity-rule = [
"100:class_g = 'screenkey'",
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"100:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'"
];

wintypes :
{
  tooltip :
  {
    fade = true;
    shadow = false;
    opacity = 0.85;
    focus = true;
  };
  fullscreen :
  {
    fade = true;
    shadow = false;
    opacity = 1;
    focus = true;
  };
};

darktooth.theme

:header-args+: :tangle ~/.config/cmus/darktooth.themeA theme for cmus based on darktooth.
# Directory colors
set color_win_dir=108

# Normal text
set color_win_fg=default

# Window background color.
set color_win_bg=0

# Command line color.
set color_cmdline_bg=0
set color_cmdline_fg=6

# Color of error messages displayed on the command line.
set color_error=lightred

# Color of informational messages displayed on the command line.
set color_info=lightgreen

# Color of the separator line between windows in view (1).
set color_separator=246

# Color of window titles (topmost line of the screen).
set color_win_title_bg=234
set color_win_title_fg=12

# Status line color (shows remaining time and playback options).
set color_statusline_bg=0
set color_statusline_fg=10

# Color of currently playing track.
set color_win_cur=009

# Color of the line displaying currently playing track.
set color_titleline_bg=234
set color_titleline_fg=12

# Color of the selected row which is also the currently playing track in active window.
set color_win_cur_sel_bg=237
set color_win_cur_sel_fg=9

# Color of the selected row which is also the currently playing track in inactive window.
set color_win_inactive_cur_sel_bg=236
set color_win_inactive_cur_sel_fg=9

# Color of selected row in active window.
set color_win_sel_bg=237
set color_win_sel_fg=default

# Color of selected row in inactive window.
set color_win_inactive_sel_bg=236
set color_win_inactive_sel_fg=default

dunstrc

:header-args+: :tangle ~/.config/dunst/dunstrc
# -*- mode: conf -*-
[global]
font = Iosevka Term 9

frame_width = 5
frame_color = "#504945"
# Allow a small subset of html markup:
#   <b>bold</b>
#   <i>italic</i>
#   <s>strikethrough</s>
#   <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the
# message.
markup = yes

# The format of the message.  Possible variables are:
#   %a  appname
#   %s  summary
#   %b  body
#   %i  iconname (including its path)
#   %I  iconname (without its path)
#   %p  progress value if set ([  0%] to [100%]) or nothing
# Markup is allowed
format = "<b>%s</b> %p\n%b"

# Sort messages by urgency.
sort = yes

# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes

# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left

# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with "word_wrap".
# Set to 0 to disable.
bounce_freq = 5


# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60

# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes

# Ignore newlines '\n' in notifications.
ignore_newline = no


# The geometry of the window:
#   [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels.  If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like).  If width is 0, the window expands to the longest
# message displayed.  A positive x is measured from the left, a
# negative from the right side of the screen.  Y is measured from
# the top and down respectevly.
# The width can be negative.  In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "700x5-30+70"

# Shrink window if it's smaller than the width.  Will be ignored if
# width is 0.
shrink = yes

# The transparency of the window.  Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
# transparency = 15

# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# default 120
idle_threshold = 120

# Which monitor should the notifications be displayed on.
monitor = 0

# Display notification on focused monitor.  Possible modes are:
#   mouse: follow mouse pointer
#   keyboard: follow window with keyboard focus
#   none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse

# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes

# Maximum amount of notifications kept in history
history_length = 20

# Display indicators for URLs (U) and actions (A).
show_indicators = yes

# The height of a single line.  If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 0

# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 1

# Padding between text and separator.
# padding = 8
padding = 8

# Horizontal padding.
horizontal_padding = 10

# Define a color for the separator.
# possible values are:
#  * auto: dunst tries to find a color fitting to the background;
#  * foreground: use the same color as the foreground;
#  * frame: use the same color as the frame;
#  * anything else will be interpreted as a X color.
separator_color = #454947

# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false

# dmenu path.
# dmenu = /usr/bin/rofi -dmenu -p dunst:

# Browser for opening urls in context menu.
browser = firefox-nightly

# Align icons left/right/off
# icon_position = left

# Paths to default icons.
# icon_folders = /usr/share/icons/Adwaita/48x48/status/:/usr/share/icons/Adwaita/48x48/devices/

# Limit icons size.
max_icon_size=128

[shortcuts]

# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.

# Close notification.
close = mod1+space

# Close all notifications.
# close_all = ctrl+shift+space
close_all = ctrl+mod1+space

# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1".
history = ctrl+mod4+h

# Context menu.
context = ctrl+mod1+c

[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#282828"
foreground = "#FDF4C1"
timeout = 10

[urgency_normal]
background = "#282828"
foreground = "#FDF4C1"
timeout = 10

[urgency_critical]
background = "#D62929"
foreground = "#F9FAF9"
timeout = 0


# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
#   script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.

#[espeak]
#    summary = "*"
#    script = dunst_espeak.sh

#[script-test]
#    summary = "*script*"
#    script = dunst_test.sh

#[ignore]
#    # This notification will not be displayed
#    summary = "foobar"
#    format = ""

#[signed_on]
#    appname = Pidgin
#    summary = "*signed on*"
#    urgency = low
#
#[signed_off]
#    appname = Pidgin
#    summary = *signed off*
#    urgency = low
#
#[says]
#    appname = Pidgin
#    summary = *says*
#    urgency = critical
#
#[twitter]
#    appname = Pidgin
#    summary = *twitter.com*
#    urgency = normal
#
#[Claws Mail]
#    appname = claws-mail
#    category = email.arrived
#    urgency = normal
#    background = "#2F899E"
#    foreground = "#FFA247"
#
#[mute.sh]
#     appname = mute
#     category = mute.sound
#     script = mute.sh
#
#[JDownloader]
#    appname = JDownloader
#    category = JD
#    background = "#FFA247"
#    foreground = "#FFFFFF"
#
#[newsbeuter]
#    summary = *Feeds*
#    background = "#A8EB41"
#    foreground = "#FFFFFF"
#
[irc]
appname = weechat
timeout = 0
background = "#0033bb"
foreground = "#dddddd"
#
[weechat hl]
appname = weechat
category = weechat.HL
background = "#FF5C47"
foreground = "#FFFFFF"
#
[weechat pn]
appname = weechat
category = weechat.PM
background = "#D53B84"
foreground = "#FFFFFF"
#
#[CMUS]
#    appname = CMUS
#    category = cmus
#    background = "#6C4AB7"
#    foreground = "#FFE756"
#
#
#     background = "#30AB70"
#     foreground = "#F67245"
#
# vim: ft=cfg

fish

config.fish

:header-args+: :tangle ~/.config/fish/config.fish :comments no

defaults

if [ $TERM = "eterm-256color" ];
    set fish_term24bit 0
else;
    if [ $TERM = "linux" ];
        set oldterm "linux"
    end
    set -gx TERM xterm-256color
    if [ "$oldterm" = "linux" ];
        set -g fish_color_autosuggestion 282828
    end
end

prompt

disable vi prompt
function fish_mode_prompt
  # NOOP - Disable vim mode indicator
end
git prompt
set __fish_git_prompt_show_informative_status 1
set __fish_git_prompt_hide_untrackedfiles 1
set __fish_git_prompt_showupstream "informative"
set __fish_git_prompt_color_branch brgreen
set __fish_git_prompt_color_dirtystate brred
set __fish_git_prompt_color_stagedstate brblue
set __fish_git_prompt_color_untrackedfiles $fish_color_normal
set __fish_git_prompt_color_cleanstate brgreen
set __fish_git_prompt_color_invalidstate brred
set __fish_git_prompt_color_upstream brmagenta

# # Status Chars
set __fish_git_prompt_char_untrackedfiles ""
set __fish_git_prompt_char_dirtystate ""
set __fish_git_prompt_char_stagedstate ''
set __fish_git_prompt_char_upstream_ahead ''
set __fish_git_prompt_char_upstream_behind ''
set __fish_git_prompt_char_upstream_prefix ""
set __fish_git_prompt_char_conflictedstate ""
set __fish_git_prompt_char_cleanstate ""
prompt
set __fish_prompt_normal (set_color normal)
function fish_prompt --description 'Write out the prompt'
    set -l last_status $status
    printf '%s' (string trim (__fish_vcs_prompt))
    set_color BDAE93
    printf '%s ' (prompt_pwd)
    set_color DD6F48
    echo -n "λ "
    set_color normal
end

alias

# alias ls='exa --group-directories-first --sort=extension'
alias rg="rg -M 200 -i -g '!archive-contents' --colors 'line:style:bold' --colors 'path:style:bold'"
alias fzf='fzf --reverse'

fishfile

:header-args+: :tangle ~/.config/fish/fishfile :comments noExtensions
done
getopts
z
omf/plugin-foreign-env
decors/fish-colored-man

functions

fish_user_key_bindings.fish

:header-args+: :tangle ~/.config/fish/functions/fish_user_key_bindings.fish :comments no
function fish_user_key_bindings
    fish_vi_key_bindings
    bind -M insert \cp cool-ps
    bind -M insert \cr cool-history
    bind -M insert \cc kill-whole-line force-repaint
    bind -M normal \e insert-sudo
    bind -M insert \c_ "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end"
    for mode in insert default visual
        bind -M $mode \cf forward-char
    end
end

fuck.fish

:header-args+: :tangle ~/.config/fish/functions/fuck.fish :comments no
function fuck -d "Correct your previous console command"
  set -l fucked_up_command $history[1]
  env TF_ALIAS=fuck PYTHONIOENCODING=utf-8 thefuck $fucked_up_command | read -l unfucked_command
  if [ "$unfucked_command" != "" ]
    eval $unfucked_command
    builtin history delete --exact --case-sensitive -- $fucked_up_command
    builtin history merge ^ /dev/null
  end
end

cool-ps.fish

:header-args+: :tangle ~/.config/fish/functions/cool-ps.fish :comments no
function cool-ps
    ps axco user,pid,%cpu,%mem,start,time,command | \
    tail -n +2 | \
    fzf --reverse --prompt "[ps] " | \
    awk '{print $2}' | \
    read -l pid

    if test $pid
        commandline -i $pid
    end
end

cool-history.fish

:header-args+: :tangle ~/.config/fish/functions/cool-history.fish :comments no
function cool-history
    history | fzf --reverse --prompt "[history] " -q (commandline -b) | read -l hist_item
    if test $hist_item
        commandline -r $hist_item
    end
end

insert-sudo.sh

:header-args+: :tangle ~/.config/fish/functions/insert-sudo.fish :comments no
function insert-sudo
    set -l pos commandline -C
    commandline -C 0
    commandline -i "sudo "
    commandline -C $pos
end

universal vars

set -U man_bold -o brred
set -U man_underline -o brgreen
set -U man_standout bryellow -b blue
set -U __done_min_cmd_duration 10000
set -U fish_color_autosuggestion 7C6F64
set -U fish_color_command brgreen
set -U fish_color_param normal
set -U fish_color_comment 7C6F64
set -U fish_greeting
set -U fish_cursor_insert line
set -U fish_cursor_replace_one underscore

fonts.conf

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/.config/fontconfig/fonts.conf”) :comments no
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>Iosevka Term</family>
    <default>
      <family>monospace</family>
    </default>
    <prefer>
      <family>FontAwesome</family>
    </prefer>
  </alias>
  <match>
    <test compare="eq" name="family">
      <string>sans-serif</string>
    </test>
    <test compare="eq" name="family">
      <string>monospace</string>
    </test>
    <edit mode="delete" name="family"/>
  </match>
</fontconfig>

git

gitconfig

:header-args+: :tangle ~/.gitconfigI know, it probably doesn’t make sense to keep my gitconfig here.

media

[filter "media"]
    required = true
    clean = git media clean %f
    smudge = git media smudge %f

user

[user]
    name = dieggsy
    email = dieggsy@protonmail.com
    signingkey = 1DF81CB1

filter

[filter "lfs"]
    clean = git-lfs clean %f
    smudge = git-lfs smudge %f
    required = true

core

[core]
    editor = emacsclient -t
    excludesfile = ~/.gitignore
    pager = "less"

gpg

[gpg]
    program = gpg2

alias

[alias]
    eclipse = !git fetch upstream && git rebase -s recursive -X theirs upstream/master
    gconfig = config --global
    lconfig = config --local
    mypull = pull -s recursive -X ours
    myrebase = rebase -s recursive -X theirs
    optimize = "!f() { git reflog expire --all --expire=now && git gc --prune=now --aggressive; }; f"
    plog = log --graph --pretty=format:'%C(bold black)%h%Creset - %<(50,trunc)%C(bold normal)%s%Creset %<(20)%C(bold green)%an%Creset %<(15)%C(bold red)%cr%Creset%C(bold yellow)%d%Creset' --abbrev-commit
    plog-nocolor = log --graph --pretty=format:'%h - %<(50,trunc)%s %<(20)%an %<(15)%cr%d' --abbrev-commit
    update-from-upstream = pull --rebase -s recursive -X theirs upstream/master
    aliases = config --get-regexp '^alias\\.'
    a = add
    s = status
    sl = status --long
    c = checkout
    cb = checkout -b
    b = branch
    r = rebase
    p = pull
    pr = pull --rebase
    ps = push
    psf = push --force

http

[http]
    postBuffer = 524288000

color

[color]
    ui = auto
[color "status"]
    added = green bold
    changed = red bold
    untracked = red bold
[color "branch"]
    current = green bold
    remote = magenta bold
[color "diff"]
    new = green bold
    old = red bold

http

[push]
    followTags = true

status

[status]
    showUntrackedFiles = all
    short=true
    branch=true

commit

[commit]
    gpgsign = true

push

[push]
    followTags = true

github

[github]
	user = dieggsy

gitignore

:header-args+: :tangle ~/.gitignore
.DS\_Store
*.pyc
__pychache__

networkmanager_dmenu

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/.config/networkmanager-dmenu/config.ini”)
[dmenu]
l = 10
rofi_highlight=True
# # Note that dmenu_command can contain arguments as well like `rofi -width 30`
# # Rofi and dmenu are set to case insensitive by default `-i`
# l = number of lines to display, defaults to number of total network options
# fn = font string
# nb = normal background (name, #RGB, or #RRGGBB)
# nf = normal foreground
# sb = selected background
# sf = selected foreground
# b =  (just set to empty value and menu will appear at the bottom
# m = number of monitor to display on
# p = Custom Prompt for the networks menu
# pinentry = Pinentry command

[editor]
terminal = termite
gui_if_available = True
# terminal = <name of terminal program>
# gui_if_available = <True or False>

polybar

:header-args+: :tangle ~/.config/polybar/config
[colors]
background = #282828
foreground = #FDF4C1
black = ${colors.background}
white = ${colors.foreground}
green = #B8BB26
red = #FB4933
yellow = #FABD2F
blue = #83A598
purple = #D3869B
aqua = #8EC07C
orange = #FE8019
cyan = #3FD7E5
sienna = #DD6F48
light4 = #A89984
dark2 = #504945
alert = ${colors.red}

[bar/simple]
monitor = eDP-1
width = 2560
height = 47
fixed-center = true

dpi = 172
background = ${colors.background}
foreground = ${colors.foreground}

module-margin=0
separator=

font-0 = Iosevka Term:size=10;3
font-1 = FontAwesome:size=10;3
font-2 = Weather Icons:size=10;3

modules-left = bspwm date network bluez
modules-right = weather mem cpu pulse battery

wm-restack = bspwm

cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true

[module/xwindow]
type = internal/xwindow
label = %{F#BDAE93}%title:0:30:...%%{F-}

[module/bspwm]
type = internal/bspwm
format =<label-state>
wrapping-scroll = false
enable-click = false
enable-scroll = false
reverse-scroll = false

pin-workspaces = true

label-focused = %name%
label-focused-padding = 1
label-focused-foreground = #BDAE93
label-focused-background = ${colors.dark2}

label-occupied =

label-urgent-background = ${colors.alert}
label-urgent-foreground = ${colors.black}
label-urgent-padding = 1

label-empty =

[module/xbacklight]
type = internal/backlight
card = intel_backlight
format-background = ${colors.dark2}
format-foreground = #BDAE93
format-padding = 1
format =  <label>
label = %percentage%

[module/network]
click-left = networkmanager_dmenu
type = custom/script
exec = ~/bin/blocks/networkmanager
format-background = ${colors.dark2}
format-foreground = #BDAE93
format-padding = 1
interval = 2

[module/bluetooth]
type = custom/script
exec = rfkill list bluetooth | grep yes > /dev/null && echo '' || echo 
format-foreground = #BDAE93
format-padding = 1

[module/bluez]
click-left = blueman-manager
type = custom/script
exec = ~/bin/blocks/bluez
format-foreground = #BDAE93
format-padding=1
interval = 1

[module/date]
type = custom/script
exec = date +'%%{F#665C54} %a %Y-%m-%d%%{F-} %%{F#BDAE93}%H:%M%%{F-}'
interval = 60
format-padding=1
click-left = notify-send "$(cal --color=never | cut -c -20 | head -n-1)"

[module/bat0]
type = internal/battery
format-full-background = ${colors.dark2}
format-full-foreground = #BDAE93
format-full-padding = 1
format-charging-background = ${colors.dark2}
format-charging-foreground = #BDAE93
format-charging-padding = 1
format-discharging-background = ${colors.dark2}
format-discharging-foreground = #BDAE93
format-discharging-padding = 1
battery = BAT0
adapter = ADP1
full-at = 100

format-full = %{A1:notify-send "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0)":} <label-full>%{A}
format-charging = %{A1:notify-send "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0)":}<animation-charging> <label-charging>%{A}
format-discharging = %{A1:notify-send "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0)":}<ramp-capacity> <label-discharging>%{A}

label-full = %percentage%
label-charging = %percentage%
label-discharging = %percentage%

ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 

animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-framerate = 750

[module/cpu]
type = internal/cpu
format-background = ${colors.dark2}
format-foreground = #BDAE93
format-padding = 1
format = <label>
label = P %percentage:2%%

[module/mem]
type = internal/memory
format = <label>
label = M %percentage_used:2%%
format-foreground = #BDAE93
format-padding=1

[module/weather]
type = custom/script
exec = ~/bin/blocks/darksky
; format-foreground = #BDAE93
format-background = ${colors.dark2}
format-foreground = #BDAE93
format-padding = 1
click-left = xdg-open https://darksky.net
interval = 120
label-font = 3

[module/battery]
type=custom/script
tail=true
exec = ~/bin/blocks/t480-battery
format-foreground = #BDAE93
format-background = ${colors.dark2}
format-padding = 1


[module/cmus]
type = custom/script
exec = ~/bin/blocks/mpris cmus
tail = true
click-left = playerctl --player=cmus play-pause
scroll-up = playerctl --player=cmus previous
scroll-down = playerctl --player=cmus next
format-prefix = " "
format-prefix-foreground = ${colors.green}

[module/spotify]
type = custom/script
exec = ~/bin/blocks/mpris spotify
tail = true
format-prefix = " "
format-prefix-foreground = ${colors.green}
click-left = playerctl --player=spotify play-pause
scroll-up = playerctl --player=spotify previous
scroll-down = playerctl --player=spotify next

[module/dropbox]
type = custom/script
exec = ~/bin/blocks/dropbox
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.cyan}

[module/github]
type = custom/script
exec = ~/bin/blocks/github-unread
interval = 10
format-prefix = " "
click-left = xdg-open https://github.com/notifications

[module/volume]
type = custom/script
exec = ~/bin/blocks/amixer
tail = true
format-foreground = #BDAE93
format-padding=1

[module/pulse]
type=internal/pulseaudio
format-volume-foreground = #BDAE93
format-muted-foreground=#BDAE93
format-volume = <ramp-volume> <label-volume>
format-muted =  <label-muted>
label-volume = %percentage%
use-ui-max = false
label-muted =  %percentage%
ramp-volume-0 = 
ramp-volume-1 = 
format-volume-padding=1
format-muted-padding=1

[module/inbox-reddit]
type = custom/script
exec = ~/bin/blocks/reddit-unread
interval = 10
click-left = xdg-open https://reddit.com/message/unread
format-prefix = " "
format-prefix-foreground = #FF3F18

[module/xkb]
type = custom/ipc
hook-0 = ~/bin/blocks/xkb -display
initial = 1
format-prefix = " "

[settings]
screenchange-reload = true

profile

:header-args+: :tangle ~/.profile
[ -d $HOME/.nix-profile ] && source ~/.nix-profile/etc/profile.d/nix.sh
if [ -d $HOME/.guix-profile ]; then
    export PATH=$HOME/.guix-profile/bin:$PATH
    export INFOPATH=$HOME/.guix-profile/share/info:$INFOPATH
fi

[ -d $HOME/.local/bin ] && export PATH=$HOME/.local/bin:$PATH
[ -d $HOME/.pyenv/bin ] && export PATH=$HOME/.pyenv/bin:$PATH
[ -d $HOME/.pyenv/shims ] && export PATH=$HOME/.pyenv/shims:$PATH
[ -d $HOME/bin ] && export PATH=$HOME/bin:$PATH
[ -d $HOME/.evm/bin ] && export PATH=$HOME/.evm/bin:$PATH
[ -d $HOME/go ] && export GOPATH=$HOME/go && export PATH=$GOPATH/bin:$PATH

[ -d $HOME/.guix-profile/lib/locale/ ] && export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale

[ -d $HOME/dotfiles/guix/ ] && export GUIX_PACKAGE_PATH="$HOME/dotfiles/guix/packages"

[ -d /usr/lib/ccache/ ] && export PATH=/usr/lib/ccache/bin:$PATH
export XDG_DATA_DIRS="$HOME/.local/share:$HOME/.nix-profile/share:/usr/local/share:/usr/share"
export CHICKEN_REPOSITORY=~/.local/lib/chicken/8

gpgconf --launch gpg-agent
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpg-connect-agent updatestartuptty /bye >&/dev/null

# if [ "$TERM" = "linux" ]; then
#     exec fish
# fi

pythonrc.py

:header-args+: :tangle ~/.pythonrc.py :padline no
# -*- coding: utf-8 -*-

from __future__ import print_function, unicode_literals, division

try:
    def progBar(i, total, length=50, kind=None):
        """A nice progress bar to use with for loops."""
        i += 1
        n = int(i*length/total)
        percent = i/total*100
        frame = ("{0:6.2f}% |{1}{2}|".format(percent, ''*n, ' '*(length-n))
                if kind is None else
                "{0:6.2f}% [{1}{2}]".format(percent, str(kind)*n, ' '*(length-n)))
        endchar = ('\r' if i < total else ' Done!\n')
        print(frame, end=endchar)
except:
    pass

# def write_csv(path, rows):
#     "Write a list of iterables to a CSV, I think"
#     with open(path, 'w') as f:
#         writer = csv.writer(f)
#         writer.writerows(rows)

rofi

config

:header-args+: :tangle ~/.config/rofi/config
rofi.theme: ~/.config/rofi/darktooth.rasi
rofi.modi: window,run,ssh,drun,combi
rofi.combi-modi: window,drun,run
rofi.dpi: 172

darktooth.rasi

:header-args+: :tangle ~/.config/rofi/darktooth.rasi
* {
    backgroundcolor: #282828;
    bg1: #504945;
    backgroundcoloralternate: #282828;
    separatorcolor: #504945;
    scrollbarcolor: #504945;
    foregroundcolor: #ebdbb2;
    foregroundcolorinverse: #ebdbb2;
    selectioncolor: #504945;

    font: "Iosevka Term 10";
    border-color: @separatorcolor;
    background-color: @backgroundcolor;
    text-color: @foregroundcolor;
    margin: 0;
    margin-bottom: 0;
    margin-top: 0;
    spacing: 0;
}

#listview {
    spacing: 0;
    scrollbar: true;
    margin: 0;
    dynamic: true;
    padding-top: 500;
    lines: 10;
}

#window {
    background-color: @backgroundcolor;
    border-color: @separatorcolor;
    border-color: #928374;
    border: 5;
    border-radius: 0;
    width: 800;
}

#mainbox {
    border: 0;
    padding: 0;
    background-color: @backgroundcoloralternate;
}

#element {
    padding: 16;
    border: 0 0 1 0;
    border-color: @separatorcolor;
    background-color: @backgroundcoloralternate;
}

#message {
    format: center;
    padding: 16 4ch;
    border: 0 0 1 0;
    border-color: @separatorcolor;
    background-color: @backgroundcoloralternate;
}

#textbox {
    text-color: #7C6F64;
}

#element.selected.normal {
    background-color: @selectioncolor;
    text-color: @foregroundcolorinverse;
    border-radius: 0;

    border: 0 0 1 0;
    border-color: @separatorcolor;
}

#element.alternate.normal {
    background-color: @backgroundcoloralternate;
}

#element.normal.active {
    background-color: #7c6f64;
}

#element.alternate.active {
    background-color: #7c6f64;
}

#element.selected.active {
    background-color: @selectioncolor;
    text-color: @foregroundcolorinverse;
    border-radius: 0;

    border: 0 0 1 0;
    border-color: @separatorcolor;
}

#inputbar {
    border: 0 solid 0 solid 1 solid 0 solid;
    margin: 0;
    spacing: 0;
    border-color: @separatorcolor;
}

#prompt {
    padding: 16;
    background-color: @backgroundcoloralternate;
    border: 0 1 0 0;
}

#entry {
    padding: 16;
}

#scrollbar {
    border: 0;
    width: 0;
    handle-color: @scrollbarcolor;
    handle-width: 0;
    background-color: @backgroundcoloralternate;
}

/* vim: set ft=css : */

rsync-exclude

:header-args+: :tangle ~/.rsync-exclude :comments no
.eve
downloads
music
.cache
.mbed
.platformio
Dropbox
org
.dropbox
.dropbox-dist
syncthing
dotfiles/emacs.d/straight/repos
dotfiles/emacs.d/straight/build
pkg/emacs
.local/share/Steam
.local/share/Aspyr
.config/unity3d
.config/spotify

termite

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/.config/termite/config”)
[options]
font = iosevka term 9.5
allow_bold=0
cursor_shape=ibeam
cursor=#FDF4C1
[colors]
background=#282828
foreground=#FDf4c1
color0=#282828
color1=#9d1306
color2=#79740e
color3=#b57614
color4=#076678
color5=#8f3f71
color6=#00a7af
color7=#bdae93
color8=#686868
color9=#fb4933
color10=#b8bb26
color11=#fabd2f
color12=#83a598
color13=#d3869b
color14=#3fd7e5
color15=#fdf4c1

tmux.conf

:header-args+: :tangle ~/.tmux.conf

Initialize

set -s escape-time 0
set -g default-command /usr/bin/fish
# set -g default-terminal "xterm-256color"
# set -ga terminal-overrides ",screen-256color:Tc"
# set -g lock-after-time 300
# set -g lock-command "/usr/bin/cmatrix -B"
set -g update-environment -r
set -g set-titles on
set -g set-titles-string '#W'
# set-option -g set-titles-string '#H:#S.#I.#P #W #T'
set -ga update-environment ' SSH_AUTH_SOCK'

Prefix

unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

Bindings

bind r source-file ~/.tmux.conf

set -g mouse on
set-window-option -g xterm-keys on
set-option -g status-keys vi
setw -g mode-keys vi
bind-key x kill-pane
bind-key q detach-client
bind-key Q detach-client
bind-key Escape copy-mode
bind-key [ copy-mode
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe 'xclip -i -sel c' \; send -X clear-selection
set-option -s set-clipboard off
bind -n C-k clear-history

bind -n M-F11 \
    setw -g window-status-current-format ' #I#[fg=colour237]:#[fg=colour007]#W#[fg=colour244]#F '\; \
    setw -g window-status-current-fg colour13\; \
    setw -g window-status-current-bg colour235\; \
    setw -g window-status-current-attr none
bind -n M-F12 \
    setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour015]#W#[fg=colour6]#F '\; \
    setw -g window-status-current-fg colour81\; \
    setw -g window-status-current-bg colour238\; \
    setw -g window-status-current-attr bold

bind -n S-up \
    send-keys M-F12\; \
    setw -g window-status-current-format ' #I#[fg=colour237]:#[fg=colour007]#W#[fg=colour244]#F '\; \
    setw -g window-status-current-fg colour13\; \
    setw -g window-status-current-bg colour235\; \
    setw -g window-status-current-attr none\; \
    set -qg prefix C-b
bind -n S-down \
    send-keys M-F11\; \
    setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour015]#W#[fg=colour6]#F '\; \
    setw -g window-status-current-fg colour81\; \
    setw -g window-status-current-bg colour238\; \
    setw -g window-status-current-attr bold\; \
    set -qg prefix C-a

Windows/Panes

setw -g monitor-activity on
set-option -g allow-rename off
set -g history-limit 5000
set -g base-index 1
set -g pane-base-index 1
set-option -g renumber-windows on

bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
unbind '"'
unbind %

bind { swap-window -t -1
bind } swap-window -t +1
bind \ next-window

bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R
bind o swap-pane -D
bind < split-window -h \; choose-window 'kill-pane ; join-pane -hs %%'
bind > break-pane -d
bind ^ split-window -v \; choose-window 'kill-pane ; join-pane -vs %%'
bind = select-layout even-horizontal
bind + select-layout even-vertical

Bell

set-option -g bell-action any
set-option -g visual-bell off

Theming

# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred

## Status bar design
# status line
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2

# messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black

#window mode
setw -g mode-bg colour6
setw -g mode-fg colour0

# Info on left (I don't have a session display for now)
set -g status-left ''

# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-window-option -g aggressive-resize on
set-option -g bell-action none

set -g default-terminal "screen-256color"

# The modes {
setw -g clock-mode-colour colour135
setw -g mode-attr none
setw -g mode-fg colour9
setw -g mode-bg colour237

# }
# The panes {

set -g pane-border-bg colour0
set -g pane-border-fg colour238
set -g pane-active-border-bg colour0
set -g pane-active-border-fg colour6

# }
# The statusbar {

set -g status-position bottom
set -g status-bg colour234
set -g status-fg colour137
set -g status-attr dim
set -g status-left ''
# set -g status-right '#[fg=colour233,bg=colour241,bold] %Y-%d-%m #[fg=colour233,bg=colour245,bold] %H:%M '
# set -g status-right-length 50
# set -g status-left-length 20
set -g status-right ''

setw -g window-status-current-fg colour81
setw -g window-status-current-bg colour238
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour015]#W#[fg=colour6]#F '

setw -g window-status-fg colour13
setw -g window-status-bg colour235
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour007]#W#[fg=colour244]#F '

setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1

# }
# The messages {

set -g message-attr bold
set -g message-fg colour232
set -g message-bg colour166

# }

osx-specific

set-option -g default-command "reattach-to-user-namespace -l zsh"
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"

Plugins

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-urlview'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @continuum-restore 'on'

set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @sidebar-tree-command 'exa -TL2 --color=always'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

user-dirs.dirs

:header-args+: :tangle ~/.config/user-dirs.dirs :comments nil
XDG_DESKTOP_DIR="$HOME/desktop"
XDG_DOCUMENTS_DIR="$HOME/doc"
XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pic"
XDG_PUBLICSHARE_DIR="$HOME/public"
XDG_TEMPLATES_DIR="$HOME/templates"
XDG_VIDEOS_DIR="$HOME/vid"

xorg.conf.d

00-keyboard.conf

ctrl:nocaps
make caps lock another ctrl
grp:shifs_toggle
pressing both shift keys toggles xkblayout
grp_led:caps
caps lock key used to indicate active layout
compose:prsc
use PrtSc key as compose key
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "dvorak,us"
        Option "XkbOptions" "ctrl:nocaps,grp:shifts_toggle,grp_led:caps,compose:prsc"
EndSection

40-libinput.conf

# On all pointers, use flat acceleration
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "AccelProfile" "flat"
EndSection

# Ignore trackpad
Section "InputClass"
        Identifier "SynPS/2 Synaptics TouchPad"
        MatchProduct "SynPS/2 Synaptics TouchPad"
        Option "Ignore" "on"
EndSection

# Make Lenovo trackpoint faster
Section "InputClass"
        Identifier "Lenovo Trackpoint"
        MatchProduct "TPPS/2 IBM TrackPoint"
        Option "TransformationMatrix" "2.5 0 0 0 2.5 0 0 0 1"
        Option "AccelSpeed" "1"
EndSection

Xresources

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/.Xresources”)
#if __has_include(".extend.Xresources")
#include ".extend.Xresources"
#endif

Xft.dpi: 172
Xft.antialias: 1
Xft.hinting: 1
Xft.rgba: rgb
Xft.autohint: false
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault

Xcursor.size: 32
Xcursor.theme: Breeze

Emacs.fontBackend: xft
Emacs.internalBorder: 15
Emacs.font: Iosevka Term-10:weight=book
! Emacs.geometry: 105x41
Emacs.menuBar: off
Emacs.toolBar: off
Emacs.verticalScrollBars: off
Emacs.cursorBlink: off
Emacs.foreground: #fdf4c1
Emacs.background: #282828
Emacs.mode-line.attributeForeground: #EBDBB2
Emacs.mode-line.attributeBackground: #1D2021
Emacs.mode-line.attributeBox: nil

xterm-24bit.terminfo

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/xterm-24bit.terminfo”)
# Use colon separators.
xterm-24bit|xterm with 24-bit direct color mode,
  use=xterm-256color,
  setb24=\E[48:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,
  setf24=\E[38:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,
# Use semicolon separators.
xterm-24bits|xterm with 24-bit direct color mode,
  use=xterm-256color,
  setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,
  setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,

zathurarc

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/.config/zathura/zathurarc”)
set font "Iosevka Term 9"
set default-bg "#282828"
set default-fg "#fdf4c1"
set inputbar-bg "#282828"
set inputbar-fg "#3FD7E5"
set statusbar-fg "#fdf4c1"
set first-page-column 1
set recolor-darkcolor "#fDf4c1"
set recolor-lightcolor "#282828"
set smooth-scroll true

Scripts

desktop-record

:header-args+: :tangle ~/bin/desktop-record :shebang “#!/usr/bin/bash”
screenkey -mf "Iosevka Term" --bg-color "#282828" --font-color "#FDF4C1" --opacity 1 --mods-mode emacs -p fixed -g 2560x129+0+0
# emacsclient --eval '(increase-all-fonts)'
recordmydesktop --device pulse
# emacsclient ---eval '(decrease-all-fonts)'
pkill -f screenkey

wm-exit-rofi

:header-args+: :tangle ~/bin/wm-exit-rofi :shebang “#!/usr/bin/env bash”
# message="Exit i3?"
response=$(echo -e "exit\nlock\nsuspend\nhibernate\nreboot\nshutdown" | rofi -l 6 -width 30 -dmenu -i -p "")
if [ -n "$response" ]; then
    ~/bin/wm-exit $response
fi

wm-exit

:header-args+: :tangle ~/bin/wm-exit :shebang “#!/bin/sh”
[[ $(cat /proc/1/comm) == "systemd" ]] && logind=systemctl || logind=loginctl

case "$1" in
    lock)
        slock
        ;;
    exit)
        bspc quit
        ;;
    suspend)
        $logind suspend
        ;;
    hibernate)
        $logind hibernate
        ;;
    reboot)
        $logind reboot
        ;;
    shutdown)
        $logind poweroff
        ;;
    *)
        notify-send 'Invalid argument'
        exit 2
esac

exit 0

no-lock-fullscreen

:header-args+: :tangle ~/bin/no-lock-fullscreen :shebang “#!/usr/bin/env bash”This goes in a cron job using crontab -e like so:
*/2 * * * * /home/dieggsy/bin/no-lock-fullscreen
active_id=`xprop -display :0 -root _NET_ACTIVE_WINDOW`
fullscreen="$(xprop -display :0 -id ${active_id:40:9} | grep _NET_WM_STATE_FULLSCREEN)"
if [ -n "$fullscreen" ]; then
    echo "RESTARTING XAUTOLOCK"
    export DISPLAY=":0"
    # xautolock -disable; xautolock -enable
fi

ocrpdf

:header-args+: :tangle ~/bin/ocrpdf :shebang “#!/usr/bin/env bash”
if [[ -z $1 ]]; then
    echo "No input file provided."
elif [[ -z $2 ]]; then
    echo "No output file provided"
else
    echo "Converting pdf to tif..."
    \gs -dNOPAUSE -q -r500 \
        -sDEVICE=tiffg4 \
        -dBATCH \
        -sOutputFile=$TMPDIR/tempocr.tif \
        $1
    echo "Running tesseract on pngs..."
    tesseract $TMPDIR/tempocr.tif $2 >/dev/null 2>&1
    echo "Done."
fi

ocrpdf2

:header-args+: :tangle ~/bin/ocrpdf2 :shebang “#!/usr/bin/env bash”
if [[ -z $1 ]]; then
    echo "No input file provided."
elif [[ -z $2 ]]; then
    echo "No output file provided"
else
    echo "Converting pdf to png..."
    convert -density 500 $1 $TMPDIR/tempocr.png
    count=0
    echo "Running tesseract on pngs..."
    while [ -f $TMPDIR/tempocr-$count.png ]; do
        echo "    Page $count"
        tesseract $TMPDIR/tempocr-$count.png $TMPDIR/tempocr >/dev/null 2>&1
        cat $TMPDIR/tempocr.txt >> $2
        let count=count+1
    done
    echo "Created output file $2"
fi

pass

Extensions and utilities for pass password manager.

pass-fzf

:header-args+: :tangle ~/.password-store/.extensions/fzf.bash :shebang “#!/usr/bin/env bash”
name=$(rg -g "*.gpg" "$HOME/.password-store" --files \
           | sed 's@'"$HOME"'/\.password-store/\(.\+\?\)\.gpg@\1@' \
           | fzf --reverse --prompt="[pass] ")

[[ -n "$name" ]] && pass -c $name

pass-rofi

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/.password-store/.extensions/rofi.bash”) :shebang “#!/usr/bin/env bash”
name=$(rg -g "*.gpg" "$HOME/.password-store" --files \
           | sed 's@'"$HOME"'/\.password-store/\(.\+\?\)\.gpg@\1@' \
           | sort \
           | rofi -dmenu -i -p "pass" -width 30)

pass -c $name

rofi-files

:header-args+: :tangle (when (eq system-type ‘gnu/linux) “~/bin/rofi-files”) :shebang “#!/usr/bin/env zsh”A script to search all files using ripgrep and rofi.
rg -a --files 2>/dev/null \
    | LC_ALL=C sort \
    | awk -v len=85 '{ if (length($0) > len) print "..." substr($0, length($0)-len, length($0)); else print; }' \
    | rofi -dmenu -i -width 50 -levenshtein-sort -matching regex -p '[files] '\
    | xargs -d '\n' xdg-open

snapbackup

:header-args+: :tangle “~/bin/snapbackup” :shebang “#!/bin/bash”
# if [ $(/usr/bin/id -u) -ne 0 ]; then
#     echo "Invalid Permissions. Are you root?"
#     exit
# fi
# Basic snapshot-style rsync backup script

# Config
if [ -d "/run/media/dieggsy/wd-passport/" ]; then
    echo "Backing up locally..."
    SSHOPT=""
    DEST="/run/media/dieggsy/wd-passport/backup"
    SSHDEST=""
else
    echo "Backing up over ssh..."
    SSHOPT="-e ssh"
    SSHDEST="dieggsy@panda:"
    DEST="~/wd-passport/backup"
fi
OPT="-avAXh --delete --exclude-from=/home/dieggsy/.rsync-exclude"
LINK="--link-dest=../last"
SRC="/home/dieggsy/"
SNAP="$SSHDEST$DEST"
LAST="$DEST/last"
date=`date "+%Y-%m-%dT%H%M"`

notify-send "Backing up home directory" "to $SNAP"

# Run rsync to create snapshot
rsync $OPT $SSHOPT $LINK $SRC ${SNAP}/$date # | pv -lep -s $(rsync -n $OPT $SSHOPT $LINK $SRC ${SNAP}/$date | awk 'NF' | wc -l) > /dev/null

# Remove symlink to previous snapshot
# Create new symlink to latest snapshot for the next backup to hardlink
if [ -d "/run/media/dieggsy/wd-passport/" ]; then
    rm -f $LAST
    ln -s $DEST/$date $LAST
    find $DEST -maxdepth 1 -type d ! -path $DEST -mtime +30 -exec echo 'Removing' {} + -exec rm -vrf {} +
else
    ssh dieggsy@panda "rm -f $LAST && ln -s ${DEST}/$date $LAST"
    # ssh dieggsy@panda "find $DEST -maxdepth 1 -type d ! -path $DEST ! -path $DEST/$date -mtime -1 -exec echo 'Removing' {} + -exec rm -rf {} +"
    ssh dieggsy@panda "find $DEST -maxdepth 1 -type d ! -path $DEST -mtime +30 -exec echo 'Removing' {} + -exec rm -vrf {} +"
fi

spectrum_ls

:header-args+: :tangle ~/bin/spectrum_ls :shebang “#!/usr/bin/env zsh”Builds on oh-my-zsh’s spectrum_ls.
if [ "$#" = 1 ]; then
  code="$(printf "%03d\n" $1)"
  print -P -- "$code: %F{$code}$code%f"
else;
    for code in $(seq -f "%03g" ${1:-000} ${2:-255}); do
        print -P -- "$code: %F{$code}$code%f"
    done
fi

Desktop files

cmus.desktop

:header-args+: :tangle ~/.local/share/applications/cmus.desktop
[Desktop Entry]
Name = Cmus
GenericName=Music Player
Terminal=true
Exec=cmus
TryExec=cmus
Type=Application
Categories=Audio;Music;Player;AudioVideo;
Icon=multimedia-player

emacs

emacsclient.desktop

:header-args+: :tangle ~/.local/share/applications/emacsclient.desktopThis lets you open files with a running instance of emacs. Kinda nifty.
[Desktop Entry]
Name=Emacs Client
Exec=emacsclient -n %u
Icon=emacs
Type=Application
Terminal=false

emacs-q.desktop

:header-args+: :tangle ~/.local/share/applications/emacs-q.desktop
[Desktop Entry]
Name=Emacs -q
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=emacs -q %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=Emacs
Keywords=Text;Editor;

emacs-debug-init.desktop

:header-args+: :tangle ~/.local/share/applications/emacs-debug-init.desktop
[Desktop Entry]
Name=Emacs -debug-init
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=emacs -debug-init %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=Emacs
Keywords=Text;Editor;

firefox.desktop

:header-args+: :tangle ~/.local/share/applications/firefox.desktop
[Desktop Entry]
Version=1.0
Name=Firefox
Comment=Browse the Web
Exec=env GTK_THEME=Arc /usr/lib/firefox/firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
StartupWMClass=Firefox
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
Exec=/usr/lib/firefox/firefox --private-window %u

spotify.desktop

:header-args+: :tangle ~/.local/share/applications/spotify.desktopOn high dpi displays with linux, the spotify UI is way too small. This scales it up
[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Spotify streaming music client
Icon=spotify-client
Exec=spotify --force-device-scale-factor=2  %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Audio;Music;Player;AudioVideo;
MimeType=x-scheme-handler/spotify;

vlc-dvd.desktop

:header-args+: :tangle ~/.local/share/applications/vlc-dvd.desktop
[Desktop Entry]
Version=1.0
Name=VLC DVD player
Exec=vlc dvd://
TryExec=vlc
Icon=vlc
Terminal=false
Type=Application
Categories=AudioVideo;Player;Recorder;
X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb
Keywords=Player;Capture;DVD;Audio;Video;Server;Broadcast;

Local vars

Tangles the files asynchronously on save.

# Local Variables:
# eval: (add-hook 'after-save-hook 'd/async-babel-tangle 'append 'local)
# End: