├── .gitignore ├── .gitmodules ├── Makefile ├── autoenv ├── buildroot-enter └── buildroot-leave ├── bin ├── alot-run-editor ├── aptigalia ├── borg-backup ├── diff-highlight ├── dotdot ├── git-autobranch ├── git-autorebase ├── git-branch-status ├── git-neck ├── git-trail ├── icecc-mkenv ├── id3-picture-tidy ├── jhenv ├── notmuch-monthly-archive ├── quick-nat ├── sk-or-fzf ├── sway-launch ├── v8-build ├── vcal-stdin ├── xinput-touchpad-configure └── xwin-decor ├── dot.Xresources ├── dot.bash_profile ├── dot.bashrc ├── dot.config--afew--config ├── dot.config--alacritty.yml ├── dot.config--alot--config ├── dot.config--alot--hooks.py ├── dot.config--beets--config.yaml ├── dot.config--bower--bower.conf ├── dot.config--dunst--dunstrc ├── dot.config--dwt ├── background-color ├── font ├── foreground-color ├── no-header-bar └── theme ├── dot.config--foot--foot.ini ├── dot.config--git--config ├── dot.config--gtk-3.0--gtk.css ├── dot.config--j4status--config ├── dot.config--mako--config ├── dot.config--mpDris2--mpDris2.conf ├── dot.config--mpv └── config ├── dot.config--nvim ├── dot.config--pangoterm.cfg ├── dot.config--rofi-pass--config ├── dot.config--sway--config ├── dot.config--termite--config ├── dot.config--tig--config ├── dot.config--zathura--zathurarc ├── dot.ctags ├── dot.cwmrc ├── dot.gdbinit ├── dot.gitignore-global ├── dot.gnupg--gpg-agent.conf ├── dot.gnupg--gpg.conf ├── dot.inputrc ├── dot.mailcap ├── dot.mpdconf ├── dot.notmuch-config ├── dot.nvimrc ├── dot.screenrc ├── dot.signature ├── dot.startup.py ├── dot.tmux.conf ├── dot.vim--after └── ftplugin │ ├── c.vim │ ├── cmake.vim │ ├── cpp.vim │ ├── d.vim │ ├── lua.vim │ ├── markdown.vim │ ├── meson.vim │ ├── objc.vim │ └── text.vim ├── dot.vim--init.vim ├── dot.vim--plugx.vim ├── dot.vimrc ├── dot.xsettingsd ├── dot.yashrc ├── dot.zsh--rc.zsh ├── dot.zshrc ├── mplayer └── config ├── ncmpcpp └── config └── xinitrc-basic /.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[op] 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dot.vim/bundle/vimcompletesme"] 2 | path = dot.vim/bundle/vimcompletesme 3 | url = https://github.com/ajh17/vimcompletesme 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile 3 | # Adrian Perez, 2013-12-18 17:36 4 | # 5 | 6 | SUBDIRS := $(patsubst %/Makefile,%,$(wildcard */Makefile)) 7 | 8 | all: 9 | 10 | ALL_TARGETS := 11 | DIRS_TARGETS := 12 | CLEAN_TARGETS := 13 | 14 | define subdir-template 15 | all-$1: 16 | $$(MAKE) -C $1 all 17 | ALL_TARGETS += all-$1 18 | 19 | dirs-$1: 20 | $$(MAKE) -C $1 dirs 21 | DIRS_TARGETS += dirs-$1 22 | 23 | clean-$1: 24 | $$(MAKE) -C $1 clean 25 | CLEAN_TARGETS += clean-$1 26 | 27 | .PHONY: $1-all $1-clean $1-dirs 28 | endef 29 | 30 | $(foreach S,$(SUBDIRS),$(eval $(call subdir-template,$S))) 31 | 32 | 33 | all: $(ALL_TARGETS) 34 | dirs: $(DIRS_TARGETS) 35 | clean: $(CLEAN_TARGETS) 36 | .PHONY: all dirs clean 37 | 38 | -------------------------------------------------------------------------------- /autoenv/buildroot-enter: -------------------------------------------------------------------------------- 1 | #! /bin/zsh 2 | 3 | if [[ -z ${BUILDROOT_SRCDIR:-} ]] ; then 4 | echo 'BUILDROOT_SRCDIR is undefined' >&2 5 | return 6 | fi 7 | 8 | autostash PATH="${PATH}:${BUILDROOT_SRCDIR}/utils" 9 | 10 | get-developers () { 11 | "${BUILDROOT_SRCDIR}/utils/get-developers" "$@" 12 | } 13 | 14 | send-patch () { 15 | if [[ $# -eq 0 ]] ; then 16 | echo 'send-patch: No patch files specified' >&2 17 | return 1 18 | fi 19 | local cmd=$(get-developers "$@") 20 | echo "${cmd}" 21 | 22 | local p 23 | for p in "$@" ; do 24 | echo " - ${p}" 25 | done 26 | echo 27 | local answer 28 | printf 'Continue? [y/n] ' 29 | if read -q ; then 30 | echo ' (sending...)' 31 | eval "${cmd} $*" 32 | else 33 | echo ' (cancelled)' 34 | fi 35 | } 36 | 37 | check-package () { 38 | python "${BUILDROOT_SRCDIR}/utils/check-package" "$@" 39 | } 40 | -------------------------------------------------------------------------------- /autoenv/buildroot-leave: -------------------------------------------------------------------------------- 1 | #! /bin/zsh 2 | 3 | unfunction check-package 4 | unfunction get-developers 5 | unfunction send-patch 6 | -------------------------------------------------------------------------------- /bin/alot-run-editor: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # alot-run-editor 4 | # Copyright (C) 2014 Adrian Perez 5 | # 6 | # Distributed under terms of the MIT license. 7 | # 8 | 9 | if [[ -n ${TMUX} && -n ${TMUX_PANE} ]] ; then 10 | if [[ -n ${PPID} ]] ; then 11 | CHAN_ID="alot-compose-${PPID}-$$" 12 | else 13 | CHAN_ID="alot-compose-$$" 14 | fi 15 | tmux split-window -h "$* ; tmux wait-for -S '${CHAN_ID}'" 16 | exec tmux wait-for "${CHAN_ID}" 17 | fi 18 | 19 | unset TMUX 20 | export TERM=xterm-256color 21 | export DWT_SINGLE_WINDOW_PROCESS=1 22 | exec dwt \ 23 | --title='alot - Compose' \ 24 | --workdir="${HOME}" \ 25 | --no-title-updates \ 26 | --scrollback=0 \ 27 | --command="$*" 28 | -------------------------------------------------------------------------------- /bin/aptigalia: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | exec scp "$@" root@petibonum.igalia.com:/var/www/apt.igalia.com/incoming 4 | 5 | -------------------------------------------------------------------------------- /bin/borg-backup: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | set -e 3 | 4 | args=( 5 | /home/aperez 6 | --exclude=/home/aperez/Templates 7 | --exclude=/home/aperez/Public 8 | --exclude=/home/aperez/Music 9 | --exclude=/home/aperez/Downloads 10 | --exclude=/home/aperez/pictures 11 | --exclude=/home/aperez/Pictures 12 | --exclude=/home/aperez/Movies 13 | --exclude=/home/aperez/tmp 14 | --exclude=/home/aperez/nobackup 15 | --exclude=/home/aperez/devel/WebKit 16 | --exclude=/home/aperez/devel/WebKit-ContentBlocking 17 | --exclude=/home/aperez/devel/v8 18 | --exclude=/home/aperez/devel/epiphany 19 | --exclude=/home/aperez/devel/gobby 20 | --exclude=/home/aperez/devel/mozilla-central 21 | --exclude=/home/aperez/devel/wpe/WebKit 22 | --exclude=/home/aperez/devel/wpe/buildroot 23 | --exclude=/home/aperez/nobackup 24 | --exclude=/home/aperez/.dotfiles 25 | --exclude=/home/aperez/.ccache 26 | --exclude=/home/aperez/.cache 27 | --exclude=/home/aperez/.gog 28 | --exclude=/home/aperez/.vim 29 | --exclude=/home/aperez/.thumbnails 30 | --exclude=/home/aperez/.local 31 | --exclude=/home/aperez/.mail 32 | --exclude=/home/aperez/.prefix 33 | --exclude=/home/aperez/archbuild 34 | --exclude='*.flv' 35 | --exclude='*.wmv' 36 | --exclude='*.avi' 37 | --exclude='*.mp4' 38 | --exclude='*.m4a' 39 | --exclude='*.m4v' 40 | --exclude='*.mpg' 41 | --exclude='*.mkv' 42 | --exclude='*.ogg' 43 | --exclude='*.oga' 44 | --exclude='*.ogv' 45 | --exclude='*.mp3' 46 | --exclude='*.flac' 47 | ) 48 | 49 | : ${REPO:=/run/media/aperez/fozzie/backup.attic} 50 | : ${HOST:=$(hostname)} 51 | : ${BACKUP_NAME:=${HOST}-$(date '+%Y-%m-%d')} 52 | 53 | echo "Backing up to ${REPO}::${BACKUP_NAME}" 54 | ionice -c 3 borg create --compression auto,zstd,10 --stats "${REPO}::${BACKUP_NAME}" "${args[@]} --do-not-cross-mountpoints" 55 | echo "Pruning old backups..." 56 | ionice -c 3 borg prune -v "${REPO}" --keep-daily=7 --keep-weekly=4 --keep-monthly=6 57 | -------------------------------------------------------------------------------- /bin/diff-highlight: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env perl 2 | 3 | use warnings FATAL => 'all'; 4 | use strict; 5 | 6 | # Highlight by reversing foreground and background. You could do 7 | # other things like bold or underline if you prefer. 8 | my $HIGHLIGHT = "\x1b[7m"; 9 | my $UNHIGHLIGHT = "\x1b[27m"; 10 | my $COLOR = qr/\x1b\[[0-9;]*m/; 11 | my $BORING = qr/$COLOR|\s/; 12 | 13 | my @removed; 14 | my @added; 15 | my $in_hunk; 16 | 17 | while (<>) { 18 | if (!$in_hunk) { 19 | print; 20 | $in_hunk = /^$COLOR*\@/; 21 | } 22 | elsif (/^$COLOR*-/) { 23 | push @removed, $_; 24 | } 25 | elsif (/^$COLOR*\+/) { 26 | push @added, $_; 27 | } 28 | else { 29 | show_hunk(\@removed, \@added); 30 | @removed = (); 31 | @added = (); 32 | 33 | print; 34 | $in_hunk = /^$COLOR*[\@ ]/; 35 | } 36 | 37 | # Most of the time there is enough output to keep things streaming, 38 | # but for something like "git log -Sfoo", you can get one early 39 | # commit and then many seconds of nothing. We want to show 40 | # that one commit as soon as possible. 41 | # 42 | # Since we can receive arbitrary input, there's no optimal 43 | # place to flush. Flushing on a blank line is a heuristic that 44 | # happens to match git-log output. 45 | if (!length) { 46 | local $| = 1; 47 | } 48 | } 49 | 50 | # Flush any queued hunk (this can happen when there is no trailing context in 51 | # the final diff of the input). 52 | show_hunk(\@removed, \@added); 53 | 54 | exit 0; 55 | 56 | sub show_hunk { 57 | my ($a, $b) = @_; 58 | 59 | # If one side is empty, then there is nothing to compare or highlight. 60 | if (!@$a || !@$b) { 61 | print @$a, @$b; 62 | return; 63 | } 64 | 65 | # If we have mismatched numbers of lines on each side, we could try to 66 | # be clever and match up similar lines. But for now we are simple and 67 | # stupid, and only handle multi-line hunks that remove and add the same 68 | # number of lines. 69 | if (@$a != @$b) { 70 | print @$a, @$b; 71 | return; 72 | } 73 | 74 | my @queue; 75 | for (my $i = 0; $i < @$a; $i++) { 76 | my ($rm, $add) = highlight_pair($a->[$i], $b->[$i]); 77 | print $rm; 78 | push @queue, $add; 79 | } 80 | print @queue; 81 | } 82 | 83 | sub highlight_pair { 84 | my @a = split_line(shift); 85 | my @b = split_line(shift); 86 | 87 | # Find common prefix, taking care to skip any ansi 88 | # color codes. 89 | my $seen_plusminus; 90 | my ($pa, $pb) = (0, 0); 91 | while ($pa < @a && $pb < @b) { 92 | if ($a[$pa] =~ /$COLOR/) { 93 | $pa++; 94 | } 95 | elsif ($b[$pb] =~ /$COLOR/) { 96 | $pb++; 97 | } 98 | elsif ($a[$pa] eq $b[$pb]) { 99 | $pa++; 100 | $pb++; 101 | } 102 | elsif (!$seen_plusminus && $a[$pa] eq '-' && $b[$pb] eq '+') { 103 | $seen_plusminus = 1; 104 | $pa++; 105 | $pb++; 106 | } 107 | else { 108 | last; 109 | } 110 | } 111 | 112 | # Find common suffix, ignoring colors. 113 | my ($sa, $sb) = ($#a, $#b); 114 | while ($sa >= $pa && $sb >= $pb) { 115 | if ($a[$sa] =~ /$COLOR/) { 116 | $sa--; 117 | } 118 | elsif ($b[$sb] =~ /$COLOR/) { 119 | $sb--; 120 | } 121 | elsif ($a[$sa] eq $b[$sb]) { 122 | $sa--; 123 | $sb--; 124 | } 125 | else { 126 | last; 127 | } 128 | } 129 | 130 | if (is_pair_interesting(\@a, $pa, $sa, \@b, $pb, $sb)) { 131 | return highlight_line(\@a, $pa, $sa), 132 | highlight_line(\@b, $pb, $sb); 133 | } 134 | else { 135 | return join('', @a), 136 | join('', @b); 137 | } 138 | } 139 | 140 | sub split_line { 141 | local $_ = shift; 142 | return map { /$COLOR/ ? $_ : (split //) } 143 | split /($COLOR*)/; 144 | } 145 | 146 | sub highlight_line { 147 | my ($line, $prefix, $suffix) = @_; 148 | 149 | return join('', 150 | @{$line}[0..($prefix-1)], 151 | $HIGHLIGHT, 152 | @{$line}[$prefix..$suffix], 153 | $UNHIGHLIGHT, 154 | @{$line}[($suffix+1)..$#$line] 155 | ); 156 | } 157 | 158 | # Pairs are interesting to highlight only if we are going to end up 159 | # highlighting a subset (i.e., not the whole line). Otherwise, the highlighting 160 | # is just useless noise. We can detect this by finding either a matching prefix 161 | # or suffix (disregarding boring bits like whitespace and colorization). 162 | sub is_pair_interesting { 163 | my ($a, $pa, $sa, $b, $pb, $sb) = @_; 164 | my $prefix_a = join('', @$a[0..($pa-1)]); 165 | my $prefix_b = join('', @$b[0..($pb-1)]); 166 | my $suffix_a = join('', @$a[($sa+1)..$#$a]); 167 | my $suffix_b = join('', @$b[($sb+1)..$#$b]); 168 | 169 | return $prefix_a !~ /^$COLOR*-$BORING*$/ || 170 | $prefix_b !~ /^$COLOR*\+$BORING*$/ || 171 | $suffix_a !~ /^$BORING*$/ || 172 | $suffix_b !~ /^$BORING*$/; 173 | } 174 | -------------------------------------------------------------------------------- /bin/dotdot: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | if [[ -z ${DOTFILES} ]] ; then 4 | DOTFILES=$(dirname "$(dirname "$0")") 5 | fi 6 | 7 | if [[ ! -d ${DOTFILES} ]] ; then 8 | echo "Directory '${DOTFILES}' does not exist" 1>&2 9 | return 1 10 | fi 11 | 12 | integer retcode=0 13 | cd "${DOTFILES}" 14 | DOTFILES=$(pwd) 15 | for filename in * ; do 16 | if [[ ${filename:0:4} = dot. ]] ; then 17 | target=${filename:3} 18 | target_name="${target//--//}" 19 | if [[ ${HOME} = */ ]] ; then 20 | target="${HOME}${target_name}" 21 | else 22 | target="${HOME}/${target_name}" 23 | fi 24 | target_dir=$(dirname "${target}") 25 | 26 | if [[ ! -d ${target_dir} ]] ; then 27 | echo "[DIR] ${target_dir}" 28 | mkdir -p "${target_dir}" 29 | fi 30 | 31 | if [[ -L ${target} ]] ; then 32 | existing_target=$(readlink -f "${target}") 33 | if [[ ${DOTFILES}/${filename} != ${existing_target} ]] ; then 34 | echo "[ERR] Symlink '${target_name}' points to '${existing_target}' instead of '${DOTFILES}/${filename}'" 1>&2 35 | retcode=2 36 | else 37 | echo "[---] ${target_name}" 38 | fi 39 | elif [[ ! -d ${DOTFILES}/${filename} && -x ${DOTFILES}/${filename} ]] ; then 40 | # This is a generator program, send its output to the target file 41 | echo "[GEN] ${target_name}" 42 | output=$(OSTYPE=${OSTYPE} MACHTYPE=${MACHTYPE} CPUTYPE=${CPUTYPE} \ 43 | "${DOTFILES}/${filename}" "${target}") 44 | if [[ -n ${output} ]] ; then 45 | cat > "${target}" <<< "${output}" 46 | fi 47 | elif [[ -r ${target} ]] ; then 48 | echo "Warning: '${target_name}' is not a symlink" 1>&2 49 | retcode=1 50 | else 51 | echo "[SYM] ${target_name}" 52 | ln -s "${DOTFILES}/${filename}" "${target}" 53 | fi 54 | fi 55 | done 56 | 57 | if whence -p systemctl &> /dev/null ; then 58 | # For systemd we use hard link to circumvent the "too many symbolic 59 | # links" issue (https://bugzilla.redhat.com/show_bug.cgi?id=955379) 60 | mkdir -p ~/.config/systemd/user 61 | setopt nullglob 62 | for item in "${DOTFILES}"/systemd/* ; do 63 | echo "[LNK] .config/systemd/user/$(basename "${item}")" 64 | ln -f "${item}" ~/.config/systemd/user 65 | done 66 | fi 67 | 68 | exit ${retcode} 69 | -------------------------------------------------------------------------------- /bin/git-autobranch: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # git-autorebase 4 | # Copyright (C) 2014 Adrian Perez 5 | # 6 | # Distributed under terms of the MIT license. 7 | # 8 | set -e 9 | 10 | current_branch=$(git symbolic-ref HEAD) 11 | current_branch=${current_branch#refs/heads/} 12 | 13 | show_usage () 14 | { 15 | cat 1>&2 <<-EOF 16 | usage: git autobranch [branch [parent]] 17 | 18 | Without arguments, a list of parents for local branches is displayed: 19 | 20 | git autobranch 21 | 22 | Passing current branch name as argument, the parent of the current 23 | branch is shown: 24 | 25 | git autobranch current-branch 26 | 27 | Passing a name other than the current branch creates a new branch with 28 | that name, sets the current branch as the parent, and checks out the 29 | newly-created branch: 30 | 31 | git checkout master 32 | git autobranch new-branch-name 33 | 34 | Passing the current branch name and an additional argument changes 35 | the parent branch for the current branch: 36 | 37 | git autobranch current-branch parent-branch 38 | 39 | EOF 40 | } 41 | 42 | # Check for -h/-? and show the usage text 43 | for arg in "$@" ; do 44 | if [[ ${arg} = -h || ${arg} = -? ]] ; then 45 | show_usage 46 | exit 0 47 | fi 48 | done 49 | 50 | if [[ $# -eq 0 ]] ; then 51 | # No arguments, print the auto{branch,rebase}-tracked branches 52 | while read -r line ; do 53 | if [[ ${line} = autorebase.* ]] ; then 54 | line=${line#autorebase.} 55 | read branch parent <<< "${line/=/ }" 56 | if [[ ${branch} = ${current_branch} ]] ; then 57 | echo "${branch} ${parent}" 58 | else 59 | echo "${branch} ${parent}" 60 | fi 61 | fi 62 | done < <( git config --local --list ) 63 | exit 0 64 | fi 65 | 66 | branch=$1 67 | if [[ ${branch} = ${current_branch} ]] ; then 68 | if [[ $# -eq 1 ]] ; then 69 | # Show current parent branch 70 | parent=$(git config --local "autorebase.${branch}" || true) 71 | [[ -n ${parent} ]] || exit 1 72 | echo "${parent}" 73 | elif [[ $# -eq 2 ]] ; then 74 | # Set parent branch 75 | git config --local "autorebase.${branch}" "$2" 76 | else 77 | show_usage 78 | exit 1 79 | fi 80 | exit 0 81 | fi 82 | 83 | git config --local "autorebase.${branch}" "${current_branch}" 84 | git checkout -b "${branch}" 85 | -------------------------------------------------------------------------------- /bin/git-autorebase: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # git-autorebase 4 | # Copyright (C) 2014 Adrian Perez 5 | # 6 | # Distributed under terms of the MIT license. 7 | # 8 | set -e 9 | 10 | show_usage () 11 | { 12 | cat 1>&2 <<-EOF 13 | usage: git autorebase [branch] 14 | 15 | Automatically rebases the named branch (or the current branch if none 16 | given) against its configured "parent branch". Parent branches can have 17 | other parents in turn, and the whole chain of branches will be rebased 18 | recursively. For example, after starting a feature branch another branch 19 | can be started off it. While in "master": 20 | 21 | git autobranch new-feature && hackety-hack 22 | git autobranch sub-branch && hackety-hack 23 | 24 | At this point the tree of branches looks like this: 25 | 26 | master 27 | ╰─► new-feature 28 | ╰─► sub-branch ── active branch 29 | 30 | When the "master" branch is updated with upstream changes, the branch 31 | "new-feature" has to be rebased against "master", and "sub-branch" has 32 | to be rebased against "new-feature". Using "git autorebase" will do 33 | precisely that. In this scenario, it is equivalent to: 34 | 35 | git checkout new-feature && git rebase master 36 | git checkout sub-branch && git rebase new-feature 37 | 38 | The "git autobranch" command can be used to create branches with an 39 | associated parent branch, and to show the configured parents of local 40 | branches. 41 | EOF 42 | } 43 | 44 | for arg in "$@" ; do 45 | if [[ ${arg} = -h || ${arg} = -? ]] ; then 46 | show_usage 47 | exit 0 48 | fi 49 | done 50 | 51 | if [[ $# -ne 0 && $# -ne 1 ]] ; then 52 | show_usage 53 | exit 1 54 | fi 55 | 56 | current_branch=$(git symbolic-ref HEAD) 57 | current_branch=${current_branch#refs/heads/} 58 | branch=${1:-${current_branch}} 59 | 60 | if [[ ${branch} != ${current_branch} ]] ; then 61 | git checkout "${branch}" 62 | git autorebase 63 | git checkout "${current_branch}" 64 | else 65 | parent_branch=$(git config "autorebase.${current_branch}" || true) 66 | if [[ -n ${parent_branch} ]] ; then 67 | git checkout "${parent_branch}" 68 | git autorebase 69 | git checkout "${current_branch}" 70 | git rebase "${parent_branch}" 71 | fi 72 | fi 73 | -------------------------------------------------------------------------------- /bin/git-branch-status: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | # by http://github.com/jehiah 3 | # this prints out some branch status (similar to the '... ahead' info you get from git status) 4 | 5 | # example: 6 | # $ git branch-status 7 | # dns_check (ahead 1) | (behind 112) origin/master 8 | # master (ahead 2) | (behind 0) origin/master 9 | 10 | git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads | \ 11 | while read local remote 12 | do 13 | [ -z "$remote" ] && continue 14 | git rev-list --left-right ${local}...${remote} -- 2>/dev/null >/tmp/git_upstream_status_delta || continue 15 | LEFT_AHEAD=$(grep -c '^<' /tmp/git_upstream_status_delta) 16 | RIGHT_AHEAD=$(grep -c '^>' /tmp/git_upstream_status_delta) 17 | echo "$local (ahead $LEFT_AHEAD) | (behind $RIGHT_AHEAD) $remote" 18 | done 19 | -------------------------------------------------------------------------------- /bin/git-neck: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # git neck [-r] [COMMIT] - show commits until first branching point 3 | 4 | [ "$1" = -r ] && shift && R=-r 5 | COMMIT=$(git rev-parse --no-flags --default HEAD "$@") 6 | # skip first elements of trail 7 | TORSO=$(git trail $R $COMMIT | cut -d' ' -f2 | uniq | sed -n 2p) 8 | # fall back to initial commit on empty trail 9 | : ${TORSO:=$(git rev-list --max-parents=0 HEAD)} 10 | git log --oneline $(git rev-parse --no-revs "$@") $COMMIT...$TORSO 11 | -------------------------------------------------------------------------------- /bin/git-trail: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # git trail [-r] [-t] [COMMIT] - show all branching points in Git history 3 | 4 | [ "$1" = -r ] && shift || REMOTES="-e refs/remotes/" 5 | [ "$1" = -t ] && shift || TAGS="-e refs/tags/" 6 | COMMIT=$(git rev-parse --no-flags --default HEAD "$@") 7 | 8 | { git for-each-ref | grep -v -e '^$' $TAGS $REMOTES 9 | git log --date=short --format="%cd %h %H" "$@" 10 | } | awk ' 11 | $2 == "commit" || $2 == "tag" { 12 | "git merge-base '$COMMIT' " $1 | getline mb 13 | merge[mb] = merge[mb] " " $3 14 | } 15 | { 16 | if ($3 in merge) { 17 | split(merge[$3], mbs, " ") 18 | for (i in mbs) { 19 | "git name-rev --name-only --refs=\"" mbs[i] "\" " $3 | getline nr 20 | if (nr != "undefined") print $1, $2, nr # skip unreachable commits 21 | } 22 | } 23 | }' | git -p column # paginate output 24 | -------------------------------------------------------------------------------- /bin/icecc-mkenv: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | set -euf -o pipefail 3 | 4 | scriptname=${0##*/} 5 | declare -r scriptname 6 | 7 | for opt in "$@" ; do 8 | if [[ ${opt} = --help || ${opt} = -h ]] ; then 9 | cat <<-EOF 10 | Usage: ${scriptname} [compiler] 11 | EOF 12 | exit 0 13 | fi 14 | done 15 | 16 | workdir=$(mktemp -d icecc-mkenv.XXXXXXXXXX) 17 | declare -r workdir 18 | 19 | cleanup () { 20 | rm -rf "${workdir}" 21 | } 22 | 23 | trap cleanup EXIT 24 | 25 | # 26 | # Helper functions. 27 | # 28 | 29 | die () 30 | { 31 | echo "${scriptname}: $*" 32 | exit 1 33 | } 1>&2 34 | 35 | # findtool 36 | findtool () 37 | { 38 | local name tool path 39 | name=$1 40 | shift 41 | for tool in "$@" ; do 42 | path=$(type -P "${tool}") 43 | if [[ -x ${path} ]] ; then 44 | printf -v "${name}" '%s' "${path}" 45 | return 46 | fi 47 | done 48 | return 1 49 | } 50 | 51 | 52 | findtool GZIP pigz gzip || die 'Cannot find tool: gzip' 53 | findtool TAR bsdtar tar star || die 'Cannot find tool: tar' 54 | findtool READELF readelf || die 'Cannot find tool: readelf' 55 | findtool READLINK readlink || die 'Cannot find tool: readlink' 56 | findtool LDCONFIG ldconfig true 57 | 58 | if findtool MAKESUM sha256sum ; then 59 | caching_enabled=true 60 | checksum () { 61 | local sum rest 62 | read -r sum rest < <("${MAKESUM}" -) 63 | echo "${sum}" 64 | } 65 | else 66 | caching_enabled=false 67 | checksum () { 68 | true 69 | } 70 | fi 71 | declare -r caching_enabled 72 | 73 | cache_dir="${XDG_CACHE_DIR:-${HOME}/.cache}/icecc-mkenv" 74 | declare -r cache_dir 75 | 76 | if ${caching_enabled} ; then 77 | mkdir -p "${cache_dir}" 78 | fi 79 | 80 | 81 | cache_is_fresh=true 82 | 83 | # cache_neq 84 | cache_check () 85 | { 86 | if ${caching_enabled} ; then 87 | local path="${cache_dir}/${1//\//__}" 88 | if [[ -r ${path} ]] ; then 89 | if [[ $(< "${path}") = "$2" ]] ; then 90 | return 91 | fi 92 | fi 93 | echo "$2" > "${path}" 94 | fi 95 | cache_is_fresh=false 96 | } 97 | 98 | 99 | # 100 | # Find out which compiler is to be packaged. In order of preference: 101 | # 102 | # 1. First parameter to the script. 103 | # 2. Contents of the $CC / $CXX variables. 104 | # 3. Fall-back to cc / c++. 105 | # 106 | if [[ $# -eq 1 ]] ; then 107 | compiler=$1 108 | elif [[ ${CC+set} = set ]] ; then 109 | compiler=${CC} 110 | elif [[ ${CXX+set} = set ]] ; then 111 | compiler=${CXX} 112 | else 113 | compiler=cc 114 | fi 115 | compiler=$(type -P "${compiler}") 116 | [[ -n ${compiler:-} ]] || die 'Cannot find absolute path to compiler' 117 | [[ -x ${compiler} ]] || die "Compiler '${compiler}' is not executable" 118 | declare -r compiler 119 | 120 | 121 | # 122 | # Utility functions to obtain dependencies of ELF objects. 123 | # 124 | 125 | # elfdepfind 126 | elfdepfind () 127 | { 128 | local path deppath depname=$1 129 | shift 130 | 131 | for deppath in lib usr/lib "$@" ; do 132 | path="/${deppath}/${depname}" 133 | if [[ -r ${path} ]] ; then 134 | echo "${deppath} ${path}" 135 | return 136 | fi 137 | done 138 | die "Cannot find: ${depname}" 139 | } 140 | 141 | 142 | # elfdeps 143 | elfdeps () 144 | { 145 | local path 146 | local -a needed rpath line 147 | 148 | while read -r -a line ; do 149 | if [[ ${#line[@]} -lt 2 ]] ; then 150 | continue 151 | fi 152 | 153 | # Extract last item. File name/paths are usually enclosed between 154 | # square brackets and those need to be removed. 155 | path=${line[$(( ${#line[@]} - 1 ))]} 156 | if [[ ${path} = *']' ]] ; then 157 | path=${path:1:-1} 158 | fi 159 | 160 | if [[ ${line[1]} = \(RPATH\) ]] ; then 161 | if [[ ${path} = \$ORIGIN/* ]] ; then 162 | path="${1%/*}/${path:8}" 163 | fi 164 | rpath+=( "${path}" ) 165 | elif [[ ${line[1]} = \(NEEDED\) ]] ; then 166 | needed+=( "${path}" ) 167 | fi 168 | done < <( "${READELF}" -W -d "$1" ) 169 | 170 | for path in "${needed[@]}" ; do 171 | elfdepfind "${path}" "${rpath[@]}" 172 | done 173 | } 174 | 175 | 176 | # doins [destdir] 177 | # If is a symbolic link, the pointed file is copied, and a 178 | # new relative symbolic link created in [destdir] pointing to the copy. 179 | doins () 180 | { 181 | local destdir=${2:-bin} 182 | 183 | if [[ ! -d ${workdir}/${destdir} ]] ; then 184 | mkdir -p "${workdir}/${destdir}" # TODO: Cache already-created dirs. 185 | fi 186 | if [[ -L $1 ]] ; then 187 | local linkdest 188 | linkdest=$("${READLINK}" -f "$1") 189 | cp --reflink=auto -af "${linkdest}" "${workdir}/${destdir}" 190 | ln -sf "${linkdest##*/}" "${workdir}/${destdir}/${1##*/}" 191 | else 192 | cp --reflink=auto -af "$1" "${workdir}/${destdir}" 193 | fi 194 | } 195 | 196 | 197 | declare -A LIBPATH 198 | 199 | # dodeps 200 | dodeps () 201 | { 202 | if [[ $# -eq 0 ]] ; then 203 | return 204 | fi 205 | 206 | local deppath='' abspath='' elfobj=$1 207 | local -a pending=( ) 208 | shift 209 | 210 | while read -r deppath abspath ; do 211 | if [[ -n ${LIBPATH[${abspath}]:-} ]] ; then 212 | # Dependency already copied. 213 | continue 214 | fi 215 | LIBPATH[${abspath}]=${deppath} 216 | pending+=( "${abspath}" ) 217 | doins "${abspath}" "${deppath}" 218 | done < <( elfdeps "${elfobj}" ) 219 | dodeps "$@" "${pending[@]}" 220 | } 221 | 222 | dobindeps () 223 | { 224 | doins "$1" "${2:-bin}" 225 | dodeps "$1" 226 | } 227 | 228 | 229 | # 230 | # File system builders. 231 | # 232 | 233 | filesystem_common_pre () 234 | { 235 | mkdir -p "${workdir}"/{bin,lib,etc} 236 | ln -s . "${workdir}/usr" # /usr -> / 237 | ln -s lib "${workdir}/lib64" # /lib64 -> /lib 238 | ln -s bin "${workdir}/sbin" # /sbin -> /bin 239 | 240 | dobindeps "$(type -P true)" 241 | dobindeps "${compiler}" 242 | dobindeps "${compiler%/*}/as" 243 | 244 | if [[ -r /etc/ld.so.conf ]] ; then 245 | doins /etc/ld.so.conf etc 246 | fi 247 | } 248 | 249 | filesystem_common_post () 250 | { 251 | "${LDCONFIG}" -r "${workdir}" 252 | } 253 | 254 | filesystem_clang () 255 | { 256 | local path 257 | 258 | # Add a "clang++" symlink. 259 | path=$(type -P "${compiler%/*}/clang++") 260 | if [[ -r ${path} ]] ; then 261 | dobindeps "${path}" 262 | fi 263 | 264 | # 265 | # Clang 4.x insists in reading /proc/cpuinfo, but it's used only when linking. 266 | # Providing an empty file silences the warnings. 267 | # 268 | mkdir -p "${workdir}/proc" 269 | touch "${workdir}/proc/cpuinfo" 270 | } 271 | 272 | filesystem_gcc () 273 | { 274 | local path item 275 | 276 | for item in cc1 liblto_plugin.so ; do 277 | path=$("${compiler}" "-print-prog-name=${item}") 278 | if [[ ${path} = "${item}" ]] ; then 279 | # Skip unexistant binaries. 280 | continue 281 | fi 282 | dobindeps "${path}" "${path%/${item}}" 283 | done 284 | 285 | # Add the C++ compiler, if present. 286 | path=$(type -P "${compiler%/*}/g++") 287 | if [[ -x ${path} ]] ; then 288 | dobindeps "${path}" 289 | # Find "cc1plus" 290 | path=$("${compiler}" -print-prog-name=cc1plus) 291 | if [[ ${path} = cc1plus ]] ; then 292 | die "Cannot find GCC's cc1plus" 293 | fi 294 | dobindeps "${path}" "${path%/cc1plus}" 295 | fi 296 | } 297 | 298 | # 299 | # Extract the compiler kind and version. 300 | # 301 | compiler_info () 302 | { 303 | local info 304 | info=$("${compiler}" -v 2>&1) 305 | local -a v 306 | read -ra v < <(grep '^[a-zA-Z0-9_.]\+\s\+version\s\+[0-9.]\+' <<< "${info}") 307 | cache_check "${v[0]}/info" "${info}" 308 | echo "${v[0]} ${v[2]}" 309 | } 310 | 311 | read -r compiler_kind compiler_version < <( compiler_info "${compiler}" ) 312 | 313 | cache_check "${compiler_kind}/version" "${compiler_version}" 314 | cache_check "${compiler_kind}/binsum" "$(checksum < "${compiler}")" 315 | 316 | output_file="${cache_dir}/${compiler_kind}-${compiler_version}.tar.gz" 317 | 318 | if [[ -z $(type -t "filesystem_${compiler_kind}") ]] ; then 319 | echo "${0##*/}: Unsupported compiler kind '${compiler_kind}'" 320 | exit 1 321 | fi 322 | 323 | filesystem_common_pre 324 | "filesystem_${compiler_kind}" 325 | filesystem_common_post 326 | 327 | declare -a all_files 328 | while read -r line ; do 329 | all_files+=( "${line}" ) 330 | done < <( find "${workdir}" -type f -printf './%P\n' | sort ) 331 | 332 | cache_check "${compiler_kind}/filelistsum" "$(checksum <<< "${all_files[*]}")" 333 | cache_check "${compiler_kind}/filessum" "$(cd "${workdir}" && cat "${all_files[@]}" | checksum)" 334 | 335 | if ! ${cache_is_fresh} || [[ ! -r ${output_file} ]] ; then 336 | "${TAR}" -C "${workdir}" -cf - . | "${GZIP}" -9c > "${output_file}" 337 | fi 338 | 339 | echo "${output_file}" 340 | -------------------------------------------------------------------------------- /bin/id3-picture-tidy: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Traverse a directory tree, picking embedded pictures from .MP3 and .M4A audio 5 | # saving them to a “cover.{png,jpg,bmp}” (as long as the file does *not* exist) 6 | # and then removing the embedded pictures from the audio file. 7 | # 8 | # Requires the Mutagen tag edition library: https://code.google.com/p/mutagen/ 9 | # Most distributions ship in a package called “python-mutagen“. 10 | # 11 | 12 | from os import path as P 13 | import os, sys 14 | import mutagen 15 | 16 | PIC_TAGS = ( 17 | "PIC", u"PIC", u"PIC:", 18 | "APIC", u"APIC", u"APIC:", 19 | ) 20 | 21 | 22 | def handle_dir(path, files): 23 | for fpath in (P.join(path, f) for f in files): 24 | try: 25 | fileinfo = mutagen.File(fpath) 26 | except Exception, e: 27 | print >> sys.stderr, "%s" % e 28 | continue 29 | 30 | for tag in PIC_TAGS: 31 | if tag in fileinfo.tags: 32 | pic_data = fileinfo.tags.get(tag) 33 | pic_mime = pic_data.mime.lower() 34 | pic_path = None 35 | if pic_mime == "image/png": 36 | pic_path = P.join(path, "cover.png") 37 | elif pic_mime == "image/bmp": 38 | pic_path = P.join(path, "cover.bmp") 39 | elif pic_mime == "image/jpeg" or pic_mime == "image/jpg": 40 | pic_path = P.join(path, "cover.jpg") 41 | else: 42 | print >> sys.stderr, " - %r unrecognized type %r" % (fpath, pic_mime) 43 | 44 | if pic_path is not None and not P.isfile(pic_path): 45 | print "Writing %r" % pic_path 46 | with file(pic_path, "wb") as pic_fd: 47 | pic_fd.write(pic_data.data) 48 | 49 | print "Removing picture from %r" % fpath 50 | for tag in PIC_TAGS: 51 | fileinfo.tags.delall(tag) 52 | fileinfo.tags.save() 53 | fileinfo.save() 54 | 55 | 56 | def walk_and_handle(path, cb=handle_dir): 57 | for dirpath, dirnames, filenames in os.walk(path): 58 | audios = [f for f in filenames 59 | if f.lower().endswith(".mp3") 60 | or f.lower().endswith(".m4a")] 61 | if len(audios): cb(dirpath, audios) 62 | 63 | if __name__ == "__main__": 64 | import sys 65 | if len(sys.argv) == 2: 66 | walk_and_handle(sys.argv[1]) 67 | else: 68 | raise SystemExit("Usage: %s " % sys.argv[0]) 69 | 70 | -------------------------------------------------------------------------------- /bin/jhenv: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # vim: set ts=4 sw=4 noet 3 | # 4 | # jhenv 5 | # Copyright (C) 2017 Adrian Perez 6 | # 7 | # Distributed under terms of the MIT license. 8 | # 9 | set -e 10 | 11 | die () { 12 | if [[ $# -eq 0 ]] ; then 13 | cat 14 | else 15 | echo "$*" 16 | fi 17 | exit 1 18 | } 1>&2 19 | 20 | 21 | [[ $# -ge 1 ]] || die <<-EOF 22 | $0: Prefix directory not specified 23 | Usage: $0 24 | EOF 25 | 26 | declare -r prefix=$(realpath "$1") 27 | shift 28 | 29 | # Usage: add 30 | # 31 | declare -A export_vars 32 | 33 | add () { 34 | local position=$1 35 | local variable=$2 36 | 37 | local value=${export_vars[${variable}]} 38 | 39 | # If empty, try to pick the value from the environment, or if that is 40 | # empty use the default value passed to the function. 41 | if [[ -z ${value} ]] ; then 42 | eval eval "local env_value=\\'\${${variable}}\\'" 43 | if [[ -n ${env_value} ]] ; then 44 | value=${env_value} 45 | elif [[ $3 != - ]] ; then 46 | value=$3 47 | fi 48 | fi 49 | shift 3 50 | 51 | local -a items 52 | local -A seen 53 | 54 | # Add first elements either from the existing value, or the old one. 55 | local item saved_IFS=${IFS} 56 | IFS=':' 57 | for item in ${value} ; do 58 | if [[ -z ${seen[${item}]} ]] ; then 59 | seen["${item}"]=1 60 | items+=( "${item}" ) 61 | fi 62 | done 63 | IFS=${saved_IFS} 64 | 65 | # Add now additional elements given as positional arguments. 66 | for item in "$@" ; do 67 | item=$(realpath -m "${prefix}/${item}") 68 | if [[ -z ${seen[${item}]} ]] ; then 69 | seen["${item}"]=1 70 | case ${position} in 71 | -p | --prepend) 72 | items=( "${item}" "${items[@]}" ) 73 | ;; 74 | -a | --append) 75 | items+=( "${item}" ) 76 | ;; 77 | esac 78 | fi 79 | done 80 | 81 | # Reassemble back the value. 82 | value='' 83 | for item in "${items[@]}" ; do 84 | value="${value}:${item}" 85 | done 86 | export_vars[${variable}]=${value:1} # Remove the leading colon. 87 | } 88 | 89 | add -p PATH /bin:/sbin:/usr/bin:/usr/sbin bin sbin 90 | 91 | add -p MANPATH - share/man 92 | add -p INFOPATH - share/info 93 | 94 | add -p C_INCLUDE_PATH - include 95 | add -p OBJC_INCLUDE_PATH - include 96 | add -p CPLUS_INCLUDE_PATH - include 97 | 98 | add -p LD_LIBRARY_PATH - lib 99 | add -p LIBRARY_PATH - lib 100 | 101 | add -p PERL5LIB - lib/perl5 102 | 103 | add -p ACLOCAL_PATH /usr/share/aclocal \ 104 | share/aclocal 105 | 106 | add -p PKG_CONFIG_PATH /usr/lib/pkgconfig:/usr/share/pkgconfig \ 107 | lib/pkgconfig share/pkgconfig 108 | 109 | add -p GI_TYPELIB_PATH /usr/lib/girepository-1.0 \ 110 | lib/girepository-1.0 111 | 112 | add -p XDG_DATA_DIRS /usr/share share 113 | add -p XDG_CONFIG_DIRS /etc/xdg etc/xdg 114 | 115 | #add -p XCURSOR_PATH - share/icons 116 | 117 | add -p GST_PLUGIN_PATH - lib/gstreamer-0.10 118 | add -p GST_PLUGIN_PATH_1_0 - lib/gstreamer-1.0 119 | 120 | export_vars[GST_REGISTRY]="${prefix}/.gstreamer-0.10.registry" 121 | export_vars[GST_REGISTRY_1_0]="${prefix}/.gstreamer-1.0.registry" 122 | export_vars[JHENV]=${prefix} 123 | 124 | for v in "${!export_vars[@]}" ; do 125 | eval "export ${v}='${export_vars[${v}]}'" 126 | done 127 | 128 | if [[ $# -eq 0 ]] ; then 129 | exec bash 130 | else 131 | exec "$@" 132 | fi 133 | -------------------------------------------------------------------------------- /bin/notmuch-monthly-archive: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # notmuch-monthly-archive 4 | # Copyright (C) 2014 Adrian Perez 5 | # 6 | # Distributed under terms of the MIT license. 7 | # 8 | set -e 9 | 10 | declare -r maildir="$HOME/.mail" 11 | 12 | 13 | get_previous_month () 14 | { 15 | local -i year=$1 month=$2 16 | 17 | if [[ $(( month-- )) -eq 1 ]] ; then 18 | (( year-- )) 19 | month=12 20 | fi 21 | echo "${year} ${month}" 22 | } 23 | 24 | ensure_maildir_folders () 25 | { 26 | if [[ -d $1/cur ]] ; then 27 | return 28 | fi 29 | 30 | mkdir -p "$1"/{tmp,cur,new} 31 | ensure_maildir_folders "${1%.*}" 32 | } 33 | 34 | maildir_flags () 35 | { 36 | local flags=${1##*:} 37 | [[ ${flags} == $1 ]] || printf "%s\n" "${flags}" 38 | } 39 | 40 | declare -i year month prev_year prev_month 41 | declare archive_folder='' 42 | declare date_range='' 43 | declare path='' 44 | 45 | printf -v year '%(%Y)T' -1 46 | printf -v month '%(%-m)T' -1 47 | read prev_year prev_month < <( get_previous_month ${year} ${month} ) 48 | 49 | 50 | while true ; do 51 | printf -v date_range 'date:%i-%02i-01..%i-%02i-01' \ 52 | ${prev_year} ${prev_month} ${year} ${month} 53 | printf -v archive_folder 'Archives.%i.%i-%02i' \ 54 | ${prev_year} ${prev_year} ${prev_month} 55 | 56 | ensure_maildir_folders "${maildir}/${archive_folder}" 57 | 58 | got_messages=false 59 | while read -r path ; do 60 | [[ -f ${path} ]] || continue 61 | got_messages=true 62 | # 63 | # In order to move a message to the archive folder, try first to 64 | # hardlink with the same file name, which will keep the Maildir 65 | # flags intact. If that fails (because a file with the same name 66 | # exists), then revert to move it it the directory using safecat, 67 | # and the re-adding the flags. 68 | # 69 | if ! ln -t "${maildir}/${archive_folder}/cur" "${path}" 2> /dev/null 70 | then 71 | dest_filename=$(safecat "${maildir}/${archive_folder}/tmp" \ 72 | "${maildir}/${archive_folder}/cur" \ 73 | < "${path}") 74 | flags=$(maildir_flags) 75 | if [[ -n ${flags} && -n ${dest_filename} ]] ; then 76 | mv -T "${maildir}/${archive_folder}/cur/${dest_filename}" \ 77 | "${maildir}/${archive_folder}/cur/${dest_filename}:${flags}" 78 | fi 79 | fi 80 | rm -f "${path}" 81 | done < <( notmuch search --output=files "${date_range}" \ 82 | and not "folder:${archive_folder}" \ 83 | and not \( tag:inbox or tag:unread or tag:sent \) ) \ 84 | > /dev/null 85 | 86 | # No messages were archived for the previous month, there is nothing left to do. 87 | ${got_messages} || break 88 | echo "Archived messages under ${archive_folder}" 89 | 90 | # Archive messages from the previous month 91 | year=${prev_year} 92 | month=${prev_month} 93 | read prev_year prev_month < <( get_previous_month ${year} ${month} ) 94 | done 95 | notmuch new 96 | -------------------------------------------------------------------------------- /bin/quick-nat: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | set -e 3 | 4 | default-route-dev () { 5 | local -a line 6 | while read -r -a line ; do 7 | if [[ ${#line[@]} -ge 5 && ${line[0]} = default && ${line[1]} = via ]] 8 | then 9 | echo "${line[4]}" 10 | break 11 | fi 12 | done < <( ip route ) 13 | } 14 | 15 | available-devices () { 16 | local -a line 17 | local default=$(default-route-dev) 18 | while read -r -a line ; do 19 | if [[ ${#line[@]} -ge 2 && ${line[0]} != ${default} && ${line[1]} != UNKNOWN ]] ; then 20 | echo "${line[0]}" 21 | fi 22 | done < <( ip -br link ) 23 | } 24 | 25 | msg () { printf '%s%s\n' "${1}" "${2:-}" ; } 1>&2 26 | die () { printf '%s\n' "$*" ; } 1>&2 27 | 28 | 29 | declare -a candidates=( $(available-devices) ) 30 | [[ ${#candidates[@]} -gt 0 ]] || die 'No candidate devices' 31 | 32 | declare -r defaultroute=$(default-route-dev) 33 | [[ -n ${defaultroute} ]] || die 'No default route' 34 | 35 | msg 'Default route: ' "${defaultroute}" 36 | msg 'Available devices: ' "${candidates[*]}" 37 | 38 | if [[ $# -eq 1 ]] ; then 39 | candidates[0]=$1 40 | fi 41 | [[ ${#candidates[@]} -eq 1 ]] || die 'Multiple devices available' 42 | 43 | msg 'Chosen device: ' "${candidates[0]}" 44 | 45 | msg 'Script:' 46 | cat < /proc/sys/net/ipv4/ip_forward 48 | iptables -t nat -A POSTROUTING -o ${defaultroute} -j MASQUERADE 49 | iptables -A FORWARD -i ${defaultroute} -o ${candidates[0]} -m state --state RELATED,ESTABLISHED -j ACCEPT 50 | iptables -A FORWARD -i ${candidates[0]} -o ${defaultroute} -j ACCEPT 51 | EOF 52 | -------------------------------------------------------------------------------- /bin/sk-or-fzf: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -e 3 | for tool in sk fzf ; do 4 | X=$(command -v "$tool" 2>/dev/null) 5 | if [ -n "$X" ] && [ -x "$X" ] ; then 6 | exec "$X" "$@" 7 | fi 8 | done 9 | echo 'Skim or Fzf not found' 1>&2 10 | exit 1 11 | -------------------------------------------------------------------------------- /bin/sway-launch: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | set -eu -o pipefail 3 | # export GDK_BACKEND=wayland 4 | # export CLUTTER_BACKEND=wayland 5 | # export SDL_VIDEODRIVER=wayland 6 | export QT_QPA_PLATFORM=wayland-egl 7 | export QT_QPA_PLATFORMTHEME=qt5ct 8 | # export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 9 | export MOZ_ENABLE_WAYLAND=1 10 | export SWAY_CURSOR_THEME=Hackneyed 11 | export SWAY_CURSOR_SIZE=24 12 | export XCURSOR_THEME=$SWAY_CURSOR_THEME 13 | export XCURSOR_SIZE=$SWAY_CURSOR_SIZE 14 | exec "${WLC:-sway}" "$@" 15 | -------------------------------------------------------------------------------- /bin/v8-build: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # vim:set ts=2 sw=2 et: 3 | # 4 | # v8-build 5 | # Copyright (C) 2013-2015 Adrian Perez 6 | # 7 | # Distributed under terms of the MIT license. 8 | # 9 | set -e 10 | 11 | # Toolchain to use: 'clang' or 'gcc' 12 | compiler='clang' 13 | 14 | # Build system to use: 'make' or 'ninja' 15 | builder='make' 16 | 17 | # Build type: 'release', 'debug', or 'optdebug' 18 | buildtype='debug' 19 | 20 | # Whether to use Icrecream (IceCC) to do a distributed build. 21 | # Setting to true forces compiler='gcc', and builder='ninja' above. 22 | use_icecc=false 23 | 24 | # Whether to use clang's Address Sanitizer (ASAN). 25 | # Setting to true forces compiler='clang' above 26 | use_asan=false 27 | 28 | # Number of parallel jobs. By default, it's set to the number of online 29 | # CPUs. When doing a distributed build, this is multiplied by five. 30 | parallel_jobs=$(getconf _NPROCESSORS_ONLN) 31 | 32 | # Target. Valid values (other than empty, which means "all") are: 33 | # parser-shell 34 | build_target='' 35 | 36 | 37 | declare -r clang_opts=( 38 | '-ferror-limit=1' 39 | '-Qunused-arguments' 40 | ) 41 | declare -r clang_asan_opts=( 42 | '-g' 43 | '-O1' 44 | '-fsanitize=address' 45 | '-fno-omit-frame-pointer' 46 | ) 47 | declare -r clang_libcxx_opts=( 48 | '-stdlib=libc++' 49 | ) 50 | declare -r link_libcxx_opts=( 51 | "${clang_libcxx_opts[@]}" 52 | '-lc++abi' 53 | ) 54 | declare -a options=( 55 | 'console=readline' 56 | 'werror=no' 57 | 'disassembler=on' 58 | 'objectprint=on' 59 | 'verifyheap=on' 60 | 'backtrace=on' 61 | 'verifypredictable=on' 62 | 'gdbjit=off' 63 | 'deprecationwarnings=on' 64 | ) 65 | declare -a build_opts=( ) 66 | 67 | declare -a gyp_cli_options=( ) 68 | declare -a gyp_env_defines=( 69 | 'linux_use_bundled_binutils=0' 70 | 'linux_use_bundled_gold=0' 71 | 'linux_use_gold_flags=0' 72 | 'linux_use_debug_fission=0' 73 | ) 74 | 75 | # Those manipulate the two previous variables. 76 | gyp_envd () { 77 | if [[ -n $1 ]] ; then 78 | gyp_env_defines=( "${gyp_env_defines[@]}" "$1" ) 79 | fi 80 | } 81 | gyp_flag () { 82 | if [[ -n $1 ]] ; then 83 | gyp_cli_options=( "${gyp_cli_options[@]}" "$1" ) 84 | fi 85 | } 86 | 87 | 88 | on_off () { 89 | case $1 in 90 | off) echo 0 ;; 91 | on ) echo 1 ;; 92 | * ) die "Invalid on/off value: $1" ;; 93 | esac 94 | } 95 | 96 | 97 | info () { 98 | printf -- "%10s → %s\n" "$1" "$2" 99 | } 100 | 101 | 102 | die () { 103 | echo "$*" 1>&2 104 | exit 1 105 | } 106 | 107 | 108 | setup_icecc () { 109 | if ${use_asan} ; then 110 | die "Cannot use --asan and --icecc at the same time" 111 | fi 112 | 113 | export CCACHE_PREFIX=/usr/lib/icecream/bin/icecc 114 | if [[ -n ${ICECC_VERSION} ]] ; then 115 | info "icecc" "Using preset toolchain" 116 | else 117 | info "icecc" "Creating toolchain tarball" 118 | export ICECC_VERSION="$(pwd)/$(/usr/lib/icecream/bin/icecc --build-native 2>&1 |awk '/^creating/{print $2}')" 119 | fi 120 | info "icecc" "${ICECC_VERSION}" 121 | 122 | parallel_jobs=$(( parallel_jobs * 5 )) 123 | compiler='gcc' 124 | } 125 | 126 | 127 | setup_asan () { 128 | if ${use_icecc} ; then 129 | die "Cannot use --asan and --icecc at the same time" 130 | fi 131 | 132 | local clang_dir=$(dirname "$(which clang)") 133 | if [[ -z ${ASAN_SYMBOLIZER_PATH} ]] ; then 134 | if [[ -x /usr/bin/llvm-symbolizer ]] ; then 135 | ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer 136 | else 137 | ASAN_SYMBOLIZER_PATH="${clang_dir}/llvm-symbolizer" 138 | fi 139 | fi 140 | 141 | [[ -x ${ASAN_SYMBOLIZER_PATH} ]] \ 142 | || die "${ASAN_SYMBOLIZER_PATH}: missing or it is not executable" 143 | export ASAN_SYMBOLIZER_PATH 144 | 145 | CXX="${clang_dir}/clang++ ${clang_opts[*]} ${clang_asan_opts[*]} ${clang_libcxx_opts[*]}" 146 | LINK="${clang_dir}/clang++ ${clang_asan_opts[*]} ${link_libcxx_opts[*]}" 147 | 148 | gyp_envd 'asan=1' 149 | compiler='clang' 150 | builder='make' 151 | } 152 | 153 | 154 | setup_compiler_clang () { 155 | [[ -n ${LINK} ]] || LINK="clang++ ${clang_opts[*]}" 156 | [[ -n ${CXX} ]] || CXX="clang++ ${clang_opts[*]}" 157 | [[ -n ${CC} ]] || CC="clang ${clang_opts[*]}" 158 | gyp_envd 'clang=1' 159 | export CC CXX LINK 160 | } 161 | 162 | 163 | setup_compiler_gcc () { 164 | [[ -n ${LINK} ]] || LINK="g++" 165 | [[ -n ${CXX} ]] || CXX="g++" 166 | [[ -n ${CC} ]] || CC="gcc" 167 | gyp_envd 'clang=0' 168 | export CC CXX LINK 169 | } 170 | 171 | 172 | setup_builder_ninja () { 173 | if [[ -n ${build_target} ]] ; then 174 | echo 'Ninja builder does not support specifying targets (yet)' 1>&2 175 | exit 1 176 | fi 177 | if [[ ${buildtype} = debug ]] ; then 178 | build_opts=( "${build_opts[@]}" '-C' 'out/Debug' ) 179 | else 180 | build_opts=( "${build_opts[@]}" '-C' 'out/Release' ) 181 | fi 182 | export GYP_GENERATORS='ninja' 183 | } 184 | 185 | 186 | declare -r builder_make_targets=( 187 | parser-shell 188 | d8 189 | ) 190 | setup_builder_make () { 191 | if [[ -z ${build_target} ]] ; then 192 | build_opts=( "${build_opts[@]}" "x64.${buildtype}" ) 193 | elif [[ ${build_target} = help ]] ; then 194 | echo 'Supported targets:' 195 | for target in "${builder_make_targets[@]}" ; do 196 | printf ' * %s\n' "${target}" 197 | done 198 | exit 0 199 | else 200 | local invalid_target=true 201 | for target in "${builder_make_targets[@]}" ; do 202 | if [[ ${target} = ${build_target} ]] ; then 203 | invalid_target=false 204 | break 205 | fi 206 | done 207 | if ${invalid_target} ; then 208 | printf 'Invalid target "%s" (hint: use --target=help for a list)\n' \ 209 | "${build_target}" 1>&2 210 | exit 1 211 | fi 212 | local var_buildtype=$(python -c \ 213 | 'print raw_input().replace("opt", "").capitalize()' <<< ${buildtype}) 214 | 215 | # XXX: This uses knowledge about how the top-level V8 Makefile works, and 216 | # may break horribly if the logic in there ever changes. Also, it 217 | # assumes that $(OUTDIR) is always "out" and it won't be changed. 218 | build_opts=( "${build_opts[@]}" 219 | -C out -f Makefile.x64.${buildtype} 220 | "BUILDTYPE=${var_buildtype}" 221 | "builddir=$(pwd)/out/x64.${buildtype}" 222 | "${build_target}" 223 | ) 224 | fi 225 | } 226 | 227 | 228 | build_gyp_cli_options () { 229 | local item 230 | 231 | for item in "${gyp_defs[@]}" ; do 232 | gyp_cli_options=( "${gyp_cli_options[@]}" "-D${item}" ) 233 | done 234 | 235 | for item in "${options[@]}" ; do 236 | case ${item} in 237 | console=*) 238 | gyp_flag "-D${item}" 239 | ;; 240 | werror=*) 241 | v=${item#*=} 242 | if [[ ${v} = no ]] ; then 243 | gyp_flag '-Dwerror=' 244 | elif [[ ${v} != yes ]] ; then 245 | gyp_flag "-Dwerror='${v}'" 246 | fi 247 | ;; 248 | disassembler=* | backtrace=* | gdbjit=*) 249 | gyp_flag "-Dv8_enable_${item%%=*}=$(on_off ${item#*=})" 250 | ;; 251 | verifypredictable=*) 252 | gyp_flag "-Dv8_enable_verify_predictable=$(on_off ${item#*=})" 253 | ;; 254 | verifyheap=*) 255 | gyp_flag "-Dv8_enable_verify_heap=$(on_off ${item#*=})" 256 | ;; 257 | objectprint=*) 258 | gyp_flag "-Dv8_object_print=$(on_off ${item#*=})" 259 | ;; 260 | extrachecks=*) 261 | gyp_flag "-Ddcheck_always_on=$(on_off ${item#*=})" 262 | gyp_flag "-Dv8_enable_handle_zapping=$(on_off ${item#*=})" 263 | ;; 264 | slowdchecks=*) 265 | gyp_flag "-Dv8_enable_slow_dchecks=$(on_off ${item#*=})" 266 | ;; 267 | deprecationwarnings=*) 268 | gyp_flag "-Dv8_deprecation_warnings=$(on_off ${item#*=})" 269 | ;; 270 | esac 271 | done 272 | } 273 | 274 | 275 | build_ninja () { 276 | build_gyp_cli_options 277 | ./gypfiles/gyp_v8 "${gyp_cli_options[@]}" 278 | ln -fs Debug out/x64.debug 279 | ln -fs Release out/x64.release 280 | exec ninja -j${parallel_jobs} "${build_opts[@]}" 281 | } 282 | 283 | 284 | build_make () { 285 | exec make -j${parallel_jobs} "${options[@]}" "${build_opts[@]}" 286 | } 287 | 288 | 289 | do_help () { 290 | cat < "${tmpfile}" 6 | vcal "$@" "${tmpfile}" 7 | -------------------------------------------------------------------------------- /bin/xinput-touchpad-configure: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # xinput-touchpad-tap 4 | # Copyright (C) 2016 Adrian Perez 5 | # 6 | # Distributed under terms of the MIT license. 7 | set -e 8 | 9 | configure_device () { 10 | xinput set-int-prop "${1}" 'libinput Tapping Enabled' 8 1 11 | xinput set-int-prop "${1}" 'libinput Middle Emulation Enabled' 8 1 12 | } 13 | 14 | while read -r line ; do 15 | case ${line} in 16 | *[tT]ouch[pP]ad*) 17 | configure_device "${line}" 18 | ;; 19 | esac 20 | done < <( xinput list --name-only ) 21 | -------------------------------------------------------------------------------- /bin/xwin-decor: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | set -e 3 | 4 | bit=1 5 | case ${1:-on} in 6 | on) bit=1 ;; 7 | off) bit=0 ;; 8 | esac 9 | 10 | declare -a xprop_args=( 11 | -f _MOTIF_WM_HINTS 32c 12 | -set _MOTIF_WM_HINTS "0x2,0x0,0x${bit},0x0,0x0" 13 | ) 14 | 15 | if [[ $2 = choose ]] ; then 16 | : 17 | elif [[ -n $2 ]] ; then 18 | xprop_args+=( -id "$2" ) 19 | elif [[ -n ${WINDOWID} ]] ; then 20 | xprop_args+=( -id "${WINDOWID}" ) 21 | fi 22 | 23 | exec xprop "${xprop_args[@]}" 24 | -------------------------------------------------------------------------------- /dot.Xresources: -------------------------------------------------------------------------------- 1 | ! vim: ft=xdefaults 2 | 3 | ! Xcursor.theme: Adwaita 4 | ! Xcursor.theme: Bluecurve 5 | ! Xcursor.theme: Hackneyed 6 | ! Xcursor.theme: Hackneyed-Dark 7 | ! Xcursor.theme: Vanilla-DMZ 8 | ! Xcursor.theme: DMZ-White 9 | ! Xcursor.theme: cz-Viator-rotor-white 10 | ! Xcursor.theme: cz-Viator-ring-black 11 | ! Xcursor.theme: cz-Viator-ring-white 12 | ! Xcursor.theme: elementary 13 | ! Xcursor.theme: Qogir-dark 14 | ! Xcursor.theme: We10XOS-cursors 15 | ! Xcursor.theme: WhiteSur-cursors 16 | ! Xcursor.size: 24 17 | 18 | ! Xft.autohint: 0 19 | ! Xft.lcdfilter: lcdlight 20 | ! Xft.hintstyle: hintslight 21 | ! Xft.hinting: 0 22 | ! Xft.antialias: 1 23 | ! Xft.rgba: rgb 24 | 25 | XTerm*decTerminalID: vt340 26 | XTerm*vt100.utf8: true 27 | XTerm*bellIsUrgent: true 28 | XTerm*visualBell: true 29 | XTerm*visualBellLine: true 30 | XTerm*eightBitInput: false 31 | XTerm*scrollBar: false 32 | XTerm*vt100.toolBar: false 33 | XTerm*vt100.allowBoldFonts: true 34 | XTerm*vt100.background: black 35 | XTerm*vt100.foreground: grey80 36 | XTerm*vt100.cursorColor: #ff7a7a 37 | XTerm*vt100.faceName: DM Mono 38 | ! XTerm*vt100.faceName: Inconsolata LGC 39 | ! XTerm*vt100.faceSize: 9.875 40 | ! XTerm*vt100.faceName: xos4 Terminus 41 | XTerm*vt100.faceSize: 10 42 | XTerm*vt100.font: -*-terminus-bold-*-*-*-28-*-*-*-*-*-iso10646-1 43 | XTerm*vt100.faceNameDoublesize: Koruri 44 | XTerm*vt100.deleteIsDEL: true 45 | !XTerm*vt100.faceSize: 12 46 | !XTerm*vt100.faceName: unifont 47 | XTerm*termName: xterm-256color 48 | XTerm*charClass: 33:48,35-38:48,39:43,42-47:48,58-59:48,61:48,63-64:48,126:48 49 | 50 | UXTerm*decTerminalID: vt340 51 | UXTerm*vt100.utf8: true 52 | UXTerm*bellIsUrgent: true 53 | UXTerm*visualBell: true 54 | UXTerm*visualBellLine: true 55 | UXTerm*eightBitInput: false 56 | UXTerm*scrollBar: false 57 | UXTerm*vt100.toolBar: false 58 | UXTerm*vt100.allowBoldFonts: true 59 | UXTerm*vt100.background: black 60 | UXTerm*vt100.foreground: grey80 61 | UXTerm*vt100.cursorColor: #aa0033 62 | UXTerm*vt100.faceName: PragmataPro Mono 63 | UXTerm*vt100.font: -*-gohufont-medium-r-normal-*-14-*-*-*-c-80-iso10646-1 64 | UXTerm*vt100.boldFont: -*-gohufont-bold-r-normal-*-14-*-*-*-c-80-iso10646-1 65 | UXTerm*vt100.faceSize: 10 66 | !UXTerm*vt100.faceNameDoublesize: VL Gothic 67 | UXTerm*vt100.deleteIsDEL: false 68 | UXTerm*charClass: 33:48,35-38:48,39:43,42-47:48,58-59:48,61:48,63-64:48,126:48 69 | UXTerm*loginShell: true 70 | UXTerm*termName: xterm-256color 71 | 72 | Emacs*useXIM: false 73 | Notmuch*useXIM: false 74 | Notmuch.iconName: evolution 75 | 76 | URxvt.geometry: 90x42 77 | URxvt.font: xft:PragmataPro:size=12 78 | URxvt.boldFont: xft:PragmataPro:size=12:bold 79 | URxvt.urgentOnBell: true 80 | URxvt.print-pipe: cat > $(TMPDIR=$HOME mktemp urxvt.XXXXXX) 81 | URxvt.scrollBar: false 82 | URxvt.pointerBlank: true 83 | URxvt.secondaryScreen: false 84 | URxvt.cursorColor: #00cc00 85 | URxvt.background: black 86 | URxvt.foreground: #dddddd 87 | URxvt.letterSpace: -2 88 | URxvt.lineSpace: -1 89 | URxvt.internalBorder: 2 90 | URxvt.borderColor: black 91 | URxvt.scrollstyle: rxvt 92 | URxvt.loginShell: true 93 | URxvt.jumpScroll: true 94 | URxvt.skipScroll: true 95 | 96 | ! Launch URLs by clicking them 97 | URxvt.perl-ext-common: default,matcher 98 | URxvt.urlLauncher: xdg-open 99 | URxvt.matcher.button: 1 100 | ! URxvt.colorUL: #86a2be 101 | 102 | ! black 103 | URxvt.color0 : #000000 104 | URxvt.color8 : #555555 105 | ! red 106 | URxvt.color1 : #aa0000 107 | URxvt.color9 : #ff5555 108 | ! green 109 | URxvt.color2 : #00aa00 110 | URxvt.color10 : #55ff55 111 | ! yellow 112 | URxvt.color3 : #aa5500 113 | URxvt.color11 : #ffff55 114 | ! blue 115 | URxvt.color4 : #0000aa 116 | URxvt.color12 : #5555ff 117 | ! magenta 118 | URxvt.color5 : #aa00aa 119 | URxvt.color13 : #ff55ff 120 | ! cyan 121 | URxvt.color6 : #00aaaa 122 | URxvt.color14 : #55ffff 123 | ! white 124 | URxvt.color7 : #aaaaaa 125 | URxvt.color15 : #ffffff 126 | 127 | ! st.font : xos4 Terminus:size=12 128 | ! st.font : JetBrains Mono:size=11.5 129 | st.font : PragmataPro Mono:size=11 130 | st.xfps : 120 131 | st.borderpx : 4 132 | st.cwscale : 0.9 133 | st.cursor : #aa0033 134 | st.reverseCursor : #fddddd 135 | st.foreground : #dcdcdc 136 | st.background : #040404 137 | st.color0 : #000000 138 | st.color8 : #555555 139 | st.color1 : #aa0000 140 | st.color9 : #ff5555 141 | st.color2 : #00aa00 142 | st.color10 : #55ff55 143 | st.color3 : #aa5500 144 | st.color11 : #ffff55 145 | st.color4 : #0000aa 146 | st.color12 : #5555ff 147 | st.color5 : #aa00aa 148 | st.color13 : #ff55ff 149 | st.color6 : #00aaaa 150 | st.color14 : #55ffff 151 | st.color7 : #aaaaaa 152 | st.color15 : #ffffff 153 | 154 | Zutty.font: JetBrainsMono 155 | Zutty.dwfont: wqy-microhei 156 | Zutty.fontsize: 26 157 | Zutty.fontpath: /home/aperez/.local/share/fonts:/usr/share/fonts 158 | Zutty.boldColors: true 159 | Zutty.quiet: true 160 | Zutty.cr: #9922bb 161 | Zutty.fg: #dcdcdc 162 | Zutty.bg: #040404 163 | Zutty.color0: #000000 164 | Zutty.color1: #aa0000 165 | Zutty.color2: #00aa00 166 | Zutty.color3: #aa5500 167 | Zutty.color4: #2244ff 168 | Zutty.color5: #aa00aa 169 | Zutty.color6: #00aaaa 170 | Zutty.color7: #bbbbbb 171 | Zutty.color8: #777777 172 | Zutty.color9: #ff5555 173 | Zutty.color10: #55ff55 174 | Zutty.color11: #ffff55 175 | Zutty.color12: #5599ff 176 | Zutty.color13: #ff55ff 177 | Zutty.color14: #55ffff 178 | Zutty.color15: #ffffff 179 | -------------------------------------------------------------------------------- /dot.bash_profile: -------------------------------------------------------------------------------- 1 | if [[ -r ~/.bashrc ]] ; then 2 | source ~/.bashrc 3 | fi 4 | -------------------------------------------------------------------------------- /dot.bashrc: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | for dirpath in ${HOME}/.local/bin ${HOME}/.dotfiles/bin ; do 4 | if [[ -d ${dirpath} ]] ; then 5 | PATH="${dirpath}:${PATH}" 6 | fi 7 | done 8 | 9 | if [[ $- == *i* ]] ; then 10 | 11 | # Set colorful PS1 only on colorful terminals. 12 | # dircolors --print-database uses its own built-in database 13 | # instead of using /etc/DIR_COLORS. Try to use the external file 14 | # first to take advantage of user additions. Use internal bash 15 | # globbing instead of external grep binary. 16 | safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM 17 | match_lhs="" 18 | [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)" 19 | [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(/dev/null \ 22 | && match_lhs=$(dircolors --print-database) 23 | [[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true 24 | 25 | if ${use_color} ; then 26 | # Enable colors for ls, etc. Prefer ~/.dir_colors #64489 27 | if type -P dircolors >/dev/null ; then 28 | if [[ -f ~/.dir_colors ]] ; then 29 | eval $(dircolors -b ~/.dir_colors) 30 | elif [[ -f /etc/DIR_COLORS ]] ; then 31 | eval $(dircolors -b /etc/DIR_COLORS) 32 | fi 33 | fi 34 | 35 | if [[ ${EUID} == 0 ]] ; then 36 | PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' 37 | else 38 | PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' 39 | fi 40 | 41 | if ls --version && ls --version | grep GNU ; then 42 | alias ls='ls --color=auto -F' 43 | else 44 | # In BSD systems, usually setting this makes "ls" use colors 45 | export CLICOLOR=1 46 | export LSCOLORS=ExGxFxdxCxDxDxhbabacae 47 | if [[ $(type -pt colorls) = file ]] ; then 48 | alias ls='colorls -F' 49 | else 50 | alias ls='ls -F' 51 | fi 52 | fi &> /dev/null 53 | 54 | if grep --version && grep --version | grep GNU ; then 55 | alias grep='grep --colour=auto' 56 | fi &> /dev/null 57 | else 58 | if [[ ${EUID} == 0 ]] ; then 59 | # show root@ when we don't have colors 60 | PS1='\u@\h \W \$ ' 61 | else 62 | PS1='\u@\h \w \$ ' 63 | fi 64 | fi 65 | 66 | 67 | # Aliases! 68 | alias vi='vim' 69 | alias view='vim -R' 70 | alias -- '+'=pushd 71 | alias -- '-'=popd 72 | alias -- '..'='cd ..' 73 | 74 | case $TERM in 75 | # Unicode for the masses! 76 | xterm* | uxterm* | gnome-terminal | urxvt*) 77 | LANG=en_US.UTF-8 78 | ;; 79 | esac 80 | 81 | for editor in nvim vim vi e3vi ; do 82 | if [[ $(type -pt ${editor}) = file ]] ; then 83 | EDITOR=${editor} 84 | break 85 | fi 86 | done 87 | 88 | export GPG_TTY=$(tty) 89 | if [[ $(type -pt gpg-connect-agent) = file ]] ; then 90 | gpg-connect-agent -q updatestartuptty /bye > /dev/null 91 | fi 92 | 93 | export PATH EDITOR 94 | if [[ $(type -pt systemctl) == file ]] ; then 95 | systemctl --user import-environment PATH EDITOR LANG 96 | fi 97 | 98 | if [[ -r /usr/share/fzf/key-bindings.bash ]] ; then 99 | source /usr/share/fzf/key-bindings.bash 100 | fi 101 | 102 | fi # Interactive shell 103 | -------------------------------------------------------------------------------- /dot.config--afew--config: -------------------------------------------------------------------------------- 1 | # vim:ft=cfg 2 | 3 | [SpamFilter] 4 | #[ClassifyingFilter] 5 | [KillThreadsFilter] 6 | [ListMailsFilter] 7 | 8 | [Filter.1] 9 | message = Mark killed threads as read 10 | query = tag:killed and tag:unread 11 | tags = -unread 12 | 13 | [Filter.2] 14 | message = Mark Bugzilla/Trac messages as tickets 15 | query = from:bugzilla-daemon@webkit.org 16 | or from:bugzilla@busybox.net 17 | or from:igalia-management-staff@igalia.com 18 | or from:igalia-systems@igalia.com 19 | tags = +ticket 20 | 21 | [Filter.3] 22 | messages = Mark Myrddin mailing list messages 23 | query = to:myrddin-dev@eigenstate.org 24 | tags = +myrddin 25 | 26 | #[Filter.4] 27 | #message = Mark patches 28 | #query = subject:/^\[Buildroot\] \[PATCH/ or subject:/\[PATCH/ 29 | #query = subject:/^\[Buildroot\] \[PATCH/ 30 | #tags = +patch 31 | 32 | [HeaderMatchingFilter.1] 33 | message = Mark patches sent by git-send-email 34 | header = X-Mailer 35 | pattern = ^git-send-email\s 36 | tags = +patch 37 | 38 | [SentMailsFilter] 39 | sent_tag = sent 40 | 41 | [ArchiveSentMailsFilter] 42 | 43 | [InboxFilter] 44 | tags = +unread;+inbox 45 | 46 | [MailMover] 47 | folders = INBOX Spam 48 | INBOX = 'tag:spam':Spam 49 | Spam = 'not tag:spam':INBOX 50 | -------------------------------------------------------------------------------- /dot.config--alot--config: -------------------------------------------------------------------------------- 1 | # vim: ft=cfg 2 | auto_remove_unread = False 3 | auto_replyto_mailinglist = True 4 | honor_followup_to = True 5 | folowup_to = True 6 | terminal_cmd = /home/aperez/.dotfiles/bin/alot-run-editor 7 | initial_command = search tag:inbox AND NOT ( tag:killed OR tag:deleted ) 8 | ask_subject = True 9 | editor_spawn = True 10 | editor_in_thread = True 11 | prefer_plaintext = True 12 | input_timeout = 0.4 13 | tabwidth = 4 14 | 15 | [accounts] 16 | [[igalia]] 17 | realname = Adrián Pérez de Castro 18 | address = aperez@igalia.com 19 | sent_box = maildir:///home/aperez/Maildir/Sent 20 | draft_box = maildir:///home/aperez/Maildir/Drafts 21 | signature_filename = file:///home/aperez/.signature 22 | gpg_key = E4C9123B 23 | sign_by_default = True 24 | [[[abook]]] 25 | type = shellcommand 26 | regexp = '^(?P[^@]+@[^\t]+)\t+(?P[^\t]+)' 27 | command = notmuch-addrlookup --mutt 28 | ignorecase = True 29 | 30 | [bindings] 31 | Q = exit 32 | q = bclose 33 | [[search]] 34 | d = toggletags deleted 35 | J = toggletags spam 36 | t = toggletags ticket 37 | i = toggletags fyi 38 | s = toggletags unread 39 | A = untag unread,inbox 40 | [[thread]] 41 | d = toggletags deleted 42 | J = toggletags spam 43 | t = toggletags ticket 44 | i = toggletags fyi 45 | & = toggletags killed 46 | s = toggletags unread 47 | A = untag unread,inbox 48 | 49 | [tags] 50 | [[flagged]] 51 | translated = ! 52 | normal = '','','light red','','light red','' 53 | focus = '','','light red','','light red','' 54 | [[replied]] 55 | translated = ↑ 56 | [[sent]] 57 | translated = → 58 | [[signed]] 59 | translated = § 60 | [[unread]] 61 | focus = '','','light green','','light green','' 62 | -------------------------------------------------------------------------------- /dot.config--alot--hooks.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # vim:fenc=utf-8 4 | # 5 | # Copyright © 2015 Adrian Perez 6 | # 7 | # Distributed under terms of the MIT license. 8 | 9 | from os import path 10 | S = path.expanduser(path.join(path.dirname(path.dirname(path.dirname(__file__))), ".signature")) 11 | 12 | def pre_edit_translate(body, ui=None, dbm=None): 13 | if path.isfile(S): 14 | signature = None 15 | try: 16 | with open(S, "rb") as fd: 17 | signature = fd.read() 18 | except: 19 | pass 20 | if signature is not None: 21 | signature = u"\n--\n" + signature.decode("utf-8") 22 | if not body.endswith(signature): 23 | body += signature 24 | return body 25 | -------------------------------------------------------------------------------- /dot.config--beets--config.yaml: -------------------------------------------------------------------------------- 1 | asciify_paths: yes 2 | 3 | import: 4 | move: yes 5 | resume: ask 6 | languages: [en] 7 | 8 | match: 9 | preferred: 10 | countries: ['US', 'GB|UK', 'ES', 'FI'] 11 | media: ['CD', 'Vinyl', 'Digital Media|File'] 12 | original_year: yes 13 | 14 | paths: 15 | singleton: '%the{${albumartist}}/${title}' 16 | default: '${albumartist}/${album}%if{%aunique{}, %aunique{}}/${disc_and_track}${title}' 17 | compilation: 'Various Artists/${album}%if{%aunique{}, %aunique{}}/${disc_and_track}${artist} - ${title}' 18 | 19 | # discogs 20 | plugins: duplicates edit fetchart fromfilename fuzzy info inline lastgenre mbsync missing permissions play random replaygain scrub the web zero chroma acousticbrainz mbsubmit 21 | 22 | acoustid: 23 | apikey: 'm35mx1Wr' 24 | 25 | fetchart: 26 | minwidth: 250 27 | maxwidth: 600 28 | enforce_ratio: yes 29 | 30 | item_fields: 31 | disc_and_track: u'%02i. %02i. ' % (disc, track) if disctotal > 1 else u'%02i. ' % (track) 32 | 33 | chroma: 34 | auto: yes 35 | 36 | play: 37 | command: gst-play-1.0 38 | raw: yes 39 | 40 | replaygain: 41 | backend: gstreamer 42 | method: ebu 43 | overwrite: yes 44 | auto: yes 45 | 46 | zero: 47 | update_database: true 48 | fields: comments images 49 | comments: 50 | - EAC 51 | - LAME 52 | - from.+collection 53 | - '[nN]ew[Aa]lbum[Rr]eleases' 54 | - 'ripped by' 55 | -------------------------------------------------------------------------------- /dot.config--bower--bower.conf: -------------------------------------------------------------------------------- 1 | # Bower configuration file. 2 | # 3 | # This file belongs in ~/.config/bower/bower.conf or 4 | # $XDG_CONFIG_DIRS/bower/bower.conf, where $XDG_CONFIG_DIRS 5 | # is defined by the XDG Base Directory Specification. 6 | # 7 | # The lines beginning with '#' or ';' are treated as comment lines. 8 | 9 | # Values representing shell commands use shell-style quoting rules: 10 | # 11 | # - within single quotes, all characters represent themselves 12 | # - within double quotes, all characters represent themselves except for 13 | # backslash which escapes the next character 14 | # - outside of quotes, backslash escapes the next character 15 | # - no escape sequences are supported, i.e. "\n" is the same as "n". 16 | # 17 | # If the first word of a command contains the unquoted and unescaped 18 | # string "ssh" then an additional level of shell quoting will be applied 19 | # to any arguments that bower adds to the command. 20 | 21 | #-----------------------------------------------------------------------------# 22 | 23 | [command] 24 | 25 | # How to run notmuch. 26 | # Set this if notmuch is not already on your PATH. 27 | # 28 | # I run bower locally but keep my mail and notmuch on a remote machine, 29 | # accessed via ssh. For that, you may like to enable the OpenSSH 30 | # ControlMaster option, and also set ControlPersist to greater than 60 31 | # seconds (or your selected polling period). 32 | # 33 | ; notmuch = ssh user@host /remote/notnumch 34 | 35 | # How to edit a message. 36 | # The default is to use $EDITOR, or else "vi". 37 | # 38 | editor = vim '+set ft=mail spell' 39 | 40 | # Specifying an alt_html_filter allows to compose multipart/alternative 41 | # messages with bower. The filter will receive the text/plain part on 42 | # stdin and is meant to produce an equivalent text/html part on stdout. 43 | # If no filter is specified, bower will try to use pandoc. 44 | # 45 | # Some of the email's header values will be available to the filter 46 | # as environment variables. The following environment variables are 47 | # set by bower: MAIL_FROM, MAIL_TO, MAIL_CC, MAIL_BCC, MAIL_SUBJECT, 48 | # MAIL_REPLY_TO, MAIL_IN_REPLY_TO. 49 | # 50 | ; alt_html_filter = pandoc -f markdown -t html 51 | 52 | # When to use the alt_html_filter. Can be one of never, manual, 53 | # default or always. If either manual or default are chosen, 54 | # the filter can be toggled on or off on a per message basis by 55 | # pressing H. 56 | # 57 | ; use_alt_html_filter = manual 58 | 59 | # Default command to open a part. 60 | # An unquoted & suffix causes the command to run in the background. 61 | # 62 | open_part = xdg-open& 63 | 64 | # Default command to open a URL. 65 | # An unquoted & suffix causes the command to run in the background. 66 | # 67 | ; open_url = xdg-open& 68 | 69 | # Default command to pass thread or message IDs to using the '|' command. 70 | # The command should read from standard input. Multiple IDs are separated 71 | # by spaces. 72 | # 73 | ; pipe_id = xclip 74 | 75 | # Command to execute after polling finds there are new unread messages 76 | # matching the current search terms in the index view. 77 | # The notification message is provided as an argument. 78 | # 79 | ; poll_notify = notify-send -i mail-message-new -c email.arrived -a Bower Bower 80 | 81 | # These keys are deprecated and should be moved to an [account.*] section. 82 | # 83 | ; sendmail = 84 | ; post_sendmail = 85 | 86 | #-----------------------------------------------------------------------------# 87 | 88 | # How to convert non-text parts to text using external commands. 89 | # Each command receives input on standard input and must output UTF-8. 90 | # The process will inherit these environment variables: 91 | # PART_CONTENT_TYPE - content type of the part being filtered 92 | # PART_CHARSET - charset of the part being filtered (if available) 93 | 94 | [filter] 95 | 96 | # HTML is formatted using this command by default. 97 | # Set the value to an empty string to disable. 98 | # 99 | ; text/html = pandoc -f html -t plain+emoji+smart+gutenberg --columns=78 --strip-comments --reference-links --reference-location=block 100 | ; text/html = lynx -dump -force-html -stdin -display-charset=utf-8 -assume-charset=utf-8 -hiddenlinks=ignore -localhost -list-inline 101 | text/html = w3m -bookmark /dev/null -config /dev/null -o display_link_number=true -o decode_url=true -o ignore_null_img_alt=false -o display_image=false -o auto_image=true -o pseudo_inlines=true -o display_link=true -o use_wide=true -I utf-8 -O utf-8 -X -r -T text/html -s -F -graph -dump 102 | ; text/html = elinks -force-html -dump-charset utf-8 -dump 103 | ; text/html = html2text --protect-links --ignore-images --reference-links --ignore-tables --links-after-para -d -e -b 78 --no-wrap-links 104 | ; text/html = /home/aperez/.dotfiles/bin/htmldump 105 | 106 | # You can specify commands to filter other media types. 107 | # The following examples are not enabled by default. 108 | # 109 | application/pdf = pdftotext - - 110 | text/calendar = vcal-stdin -description -start -end -location 111 | 112 | #-----------------------------------------------------------------------------# 113 | 114 | # How to send mail for one or more email accounts. 115 | # Each account is defined in a section called [account.NAME] where NAME is some 116 | # short name of your choosing. 117 | 118 | [account.default] 119 | 120 | # An account is selected by matching the From address on the message to 121 | # from_address value. Defaults to the combination of user.name and 122 | # user.primary_email from .notmuch-config. 123 | # 124 | ; from_address = My Name 125 | 126 | # One account can be designated as the default account. 127 | # 128 | ; default = true 129 | 130 | # How to send a message from this account. 131 | # The default is to use sendmail but I use msmtp. 132 | # The command should understand the "-t" option to read recipients 133 | # from the message headers itself. 134 | # 135 | ; sendmail = /usr/bin/sendmail -oi -oem 136 | ; sendmail = /usr/bin/msmtp 137 | 138 | # Command to execute after the sendmail command is successful. 139 | # The default is to use "notmuch insert" to add the sent message to the 140 | # maildir (see README.md for the folder). You can override the command 141 | # or disable it by setting it to the empty string. 142 | # 143 | ; post_sendmail = 144 | 145 | ; [account.work] 146 | ; from_address = My Name 147 | ; sendmail = /usr/bin/msmtp --account=work 148 | ; post_sendmail = 149 | 150 | #-----------------------------------------------------------------------------# 151 | 152 | [ui] 153 | 154 | # How often to check for new messages matching the current search 155 | # terms in the index view, or new messages in the current thread 156 | # in the thread view. Disable with "off". 157 | # 158 | ; poll_period_secs = 60 159 | 160 | # Automatically refresh the index view after this many seconds of 161 | # inactivity when there are new messages matching the current search terms. 162 | # Disable with "off". 163 | # 164 | ; auto_refresh_inactive_secs = off 165 | 166 | # Wrap lines in message bodies at this column, if the terminal is wider. 167 | # 168 | ; wrap_width = 169 | 170 | # Default thread ordering when viewing messages. May be "flat" or 171 | # "threaded". Default: "threaded". The ordering can be toggled by 172 | # pressing 'O' while viewing a thread of messages. 173 | # 174 | ; thread_ordering = threaded 175 | 176 | #-----------------------------------------------------------------------------# 177 | 178 | [compose] 179 | 180 | # Append contents of this file when composing messages. 181 | # The path must be an absolute path; relative paths are not supported yet. 182 | # An initial ~/ expands to the home directory. 183 | # 184 | signature_file = ~/.signature 185 | 186 | #-----------------------------------------------------------------------------# 187 | 188 | [crypto] 189 | 190 | # Enable encryption by default when composing messages. 191 | # 192 | encrypt_by_default = false 193 | 194 | # Enable signing by default when composing messages. 195 | # 196 | sign_by_default = true 197 | 198 | # Attempt to decrypt messages when a thread is opened. 199 | # 200 | decrypt_by_default = true 201 | 202 | # Attempt to verify signatures when a thread is opened. 203 | # 204 | verify_by_default = true 205 | 206 | #-----------------------------------------------------------------------------# 207 | 208 | # Colours are defined in the [color] and [color.CONTEXT] sections. 209 | # The more-specific sections override keys in the generic section. 210 | # 211 | # Each value has the form: 212 | # [attribute] [foreground] [/ background] 213 | # 214 | # attribute may be: 215 | # normal, bold 216 | # 217 | # foreground and background may be: 218 | # default, black, red, green, yellow, blue, magenta, cyan, white 219 | 220 | [color] 221 | current = bold yellow / red 222 | ; relative_date = bold blue 223 | ; selected = bold magenta 224 | ; standard_tag = normal 225 | ; flagged = bold red 226 | ; author = normal 227 | ; subject = normal 228 | ; other_tag = bold red 229 | ; field_name = bold red 230 | ; field_body = normal 231 | ; good_key = bold green 232 | ; bad_key = bold red 233 | 234 | [color.status] 235 | ; bar = white / blue 236 | ; info = bold cyan 237 | ; warning = bold red 238 | ; prompt = normal 239 | 240 | [color.pager] 241 | ; body = normal 242 | ; quote_odd = bold blue 243 | ; quote_even = green 244 | ; diff_common = normal 245 | ; diff_add = bold cyan 246 | ; diff_rem = bold red 247 | ; diff_hunk = bold yellow 248 | ; diff_index = bold green 249 | ; url = magenta 250 | ; part_head = bold magenta 251 | ; part_head_low = magenta 252 | ; part_message = magenta 253 | ; fold = magenta 254 | ; separator = bold blue 255 | 256 | [color.index] 257 | ; count = green 258 | ; total = bold black 259 | 260 | [color.thread] 261 | ; tree = magenta 262 | ; author = normal 263 | ; subject = green 264 | 265 | [color.compose] 266 | ; address = bold blue 267 | ; invalid = red 268 | 269 | #-----------------------------------------------------------------------------# 270 | -------------------------------------------------------------------------------- /dot.config--dunst--dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | font = Iosevka 13 3 | 4 | # Allow a small subset of html markup: 5 | # bold 6 | # italic 7 | # strikethrough 8 | # underline 9 | # 10 | # For a complete reference see 11 | # . 12 | # If markup is not allowed, those tags will be stripped out of the 13 | # message. 14 | allow_markup = yes 15 | 16 | # The format of the message. Possible variables are: 17 | # %a appname 18 | # %s summary 19 | # %b body 20 | # %i iconname (including its path) 21 | # %I iconname (without its path) 22 | # %p progress value if set ([ 0%] to [100%]) or nothing 23 | # Markup is allowed 24 | format = "%s\n%b" 25 | 26 | # Sort messages by urgency. 27 | sort = yes 28 | 29 | # Show how many messages are currently hidden (because of geometry). 30 | indicate_hidden = yes 31 | 32 | # Alignment of message text. 33 | # Possible values are "left", "center" and "right". 34 | alignment = left 35 | 36 | # The frequency with wich text that is longer than the notification 37 | # window allows bounces back and forth. 38 | # This option conflicts with "word_wrap". 39 | # Set to 0 to disable. 40 | bounce_freq = 0 41 | 42 | # Show age of message if message is older than show_age_threshold 43 | # seconds. 44 | # Set to -1 to disable. 45 | show_age_threshold = 60 46 | 47 | # Split notifications into multiple lines if they don't fit into 48 | # geometry. 49 | word_wrap = yes 50 | 51 | # Ignore newlines '\n' in notifications. 52 | ignore_newline = no 53 | 54 | 55 | # The geometry of the window: 56 | # [{width}]x{height}[+/-{x}+/-{y}] 57 | # The geometry of the message window. 58 | # The height is measured in number of notifications everything else 59 | # in pixels. If the width is omitted but the height is given 60 | # ("-geometry x2"), the message window expands over the whole screen 61 | # (dmenu-like). If width is 0, the window expands to the longest 62 | # message displayed. A positive x is measured from the left, a 63 | # negative from the right side of the screen. Y is measured from 64 | # the top and down respectevly. 65 | # The width can be negative. In this case the actual width is the 66 | # screen width minus the width defined in within the geometry option. 67 | geometry = "300x5-30+20" 68 | 69 | # Shrink window if it's smaller than the width. Will be ignored if 70 | # width is 0. 71 | shrink = yes 72 | 73 | # The transparency of the window. Range: [0; 100]. 74 | # This option will only work if a compositing windowmanager is 75 | # present (e.g. xcompmgr, compiz, etc.). 76 | transparency = 0 77 | 78 | # Don't remove messages, if the user is idle (no mouse or keyboard input) 79 | # for longer than idle_threshold seconds. 80 | # Set to 0 to disable. 81 | idle_threshold = 120 82 | 83 | # Which monitor should the notifications be displayed on. 84 | monitor = 0 85 | 86 | # Display notification on focused monitor. Possible modes are: 87 | # mouse: follow mouse pointer 88 | # keyboard: follow window with keyboard focus 89 | # none: don't follow anything 90 | # 91 | # "keyboard" needs a windowmanager that exports the 92 | # _NET_ACTIVE_WINDOW property. 93 | # This should be the case for almost all modern windowmanagers. 94 | # 95 | # If this option is set to mouse or keyboard, the monitor option 96 | # will be ignored. 97 | follow = none 98 | 99 | # Should a notification popped up from history be sticky or timeout 100 | # as if it would normally do. 101 | sticky_history = yes 102 | 103 | # Maximum amount of notifications kept in history 104 | history_length = 20 105 | 106 | # Display indicators for URLs (U) and actions (A). 107 | show_indicators = yes 108 | 109 | # The height of a single line. If the height is smaller than the 110 | # font height, it will get raised to the font height. 111 | # This adds empty space above and under the text. 112 | line_height = 0 113 | 114 | # Draw a line of "separatpr_height" pixel height between two 115 | # notifications. 116 | # Set to 0 to disable. 117 | separator_height = 1 118 | 119 | # Padding between text and separator. 120 | padding = 8 121 | 122 | # Horizontal padding. 123 | horizontal_padding = 8 124 | 125 | # Define a color for the separator. 126 | # possible values are: 127 | # * auto: dunst tries to find a color fitting to the background; 128 | # * foreground: use the same color as the foreground; 129 | # * frame: use the same color as the frame; 130 | # * anything else will be interpreted as a X color. 131 | separator_color = frame 132 | 133 | # Print a notification on startup. 134 | # This is mainly for error detection, since dbus (re-)starts dunst 135 | # automatically after a crash. 136 | startup_notification = false 137 | 138 | # dmenu path. 139 | dmenu = /usr/bin/rofi -dmenu -p dunst: 140 | 141 | # Browser for opening urls in context menu. 142 | browser = xdg-open 143 | 144 | # Align icons left/right/off 145 | icon_position = off 146 | 147 | # Paths to default icons. 148 | icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ 149 | 150 | [frame] 151 | width = 1 152 | color = "#aaaaaa" 153 | 154 | [shortcuts] 155 | # Shortcuts are specified as [modifier+][modifier+]...key 156 | # Available modifiers are "ctrl", "mod1" (the alt-key), "mod2", 157 | # "mod3" and "mod4" (windows-key). 158 | # Xev might be helpful to find names for keys. 159 | 160 | # Close notification. 161 | close = ctrl+space 162 | 163 | # Close all notifications. 164 | close_all = ctrl+shift+space 165 | 166 | # Redisplay last message(s). 167 | # On the US keyboard layout "grave" is normally above TAB and left 168 | # of "1". 169 | history = ctrl+shift+comma 170 | 171 | # Context menu. 172 | context = ctrl+shift+period 173 | 174 | [urgency_low] 175 | # IMPORTANT: colors have to be defined in quotation marks. 176 | # Otherwise the "#" and following would be interpreted as a comment. 177 | background = "#222222" 178 | foreground = "#888888" 179 | timeout = 10 180 | 181 | [urgency_normal] 182 | background = "#285577" 183 | foreground = "#ffffff" 184 | timeout = 10 185 | 186 | [urgency_critical] 187 | background = "#900000" 188 | foreground = "#ffffff" 189 | timeout = 0 190 | 191 | 192 | # Every section that isn't one of the above is interpreted as a rules to 193 | # override settings for certain messages. 194 | # Messages can be matched by "appname", "summary", "body", "icon", "category", 195 | # "msg_urgency" and you can override the "timeout", "urgency", "foreground", 196 | # "background", "new_icon" and "format". 197 | # Shell-like globbing will get expanded. 198 | # 199 | # SCRIPTING 200 | # You can specify a script that gets run when the rule matches by 201 | # setting the "script" option. 202 | # The script will be called as follows: 203 | # script appname summary body icon urgency 204 | # where urgency can be "LOW", "NORMAL" or "CRITICAL". 205 | # 206 | # NOTE: if you don't want a notification to be displayed, set the format 207 | # to "". 208 | # NOTE: It might be helpful to run dunst -print in a terminal in order 209 | # to find fitting options for rules. 210 | 211 | #[espeak] 212 | # summary = "*" 213 | # script = dunst_espeak.sh 214 | 215 | #[script-test] 216 | # summary = "*script*" 217 | # script = dunst_test.sh 218 | 219 | #[ignore] 220 | # # This notification will not be displayed 221 | # summary = "foobar" 222 | # format = "" 223 | 224 | #[signed_on] 225 | # appname = Pidgin 226 | # summary = "*signed on*" 227 | # urgency = low 228 | # 229 | #[signed_off] 230 | # appname = Pidgin 231 | # summary = *signed off* 232 | # urgency = low 233 | # 234 | #[says] 235 | # appname = Pidgin 236 | # summary = *says* 237 | # urgency = critical 238 | # 239 | #[twitter] 240 | # appname = Pidgin 241 | # summary = *twitter.com* 242 | # urgency = normal 243 | # 244 | # vim: ft=cfg 245 | -------------------------------------------------------------------------------- /dot.config--dwt/background-color: -------------------------------------------------------------------------------- 1 | #030303 2 | -------------------------------------------------------------------------------- /dot.config--dwt/font: -------------------------------------------------------------------------------- 1 | Inconsolata 12 2 | PragmataPro 10.6 3 | IBM Plex Mono 9.75 4 | Iosevka Term 10.75 5 | SF Mono 9.75 6 | Terminus Re33 12.35 7 | Fantasque Sans Mono 11 8 | Roboto Mono 12 9 | -------------------------------------------------------------------------------- /dot.config--dwt/foreground-color: -------------------------------------------------------------------------------- 1 | #D8D8D8 2 | -------------------------------------------------------------------------------- /dot.config--dwt/no-header-bar: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /dot.config--dwt/theme: -------------------------------------------------------------------------------- 1 | linux 2 | -------------------------------------------------------------------------------- /dot.config--foot--foot.ini: -------------------------------------------------------------------------------- 1 | # vim:set ft=cfg: 2 | 3 | [main] 4 | title=Foot 5 | dpi-aware=auto 6 | initial-window-size-chars=90x30 7 | pad=2x2 center 8 | bold-text-in-bright=yes 9 | workers=2 10 | 11 | font=JetBrains Mono NL:size=10.5 12 | line-height=13.25 13 | letter-spacing=-0.35 14 | 15 | # font=Iosevka Term:size=11.5 16 | # line-height=13.9 17 | # vertical-letter-offset=-0.25 18 | # underline-offset=1.25 19 | 20 | [bell] 21 | urgent=yes 22 | 23 | [scrollback] 24 | lines=100 25 | 26 | [url] 27 | osc8-underline=always 28 | # label-letters=1234567890 29 | 30 | [mouse] 31 | hide-when-typing=yes 32 | 33 | [cursor] 34 | color=fddddd 9922bb 35 | 36 | [colors] 37 | foreground=dcdcdc 38 | background=040404 39 | 40 | ## Normal/regular colors (color palette 0-7) 41 | regular0=000000 # black 42 | regular1=cc0000 # red 43 | regular2=00cc00 # green 44 | regular3=cccc00 # yellow 45 | regular4=3377ff # blue 46 | regular5=cc00cc # magenta 47 | regular6=00cccc # cyan 48 | regular7=ffffff # white 49 | 50 | ## Bright colors (color palette 8-15) 51 | bright0=777777 # bright black 52 | bright1=dd2222 # bright red 53 | bright2=77ff77 # bright green 54 | bright3=ffff77 # bright yellow 55 | bright4=2266ff # bright blue 56 | bright5=ff55ff # bright magenta 57 | bright6=22eeee # bright cyan 58 | bright7=ffffff # bright white 59 | 60 | # dim0=000000 # dim black 61 | # dim1=aa0000 # dim red 62 | # dim2=00aa00 # dim green 63 | # dim3=aa6600 # dim yellow 64 | # dim4=2255ee # dim blue 65 | # dim5=aa00aa # dim magenta 66 | # dim6=00aaaa # dim cyan 67 | # dim7=aaaaaa # dim white 68 | 69 | [key-bindings] 70 | fullscreen=Control+F11 71 | prompt-next=Control+Shift+a 72 | show-urls-launch=Control+Shift+x 73 | show-urls-copy=Control+Shift+space 74 | 75 | [csd] 76 | size=20 77 | button-width=20 78 | # hide-when-maximized=yes 79 | font=Inter 80 | color=ff2f343f 81 | border-width=2 82 | button-color=ffeaeaea 83 | button-minimize-color=44ffffff 84 | button-maximize-color=44ffffff 85 | button-close-color=44ff4444 86 | 87 | [tweak] 88 | box-drawing-base-thickness=0.03 89 | -------------------------------------------------------------------------------- /dot.config--git--config: -------------------------------------------------------------------------------- 1 | # vim: ft=cfg 2 | [alias] 3 | st = status 4 | ci = commit 5 | co = checkout 6 | b = !git branch -a | sk-or-fzf -n 2 --prompt='(branch) ' --no-multi --reverse | xargs git checkout 7 | br = branch -vv 8 | cp = cherry-pick 9 | cpx = cherry-pick -x 10 | cpa = cherry-pick --abort 11 | cpc = cherry-pick --continue 12 | ff = merge --ff-only 13 | rup = !git remote update && git --no-pager branch -vv 14 | logs = log --stat --decorate 15 | logl = log --abbrev-commit --pretty=oneline --decorate 16 | logp = log --abbrev-commit --patch-with-stat --decorate 17 | logg = log --abbrev-commit --pretty=oneline --all --decorate --graph 18 | svnr = svn find-rev 19 | todo = grep -E '(FIXME|TODO) ' 20 | diffs = diff --patch-with-stat 21 | mrproper = clean -xdff 22 | format-patch = -M -C 23 | br-format-patch = format-patch -M -n -s 24 | 25 | # apple-pick taken from http://joeshaw.org/2010/06/22/667 26 | apple-pick = !sh -c 'git rev-list --reverse "$@" | xargs -n1 git cherry-pick' - 27 | apple-pickx = !sh -c 'git rev-list --reverse "$@" | xargs -n1 git cherry-pick -x' - 28 | 29 | # wip taken from https://carolynvanslyck.com/blog/2020/12/git-wip/ 30 | wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads 31 | 32 | # snapshot/assume/unassume/assumed taken from 33 | # http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/ 34 | snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}" 35 | assume = update-index --assume-unchanged 36 | unassume = update-index --no-assume-unchanged 37 | assumed = "!git ls-files -v | grep ^h | cut -c 3-" 38 | 39 | # From https://davidwalsh.name/awesome-git-aliases 40 | force-push = push --force-with-lease 41 | [fetch] 42 | fsckObjects = true 43 | [transfer] 44 | fsckObjects = true 45 | [receive] 46 | fsckObjects = true 47 | [fetch "fsck"] 48 | zeroPaddedFilemode = ignore 49 | badTimezone = ignore 50 | [branch] 51 | sort = -committerdate 52 | [color] 53 | ui = auto 54 | branch = auto 55 | diff = auto 56 | status = auto 57 | [merge] 58 | stat = true 59 | conflictstyle = diff3 60 | guitool = meld 61 | [pack] 62 | threads = 0 63 | [sendemail] 64 | chainreplyto = false 65 | suppressfrom = true 66 | verify = false 67 | annotate = true 68 | [format] 69 | numbered = auto 70 | [push] 71 | default = tracking 72 | [user] 73 | email = aperez@igalia.com 74 | name = Adrian Perez de Castro 75 | signingkey = E4C9123B 76 | [rebase] 77 | updateRefs = true 78 | autosquash = true 79 | stat = true 80 | [core] 81 | excludesfile = /home/aperez/.gitignore-global 82 | pager = delta 83 | [rerere] 84 | enabled = true 85 | [pull] 86 | rebase = true 87 | [diff] 88 | tool = difftastic 89 | algorithm = histogram 90 | colorMoved = default 91 | [difftool] 92 | prompt = false 93 | [difftool "difftastic"] 94 | cmd = difft "$LOCAL" "$REMOTE" 95 | [commit] 96 | gpgsign = true 97 | [credential] 98 | helper = libsecret 99 | [init] 100 | defaultBranch = main 101 | [tar "tar.xz"] 102 | command = xz -9c 103 | [http] 104 | cookiefile = /home/aperez/.gitcookies 105 | [interactive] 106 | diffFilter = delta --color-only --features=interactive 107 | [pager] 108 | difftool = true 109 | [delta] 110 | navigate = true 111 | line-numbers = true 112 | color-only = true 113 | file-style = bold yellow italic 114 | file-decoration-style = ul yellow 115 | # hunk-header-decoration-style = ul grey dim 116 | hunk-header-decoration-style = omit 117 | hunk-header-style = line-number white blue 118 | # hunk-header-line-number-style = white blue 119 | hunk-label = 120 | [tig "bind"] 121 | generic = C !git cherry-pick %(commit) 122 | [filter "lfs"] 123 | required = true 124 | clean = git-lfs clean -- %f 125 | smudge = git-lfs smudge -- %f 126 | process = git-lfs filter-process 127 | -------------------------------------------------------------------------------- /dot.config--gtk-3.0--gtk.css: -------------------------------------------------------------------------------- 1 | /* 2 | * dot.config--gtk-3.0--gtk.css 3 | * Copyright (C) 2016 Adrian Perez 4 | * 5 | * Distributed under terms of the MIT license. 6 | */ 7 | 8 | .vte-terminal { 9 | padding: 3px 6px; 10 | } 11 | -------------------------------------------------------------------------------- /dot.config--j4status--config: -------------------------------------------------------------------------------- 1 | [Plugins] 2 | Input=nl;upower;pulseaudio;time; 3 | Order=nl;upower;pulseaudio;time; 4 | 5 | [Netlink] 6 | Interfaces=wlp2s0; 7 | 8 | [Netlink Formats] 9 | UpWiFi= ${ssid} 📡 ${strength}${strength:+%} 10 | DownWiFi= 📡 (${aps}) 11 | 12 | [UPower] 13 | Format=${status:[;0;1;2;3;⚠️;;⚡;⚡;🔋]} ${time(t%H:%M )} 14 | 15 | [PulseAudio] 16 | Format=${port:[;0;1;🔈;🎧]} ${volume[@% ]}% 17 | Actions=mouse:1 mute toggle;mouse:4 raise;mouse:5 lower; 18 | 19 | [Time] 20 | Format= 📅 %d.%m ⌚ %H:%M 21 | Interval=10 22 | -------------------------------------------------------------------------------- /dot.config--mako--config: -------------------------------------------------------------------------------- 1 | # font=Ubuntu, FontAwesome 10 2 | # font=Monaco, FontAwesome 10 3 | # font=Hack, FontAwesome 10 4 | # font=Agave, FontAwesome 10 5 | # font=IBM Plex Sans, FontAwesome 10 6 | font=Inter UI, FontAwesome 10 7 | -------------------------------------------------------------------------------- /dot.config--mpDris2--mpDris2.conf: -------------------------------------------------------------------------------- 1 | # Copy this to /etc/mpDris2.conf or ~/.config/mpDris2/mpDris2.conf 2 | # Default values are shown here, commented out. 3 | 4 | [Connection] 5 | # You can also export $MPD_HOST and/or $MPD_PORT to change the server. 6 | #host = localhost 7 | #port = 6600 8 | #password = 9 | 10 | [Library] 11 | music_dir = ~/Music 12 | cover_regex = ^(album|cover|\.?folder|front).*\.(gif|jpeg|jpg|png)$ 13 | 14 | [Bling] 15 | #mmkeys = True 16 | notify = False 17 | -------------------------------------------------------------------------------- /dot.config--mpv/config: -------------------------------------------------------------------------------- 1 | # vim: filetype=cfg 2 | [default] 3 | msg-color=yes 4 | msg-module=yes 5 | framedrop=decoder+vo 6 | use-filedir-conf=yes 7 | embeddedfonts=yes 8 | sub-ass=yes 9 | osd-font="Source Sans Pro" 10 | sub-font="Source Sans Pro" 11 | sub-ass-hinting=native 12 | screenshot-format=png 13 | #vo=vaapi,xv,wayland,opengl-hq,opengl,sdl,x11 14 | #vo=wayland,gpu,vaapi,xv,sdl,x11 15 | -------------------------------------------------------------------------------- /dot.config--nvim: -------------------------------------------------------------------------------- 1 | ../.vim -------------------------------------------------------------------------------- /dot.config--pangoterm.cfg: -------------------------------------------------------------------------------- 1 | # == Colours == 2 | foreground = "#d8d8d8" 3 | background = "#030303" 4 | cursor = "#aa0033" 5 | colour:0 = "#000000" 6 | colour:1 = "#aa0000" 7 | colour:2 = "#00aa00" 8 | colour:3 = "#aa5500" 9 | colour:4 = "#2244ee" 10 | colour:5 = "#aa00aa" 11 | colour:6 = "#00aaaa" 12 | colour:7 = "#bbbbbb" 13 | colour:8 = "#777777" 14 | colour:9 = "#ff5555" 15 | colour:10 = "#55ff55" 16 | colour:11 = "#ffff55" 17 | colour:12 = "#5599ff" 18 | colour:13 = "#ff55ff" 19 | colour:14 = "#55ffff" 20 | colour:15 = "#ffffff" 21 | 22 | # == Font and size == 23 | # font = "terminus" 24 | # font = "PragmataPro Mono" 25 | font = "Iosevka" 26 | # font = "PragmataPro" 27 | size = 11 28 | 29 | # == Window options == 30 | title = "Terminal" 31 | 32 | # == Other options == 33 | # cursor_shape = 1 (1=block 2=underbar 3=vertical bar) 34 | cursor_blink_interval = 0 35 | bold_highbright = true 36 | altscreen = true 37 | # altscreen_scroll = false 38 | term = "xterm-256color" 39 | scrollback_size = 500 40 | scrollbar_width = 3 41 | # scroll_wheel_delta = 3 42 | # unscroll_on_output = true 43 | # unscroll_on_key = true 44 | doubleclick_fullword = true 45 | 46 | chord_shift_enter = true 47 | chord_shift_space = true 48 | chord_shift_backspace = true 49 | 50 | # Options can be specific to profiles 51 | # [Profile green] 52 | # background=darkgreen 53 | # 54 | # Profile matches can use wildcards 55 | # [Profile *-large] 56 | # lines = 50 57 | # cols = 120 58 | 59 | [Profile large] 60 | size = 25 61 | -------------------------------------------------------------------------------- /dot.config--rofi-pass--config: -------------------------------------------------------------------------------- 1 | # fields to be used 2 | URL_field='url' 3 | USERNAME_field='user' 4 | AUTOTYPE_field='autotype' 5 | 6 | delay=2 7 | 8 | EDITOR='gvim -f' 9 | BROWSER='xdg-open' 10 | 11 | default_do='autopass' # copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl 12 | auto_enter='false' 13 | notify='false' 14 | passlength='20' 15 | 16 | # seconds to wait before re-opening showEntry-menu 17 | # after autotyping an entry. Set to "off" to disable 18 | count=off 19 | 20 | help_color="" 21 | 22 | # Clipboard settings 23 | # Possible options: primary, clipboard, both 24 | clip=both 25 | 26 | # Custom Keybindings 27 | # autotype="Alt+1" 28 | # type_user="Alt+2" 29 | # type_pass="Alt+3" 30 | # open_url="Alt+4" 31 | # copy_name="Alt+u" 32 | # copy_url="Alt+l" 33 | # copy_pass="Alt+p" 34 | # show="Alt+o" 35 | # copy_entry="Alt+2" 36 | # type_entry="Alt+1" 37 | # copy_menu="Alt+c" 38 | # action_menu="Alt+a" 39 | # type_menu="Alt+t" 40 | # help="Alt+h" 41 | # switch="Alt+x" 42 | -------------------------------------------------------------------------------- /dot.config--sway--config: -------------------------------------------------------------------------------- 1 | # vim: ft=conf 2 | 3 | # set $fontname PragmataPro, FontAwesome 4 | set $fontname Iosevka, FontAwesome 5 | # set $fontname Terminus Re33, FontAwesome 6 | # set $fontname mononoki, FontAwesome 7 | # set $fontname Hack, FontAwesome 8 | # set $fontname PT Mono, FontAwesome 9 | # set $fontname Inter UI, FontAwesome 10 | # set $fontname Hasklig, FontAwesome 11 | # set $fontname xos4 Terminus, FontAwesome Bold 12 | set $fontname iA Writer Duospace, FontAwesome 13 | 14 | set $normalfont 9.25 15 | set $biggerfont 10 16 | 17 | set $font $fontname $normalfont 18 | 19 | set $mod Mod4 20 | 21 | font $font 22 | 23 | xwayland enabled 24 | 25 | floating_modifier $mod 26 | focus_follows_mouse yes 27 | mouse_warping output 28 | default_border pixel 2 29 | titlebar_padding 4 1 30 | smart_borders on 31 | popup_during_fullscreen smart 32 | 33 | bindsym $mod+Shift+q kill 34 | bindsym $mod+Shift+F12 exit 35 | 36 | bindsym $mod+h focus left 37 | bindsym $mod+j focus down 38 | bindsym $mod+k focus up 39 | bindsym $mod+l focus right 40 | 41 | bindsym $mod+Left focus left 42 | bindsym $mod+Down focus down 43 | bindsym $mod+Up focus up 44 | bindsym $mod+Right focus right 45 | 46 | # move focused window 47 | bindsym $mod+Shift+h move left 48 | bindsym $mod+Shift+j move down 49 | bindsym $mod+Shift+k move up 50 | bindsym $mod+Shift+l move right 51 | 52 | # alternatively, you can use the cursor keys: 53 | bindsym $mod+Shift+Left move left 54 | bindsym $mod+Shift+Down move down 55 | bindsym $mod+Shift+Up move up 56 | bindsym $mod+Shift+Right move right 57 | 58 | # split in horizontal orientation 59 | bindsym $mod+b split h 60 | 61 | # split in vertical orientation 62 | bindsym $mod+v split v 63 | 64 | # enter fullscreen mode for the focused container 65 | bindsym $mod+f fullscreen toggle 66 | 67 | # change container layout (stacked, tabbed, toggle split) 68 | bindsym $mod+s layout stacking 69 | bindsym $mod+w layout tabbed 70 | bindsym $mod+e layout toggle split 71 | 72 | # toggle tiling / floating 73 | bindsym $mod+Shift+space floating toggle 74 | bindsym $mod+Shift+f floating toggle 75 | 76 | # change focus between tiling / floating windows 77 | bindsym $mod+space focus mode_toggle 78 | 79 | # focus the parent container 80 | bindsym $mod+a focus parent 81 | 82 | # Switch to the most recent urgent window 83 | bindsym $mod+x [urgent=latest] focus 84 | 85 | # switch to workspace 86 | bindsym $mod+1 workspace 1 87 | bindsym $mod+2 workspace 2 88 | bindsym $mod+3 workspace 3 89 | bindsym $mod+4 workspace 4 90 | bindsym $mod+5 workspace 5 91 | bindsym $mod+6 workspace 6 92 | bindsym $mod+7 workspace 7 93 | bindsym $mod+8 workspace 8 94 | bindsym $mod+9 workspace 9 95 | bindsym $mod+0 workspace 10 96 | 97 | # move focused container to workspace 98 | bindsym $mod+Shift+1 move container to workspace 1 99 | bindsym $mod+Shift+2 move container to workspace 2 100 | bindsym $mod+Shift+3 move container to workspace 3 101 | bindsym $mod+Shift+4 move container to workspace 4 102 | bindsym $mod+Shift+5 move container to workspace 5 103 | bindsym $mod+Shift+6 move container to workspace 6 104 | bindsym $mod+Shift+7 move container to workspace 7 105 | bindsym $mod+Shift+8 move container to workspace 8 106 | bindsym $mod+Shift+9 move container to workspace 9 107 | bindsym $mod+Shift+0 move container to workspace 10 108 | 109 | # Switch and move to previosly active workspace 110 | workspace_auto_back_and_forth yes 111 | bindsym $mod+Tab workspace back_and_forth 112 | 113 | # Scratchpad management 114 | bindsym $mod+minus scratchpad show 115 | bindsym $mod+Shift+minus move scratchpad 116 | 117 | # Media keys 118 | bindsym XF86AudioRaiseVolume exec ponymix increase 10 119 | bindsym XF86AudioLowerVolume exec ponymix decrease 10 120 | bindsym XF86AudioMute exec ponymix toggle 121 | bindsym XF86MonBrightnessDown exec light -U 10 122 | bindsym XF86MonBrightnessUp exec light -A 10 123 | 124 | # resize window (you can also use the mouse for that) 125 | mode "resize" { 126 | # These bindings trigger as soon as you enter the resize mode 127 | 128 | # Pressing left will shrink the window’s width. 129 | # Pressing right will grow the window’s width. 130 | # Pressing up will shrink the window’s height. 131 | # Pressing down will grow the window’s height. 132 | bindsym h resize shrink width 10 px or 10 ppt 133 | bindsym j resize grow height 10 px or 10 ppt 134 | bindsym k resize shrink height 10 px or 10 ppt 135 | bindsym l resize grow width 10 px or 10 ppt 136 | 137 | # same bindings, but for the arrow keys 138 | bindsym Left resize shrink width 10 px or 10 ppt 139 | bindsym Down resize grow height 10 px or 10 ppt 140 | bindsym Up resize shrink height 10 px or 10 ppt 141 | bindsym Right resize grow width 10 px or 10 ppt 142 | 143 | # back to normal: Enter or Escape 144 | bindsym Return mode "default" 145 | bindsym Escape mode "default" 146 | } 147 | 148 | bindsym $mod+r mode "resize" 149 | bindsym $mod+u border toggle 150 | 151 | bindsym $mod+Return exec termite 152 | # bindsym $mod+d exec bemenu-run -i -p 'exec:' --fn '$fontname $biggerfont' 153 | bindsym $mod+p exec rofi -show run 154 | # bindsym $mod+Shift+d exec j4-dmenu-desktop --term='termite -e' --dmenu='bemenu -i -p "apps:" --fn "$fontname $biggerfont"' 155 | bindsym $mod+Shift+p exec j4-dmenu-desktop --term='termite -e' --dmenu='rofi -dmenu -i' 156 | bindsym $mod+F10 exec swaylock -e -c 181818 157 | bindsym $mod+Shift+F10 exec systemctl suspend 158 | bindsym $mod+Shift+n exec makoctl dismiss 159 | bindsym $mod+Shift+Return exec synapse 160 | 161 | bindsym $mod+Shift+s mode screenshot 162 | mode screenshot { 163 | bindsym a exec grim exec "$(xdg-user-dir PICTURES)/Screenshots/all-$(date +'%Y%m%dT%H%M%S.png').png" ; mode default 164 | bindsym r exec slurp | grim -g - "$(xdg-user-dir PICTURES)/Screenshots/region-$(date +'%Y%m%dT%H%M%S').png" ; mode default 165 | 166 | bindsym Escape mode default 167 | bindsym q mode default 168 | } 169 | 170 | bar { 171 | status_command j4status -o i3bar 172 | position bottom 173 | font $font 174 | mode hide 175 | icon_theme Arc 176 | colors { 177 | background #0F0E0E 178 | } 179 | } 180 | 181 | # for_window [app_id="epiphany"] border none 182 | # for_window [app_id="revolt"] border none 183 | for_window [app_id="nm-connection-editor"] floating enable 184 | for_window [app_id="synapse"] border none 185 | 186 | output "*" { 187 | scale 2 188 | background ~/Pictures/Wallpapers/japan-city-wallpaper-wallpaper-1.jpg fill #000000 189 | } 190 | 191 | input "*" { 192 | xkb_layout es 193 | xkb_options ctrl:nocaps,compose:menu 194 | repeat_delay 500 195 | accel_profile adaptive 196 | middle_emulation enabled 197 | } 198 | 199 | input "2:7:SynPS/2_Synaptics_TouchPad" { 200 | natural_scroll enabled 201 | tap enabled 202 | dwt enabled 203 | } 204 | 205 | input "1133:16495:Logitech_MX_Ergo" { 206 | natural_scroll enabled 207 | } 208 | 209 | input "1149:8257:Kensington_Kensington_Slimblade_Trackball" { 210 | middle_emulation disabled 211 | } 212 | 213 | exec_always kanshi 214 | exec_always mako 215 | exec_always swayidle \ 216 | timeout 300 'swaylock -e -c 181818' \ 217 | timeout 600 'swaymsg "output eDP-1 dpms off"' \ 218 | resume 'swaymsg "output eDP-1 dpms on"' \ 219 | before-sleep 'swaylock -f -e -c 181818' 220 | -------------------------------------------------------------------------------- /dot.config--termite--config: -------------------------------------------------------------------------------- 1 | [options] 2 | scroll_on_output = false 3 | scroll_on_keystroke = true 4 | audible_bell = false 5 | mouse_autohide = true 6 | allow_bold = true 7 | dynamic_title = true 8 | urgent_on_bell = true 9 | clickable_url = true 10 | clickable_url_ctrl = true 11 | hyperlinks = true 12 | ### 0Oo I1l ←↓↑→ {} [] () 13 | # font = Inconsolata, FontAwesome 11.2 14 | font = Inconsolata LGC, FontAwesome 9.25 15 | # font = PragmataPro, FontAwesome 10.855 16 | # font = Iosevka, FontAwesome 10.75 17 | # font = mononoki, CamingoCode, FontAwesome 10 18 | # font = CamingoCode, FontAwesome 10 19 | # font = PT Mono, FontAwesome 9.25 20 | # font = Sudo, FontAwesome 12.85 21 | # font = Sudo, FontAwesome 13.75 22 | # font = Fira Code, FontAwesome 9.375 23 | # font = Code New Roman, FontAwesome 10.2 24 | # font = SF Mono, FontAwesome 9 25 | # font = Source Code Pro 10.5 26 | # font = Fantasque Sans Mono, FontAwesome 10.85 27 | # font = Roboto Mono, SF Mono 9.25 28 | # font = Office Code Pro, FontAwesome 9.375 29 | # font = IBM Plex Mono, FontAwesome 9.3686 30 | # font = iA Writer Mono S, FontAwesome 9.375 31 | # font = Droid Sans Mono Slashed, FontAwesome 9.35 32 | 33 | # cell_width_scale = 1.0 34 | # cell_height_scale = 1.0 35 | 36 | scrollback_lines = 300 37 | search_wrap = true 38 | icon_name = terminal 39 | #geometry = 640x480 40 | 41 | # "system", "on" or "off" 42 | cursor_blink = system 43 | 44 | # "block", "underline" or "ibeam" 45 | cursor_shape = block 46 | 47 | # $BROWSER is used by default if set, with xdg-open as a fallback 48 | #browser = xdg-open 49 | 50 | # set size hints for the window 51 | size_hints = true 52 | 53 | # Hide links that are no longer valid in url select overlay mode 54 | filter_unmatched_urls = true 55 | 56 | # emit escape sequences for extra modified keys 57 | modify_other_keys = true 58 | 59 | gtk_dark_theme = true 60 | 61 | [colors] 62 | cursor = #aa0033 63 | cursor_foreground = #fddddd 64 | # cursor = #7700aa 65 | foreground = #dcdcdc 66 | foreground_bold = #ffffff 67 | background = #040404 68 | 69 | # 20% background transparency (requires a compositor) 70 | #background = rgba(63, 63, 63, 0.8) 71 | 72 | # if unset, will reverse foreground and background 73 | highlight = #3f3f3f 74 | 75 | # colors from color0 to color254 can be set 76 | # color0 = #3f3f3f 77 | # color1 = #705050 78 | # color2 = #60b48a 79 | # color3 = #dfaf8f 80 | # color4 = #506070 81 | # color5 = #dc8cc3 82 | # color6 = #8cd0d3 83 | # color7 = #dcdccc 84 | # color8 = #709080 85 | # color9 = #dca3a3 86 | # color10 = #c3bf9f 87 | # color11 = #f0dfaf 88 | # color12 = #94bff3 89 | # color13 = #ec93d3 90 | # color14 = #93e0e3 91 | # color15 = #ffffff 92 | 93 | color0 = #000000 94 | color1 = #aa0000 95 | color2 = #00aa00 96 | color3 = #aa5500 97 | color4 = #2244ff 98 | color5 = #aa00aa 99 | color6 = #00aaaa 100 | color7 = #bbbbbb 101 | color8 = #777777 102 | color9 = #ff5555 103 | color10 = #55ff55 104 | color11 = #ffff55 105 | color12 = #5599ff 106 | color13 = #ff55ff 107 | color14 = #55ffff 108 | color15 = #ffffff 109 | 110 | [hints] 111 | #foreground = #dcdccc 112 | #background = #3f3f3f 113 | #active_foreground = #e68080 114 | #active_background = #3f3f3f 115 | padding = 3 116 | #border = #3f3f3f 117 | #border_width = 0.5 118 | #roundness = 2.0 119 | 120 | # vim: ft=dosini cms=#%s 121 | -------------------------------------------------------------------------------- /dot.config--tig--config: -------------------------------------------------------------------------------- 1 | set blame-view = id:yes,color file-name:auto author:email-user date:relative-compact line-number:yes,interval=1 text 2 | set grep-view = file-name:no line-number:yes,interval=1 text 3 | set main-view = line-number:no,interval=5 id:no date:relative-compact author:email-user commit-title:yes,graph,refs,overflow=no 4 | set refs-view = line-number:no id:no date:relative-compact author:email-user ref commit-title 5 | set stash-view = line-number:no,interval=5 id:no date:relative-compact author:email-user commit-title 6 | set status-view = line-number:no,interval=5 status:short file-name 7 | set tree-view = line-number:no,interval=5 mode author:email-user file-size date:relative-compact id:no file-name 8 | 9 | # Pager based views 10 | set pager-view = line-number:no,interval=5 text 11 | set stage-view = line-number:no,interval=5 text 12 | set log-view = line-number:no,interval=5 text 13 | set blob-view = line-number:no,interval=5 text 14 | set diff-view = line-number:no,interval=5 text:yes,commit-title-overflow=no 15 | 16 | set tab-size = 4 17 | set commit-order = topo 18 | set refresh-mode = manual 19 | -------------------------------------------------------------------------------- /dot.config--zathura--zathurarc: -------------------------------------------------------------------------------- 1 | set font "Iosevka 10.75" 2 | set database "sqlite" 3 | -------------------------------------------------------------------------------- /dot.ctags: -------------------------------------------------------------------------------- 1 | --c++-kinds=+p 2 | --fields=iaS 3 | --extra=+q 4 | -------------------------------------------------------------------------------- /dot.cwmrc: -------------------------------------------------------------------------------- 1 | command term uxterm 2 | 3 | borderwidth 2 4 | color activeborder blue 5 | color inactiveborder darkblue 6 | 7 | # Have a keybinding for reloading the config file 8 | bind CM-r reload 9 | 10 | # Disable moving the mouse with hotkeys 11 | bind CS-Left unmap 12 | bind CS-Right unmap 13 | bind CS-Up unmap 14 | bind CS-Down unmap 15 | bind C-Left unmap 16 | bind C-Right unmap 17 | bind C-Up unmap 18 | bind C-Down unmap 19 | 20 | # Disable SSH menu 21 | bind M-\. unmap 22 | -------------------------------------------------------------------------------- /dot.gdbinit: -------------------------------------------------------------------------------- 1 | set history save 2 | set history size 2500 3 | set history filename ~/.gdb_history 4 | 5 | set print pretty on 6 | set print asm-demangle on 7 | set print object on 8 | set print static-members off 9 | 10 | define dis 11 | disassemble $rip-16,+48 12 | end 13 | document dis 14 | Disassembles code around the current instruction pointer ($rip) 15 | end 16 | -------------------------------------------------------------------------------- /dot.gitignore-global: -------------------------------------------------------------------------------- 1 | .*.sw[po] 2 | .autoenv.zsh 3 | .autoenv_leave.zsh 4 | .ccls-cache/ 5 | .clangd/ 6 | -------------------------------------------------------------------------------- /dot.gnupg--gpg-agent.conf: -------------------------------------------------------------------------------- 1 | default-cache-ttl 900 2 | #default-cache-ttl-ssh 1800 3 | max-cache-ttl 999999 4 | #enable-ssh-support 5 | pinentry-program /usr/bin/pinentry-gnome3 6 | -------------------------------------------------------------------------------- /dot.gnupg--gpg.conf: -------------------------------------------------------------------------------- 1 | # Options for GnuPG 2 | # Copyright 1998, 1999, 2000, 2001, 2002, 2003, 3 | # 2010 Free Software Foundation, Inc. 4 | # 5 | # This file is free software; as a special exception the author gives 6 | # unlimited permission to copy and/or distribute it, with or without 7 | # modifications, as long as this notice is preserved. 8 | # 9 | # This file is distributed in the hope that it will be useful, but 10 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 11 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | # 13 | # Unless you specify which option file to use (with the command line 14 | # option "--options filename"), GnuPG uses the file ~/.gnupg/gpg.conf 15 | # by default. 16 | # 17 | # An options file can contain any long options which are available in 18 | # GnuPG. If the first non white space character of a line is a '#', 19 | # this line is ignored. Empty lines are also ignored. 20 | # 21 | # See the man page for a list of options. 22 | 23 | # Uncomment the following option to get rid of the copyright notice 24 | 25 | no-greeting 26 | 27 | # If you have more than 1 secret key in your keyring, you may want to 28 | # uncomment the following option and set your preferred keyid. 29 | 30 | default-key 0x91C559DBE4C9123B 31 | 32 | # If you do not pass a recipient to gpg, it will ask for one. Using 33 | # this option you can encrypt to a default key. Key validation will 34 | # not be done in this case. The second form uses the default key as 35 | # default recipient. 36 | 37 | #default-recipient some-user-id 38 | #default-recipient-self 39 | 40 | # Use --encrypt-to to add the specified key as a recipient to all 41 | # messages. This is useful, for example, when sending mail through a 42 | # mail client that does not automatically encrypt mail to your key. 43 | # In the example, this option allows you to read your local copy of 44 | # encrypted mail that you've sent to others. 45 | 46 | #encrypt-to some-key-id 47 | 48 | # By default GnuPG creates version 4 signatures for data files as 49 | # specified by OpenPGP. Some earlier (PGP 6, PGP 7) versions of PGP 50 | # require the older version 3 signatures. Setting this option forces 51 | # GnuPG to create version 3 signatures. 52 | 53 | #force-v3-sigs 54 | 55 | # Because some mailers change lines starting with "From " to ">From " 56 | # it is good to handle such lines in a special way when creating 57 | # cleartext signatures; all other PGP versions do it this way too. 58 | 59 | #no-escape-from-lines 60 | 61 | # If you do not use the Latin-1 (ISO-8859-1) charset, you should tell 62 | # GnuPG which is the native character set. Please check the man page 63 | # for supported character sets. This character set is only used for 64 | # metadata and not for the actual message which does not undergo any 65 | # translation. Note that future version of GnuPG will change to UTF-8 66 | # as default character set. In most cases this option is not required 67 | # as GnuPG is able to figure out the correct charset at runtime. 68 | 69 | #charset utf-8 70 | 71 | # Group names may be defined like this: 72 | # group mynames = paige 0x12345678 joe patti 73 | # 74 | # Any time "mynames" is a recipient (-r or --recipient), it will be 75 | # expanded to the names "paige", "joe", and "patti", and the key ID 76 | # "0x12345678". Note there is only one level of expansion - you 77 | # cannot make an group that points to another group. Note also that 78 | # if there are spaces in the recipient name, this will appear as two 79 | # recipients. In these cases it is better to use the key ID. 80 | 81 | #group mynames = paige 0x12345678 joe patti 82 | 83 | # Lock the file only once for the lifetime of a process. If you do 84 | # not define this, the lock will be obtained and released every time 85 | # it is needed, which is usually preferable. 86 | 87 | #lock-once 88 | 89 | # GnuPG can send and receive keys to and from a keyserver. These 90 | # servers can be HKP, email, or LDAP (if GnuPG is built with LDAP 91 | # support). 92 | # 93 | # Example HKP keyserver: 94 | # hkp://keys.gnupg.net 95 | # hkp://subkeys.pgp.net 96 | # 97 | # Example email keyserver: 98 | # mailto:pgp-public-keys@keys.pgp.net 99 | # 100 | # Example LDAP keyservers: 101 | # ldap://keyserver.pgp.com 102 | # 103 | # Regular URL syntax applies, and you can set an alternate port 104 | # through the usual method: 105 | # hkp://keyserver.example.net:22742 106 | # 107 | # Most users just set the name and type of their preferred keyserver. 108 | # Note that most servers (with the notable exception of 109 | # ldap://keyserver.pgp.com) synchronize changes with each other. Note 110 | # also that a single server name may actually point to multiple 111 | # servers via DNS round-robin. hkp://keys.gnupg.net is an example of 112 | # such a "server", which spreads the load over a number of physical 113 | # servers. To see the IP address of the server actually used, you may use 114 | # the "--keyserver-options debug". 115 | 116 | keyserver hkps://keys.openpgp.org 117 | 118 | # Common options for keyserver functions: 119 | # 120 | # include-disabled : when searching, include keys marked as "disabled" 121 | # on the keyserver (not all keyservers support this). 122 | # 123 | # no-include-revoked : when searching, do not include keys marked as 124 | # "revoked" on the keyserver. 125 | # 126 | # verbose : show more information as the keys are fetched. 127 | # Can be used more than once to increase the amount 128 | # of information shown. 129 | # 130 | # use-temp-files : use temporary files instead of a pipe to talk to the 131 | # keyserver. Some platforms (Win32 for one) always 132 | # have this on. 133 | # 134 | # keep-temp-files : do not delete temporary files after using them 135 | # (really only useful for debugging) 136 | # 137 | # http-proxy="proxy" : set the proxy to use for HTTP and HKP keyservers. 138 | # This overrides the "http_proxy" environment variable, 139 | # if any. 140 | # 141 | # auto-key-retrieve : automatically fetch keys as needed from the keyserver 142 | # when verifying signatures or when importing keys that 143 | # have been revoked by a revocation key that is not 144 | # present on the keyring. 145 | # 146 | # no-include-attributes : do not include attribute IDs (aka "photo IDs") 147 | # when sending keys to the keyserver. 148 | 149 | keyserver-options auto-key-retrieve 150 | keyserver-options no-honor-keyserver-url 151 | keyserver-options include-revoked 152 | 153 | # Display photo user IDs in key listings 154 | 155 | list-options show-uid-validity 156 | 157 | # Display photo user IDs when a signature from a key with a photo is 158 | # verified 159 | 160 | verify-options show-uid-validity 161 | 162 | # Use this program to display photo user IDs 163 | # 164 | # %i is expanded to a temporary file that contains the photo. 165 | # %I is the same as %i, but the file isn't deleted afterwards by GnuPG. 166 | # %k is expanded to the key ID of the key. 167 | # %K is expanded to the long OpenPGP key ID of the key. 168 | # %t is expanded to the extension of the image (e.g. "jpg"). 169 | # %T is expanded to the MIME type of the image (e.g. "image/jpeg"). 170 | # %f is expanded to the fingerprint of the key. 171 | # %% is %, of course. 172 | # 173 | # If %i or %I are not present, then the photo is supplied to the 174 | # viewer on standard input. If your platform supports it, standard 175 | # input is the best way to do this as it avoids the time and effort in 176 | # generating and then cleaning up a secure temp file. 177 | # 178 | # If no photo-viewer is provided, GnuPG will look for xloadimage, eog, 179 | # or display (ImageMagick). On Mac OS X and Windows, the default is 180 | # to use your regular JPEG image viewer. 181 | # 182 | # Some other viewers: 183 | # photo-viewer "qiv %i" 184 | # photo-viewer "ee %i" 185 | # 186 | # This one saves a copy of the photo ID in your home directory: 187 | # photo-viewer "cat > ~/photoid-for-key-%k.%t" 188 | # 189 | # Use your MIME handler to view photos: 190 | # photo-viewer "metamail -q -d -b -c %T -s 'KeyID 0x%k' -f GnuPG" 191 | 192 | # Passphrase agent 193 | # 194 | # We support the old experimental passphrase agent protocol as well as 195 | # the new Assuan based one (currently available in the "newpg" package 196 | # at ftp.gnupg.org/gcrypt/alpha/aegypten/). To make use of the agent, 197 | # you have to run an agent as daemon and use the option 198 | # 199 | use-agent 200 | # 201 | # which tries to use the agent but will fallback to the regular mode 202 | # if there is a problem connecting to the agent. The normal way to 203 | # locate the agent is by looking at the environment variable 204 | # GPG_AGENT_INFO which should have been set during gpg-agent startup. 205 | # In certain situations the use of this variable is not possible, thus 206 | # the option 207 | # 208 | # --gpg-agent-info=::1 209 | # 210 | # may be used to override it. 211 | 212 | # Automatic key location 213 | # 214 | # GnuPG can automatically locate and retrieve keys as needed using the 215 | # auto-key-locate option. This happens when encrypting to an email 216 | # address (in the "user@example.com" form), and there are no 217 | # user@example.com keys on the local keyring. This option takes the 218 | # following arguments, in the order they are to be tried: 219 | # 220 | # cert = locate a key using DNS CERT, as specified in RFC-4398. 221 | # GnuPG can handle both the PGP (key) and IPGP (URL + fingerprint) 222 | # CERT methods. 223 | # 224 | # pka = locate a key using DNS PKA. 225 | # 226 | # ldap = locate a key using the PGP Universal method of checking 227 | # "ldap://keys.(thedomain)". For example, encrypting to 228 | # user@example.com will check ldap://keys.example.com. 229 | # 230 | # keyserver = locate a key using whatever keyserver is defined using 231 | # the keyserver option. 232 | # 233 | # You may also list arbitrary keyservers here by URL. 234 | # 235 | # Try CERT, then PKA, then LDAP, then hkp://subkeys.net: 236 | #auto-key-locate cert pka ldap hkp://subkeys.pgp.net 237 | 238 | auto-key-locate cert pka hkp://subkeys.pgp.net 239 | personal-cipher-preferences AES256 AES192 AES CAST5 240 | personal-digest-preferences SHA256 SHA384 SHA512 SHA224 RIPEMD160 SHA1 241 | cert-digest-algo SHA512 242 | default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed 243 | 244 | keyid-format 0xlong 245 | with-fingerprint 246 | no-emit-version 247 | no-comments 248 | -------------------------------------------------------------------------------- /dot.inputrc: -------------------------------------------------------------------------------- 1 | set input-meta on 2 | set output-meta on 3 | set convert-meta off 4 | set enable-keypad on 5 | set enable-bracketed-paste on 6 | set blink-matching-paren on 7 | set colored-completion-prefix on 8 | set menu-complete-display-prefix on 9 | set horizontal-scroll-mode on 10 | set colored-stats on 11 | set completion-ignore-case on 12 | set completion-map-case on 13 | -------------------------------------------------------------------------------- /dot.mailcap: -------------------------------------------------------------------------------- 1 | text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput 2 | text/plain; less '%s' 3 | image/*; xdg-open '%s' 4 | application/pdf; xdg-open '%s' 5 | application/postscript; xdg-open '%s' 6 | -------------------------------------------------------------------------------- /dot.mpdconf: -------------------------------------------------------------------------------- 1 | # An example configuration file for MPD. 2 | # Read the user manual for documentation: http://www.musicpd.org/doc/user/ 3 | 4 | music_directory "~/Music" 5 | playlist_directory "~/.mpd/playlists" 6 | db_file "~/.mpd/database" 7 | pid_file "~/.mpd/pid" 8 | state_file "~/.mpd/state" 9 | sticker_file "~/.mpd/sticker.sql" 10 | 11 | # The special value "syslog" makes MPD use the local syslog daemon. This 12 | # setting defaults to logging to syslog, otherwise logging is disabled. 13 | # 14 | #log_file "~/.mpd/log" 15 | 16 | bind_to_address "localhost" 17 | port "6600" 18 | #bind_to_address "~/.mpd/socket" 19 | 20 | # This setting controls the type of information which is logged. Available 21 | # setting arguments are "default", "secure" or "verbose". The "verbose" setting 22 | # argument is recommended for troubleshooting, though can quickly stretch 23 | # available resources on limited hardware storage. 24 | # 25 | #log_level "default" 26 | 27 | gapless_mp3_playback "yes" 28 | save_absolute_paths_in_playlists "no" 29 | 30 | #metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" 31 | auto_update "yes" 32 | #follow_outside_symlinks "yes" 33 | #follow_inside_symlinks "yes" 34 | 35 | #zeroconf_enabled "no" 36 | #zeroconf_name "Music Player" 37 | 38 | 39 | input { 40 | plugin "curl" 41 | # proxy "proxy.isp.com:8080" 42 | # proxy_user "user" 43 | # proxy_password "password" 44 | } 45 | 46 | #audio_output { 47 | # type "alsa" 48 | # name "My ALSA Device" 49 | ## device "hw:0,0" # optional 50 | ## mixer_type "hardware" # optional 51 | ## mixer_device "default" # optional 52 | ## mixer_control "PCM" # optional 53 | ## mixer_index "0" # optional 54 | #} 55 | # 56 | # An example of a recorder output: 57 | 58 | audio_output { 59 | type "pulse" 60 | name "Pulse Output" 61 | # server "remote_server" # optional 62 | # sink "remote_server_sink" # optional 63 | } 64 | 65 | #audio_output { 66 | # type "null" 67 | # name "My Null Output" 68 | # mixer_type "none" # optional 69 | #} 70 | # 71 | #samplerate_converter "Fastest Sinc Interpolator" 72 | 73 | 74 | # Normalization automatic volume adjustments ################################## 75 | # 76 | # This setting specifies the type of ReplayGain to use. This setting can have 77 | # the argument "off", "album", "track" or "auto". "auto" is a special mode that 78 | # chooses between "track" and "album" depending on the current state of 79 | # random playback. If random playback is enabled then "track" mode is used. 80 | # See for more details about ReplayGain. 81 | # This setting is off by default. 82 | # 83 | replaygain "album" 84 | #replaygain_preamp "0" 85 | replaygain_missing_preamp "-2" 86 | #replaygain_limit "yes" 87 | #volume_normalization "no" 88 | 89 | filesystem_charset "UTF-8" 90 | id3v1_encoding "ISO-8859-1" 91 | 92 | 93 | # SIDPlay decoder ############################################################# 94 | # 95 | # songlength_database: 96 | # Location of your songlengths file, as distributed with the HVSC. 97 | # The sidplay plugin checks this for matching MD5 fingerprints. 98 | # See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq 99 | # 100 | # default_songlength: 101 | # This is the default playing time in seconds for songs not in the 102 | # songlength database, or in case you're not using a database. 103 | # A value of 0 means play indefinitely. 104 | # 105 | # filter: 106 | # Turns the SID filter emulation on or off. 107 | # 108 | #decoder { 109 | # plugin "sidplay" 110 | # songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt" 111 | # default_songlength "120" 112 | # filter "true" 113 | #} 114 | # 115 | ############################################################################### 116 | 117 | -------------------------------------------------------------------------------- /dot.notmuch-config: -------------------------------------------------------------------------------- 1 | # .notmuch-config - Configuration file for the notmuch mail system 2 | # 3 | # For more information about notmuch, see http://notmuchmail.org 4 | 5 | # Database configuration 6 | # 7 | # The only value supported here is 'path' which should be the top-level 8 | # directory where your mail currently exists and to where mail will be 9 | # delivered in the future. Files should be individual email messages. 10 | # Notmuch will store its database within a sub-directory of the path 11 | # configured here named ".notmuch". 12 | # 13 | 14 | [database] 15 | path=/home/aperez/.mail 16 | 17 | # User configuration 18 | # 19 | # Here is where you can let notmuch know how you would like to be 20 | # addressed. Valid settings are 21 | # 22 | # name Your full name. 23 | # primary_email Your primary email address. 24 | # other_email A list (separated by ';') of other email addresses 25 | # at which you receive email. 26 | # 27 | # Notmuch will use the various email addresses configured here when 28 | # formatting replies. It will avoid including your own addresses in the 29 | # recipient list of replies, and will set the From address based on the 30 | # address to which the original email was addressed. 31 | # 32 | 33 | [user] 34 | name=Adrian Perez de Castro 35 | primary_email=aperez@igalia.com 36 | 37 | # Configuration for "notmuch new" 38 | # 39 | # The following options are supported here: 40 | # 41 | # tags A list (separated by ';') of the tags that will be 42 | # added to all messages incorporated by "notmuch new". 43 | # 44 | 45 | [new] 46 | tags=new 47 | 48 | # Maildir compatibility configuration 49 | # 50 | # The following option is supported here: 51 | # 52 | # synchronize_flags Valid values are true and false. 53 | # 54 | # If true, then the following maildir flags (in message filenames) 55 | # will be syncrhonized with the corresponding notmuch tags: 56 | # 57 | # Flag Tag 58 | # ---- ------- 59 | # D draft 60 | # F flagged 61 | # P passed 62 | # R replied 63 | # S unread (added when 'S' flag is not present) 64 | # 65 | # The "notmuch new" command will notice flag changes in filenames 66 | # and update tags, while the "notmuch tag" and "notmuch restore" 67 | # commands will notice tag changes and update flags in filenames 68 | # 69 | ignore= 70 | 71 | [maildir] 72 | synchronize_flags=true 73 | 74 | # Search configuration 75 | # 76 | # The following option is supported here: 77 | # 78 | # exclude_tags 79 | # A ;-separated list of tags that will be excluded from 80 | # search results by default. Using an excluded tag in a 81 | # query will override that exclusion. 82 | # 83 | 84 | [search] 85 | exclude_tags=deleted;ignored;killed 86 | -------------------------------------------------------------------------------- /dot.nvimrc: -------------------------------------------------------------------------------- 1 | " Disable some built-in plug-ins which I never use. 2 | let g:loaded_2html_plugin = 1 3 | let g:loaded_getscriptPlugin = 1 4 | let g:loaded_logipat = 1 5 | let g:loaded_vimballPlugin = 1 6 | 7 | augroup vimrc 8 | autocmd! 9 | augroup END 10 | 11 | source ~/.vim/plugx.vim 12 | 13 | PluginBegin 14 | Plugin 'aperezdc/vim-elrond', '~/devel/vim-elrond' 15 | Plugin 'aperezdc/vim-lining', '~/devel/vim-lining' 16 | Plugin 'aperezdc/vim-template', '~/devel/vim-template' 17 | Plugin 'seblj/nvim-echo-diagnostics' 18 | Plugin 'ibhagwan/fzf-lua', { 'branch': 'main' } 19 | Plugin 'j-hui/fidget.nvim' 20 | 21 | Plugin 'docunext/closetag.vim', { 'for': ['html', 'xml'] } 22 | Plugin 'ledger/vim-ledger' 23 | Plugin 'justinmk/vim-dirvish' 24 | Plugin 'nelstrom/vim-visual-star-search' 25 | Plugin 'pbrisbin/vim-mkdir' 26 | Plugin 'fcpg/vim-shore' 27 | Plugin 'lluchs/vim-wren' 28 | Plugin 'sheerun/vim-polyglot' 29 | Plugin 'tmux-plugins/vim-tmux' 30 | " Plugin 'roxma/vim-tmux-clipboard' 31 | Plugin 'weakish/rcshell.vim' 32 | Plugin 'tpope/vim-commentary' 33 | Plugin 'tpope/vim-fugitive' 34 | Plugin 'vim-scripts/a.vim' 35 | Plugin 'rhysd/clever-f.vim' 36 | Plugin 'janet-lang/janet.vim' 37 | Plugin 'neovim/nvim-lspconfig' 38 | Plugin 'folke/lsp-colors.nvim' 39 | Plugin 'mhinz/vim-grepper' 40 | Plugin 'janet-lang/janet.vim' 41 | Plugin 'kergoth/vim-bitbake' 42 | PluginEnd 43 | 44 | colorscheme elrond 45 | filetype indent plugin on 46 | syntax on 47 | 48 | set completeopt=longest,menu,menuone 49 | set clipboard+=unnamedplus 50 | set exrc 51 | set shiftwidth=4 52 | set tabstop=4 53 | set hidden 54 | set incsearch 55 | set inccommand=nosplit 56 | set breakindent 57 | set updatetime=250 58 | set smartcase 59 | set ignorecase 60 | set noinfercase 61 | set nohlsearch 62 | set linebreak 63 | set textwidth=78 64 | set colorcolumn=81 65 | set encoding=utf-8 66 | set scrolloff=3 67 | set sidescrolloff=5 68 | set nowrap 69 | set whichwrap+=[,],<,> 70 | set wildignore+=*.o,*.a,a.out 71 | set shortmess+=c 72 | set ruler 73 | set timeout " for mappings 74 | set timeoutlen=1000 " default value 75 | set ttimeout " for key codes 76 | set ttimeoutlen=10 " unnoticeable small value 77 | set guicursor= 78 | 79 | if !has('nvim') 80 | set ttymouse=sgr 81 | endif 82 | 83 | if executable('rg') 84 | set grepprg=rg\ -S\ --no-heading\ --vimgrep 85 | if Have('ack.vim') 86 | let g:ackprg = 'rg -S --no-heading --vimgrep' 87 | let g:ack_use_cword_for_empty_search = 1 88 | endif 89 | endif 90 | 91 | " Persistent undo! 92 | if !isdirectory(expand('~/.cache/nvim/undo')) 93 | call system('mkdir -p ' . shellescape(expand('~/.cache/nvim/undo'))) 94 | endif 95 | set undodir=~/.cache/nvim/undo 96 | set undofile 97 | 98 | for mapmode in ['n', 'vnore', 'i', 'c', 'l', 't'] 99 | execute mapmode.'map  ' 100 | execute mapmode.'map  ' 101 | execute mapmode.'map  ' 102 | execute mapmode.'map  ' 103 | execute mapmode.'map  ' 104 | execute mapmode.'map  ' 105 | execute mapmode.'map  ' 106 | execute mapmode.'map  ' 107 | endfor 108 | unlet mapmode 109 | 110 | " Cannot live without these. 111 | command! -nargs=0 -bang Q q 112 | command! -nargs=0 -bang W w 113 | command! -nargs=0 -bang Wq wq 114 | command! -nargs=0 B b# 115 | 116 | " Convenience mappings. 117 | map 118 | map :pop 119 | map / 120 | map __ ZZ 121 | 122 | vnoremap J :m '>+1gv=gv 123 | vnoremap K :m '<-2gv=gv 124 | vnoremap < >gv 126 | 127 | nnoremap H :bprevious 128 | nnoremap L :bnext 129 | 130 | " Highlight word below the cursor. 131 | " https://stackoverflow.com/questions/6876850/how-to-highlight-all-occurrences-of-a-word-in-vim-on-double-clicking 132 | nnoremap + :execute 'highlight DoubleClick ctermbg=green ctermfg=blackmatch DoubleClick /\V\<'.escape(expand(''), '\').'\>/' 133 | nnoremap - :match none 134 | 135 | " Manually re-format a paragraph of text 136 | nnoremap Q gwip 137 | 138 | " See https://stackoverflow.com/questions/1444322/how-can-i-close-a-buffer-without-closing-the-window#8585343 139 | map q :bpspbnbd 140 | 141 | " Make . work with visually selected lines 142 | vnoremap . :norm. 143 | 144 | " Make and generate new undolist entries. 145 | " Tip from: http://vim.wikia.com/wiki/Recover_from_accidental_Ctrl-U 146 | inoremap u 147 | inoremap u 148 | 149 | " Alt+{arrow} for window movements 150 | nnoremap 151 | nnoremap 152 | nnoremap 153 | nnoremap 154 | 155 | " Always make n/N search forward/backwar, regardless of the last search type. 156 | " From https://github.com/mhinz/vim-galore 157 | nnoremap n 'Nn'[v:searchforward] 158 | nnoremap N 'nN'[v:searchforward] 159 | 160 | " Make and respect already-typed content in command mode. 161 | " From https://github.com/mhinz/vim-galore 162 | cnoremap 163 | cnoremap 164 | 165 | " https://vim.fandom.com/wiki/Make_C-Left_C-Right_behave_as_in_Windows 166 | nnoremap b 167 | nnoremap w 168 | nnoremap [[ 169 | nnoremap ]] 170 | 171 | " Jump to the last edited position in the file being loaded (if available) 172 | autocmd vimrc BufReadPost * 173 | \ if line("'\"") > 0 && line("'\"") <= line("$") | 174 | \ execute "normal g'\"" | 175 | \ endif 176 | 177 | " Make it easier to use :terminal 178 | if exists(':terminal') 179 | " Entering/Leaving terminal buffers changes from/to insert mode automatically. 180 | autocmd vimrc BufEnter term://* startinsert 181 | autocmd vimrc BufLeave term://* stopinsert 182 | 183 | " Allow using Alt+{arrow} to navigate *also* out from terminal buffers. 184 | tnoremap 185 | tnoremap 186 | tnoremap 187 | tnoremap 188 | 189 | " Make Ctrl-Shift-q exit insert mode. 190 | tnoremap 191 | endif 192 | 193 | " Ctrl-C does not trigger InsertLeave, remap it through Escape. 194 | inoremap 195 | 196 | " Alternate mapping for increasing/decreasing numbers. 197 | nnoremap 198 | nnoremap 199 | 200 | " Open location/quickfix window whenever a command is executed and the 201 | " list gets populated with at least one valid location. 202 | autocmd vimrc QuickFixCmdPost [^l]* cwindow 203 | autocmd vimrc QuickFixCmdPost l* lwindow 204 | 205 | " Plugin: templates (probably others as well) {{{1 206 | let g:user = 'Adrian Perez de Castro' 207 | let g:email = 'aperez@igalia.com' 208 | " 1}}} 209 | 210 | " Plugin: nvim-hardline {{{1 211 | if Have('nvim-hardline') 212 | lua < f FzfLua files 221 | nnoremap F FzfLua git_files 222 | nnoremap m FzfLua oldfiles 223 | nnoremap b FzfLua buffers 224 | nnoremap t FzfLua builtin 225 | nnoremap FzfLua help_tags 226 | nnoremap R FzfLua resume 227 | nmap f 228 | nmap F 229 | nmap m 230 | nmap b 231 | nmap b 232 | nmap t 233 | endif 234 | " 1}}} 235 | 236 | " Plugin: shore {{{1 237 | let g:shore_stayonfront = 1 238 | " 1}}} 239 | 240 | 241 | " Plugin: vale {{{1 242 | if Have('nvim-lint') 243 | autocmd vimrc BufWritePost lua require("lint").try_lint() 244 | endif 245 | " 1}}} 246 | 247 | lua <FzfLua lsp_" .. action .. "", opts) 279 | end 280 | else 281 | set_keymap("n", "gT", "lua vim.lsp.buf.type_definition()", opts) 282 | set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) 283 | set_keymap("n", "gR", "lua vim.lsp.buf.references()", opts) 284 | set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) 285 | end 286 | set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts) 287 | set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) 288 | set_keymap("i", "", "lua vim.lsp.buf.signature_help()", opts) 289 | 290 | set_keymap("n", "[d", "lua vim.diagnostic.goto_prev()", opts) 291 | set_keymap("n", "]d", "lua vim.diagnostic.goto_next()", opts) 292 | set_keymap("n", "sd", "lua vim.diagnostic.open_float()", opts) 293 | set_keymap("n", "fd", "lua vim.diagnostic.setloclist()", opts) 294 | 295 | set_option("formatexpr", "v:lua.vim.lsp.formatexpr()") 296 | set_option("omnifunc", "v:lua.vim.lsp.omnifunc") 297 | end 298 | 299 | local capabilities = vim.lsp.protocol.make_client_capabilities() 300 | local has_cmp_lsp, cmp_lsp = pcall(require, "cmp_nvim_lsp") 301 | if has_cmp_lsp then 302 | capabilities = cmp_lsp.default_capabilities() 303 | end 304 | 305 | local lspc = require "lspconfig" 306 | 307 | --[[ 308 | lspc.ccls.setup { 309 | on_attach = lsp_attach, 310 | capabilities = capabilities, 311 | cmd = {"ccls", "-v=0"}, 312 | } 313 | ]] 314 | 315 | lspc.clangd.setup { 316 | on_attach = lsp_attach, 317 | capabilities = capabilities, 318 | cmd = {"clangd", "--background-index", "--enable-config", "--completion-style=detailed", "-j=2", "--log=error"}, 319 | init_options = { 320 | clangdFileStatus = true, 321 | }, 322 | } 323 | 324 | lspc.serve_d.setup {on_attach = lsp_attach, capabilities = capabilities} 325 | lspc.pyright.setup {on_attach = lsp_attach, capabilities = capabilities} 326 | lspc.cmake.setup {on_attach = lsp_attach, capabilities = capabilities} 327 | lspc.prosemd_lsp.setup {on_attach = lsp_attach, capabilities = capabilities} 328 | 329 | lspc.lua_ls.setup { 330 | on_attach = lsp_attach, 331 | capabilities = capabilities, 332 | cmd = {"lua-language-server"}, 333 | settings = { 334 | Lua = { 335 | runtime = { 336 | version = "LuaJIT", 337 | path = (function () 338 | local rtp = vim.split(package.path, ";") 339 | table.insert(rtp, "lua/?.lua") 340 | table.insert(rtp, "lua/?/init.lua") 341 | return rtp 342 | end)(), 343 | }, 344 | diagnostics = { 345 | globals = {"vim"}, 346 | }, 347 | workspace = { 348 | library = vim.api.nvim_get_runtime_file("", true), 349 | }, 350 | telemetry = { 351 | enable = false, 352 | }, 353 | }, 354 | }, 355 | } 356 | EOS 357 | endif 358 | " 1}}} 359 | 360 | " Plugin: cmp + fallback {{{1 361 | if Have('nvim-cmp') 362 | lua <"] = cmp.mapping(function(fallback) 376 | if not cmp.select_next_item() then 377 | if vim.bo.buftype ~= "prompt" and has_words_before() then 378 | cmp.complete() 379 | else 380 | fallback() 381 | end 382 | end 383 | end, {"i", "s"}), 384 | 385 | [""] = cmp.mapping(function() 386 | if not cmp.select_prev_item() then 387 | if vim.bo.buftype ~= "prompt" and has_words_before() then 388 | cmp.complete() 389 | else 390 | fallback() 391 | end 392 | end 393 | end, {"i", "s"}), 394 | 395 | [""] = cmp.mapping { 396 | i = cmp.mapping.confirm { 397 | behavior = cmp.ConfirmBehavior.Replace, 398 | select = false, 399 | }, 400 | c = function(fallback) 401 | if cmp.visible() then 402 | cmp.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false } 403 | else 404 | fallback() 405 | end 406 | end, 407 | }, 408 | }, 409 | sources = cmp.config.sources({ 410 | { name = "nvim_lsp_signature_help" }, 411 | { name = "nvim_lsp" }, 412 | { name = "zsh" }, 413 | { name = "path" }, 414 | }, { 415 | { name = "buffer" }, 416 | }), 417 | view = { 418 | entries = { 419 | name = "custom", 420 | selection_order = "near_cursor", 421 | }, 422 | }, 423 | } 424 | 425 | --[[ 426 | for _, cmd_type in ipairs {"/", "?"} do 427 | cmp.setup.cmdline(cmd_type, { 428 | mapping = cmp.mapping.preset.cmdline(), 429 | sources = cmp.config.sources({ 430 | { name = "nvim_lsp_document_symbol" }, 431 | { name = "cmdline_history" }, 432 | }) 433 | }) 434 | end 435 | for _, cmd_type in ipairs {":", "@"} do 436 | cmp.setup.cmdline(cmd_type, { 437 | mapping = cmp.mapping.preset.cmdline(), 438 | sources = cmp.config.sources({ 439 | { name = "cmdline_history" }, 440 | { name = "cmdline" }, 441 | }) 442 | }) 443 | end 444 | ]] 445 | 446 | -- Zsh completion 447 | local has_cmp_zsh, cmp_zsh = pcall(require, "cmp_zsh") 448 | if has_cmp_zsh then 449 | cmp_zsh.setup { 450 | filetypes = {"zsh"}, 451 | } 452 | end 453 | EOS 454 | else 455 | function! s:check_backspace() abort 456 | let l:column = col('.') - 1 457 | return !l:column || getline('.')[l:column - 1] =~# '\s' 458 | endfunction 459 | 460 | set completeopt=longest,menu 461 | 462 | function! s:trigger_completion() abort 463 | if &omnifunc !=# '' 464 | return "\\" 465 | elseif &completefunc !=# '' 466 | return "\\" 467 | else 468 | return "\\" 469 | endif 470 | endfunction 471 | 472 | inoremap 473 | \ pumvisible() ? "\" : "\" 474 | 475 | inoremap 476 | \ pumvisible() ? "\" : 477 | \ check_backspace() ? "\" : "\" 478 | 479 | inoremap 480 | \ trigger_completion() 481 | inoremap 482 | \ pumvisible() ? "\" : "\" 483 | endif 484 | " 1}}} 485 | 486 | " Plugin: lsp-colors {{{1 487 | if Have('lsp-colors.nvim') 488 | lua <* :Grepper -cword -noprompt 504 | endif " 1}}} 505 | 506 | if Have("fidget.nvim") 507 | lua require "fidget".setup() 508 | endif 509 | 510 | " vim:set fdm=marker: 511 | -------------------------------------------------------------------------------- /dot.screenrc: -------------------------------------------------------------------------------- 1 | # ___ ___ ___ ___ __ __ 2 | # | Y .-----.--------.-----| Y |__| |_ 3 | # |. 1 | _ | | -__|. 1 /| | _| 4 | # |. _ |_____|__|__|__|_____|. _ \|__|____| 5 | # |: | | |: | \ 6 | # |::.|:. | Set-up ~yourself |::.| . ) 7 | # `--- ---' `--- ---' 8 | # 9 | 10 | logtstamp off 11 | multiuser off 12 | sessionname 'scr' 13 | startup_message off 14 | nethack on 15 | vbell on 16 | sorendition +b yr 17 | shelltitle '> |zsh' 18 | hardstatus alwayslastline '%{= bw}%{+b}[%{-}%h%{+b}]%{-} %=%-Lw%{+rb kW}%n %t%{-}%+Lw %{-}' 19 | compacthist on 20 | defscrollback 4096 21 | 22 | # vim:ft=screen 23 | # 24 | 25 | -------------------------------------------------------------------------------- /dot.signature: -------------------------------------------------------------------------------- 1 | Cheers, 2 | —Adrián 3 | -------------------------------------------------------------------------------- /dot.startup.py: -------------------------------------------------------------------------------- 1 | import readline, atexit, os, rlcompleter 2 | try: 3 | from importlib import reload 4 | except: 5 | pass 6 | 7 | historypath = os.path.expanduser("~/.pyhistory") 8 | readline.parse_and_bind("tab: complete") 9 | 10 | def save_history(historypath=historypath): 11 | import readline 12 | readline.write_history_file(historypath) 13 | 14 | if os.path.exists(historypath): 15 | readline.read_history_file(historypath) 16 | 17 | atexit.register(save_history) 18 | 19 | del os, atexit, readline, save_history, historypath, rlcompleter 20 | -------------------------------------------------------------------------------- /dot.tmux.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | set-window-option -g aggressive-resize on 4 | set-window-option -g mode-keys vi 5 | 6 | # Do not let bells pass silently. This is useful along with irssi 7 | # when it is conigured to beep when mentioned or directly messaged 8 | set -g visual-bell off 9 | set -g visual-activity off 10 | set -g visual-silence off 11 | set -g monitor-silence 0 12 | set -g monitor-activity off 13 | set -g monitor-bell on 14 | set -g bell-action any 15 | set -g silence-action any 16 | 17 | set -g xterm-keys on 18 | set -g set-titles on 19 | set -g history-limit 8192 20 | set -g display-time 5000 21 | set -g focus-events on 22 | set -g default-terminal tmux 23 | set -g update-environment 'WAYLAND_DISPLAY DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM VTE_VERSION WINDOWID SWAYSOCK' 24 | if-shell "[[ ${TERM} =~ 256color || ${TERM} = fbterm || ${TERM} = xterm-termite ]]" 'set -g default-terminal tmux-256color' 25 | 26 | set -ga terminal-overrides ',xterm-termite:Tc,xterm-*color:Tc,alacritty*:Tc' 27 | 28 | set -g base-index 1 29 | set -g pane-base-index 1 30 | set -g renumber-windows on 31 | set -s escape-time 0 32 | #set -g status on 33 | set -g status-right " %H:%M " 34 | set -g status-left "" 35 | set -g status-right-length 10 36 | set -g status-fg white 37 | set -g status-bg blue 38 | set -g window-status-current-style "fg=white bg=black bold reverse" 39 | 40 | set -g prefix C-a 41 | set -g prefix2 C-b 42 | 43 | bind C-a last-window 44 | bind C-b last-window 45 | bind C-l send-key C-l 46 | bind a send-prefix 47 | bind Space next-window 48 | bind -n C-M-Up new-window 49 | bind -n C-M-Down last-window 50 | bind -n C-M-Right next-window 51 | bind -n C-M-Left previous-window 52 | 53 | # Vim-style Visual-Mode and yank/paste 54 | unbind [ 55 | bind Escape copy-mode 56 | unbind p 57 | bind p paste-buffer 58 | bind -T copy-mode-vi v send -X begin-selection 59 | bind -T copy-mode-vi y send -X copy-selection 60 | 61 | # Open splits in the current pane path 62 | # https://unix.stackexchange.com/questions/12032/how-to-create-a-new-window-on-the-current-directory-in-tmux 63 | bind '"' split-window -c '#{pane_current_path}' 64 | bind % split-window -c '#{pane_current_path}' -h 65 | 66 | set -g @plugin 'tmux-plugins/tpm' 67 | set -g @plugin 'tmux-plugins/tmux-sensible' 68 | set -g @plugin 'tmux-plugins/tmux-yank' 69 | set -g @plugin 'tmux-plugins/tmux-open' 70 | 71 | run '~/.tmux/plugins/tpm/tpm' 72 | -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/c.vim: -------------------------------------------------------------------------------- 1 | setlocal expandtab 2 | setlocal cinoptions+=(0 3 | setlocal commentstring=//\ %s 4 | -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/cmake.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=\#\ %s 2 | setlocal expandtab 3 | setlocal shiftwidth=4 4 | setlocal tabstop=4 5 | -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/cpp.vim: -------------------------------------------------------------------------------- 1 | c.vim -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/d.vim: -------------------------------------------------------------------------------- 1 | setlocal expandtab 2 | setlocal cinoptions+=(0 3 | setlocal commentstring=//\ %s 4 | -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/lua.vim: -------------------------------------------------------------------------------- 1 | setlocal expandtab 2 | setlocal tabstop=3 3 | setlocal shiftwidth=3 4 | -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | setlocal expandtab 2 | setlocal tabstop=2 3 | setlocal shiftwidth=2 4 | setlocal wrap 5 | setlocal linebreak 6 | setlocal showbreak 7 | setlocal spell 8 | setlocal conceallevel=2 9 | -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/meson.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=\#\ %s 2 | -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/objc.vim: -------------------------------------------------------------------------------- 1 | c.vim -------------------------------------------------------------------------------- /dot.vim--after/ftplugin/text.vim: -------------------------------------------------------------------------------- 1 | setlocal formatlistpat=^\\s*[\\[({]\\\?\\([0-9]\\+\\\|[iIvVxXlLcCdDmM]\\+\\\|[a-zA-Z]\\)[\\]:.)}]\\s\\+\\\|^\\s*[-+o*]\\s\\+ 2 | setlocal formatoptions+=n 3 | -------------------------------------------------------------------------------- /dot.vim--init.vim: -------------------------------------------------------------------------------- 1 | let g:python3_host_prog = '/usr/bin/python3' 2 | let g:python_host_prog = '/usr/bin/python2' 3 | 4 | if has('nvim') && filereadable(expand('~/.nvimrc')) 5 | source ~/.nvimrc 6 | elseif filereadable(expand('~/.vimrc')) 7 | source ~/.vimrc 8 | else 9 | " Minimal configuration 10 | set incsearch 11 | set smartcase 12 | set ignorecase 13 | set infercase 14 | cmap W w 15 | map / 16 | map __ ZZ 17 | syntax on 18 | filetype indent plugin on 19 | colorscheme elflord 20 | endif 21 | -------------------------------------------------------------------------------- /dot.vim--plugx.vim: -------------------------------------------------------------------------------- 1 | " Author: Adrian Perez de Castro 2 | " License: MIT 3 | 4 | if exists('g:loaded_plugx') 5 | finish 6 | endif 7 | let g:loaded_plugx = 1 8 | 9 | let s:save_cpo = &cpo 10 | set cpo&vim 11 | 12 | let s:string_type = type('') 13 | let s:dict_type = type({}) 14 | 15 | function s:plugx(repo, ...) 16 | if a:0 > 2 17 | echohl ErrorMsg 18 | echom '[plugx] Invalid number of arguments: ' . (a:0 + 1) 19 | echohl None 20 | return 21 | endif 22 | 23 | let localpath = '' 24 | let opts = {} 25 | 26 | if a:0 > 0 27 | if a:0 == 2 28 | let localpath = a:000[0] 29 | let opts = a:000[1] 30 | elseif type(a:000[0]) == s:string_type 31 | let localpath = a:000[0] 32 | elseif type(a:000[0]) == s:dict_type 33 | let opts = a:000[0] 34 | else 35 | echoerr '[plugx] Expected string or dict for parameter #2' 36 | return 37 | endif 38 | endif 39 | 40 | if localpath ==# '' 41 | " No local directory, pass along options to vim-plug directly. 42 | return plug#(a:repo, opts) 43 | endif 44 | 45 | let plugname = fnamemodify(a:repo, ':t') 46 | let dirname = fnamemodify(localpath, ':t') 47 | if dirname !=# plugname 48 | echoerr '[plugx] Plugin names do not match:' plugname '/' dirname 49 | return 50 | endif 51 | 52 | let path = fnamemodify(localpath, ':p') 53 | if isdirectory(path) 54 | " Ensure that local plugins are always marked as frozen. 55 | let opts.frozen = 1 56 | call plug#(path, opts) 57 | else 58 | call plug#(a:repo, opts) 59 | endif 60 | endfunction 61 | 62 | function Have(name) 63 | return has_key(g:, 'plugs') && has_key(get(g:, 'plugs'), a:name) && 64 | \ isdirectory(get(get(get(g:, 'plugs'), a:name), 'dir', '/dev/null')) 65 | endfunction 66 | 67 | 68 | if filereadable(expand('~/.vim/plug.vim')) 69 | source ~/.vim/plug.vim 70 | command! -nargs=+ -bar Plugin call s:plugx() 71 | command -nargs=0 PluginBegin call plug#begin('~/.vim/bundle') 72 | command -nargs=0 PluginEnd call plug#end() 73 | else 74 | function s:noop(...) 75 | endfunction 76 | 77 | command -nargs=0 PluginEnd call s:noop() 78 | command -nargs=0 PluginBegin call s:noop() 79 | command -nargs=+ -bar Plugin call s:noop() 80 | 81 | function s:plugfetch() 82 | !curl -fLo ~/.vim/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 83 | endfunction 84 | 85 | command -nargs=0 PlugUpgrade call s:plugfetch() 86 | echom '[plug-bootstrap] Use :PlugUpgrade to install vim-plug' 87 | endif 88 | 89 | let &cpo = s:save_cpo 90 | unlet s:save_cpo 91 | -------------------------------------------------------------------------------- /dot.vimrc: -------------------------------------------------------------------------------- 1 | " set nocompatible 2 | 3 | " Disable some built-in plug-ins which I never use. 4 | let g:loaded_2html_plugin = 1 5 | let g:loaded_getscriptPlugin = 1 6 | let g:loaded_logipat = 1 7 | let g:loaded_vimballPlugin = 1 8 | 9 | augroup vimrc 10 | autocmd! 11 | augroup END 12 | 13 | iabbrev :shrug: ¯\_(ツ)_/¯ 14 | iabbrev :tableflip: (╯°□°)╯彡┻━┻ 15 | 16 | 17 | " Section: Plugins {{{1 18 | source ~/.vim/plugx.vim 19 | 20 | PluginBegin 21 | if !has('nvim') 22 | Plugin 'tpope/vim-sensible' 23 | Plugin 'ConradIrwin/vim-bracketed-paste' 24 | endif 25 | Plugin 'aperezdc/vim-elrond', '~/devel/vim-elrond' 26 | Plugin 'aperezdc/vim-lining', '~/devel/vim-lining' 27 | Plugin 'aperezdc/vim-template', '~/devel/vim-template' 28 | " Plugin 'aperezdc/vim-lift', '~/devel/vim-lift' 29 | Plugin 'wellle/tmux-complete.vim' 30 | Plugin 'bounceme/remote-viewer' 31 | Plugin 'docunext/closetag.vim', { 'for': ['html', 'xml'] } 32 | Plugin 'IngoHeimbach/neco-vim' 33 | Plugin 'fcpg/vim-shore' 34 | if executable('fzf') 35 | Plugin 'junegunn/fzf' 36 | else 37 | Plugin 'junegunn/fzf', { 'do': './install --all' } 38 | endif 39 | Plugin 'chrisbra/unicode.vim' 40 | Plugin 'dense-analysis/ale' 41 | Plugin 'junegunn/fzf.vim' 42 | Plugin 'junegunn/vim-peekaboo' 43 | Plugin 'justinmk/vim-dirvish' 44 | Plugin 'ledger/vim-ledger' 45 | Plugin 'nelstrom/vim-visual-star-search' 46 | Plugin 'lluchs/vim-wren' 47 | Plugin 'pbrisbin/vim-mkdir' 48 | Plugin 'romainl/vim-qf' 49 | Plugin 'romainl/vim-qlist' 50 | Plugin 'sgur/vim-editorconfig' 51 | Plugin 'sheerun/vim-polyglot' 52 | Plugin 'tmux-plugins/vim-tmux' 53 | Plugin 'roxma/vim-tmux-clipboard' 54 | Plugin 'weakish/rcshell.vim' 55 | Plugin 'tpope/vim-commentary' 56 | Plugin 'tpope/vim-eunuch' 57 | Plugin 'tpope/vim-fugitive' 58 | " Plugin 'tpope/vim-vinegar' 59 | Plugin 'christoomey/vim-conflicted' 60 | Plugin 'vim-scripts/a.vim' 61 | Plugin 'rhysd/clever-f.vim' 62 | Plugin 'vim-pandoc/vim-pandoc-syntax' 63 | Plugin 'yssl/QFEnter' 64 | Plugin 'mtth/scratch.vim' 65 | Plugin 'mhinz/vim-grepper' 66 | Plugin 'godlygeek/tabular' 67 | " Plugin 'plasticboy/vim-markdown' 68 | " Plugin 'mzlogin/vim-smali' 69 | Plugin 'janet-lang/janet.vim' 70 | Plugin 'kergoth/vim-bitbake' 71 | Plugin 'mfukar/robotframework-vim' 72 | PluginEnd " 1}}} 73 | 74 | " Section: Options {{{1 75 | set clipboard+=unnamedplus 76 | " set completeopt=menu,longest,noselect 77 | set completeopt=longest,menu 78 | set shiftwidth=4 79 | set tabstop=4 80 | set nobomb 81 | set exrc 82 | set hidden 83 | set incsearch 84 | set smartcase 85 | set ignorecase 86 | set noinfercase 87 | set nohlsearch 88 | set lazyredraw 89 | set linebreak 90 | set textwidth=78 91 | set colorcolumn=81 92 | set encoding=utf-8 93 | set scrolloff=3 94 | set sidescrolloff=5 95 | set nowrap 96 | set whichwrap+=[,],<,> 97 | set wildignore+=*.o,*.a,a.out 98 | set shortmess+=c 99 | set ruler 100 | " set notimeout 101 | set timeout " for mappings 102 | set timeoutlen=1000 " default value 103 | set ttimeout " for key codes 104 | set ttimeoutlen=10 " unnoticeable small value 105 | set guicursor= 106 | 107 | if !has('nvim') 108 | set ttymouse=sgr 109 | endif 110 | 111 | " Persistent undo! 112 | if !isdirectory(expand('~/.cache/vim/undo')) 113 | call system('mkdir -p ' . shellescape(expand('~/.cache/vim/undo'))) 114 | endif 115 | set undodir=~/.cache/vim/undo 116 | set undofile 117 | 118 | filetype indent plugin on 119 | syntax on 120 | 121 | if executable('rg') 122 | set grepprg=rg\ --vimgrep 123 | endif 124 | " 1}}} 125 | 126 | if Have('vim-elrond') 127 | colorscheme elrond 128 | else 129 | colorscheme elflord 130 | endif 131 | 132 | 133 | " Section: Terminal shenanigans {{{1 134 | for mapmode in ['n', 'vnore', 'i', 'c', 'l', 't'] 135 | execute mapmode.'map  ' 136 | execute mapmode.'map  ' 137 | execute mapmode.'map  ' 138 | execute mapmode.'map  ' 139 | execute mapmode.'map  ' 140 | execute mapmode.'map  ' 141 | execute mapmode.'map  ' 142 | execute mapmode.'map  ' 143 | endfor 144 | unlet mapmode 145 | 146 | if &term =~# '^screen' || &term =~# '^tmux' || &term ==# 'linux' 147 | set t_ts=k 148 | set t_fs=\ 149 | set t_Co=16 150 | endif 151 | 152 | if $TERM ==# 'tmux-256color' || $TERM ==# 'xterm-256color' || $TERM ==# 'screen-256color' || $TERM ==# 'xterm-termite' || $TERM ==# 'gnome-256color' || $TERM ==# 'fbterm' || $COLORTERM ==# 'gnome-terminal' 153 | set t_Co=256 154 | set t_AB=[48;5;%dm 155 | set t_AF=[38;5;%dm 156 | set t_ZH= 157 | set t_ZR= 158 | else 159 | if $TERM =~# 'st-256color' 160 | set t_Co=256 161 | endif 162 | endif 163 | 164 | " Configure Vim I-beam/underline cursor for insert/replace mode. 165 | " From http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes 166 | " if !has('nvim') && exists('&t_SR') 167 | " if empty($TMUX) 168 | " let &t_SI = "\[6 q" 169 | " let &t_SR = "\[4 q" 170 | " let &t_EI = "\[2 q" 171 | " else 172 | " let &t_SI = "\Ptmux;\\[6 q\\\" 173 | " let &t_SR = "\Ptmux;\\[4 q\\\" 174 | " let &t_EI = "\Ptmux;\\[2 q\\\" 175 | " endif 176 | " endif 177 | " 1}}} 178 | 179 | " Section: Mappings {{{1 180 | " Cannot live without these. 181 | command! -nargs=0 -bang Q q 182 | command! -nargs=0 -bang W w 183 | command! -nargs=0 -bang Wq wq 184 | command! -nargs=0 B b# 185 | 186 | " Convenience mappings. 187 | map 188 | map :pop 189 | map / 190 | map __ ZZ 191 | 192 | vnoremap J :m '>+1gv=gv 193 | vnoremap K :m '<-2gv=gv 194 | vnoremap < >gv 196 | 197 | nnoremap H :bprevious 198 | nnoremap L :bnext 199 | 200 | " Highlight word below the cursor. 201 | " https://stackoverflow.com/questions/6876850/how-to-highlight-all-occurrences-of-a-word-in-vim-on-double-clicking 202 | nnoremap + :execute 'highlight DoubleClick ctermbg=green ctermfg=blackmatch DoubleClick /\V\<'.escape(expand(''), '\').'\>/' 203 | nnoremap - :match none 204 | 205 | " Manually re-format a paragraph of text 206 | nnoremap Q gwip 207 | 208 | " See https://stackoverflow.com/questions/1444322/how-can-i-close-a-buffer-without-closing-the-window#8585343 209 | map q :bpspbnbd 210 | 211 | " Make . work with visually selected lines 212 | vnoremap . :norm. 213 | 214 | " Make and generate new undolist entries. 215 | " Tip from: http://vim.wikia.com/wiki/Recover_from_accidental_Ctrl-U 216 | inoremap u 217 | inoremap u 218 | 219 | " Alt+{arrow} for window movements 220 | nnoremap 221 | nnoremap 222 | nnoremap 223 | nnoremap 224 | 225 | " Always make n/N search forward/backwar, regardless of the last search type. 226 | " From https://github.com/mhinz/vim-galore 227 | nnoremap n 'Nn'[v:searchforward] 228 | nnoremap N 'nN'[v:searchforward] 229 | 230 | " Make and respect already-typed content in command mode. 231 | " From https://github.com/mhinz/vim-galore 232 | cnoremap 233 | cnoremap 234 | 235 | " https://vim.fandom.com/wiki/Make_C-Left_C-Right_behave_as_in_Windows 236 | nnoremap b 237 | nnoremap w 238 | nnoremap [[ 239 | nnoremap ]] 240 | 241 | " Jump to the last edited position in the file being loaded (if available) 242 | autocmd vimrc BufReadPost * 243 | \ if line("'\"") > 0 && line("'\"") <= line("$") | 244 | \ execute "normal g'\"" | 245 | \ endif 246 | 247 | " Make it easier to use :terminal 248 | if exists(':terminal') 249 | " Entering/Leaving terminal buffers changes from/to insert mode automatically. 250 | autocmd vimrc BufEnter term://* startinsert 251 | autocmd vimrc BufLeave term://* stopinsert 252 | 253 | " Allow using Alt+{arrow} to navigate *also* out from terminal buffers. 254 | tnoremap 255 | tnoremap 256 | tnoremap 257 | tnoremap 258 | 259 | " Make Ctrl-Shift-q exit insert mode. 260 | tnoremap 261 | endif 262 | 263 | " Ctrl-C does not trigger InsertLeave, remap it through Escape. 264 | inoremap 265 | 266 | " Alternate mapping for increasing/decreasing numbers. 267 | nnoremap 268 | nnoremap 269 | 270 | " 1}}} 271 | 272 | " Per-filetype settings 273 | autocmd vimrc BufReadPost,BufNewFile *.bst setlocal filetype=yaml 274 | autocmd vimrc BufReadPost,BufNewFile *.mm setlocal filetype=objcpp 275 | autocmd vimrc BufReadPost Config.in setlocal filetype=kconfig 276 | " autocmd vimrc FileType mkdc,markdown setlocal expandtab tabstop=2 shiftwidth=2 conceallevel=2 277 | autocmd vimrc FileType scheme setlocal tabstop=2 shiftwidth=2 expandtab 278 | autocmd vimrc FileType meson setlocal tabstop=4 shiftwidth=4 noexpandtab 279 | autocmd vimrc FileType yaml setlocal tabstop=2 shiftwidth=2 expandtab 280 | autocmd vimrc FileType dirvish call FugitiveDetect(@%) 281 | autocmd vimrc FileType help wincmd L 282 | autocmd vimrc FileType git wincmd L | wincmd x 283 | autocmd vimrc BufReadPost ~/Notes/*.md setlocal colorcolumn=0 textwidth=0 284 | 285 | " Open location/quickfix window whenever a command is executed and the 286 | " list gets populated with at least one valid location. 287 | autocmd vimrc QuickFixCmdPost [^l]* cwindow 288 | autocmd vimrc QuickFixCmdPost l* lwindow 289 | 290 | " Plugin: templates (probably others as well) {{{1 291 | let g:user = 'Adrian Perez de Castro' 292 | let g:email = 'aperez@igalia.com' 293 | " 1}}} 294 | 295 | " Plugin: editorconfig {{{1 296 | let g:editorconfig_blacklist = { 297 | \ 'filetype': ['git.*', 'fugitive'] 298 | \ } 299 | " }}}1 300 | 301 | " Plugin: markdown {{{1 302 | if Have('vim-markdown') 303 | let g:vim_markdown_folding_disabled = 1 304 | let g:vim_markdown_override_foldtext = 0 305 | let g:vim_markdown_conceal_code_blocks = 0 306 | let g:vim_markdown_fromtmatter = 1 307 | let g:vim_markdown_strikethrough = 1 308 | let g:vim_markdown_new_list_item_indent = 2 309 | endif " 1}}} 310 | 311 | " Plugin: shore {{{1 312 | let g:shore_stayonfront = 1 313 | " 1}}} 314 | 315 | " Plugin: fzf {{{1 316 | if Have('fzf.vim') 317 | nnoremap f :Files 318 | nnoremap F :GitFiles 319 | nnoremap m :History 320 | nnoremap b :Buffers 321 | nnoremap :Helptags 322 | nmap f 323 | nmap F 324 | nmap m 325 | nmap b 326 | nmap b 327 | endif 328 | 329 | " 1}}} 330 | 331 | " Tab-completion {{{1 332 | function! s:check_backspace() abort 333 | let l:column = col('.') - 1 334 | return !l:column || getline('.')[l:column - 1] =~# '\s' 335 | endfunction 336 | 337 | function! s:trigger_completion() abort 338 | if &omnifunc !=# '' 339 | let b:complete_p = 0 340 | return "\\" 341 | elseif &completefunc !=# '' 342 | let b:complete_p = 1 343 | return "\\" 344 | else 345 | let b:complete_p = 1 346 | return "\\" 347 | endif 348 | endfunction 349 | 350 | inoremap 351 | \ pumvisible() ? (get(b:, 'complete_p', 1) ? "\" : "\") : 352 | \ check_backspace() ? "\" : 353 | \ "\" 354 | inoremap 355 | \ trigger_completion() 356 | inoremap 357 | \ pumvisible() ? "\" : "\" 358 | 359 | inoremap 360 | \ pumvisible() ? "\" : "\" 361 | " 1}}} 362 | 363 | " Grep facilities {{{1 364 | command -nargs=+ Grep execute 'silent grep! ' | copen 365 | command -nargs=0 Wrep execute 'silent grep! ' | copen 366 | " 1}}} 367 | 368 | " Utilities: Language Servers support {{{1 369 | function! s:lsp(langs, ...) 370 | let aidx = 0 371 | while aidx < a:0 372 | let program = a:000[l:aidx + 0] 373 | let cmdlist = a:000[l:aidx + 1] 374 | if executable(program) 375 | if len(cmdlist) == 0 376 | let cmdlist = [program] 377 | endif 378 | for lang in a:langs 379 | call s:lsp_set_server(lang, cmdlist) 380 | endfor 381 | return 382 | endif 383 | let aidx += 2 384 | endwhile 385 | endfunction 386 | 387 | function! s:cmdlist_to_string(cmdlist) 388 | let cmd = '' 389 | let rest = 0 390 | for item in a:cmdlist 391 | if rest 392 | let cmd .= ' ' 393 | else 394 | let rest = 1 395 | endif 396 | let cmd .= shellescape(item) 397 | endfor 398 | return cmd 399 | endfunction 400 | 401 | function! s:lsp_set_server(lang, cmd) 402 | endfunction 403 | " 1}}} 404 | 405 | " Plugin: ale {{{1 406 | if Have('ale') 407 | " set completeopt=menu,menuone,preview,noselect,noinsert 408 | let g:ale_echo_msg_format = '[%linter%] %code: %%s' 409 | let g:ale_completion_enabled = 0 410 | let g:ale_set_quickfix = 0 411 | let g:ale_set_loclist = 0 412 | let g:ale_set_balloons = 1 413 | 414 | " let g:ale_yaml_yamllint_options = '' 415 | 416 | " let s:c_cpp_linters = ['flawfinder'] 417 | " let s:c_cpp_linters = ['clangtidy', 'flawfinder'] 418 | " let s:c_cpp_linters = ['clangtidy'] 419 | let s:c_cpp_linters = ['clangtidy'] 420 | for program in ['clangd', 'ccls', 'clang', 'gcc'] 421 | " for program in ['ccls', 'clangd', 'clang', 'gcc'] 422 | if executable(program) 423 | call insert(s:c_cpp_linters, program) 424 | break 425 | endif 426 | endfor 427 | 428 | let g:ale_cpp_clangd_options = '--completion-style=detailed --header-insertion=iwyu --enable-config --pch-storage=memory -j=2' 429 | let g:ale_c_clangd_options = g:ale_cpp_clangd_options 430 | 431 | let g:ale_linters = { 432 | \ 'c': s:c_cpp_linters, 'cpp': s:c_cpp_linters, 433 | \ } 434 | unlet s:c_cpp_linters 435 | 436 | nmap (ale_previous_wrap) 437 | nmap (ale_next_wrap) 438 | nmap d (ale_detail) 439 | nmap h (ale_hover) 440 | nmap D (ale_go_to_definition) 441 | nmap r (ale_find_references) 442 | nmap x (ale_fix) 443 | imap (ale_complete) 444 | 445 | if Have('vim-lining') 446 | function s:linting_done() 447 | let buffer = bufnr('') 448 | return get(g:, 'ale_enabled') 449 | \ && getbufvar(buffer, 'ale_linted', 0) 450 | \ && !ale#engine#IsCheckingBuffer(buffer) 451 | endfunction 452 | 453 | let s:ale_lining_warnings_item = {} 454 | function s:ale_lining_warnings_item.format(item, active) 455 | if a:active && s:linting_done() 456 | let counts = ale#statusline#Count(bufnr('')) 457 | let warnings = counts.total - counts.error - counts.style_error 458 | if warnings > 0 459 | return warnings 460 | endif 461 | endif 462 | return '' 463 | endfunction 464 | call lining#right(s:ale_lining_warnings_item, 'Warn') 465 | 466 | let s:ale_lining_errors_item = {} 467 | function s:ale_lining_errors_item.format(item, active) 468 | if a:active && s:linting_done() 469 | let counts = ale#statusline#Count(bufnr('')) 470 | let errors = counts.error + counts.style_error 471 | if errors > 0 472 | return errors 473 | endif 474 | endif 475 | return '' 476 | endfunction 477 | call lining#right(s:ale_lining_errors_item, 'Error') 478 | 479 | let s:ale_status_item = {} 480 | function s:ale_status_item.format(item, active) 481 | return (a:active && ale#engine#IsCheckingBuffer(bufnr(''))) ? 'linting' : '' 482 | endfunction 483 | call lining#right(s:ale_status_item) 484 | 485 | autocmd vimrc User ALEJobStarted call lining#refresh() 486 | autocmd vimrc User ALELintPost call lining#refresh() 487 | autocmd vimrc User ALEFixPost call lining#refresh() 488 | endif 489 | endif " 1}}} 490 | 491 | " Plugin: Conflicted {{{1 492 | if Have('vim-conflicted') && Have('vim-lining') 493 | let s:conflicted_version_item = {} 494 | function s:conflicted_version_item.format(item, active) 495 | return ConflictedVersion() 496 | endfunction 497 | call lining#right(s:conflicted_version_item) 498 | endif " 1}}} 499 | 500 | if Have('scratch.vim') " Plugin: Scratch {{{1 501 | let g:scratch_persistence_file = expand('~/.vim/scratch') 502 | endif " 1}}} 503 | 504 | " vim:foldmethod=marker: 505 | -------------------------------------------------------------------------------- /dot.xsettingsd: -------------------------------------------------------------------------------- 1 | Gtk/AutoMnemonics 1 2 | Gtk/CursorTheme "Hackneyed" 3 | Gtk/DialogsUseHeader 0 4 | Gtk/EnableAnimations 1 5 | Gtk/EnablePrimaryPaste 1 6 | Gtk/FontName "Inter UI 11" 7 | Gtk/DecorationLayout "menu:close" 8 | Gtk/ShellShowsAppMenu 0 9 | Gtk/ShellShowsDesktop 0 10 | Net/CursorBlink 0 11 | Net/EnableEventSounds 0 12 | Net/EnableInputFeedbackSounds 0 13 | Net/FallbackIconTheme "hicolor" 14 | Net/IconThemeName "Luv" 15 | Net/SoundThemeName "freedesktop" 16 | Net/ThemeName "Arc-Darker" 17 | Xft/HintStyle "hintslight" 18 | Xft/RGBA "rgb" 19 | -------------------------------------------------------------------------------- /dot.yashrc: -------------------------------------------------------------------------------- 1 | # Firstly, load the common customization script. 2 | # If you don't like settings applied in this script, remove this line. 3 | . --autoload --no-alias initialization/common 4 | 5 | # These are additional aliases that are not defined in the common script. 6 | # Uncomment to enable them. 7 | #alias g='grep' 8 | #alias l='$PAGER' 9 | #alias --global L='|$PAGER' 10 | #alias --global N='>/dev/null 2>&1' N1='>/dev/null' N2='2>/dev/null' 11 | 12 | # Uncomment to enable direnv support. (jq required) 13 | #_update_direnv() { 14 | # eval "$( 15 | # direnv export json | 16 | # jq -r 'to_entries | .[] | 17 | # if .value == null then 18 | # @sh "unset \(.key)" 19 | # else 20 | # @sh "export \(.key)=\(.value)" 21 | # end' 22 | # )" 23 | #} 24 | #_update_direnv 25 | #YASH_AFTER_CD=("$YASH_AFTER_CD" '_update_direnv') 26 | 27 | # And add your own customization below. 28 | 29 | # This is in a function to be able to use local variables. 30 | function yashrc_do_bindkeys { 31 | typeset M 32 | for M in v e ; do 33 | # 34 | # Bind Ctrl-Left and Ctrl-Right key sequences to jump around words, and 35 | # make Ctrl-W kill a normal word, which allows to use it for removing 36 | # path components and matches the behaviour of Ctrl-Left / Ctrl-Right. 37 | # The predefined behaviour (killing a "big" word) is moved to Alt-W. 38 | # 39 | bindkey -$M '\^[[1;5D' backward-emacsword 40 | bindkey -$M '\^[[1;5C' forward-emacsword 41 | bindkey -$M '\^W' backward-kill-emacsword 42 | bindkey -$M '\^[w' backward-kill-bigword 43 | 44 | # Bind Home/End/Delete for some funky terminals. 45 | bindkey -$M '\^[OH' beginning-of-line 46 | bindkey -$M '\^[[H' beginning-of-line 47 | bindkey -$M '\^A' beginning-of-line 48 | bindkey -$M '\^[[1~' beginning-of-line 49 | bindkey -$M '\^[OF' end-of-line 50 | bindkey -$M '\^[[F' end-of-line 51 | bindkey -$M '\^E' end-of-line 52 | bindkey -$M '\^[[4~' end-of-line 53 | bindkey -$M '\^[[3~' delete-char 54 | 55 | # The following are just for convenience. 56 | bindkey -$M '\^L' clear-and-redraw-all 57 | bindkey -$M '\^[.' vi-append-last-bigword # Alt-. 58 | bindkey -$M '\^[' accept-prediction # Alt-Enter 59 | done 60 | } 61 | yashrc_do_bindkeys 62 | unset -f yashrc_do_bindkeys 63 | 64 | alias -- '-'=popd 65 | 66 | function '+' { 67 | if [ $# -eq 0 ] ; then 68 | cd - 69 | else 70 | pushd "$@" 71 | fi 72 | } 73 | 74 | 75 | # Colourful ls 76 | if ls --version | grep GNU ; then 77 | alias ls='ls --color=auto -F' 78 | else 79 | # In BSD systems, usually setting this maks "ls" use colors. 80 | export CLICOLOR=1 81 | export LSCOLORS=ExGxFxdxCxDxDxhbabacae 82 | if [ -n "$(which colorls)" ] ; then 83 | alias ls='colorls -F' 84 | else 85 | alias ls='ls -F' 86 | fi 87 | fi 2> /dev/null 1>&2 88 | 89 | 90 | # Weather report, in the console 91 | function meteo { 92 | curl -s "http://meteo.connectical.com/${1:-}" 93 | } 94 | 95 | 96 | # Rust 97 | export RUSTFLAGS='-C target-cpu=native' 98 | 99 | 100 | # PATH additions 101 | function yashrc_path_add { 102 | if [ -d "$1" ] ; then 103 | typeset item 104 | for item in ${PATH} ; do 105 | # Item is already in $PATH, skip. 106 | if [ "${item}" = "$1" ] ; then 107 | return 108 | fi 109 | done 110 | PATH="$1:${PATH}" 111 | fi 112 | } 113 | 114 | function yashrc_do_paths { 115 | typeset item 116 | typeset saved_ifs=${IFS} 117 | IFS=: 118 | for item in "$@" ; do 119 | yashrc_path_add "${item}" 120 | done 121 | IFS=${saved_ifs} 122 | } 123 | 124 | yashrc_do_paths \ 125 | "${HOME}/.cargo/bin" \ 126 | "${HOME}/.local/bin" \ 127 | "${HOME}/.dotfiles/bin" 128 | 129 | unset -f yashrc_do_paths yashrc_path_add 130 | 131 | export GPG_TTY=$(tty) 132 | if [ -x "$(which gpg-connect-agent 2> /dev/null)" ] ; then 133 | gpg-connect-agent -q updatestartuptty /bye > /dev/null 134 | fi 135 | 136 | # vim: set et sw=2 sts=2 tw=78 ft=sh: 137 | -------------------------------------------------------------------------------- /dot.zsh--rc.zsh: -------------------------------------------------------------------------------- 1 | #! /bin/zsh 2 | 3 | stty -ixon -ixoff 4 | 5 | # https://www.johnhawthorn.com/2012/09/vi-escape-delays/ 6 | KEYTIMEOUT=1 7 | 8 | # The following lines were added by compinstall 9 | zstyle :compinstall filename '/home/aperez/.zshrc' 10 | 11 | if [[ -r ~/devel/zz-top/everything.zsh ]] ; then 12 | source ~/devel/zz-top/everything.zsh 13 | elif [[ -r ~/.zsh/zz-top/everything.zsh ]] ; then 14 | source ~/.zsh/zz-top/everything.zsh 15 | else 16 | function zz-top { 17 | [[ ${1:-} != --loco ]] 18 | } 19 | function zz-top-setup { 20 | mkdir -p ~/.zsh 21 | git clone https://github.com/aperezdc/zz-top ~/.zsh/zz-top 22 | } 23 | echo 'zz-top not available, use zz-top-setup' 24 | fi 25 | 26 | zz-top chrissicool/zsh-256color 27 | zz-top jreese/zsh-titles 28 | zz-top RobSis/zsh-completion-generator 29 | zz-top RobSis/zsh-reentry-hook 30 | zz-top zdharma-continuum/fast-syntax-highlighting 31 | zz-top zsh-users/zsh-history-substring-search 32 | zz-top zsh-users/zsh-completions 33 | zz-top zsh-users/zsh-autosuggestions 34 | zz-top aperezdc/zsh-fzy --local ~/devel/zsh-fzy 35 | zz-top aperezdc/zsh-notes --local ~/devel/zsh-notes 36 | zz-top aperezdc/virtualz --local ~/devel/virtualz 37 | zz-top aperezdc/rockz --local ~/devel/rockz 38 | zz-top Tarrasch/zsh-autoenv 39 | 40 | 41 | if [[ ! -d ~/.tmux/plugins/tpm ]] ; then 42 | echo "tpm not available, set it up with 'tpm-install' (needs Git and Internet access)" 43 | tpm-install () { 44 | mkdir -p ~/.tmux/plugins 45 | git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm 46 | echo "not (re)start tmux and use 'C-b I' to install configured plugins" 47 | unfunction tpm-install 48 | } 49 | fi 50 | 51 | autoload -Uz compinit 52 | compinit 53 | 54 | 55 | function cmd-completion () { 56 | local name=$1 57 | shift 58 | local binpath=$(whence "${name}") 59 | local compfile="${HOME}/.zsh/functions/_${name}" 60 | 61 | compdef "_${name}" "${name}" 62 | 63 | # Check whether the program exists and is executable. Otherwise skip. 64 | if [[ -z ${binpath} || ! -x ${binpath} ]] ; then 65 | return 66 | fi 67 | 68 | # No need to update the completion file if it already exists and it's 69 | # newer than the binary for which the completions are being generated. 70 | if [[ -d ~/.zsh/functions && -r ${compfile} && ${compfile} -nt ${binpath} ]] ; then 71 | return 72 | fi 73 | 74 | # Generate. 75 | echo ">> Updating completion: ${binpath} $* → ${compfile})" 76 | mkdir -p ~/.zsh/functions 77 | "${binpath}" "$@" > "${compfile}" 78 | } 79 | 80 | cmd-completion rustup completions zsh 81 | cmd-completion csview completion zsh 82 | cmd-completion gh completion --shell zsh 83 | cmd-completion poetry completions zsh 84 | cmd-completion himalaya completion zsh 85 | 86 | unfunction cmd-completion # Not needed anymore 87 | 88 | if [[ -d ~/.zsh/functions ]] ; then 89 | fpath=( ~/.zsh/functions ${fpath} ) 90 | autoload -Uz ~/.zsh/functions/*(:t) 91 | fi 92 | 93 | # End of lines added by compinstall 94 | # Lines configured by zsh-newuser-install 95 | HISTFILE=~/.histfile 96 | HISTSIZE=1000 97 | SAVEHIST=${HISTSIZE} 98 | setopt appendhistory extendedglob inc_append_history share_history \ 99 | hist_reduce_blanks hist_ignore_space extended_history \ 100 | hist_no_store hist_ignore_dups hist_expire_dups_first \ 101 | hist_find_no_dups hist_ignore_all_dups nomatch 102 | unsetopt beep 103 | bindkey -e 104 | # End of lines configured by zsh-newuser-install 105 | 106 | # Extra functionality 107 | autoload -U zmv 108 | 109 | # Initialize colors. 110 | autoload -U colors 111 | colors 112 | 113 | # Command line editing in $EDITOR 114 | autoload edit-command-line && zle -N edit-command-line 115 | bindkey '\ee' edit-command-line 116 | 117 | # Use Alt-M to copy words other from the last from the previous line 118 | autoload -Uz copy-earlier-word 119 | zle -N copy-earlier-word 120 | bindkey '\em' copy-earlier-word 121 | 122 | # Make Escape put Zle in Vi command mode, even when in Emacs mode 123 | bindkey '^[' vi-cmd-mode 124 | 125 | # Make transpose-word smarter, by understanding shell escapes 126 | autoload -Uz transpose-words-match 127 | zstyle ':zle:transpose-words' word-style shell 128 | zle -N transpose-words transpose-words-match 129 | 130 | 131 | # zsh-fzy 132 | if zz-top --loco zsh-fzy ; then 133 | zstyle ':fzy:*' lines min:12 134 | zstyle ':fzy:file' command fd --type f 135 | zstyle ':fzy:cd' command fd --type d 136 | bindkey '^F' fzy-cd-widget 137 | bindkey '^T' fzy-file-widget 138 | bindkey '^R' fzy-history-widget 139 | bindkey '^P' fzy-proc-widget 140 | fi 141 | 142 | # zsh-notes 143 | if zz-top --loco zsh-notes ; then 144 | bindkey '^N' notes-edit-widget 145 | zstyle :notes:widget once yes 146 | if whence -p sk ; then 147 | zstyle :notes:widget picker skim 148 | elif whence -p fzf ; then 149 | zstyle :notes:widget picker fzf 150 | else 151 | zstyle :notes:widget picker fzy 152 | fi 153 | if whence -p lowdown ; then 154 | zstyle :notes:widget:preview enabled yes 155 | zstyle :notes:widget:preview command lowdown -Tterm 156 | elif whence -p mdcat ; then 157 | zstyle :notes:widget:preview enabled yes 158 | zstyle :notes:widget:preview command mdcat -l 159 | fi 160 | fi &> /dev/null 161 | 162 | # Bind Ctrl-Left and Ctrl-Right key sequences, and AvPag/RePag for history 163 | bindkey "^[[1;5C" forward-word 164 | bindkey "^[[1;5D" backward-word 165 | bindkey "\e[5~" history-search-backward 166 | bindkey "\e[6~" history-search-forward 167 | 168 | # Make AvPag/RePag work in long menu selection lists 169 | zmodload -i zsh/complist 170 | bindkey -M menuselect "\e[5~" backward-word 171 | bindkey -M menuselect "\e[6~" forward-word 172 | bindkey -M menuselect "\e" send-break 173 | bindkey -M menuselect '^F' accept-and-infer-next-history 174 | bindkey -M menuselect '/' accept-and-infer-next-history 175 | bindkey -M menuselect '^?' undo 176 | bindkey -M menuselect ' ' accept-and-hold 177 | bindkey -M menuselect '*' history-incremental-search-forward 178 | bindkey -M menuselect '^C' send-break 179 | 180 | 181 | # Bind Delete/Begin/End for Zsh setups that do not include those by default 182 | # (screen, tmux, rxvt...) 183 | bindkey "^[OH" beginning-of-line 184 | bindkey "^[[H" beginning-of-line 185 | bindkey "^A" beginning-of-line 186 | bindkey "[1~" beginning-of-line 187 | bindkey "^[OF" end-of-line 188 | bindkey "^[[F" end-of-line 189 | bindkey "^E" end-of-line 190 | bindkey "[4~" end-of-line 191 | bindkey "^[[3~" delete-char 192 | 193 | # Set a bunch of options :-) 194 | setopt prompt_subst pushd_silent auto_param_slash auto_list \ 195 | hist_reduce_blanks auto_remove_slash chase_dots \ 196 | pushd_ignore_dups auto_param_keys \ 197 | mark_dirs cdablevars interactive_comments glob_complete \ 198 | print_eight_bit always_to_end glob no_warn_create_global \ 199 | hash_list_all hash_cmds hash_dirs hash_executables_only \ 200 | auto_continue check_jobs complete_in_word rc_quotes \ 201 | complete_aliases 202 | unsetopt auto_remove_slash list_ambiguous pushd_to_home 203 | 204 | # Correct things, but not too aggressively for certain commands 205 | setopt correct 206 | alias ':'='nocorrect :' 207 | alias mv='nocorrect mv' 208 | alias man='nocorrect man' 209 | alias sudo='nocorrect sudo' 210 | alias exec='nocorrect exec' 211 | alias mkdir='nocorrect mkdir' 212 | alias toot='nocorrect madonctl toot' 213 | 214 | # Bring up ${LS_COLORS} 215 | if [ -x /usr/bin/dircolors ] ; then 216 | local dircolors_TERM=${TERM} 217 | if [[ ${TERM} = xterm-termite || ${TERM} = alacritty || ${TERM} = foot ]] ; then 218 | dircolors_TERM=xterm-color 219 | fi 220 | if [ -r "${HOME}/.dir_colors" ] ; then 221 | eval $(TERM=${dircolors_TERM} dircolors -b "${HOME}/.dir_colors") 222 | elif [ -r /etc/DIRCOLORS ] ; then 223 | eval $(TERM=${dircolors_TERM} dircolors -b /etc/DIRCOLORS) 224 | else 225 | eval $(TERM=${dircolors_TERM} dircolors) 226 | fi 227 | fi 228 | 229 | # Make completion faster: use cache and do not do partial matches 230 | [[ -d ~/.zsh/cache ]] && mkdir -p ~/.zsh/cache 231 | zstyle ':completion:*' menu select 232 | zstyle ':completion:*' use-cache on 233 | zstyle ':completion:*' cache-path ~/.zsh/cache 234 | zstyle ':completion:*' insert-tab pending=1 235 | zstyle ':completion:*' squeeze-slashes true 236 | zstyle ':completion:*' accept-exact-dirs true 237 | zstyle ':completion:*' accept-exact '*(N)' 238 | zstyle ':completion:*' special-dirs .. 239 | 240 | # Fuzzy completion 241 | zstyle ':completion:*' completer _complete _match _approximate 242 | zstyle ':completion:*' matcher-list '' \ 243 | 'm:{a-z\-}={A-Z\_}' \ 244 | 'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \ 245 | 'r:[[:ascii:]]||[[:ascii:]]=** r:|=* m:{a-z\-}={A-Z\_}' 246 | zstyle ':completion:*:match:*' original only 247 | zstyle ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/5))numeric)' 248 | zstyle ':completion:*:functions' ignored-patterns '_*' 249 | zstyle ':completion:*:descriptions' format '%U%B%d%b%u' 250 | zstyle ':completion:*:warnings' format '%BNo matching %b%d' 251 | 252 | # Prevent CVS files from being matched 253 | zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS' '*.py[cod]' '__pycache__' 254 | zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS' 255 | zstyle ':completion:*:cd:*' noignore-parents noparent pwd 256 | 257 | zstyle ':completion:*:processes' command 'ps -au$USER -o pid,user,args' 258 | zstyle ':completion:*:processes-names' command 'ps -au$USER -o command' 259 | zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' '*?.old' 260 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' 261 | zstyle ':completion:*:killall:*' force-list always 262 | zstyle ':completion:*:kill:*' force-list always 263 | 264 | if [[ -n ${LS_COLORS} ]] ; then 265 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 266 | unsetopt list_types 267 | else 268 | zstyle ':completion:*' list-colors "" 269 | setopt list_types 270 | fi 271 | 272 | FMT_BRANCH="%{$fg[cyan]%}%b%u%c%{$fg[default]%}" # e.g. master¹² 273 | FMT_ACTION="·%{$fg[green]%}%a%{$fg[default]%}" # e.g. (rebase) 274 | 275 | autoload -Uz vcs_info 276 | zstyle ':vcs_info:*' enable git hg bzr svn 277 | zstyle ':vcs_info:bzr:prompt:*' use-simple true 278 | zstyle ':vcs_info:*:prompt:*' check-for-changes true 279 | zstyle ':vcs_info:*:prompt:*' unstagedstr "%B%{$fg[cyan]%}+%{$fg[default]%}%b" 280 | zstyle ':vcs_info:*:prompt:*' stagedstr "%B%{$fg[cyan]%}=%{$fg[default]%}%b" 281 | zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION} " 282 | zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH} " 283 | zstyle ':vcs_info:*:prompt:*' nvcsformats "" 284 | 285 | # Workaround for the Git file names completion, which can be very 286 | # slow for # large repositories (e.g. the Linux kernel sources). 287 | # Source: http://www.zsh.org/mla/workers/2011/msg00502.html 288 | 289 | # map alt-, to complete files 290 | # zle -C complete-files complete-word _generic 291 | # zstyle ':completion:complete-files:*' completer _files 292 | # bindkey '^[,' complete-files 293 | 294 | # Tab completion 295 | # bindkey '^i' complete-word # tab to do menu 296 | # bindkey "\e[Z" reverse-menu-complete # shift-tab to reverse menu 297 | 298 | # Up/down arrow. 299 | # I want shared history for ^R, but I don't want another shell's activity to 300 | # mess with up/down. This does that. 301 | if zz-top --loco zsh-history-substring-search ; then 302 | down-line-or-local-history() { 303 | zle set-local-history 1 304 | zle history-substring-search-down 305 | zle set-local-history 0 306 | } 307 | up-line-or-local-history() { 308 | zle set-local-history 1 309 | zle history-substring-search-up 310 | zle set-local-history 0 311 | } 312 | else 313 | down-line-or-local-history() { 314 | zle set-local-history 1 315 | zle down-line-or-history 316 | zle set-local-history 0 317 | } 318 | up-line-or-local-history() { 319 | zle set-local-history 1 320 | zle up-line-or-history 321 | zle set-local-history 0 322 | } 323 | fi 324 | zle -N down-line-or-local-history 325 | zle -N up-line-or-local-history 326 | 327 | bindkey "\e[A" up-line-or-local-history 328 | bindkey "\eOA" up-line-or-local-history 329 | bindkey "\e[B" down-line-or-local-history 330 | bindkey "\eOB" down-line-or-local-history 331 | 332 | # Search in history using the current input as prefix 333 | [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward 334 | [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward 335 | 336 | # Quote stuff that looks like URLs automatically. 337 | autoload -U url-quote-magic 338 | zstyle ':urlglobber' url-other-schema ftp git gopher http https magnet 339 | zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#=' # dropped { } 340 | 341 | # Disable Git automatic file completion -- it is slow. 342 | #__git_files(){} 343 | 344 | REAL_TERM=${TERM} 345 | if [[ -n ${TMUX} ]] ; then 346 | local tmp=$(tmux show-environment -g TERM 2> /dev/null) 347 | if [[ -n ${tmp} ]] ; then 348 | REAL_TERM=${tmp:5} 349 | fi 350 | fi 351 | 352 | # Workaround for handling TERM variable in multiple tmux sessions properly from 353 | # http://sourceforge.net/p/tmux/mailman/message/32751663/ by Nicholas Marriott. 354 | if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then 355 | case ${REAL_TERM} in 356 | *256color | xterm-termite | alacritty | foot) 357 | if infocmp tmux-256color &> /dev/null ; then 358 | TERM=tmux-256color 359 | else 360 | TERM=screen-256color 361 | fi 362 | ;; 363 | fbterm) 364 | TERM=screen-256color 365 | ;; 366 | *) 367 | if infocmp tmux &> /dev/null ; then 368 | TERM=tmux 369 | else 370 | TERM=screen 371 | fi 372 | ;; 373 | esac 374 | fi 375 | 376 | # Disable bracketed paste in terminals which won't gobble unrecognized 377 | # escapes. This fixes the trailing characters in prompts in some *BSD 378 | # consoles. Info: http://www.zsh.org/mla/users/2015/msg01055.html 379 | if [[ ${REAL_TERM} = cons* || -z $(printf '%s %q' ${(kv)terminfo[(R)*[0-9](#c4)[hl]]}) ]] ; then 380 | unset zle_bracketed_paste 381 | fi 382 | 383 | function precmd_vcs_info_prompt { 384 | vcs_info prompt 385 | } 386 | precmd_functions+=(precmd_vcs_info_prompt) 387 | 388 | # Have Zsh report the times used by commands. Also, use this value to determine 389 | # when to emit a bell to the terminal, so it does not beep so often. 390 | REPORTTIME=5 391 | 392 | function precmd_bell { 393 | if [[ ${TTYIDLE} -gt $(( REPORTTIME * 6 )) ]] ; then 394 | printf '\a' 395 | fi 396 | } 397 | precmd_functions+=(precmd_bell) 398 | 399 | case ${REAL_TERM} in 400 | xterm* | gnome* | foot) 401 | function precmd_xterm_title { 402 | print -Pn "\e]0;%n@%m: %~\a" 403 | } 404 | precmd_functions+=(precmd_xterm_title) 405 | function preexec_xterm_title { 406 | print -Pn "\e]0;$HOST: ${(q)1//(#m)[$'\000-\037\177-']/${(q)MATCH}}\a" 407 | } 408 | preexec_functions+=(preexec_xterm_title) 409 | ;; 410 | st | st-256color) 411 | # See: http://git.suckless.org/st/plain/FAQ 412 | tput smkx 413 | ;; 414 | esac 415 | 416 | if [[ -r /etc/profile.d/vte.sh ]] ; then 417 | TERM=${REAL_TERM} source /etc/profile.d/vte.sh 418 | fi 419 | if [[ ${TERM} = screen* ]] ; then 420 | tput smkx # SRSLY? 421 | fi 422 | 423 | unset REAL_TERM 424 | 425 | # Put the prefix of the jhbuild environment in the prompt 426 | zsh_jhbuild_info='' 427 | if [[ -n ${JHBUILD_PREFIX} ]] ; then 428 | zsh_jhbuild_info=" %{$fg[green]%}jhbuild%{%b%}:%{$fg[magenta]%}${JHBUILD_PREFIX}%{%b%}" 429 | fi 430 | 431 | # Try to detect whether inside a chroot and add it to the prompt 432 | zsh_chroot_info='' 433 | if [[ -n ${DEBIAN_CHROOT} ]] ; then 434 | zsh_chroot_info=${DEBIAN_CHROOT} 435 | elif [[ -n ${CHROOT_NAME} ]] ; then 436 | zsh_chroot_info=${CHROOT_NAME} 437 | elif [[ -n ${CHROOT} ]] ; then 438 | zsh_chroot_info=${CHROOT} 439 | fi 440 | 441 | if [[ -n ${zsh_chroot_info} ]] ; then 442 | zsh_chroot_info=" %{$fg[green]%}chroot%{%b%}:%{$fg[magenta]%}${zsh_chroot_info}%{%b%}" 443 | fi 444 | 445 | # Final PROMPT setting 446 | PROMPT=$'%{%B%(!.$fg[red].$fg[green])%}%m%{%b%}${zsh_chroot_info}${zsh_jhbuild_info} %{$fg[magenta]%}${VIRTUAL_ENV_NAME:+py:${VIRTUAL_ENV_NAME} }${ROCK_ENV_NAME:+lua:${ROCK_ENV_NAME} }%{$reset_color%}${vcs_info_msg_0_}%{%B$fg[blue]%}%1~ %{%(?.$fg[blue].%B$fg[red])%}%# %{%b%k%f%}' 447 | 448 | # Don't count common path separators as word characters 449 | WORDCHARS=${WORDCHARS//[&.;\/]} 450 | 451 | # Don't glob with find or wget 452 | for command in find wget curl; alias ${command}="noglob ${command}" 453 | 454 | # Aliases 455 | alias -- '-'=popd 456 | alias -- '+'=pushd 457 | alias -- '..'='cd ..' 458 | alias clip='xclip -selection clipboard' 459 | alias sprunge='curl -s -S -F "sprunge=<-" http://sprunge.us' 460 | 461 | if grep --version && grep --version | grep GNU ; then 462 | alias grep='grep --color=auto' 463 | fi &> /dev/null 464 | 465 | if ls --version && ls --version | grep GNU ; then 466 | alias ls='ls --color=auto -F' 467 | else 468 | # In BSD systems, usually setting this makes "ls" user colors. 469 | export CLICOLOR=1 470 | export LSCOLORS=ExGxFxdxCxDxDxhbabacae 471 | if whence -p colorls ; then 472 | alias ls='colorls -F' 473 | else 474 | alias ls='ls -F' 475 | fi 476 | fi &> /dev/null 477 | 478 | meteo () { 479 | curl -s "http://meteo.connectical.com/$1" 480 | } 481 | 482 | # Golang environment and binaries directory 483 | if [[ -x /usr/bin/go && -d ${HOME}/go ]] ; then 484 | export GOPATH="${HOME}/go" 485 | path=( "${GOPATH}/bin" "${path[@]}" ) 486 | fi 487 | 488 | if [[ -x /usr/bin/rustc ]] ; then 489 | export RUSTFLAGS='-C target-cpu=native' 490 | fi 491 | 492 | # Rust/Cargo binaries directory 493 | if [[ -d ${HOME}/.cargo/bin ]] ; then 494 | path=( "${HOME}/.cargo/bin" "${path[@]}" ) 495 | fi 496 | 497 | # Local binaries directory 498 | for dirpath in ${HOME}/.local/bin ${HOME}/.dotfiles/bin ; do 499 | if [[ -d ${dirpath} ]] ; then 500 | path=( "${dirpath}" "${path[@]}" ) 501 | fi 502 | done 503 | 504 | # Python startup file 505 | if [ -r "${HOME}/.startup.py" ] ; then 506 | export PYTHONSTARTUP="${HOME}/.startup.py" 507 | fi 508 | 509 | export EMAIL='aperez@igalia.com' 510 | export NAME='Adrian Perez' 511 | 512 | for i in nvim vim e3vi vi zile nano pico ; do 513 | i=$(whence -p "${i}") 514 | if [[ -x ${i} ]] ; then 515 | export EDITOR=${i} 516 | break 517 | fi 518 | done 519 | if [[ ${EDITOR} = */nvim || ${EDITOR} = */vim ]] ; then 520 | alias vi="${EDITOR}" 521 | alias view="${EDITOR} -R" 522 | alias vimdiff="${EDITOR} -d" 523 | fi 524 | 525 | for i in less most more ; do 526 | i=$(whence -p "${i}") 527 | if [[ -x ${i} ]] ; then 528 | export PAGER=${i} 529 | # Setup lesspipe colorizer. 530 | if [[ ${i##*/} = less && ${LESSOPEN} = *lesspipe* && -x $(whence -p pygmentize) ]] ; then 531 | export LESSCOLORIZER=pygmentize 532 | fi 533 | break 534 | fi 535 | done 536 | 537 | if [[ ${PAGER} = */less ]] ; then 538 | export LESS=RSMF 539 | fi 540 | 541 | 542 | if [[ -x /usr/bin/ccache ]] ; then 543 | if [[ -d /usr/lib/ccache/bin ]] ; then 544 | path=( /usr/lib/ccache/bin "${path[@]}" ) 545 | fi 546 | if [[ -d /home/devel/.ccache ]] ; then 547 | export CCACHE_DIR=/home/devel/.ccache 548 | fi 549 | fi 550 | 551 | # Settings for zsh-completion-generator 552 | GENCOMPL_PY=python3 553 | 554 | # VirtualZ settings 555 | if [[ -d /devel/.virtualenvs ]] ; then 556 | VIRTUALZ_HOME=/devel/.virtualenvs 557 | fi 558 | 559 | # Syntax highlighting settings. Set those only if the plugin has been 560 | # loaded successfully, otherwise assigning to the associate array will 561 | # cause errors and the shell will exit during startup. 562 | if zz-top --loco fast-syntax-highlighting && [[ ${FAST_HIGHLIGHT:+set} = set ]] 563 | then 564 | FAST_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=magenta,bold' 565 | FAST_HIGHLIGHT_STYLES[double-quoted-argument]='fg=magenta,bold' 566 | FAST_HIGHLIGHT_STYLES[single-quoted-argument]='fg=magenta,bold' 567 | FAST_HIGHLIGHT_STYLES[single-hyphen-option]='fg=cyan' 568 | FAST_HIGHLIGHT_STYLES[double-hyphen-option]='fg=cyan' 569 | FAST_HIGHLIGHT_STYLES[back-quoted-argument]='fg=magenta' 570 | FAST_HIGHLIGHT_STYLES[commandseparator]='fg=red,bold' 571 | FAST_HIGHLIGHT_STYLES[hashed-command]='fg=yellow,bold' 572 | FAST_HIGHLIGHT_STYLES[reserved-word]='fg=bold' 573 | FAST_HIGHLIGHT_STYLES[unknown-token]='bg=brown' 574 | FAST_HIGHLIGHT_STYLES[precommand]='fg=yellow,bold,underline' 575 | FAST_HIGHLIGHT_STYLES[function]='fg=yellow,bold' 576 | FAST_HIGHLIGHT_STYLES[globbing]='fg=cyan,bold' 577 | FAST_HIGHLIGHT_STYLES[command]='fg=yellow,bold' 578 | FAST_HIGHLIGHT_STYLES[builtin]='fg=yellow,bold' 579 | FAST_HIGHLIGHT_STYLES[alias]='fg=yellow,bold' 580 | FAST_HIGHLIGHT_STYLES[path]='fg=underline' 581 | fi 582 | 583 | if zz-top --loco zsh-autosuggestions 584 | then 585 | if [[ ${COLORTERM} != truecolor && ${TERM} != xterm-termite && ${TERM} != *-256color ]] 586 | then 587 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=black,bold 588 | fi 589 | ZSH_AUTOSUGGEST_STRATEGY=(history completion) 590 | fi 591 | 592 | if zz-top --loco zsh-fzy ; then 593 | : 594 | elif [[ -r /usr/share/skim/key-bindings.zsh ]] ; then 595 | source /usr/share/skim/key-bindings.zsh 596 | SKIM_DEFAULT_OPTIONS='--reverse' 597 | elif [[ -r /etc/profile.d/fzf.zsh ]] ; then 598 | source /etc/profile.d/fzf.zsh 599 | FZF_DEFAULT_OPTS='--reverse --inline-info' 600 | elif [[ -r /usr/share/fzf/key-bindings.zsh ]] ; then 601 | source /usr/share/fzf/key-bindings.zsh 602 | FZF_DEFAULT_OPTS='--reverse --inline-info' 603 | fi 604 | 605 | if [[ -S ~/.mpd/socket ]] ; then 606 | export MPD_HOST="${HOME}/.mpd/socket" 607 | else 608 | unset MPD_HOST 609 | fi 610 | 611 | if whence -p systemctl &> /dev/null ; then 612 | systemctl --user import-environment PATH EDITOR LANG 613 | fi 614 | 615 | export GPG_TTY=$(tty) 616 | if whence -p gpg-connect-agent &> /dev/null ; then 617 | gpg-connect-agent -q updatestartuptty /bye > /dev/null 618 | fi 619 | -------------------------------------------------------------------------------- /dot.zshrc: -------------------------------------------------------------------------------- 1 | #! /bin/zsh 2 | if [[ $- = *i* && -r ~/.zsh/rc.zsh ]] ; then 3 | set -e 4 | source ~/.zsh/rc.zsh 5 | set +e 6 | fi 7 | -------------------------------------------------------------------------------- /mplayer/config: -------------------------------------------------------------------------------- 1 | # vim: filetype=cfg 2 | # 3 | [default] 4 | msgcolor=1 5 | msgmodule=1 6 | stop-xscreensaver=1 7 | vf=screenshot 8 | fixed-vo=1 9 | framedrop=1 10 | ao=pulse,alsa 11 | vo=vaapi,gl_nosw,xv,x11 12 | #vo=xv,vaapi,gl_nosw,x11 13 | lavdopts=threads=4 14 | use-filedir-conf=1 15 | ass=1 16 | ass-hinting=2 17 | ass-color=FFFFFF00 18 | ass-border-color=00000000 19 | #ass-font-scale=1.7 20 | embeddedfonts=1 21 | fontconfig=1 22 | ffactor=0.35 23 | #subfont="Museo Sans" 24 | #subfont="Delicious Heavy" 25 | #subfont="Open Sans" 26 | subfont="Lato Bold" 27 | subfont-autoscale=2 28 | spuaa=4 29 | subcp=utf-8 30 | -------------------------------------------------------------------------------- /ncmpcpp/config: -------------------------------------------------------------------------------- 1 | mpd_music_dir = "/home/aperez/Music" 2 | mpd_communication_mode = "notifications" 3 | external_editor = "/usr/bin/vim" 4 | playlist_display_mode = "columns" 5 | browser_display_mode = "columns" 6 | search_engine_display_mode = "columns" 7 | display_remaining_time = "yes" 8 | use_console_editor = "yes" 9 | user_interface = "alternative" 10 | -------------------------------------------------------------------------------- /xinitrc-basic: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | for f in Xdefaults Xresources ; do 4 | if test -r ~/.$f ; then 5 | xrdb -merge ~/.$f 6 | elif test -r ~/.dotfiles/$f ; then 7 | xrdb -merge ~/.dotfiles/$f 8 | fi 9 | done 10 | 11 | export DMENU_OPTIONS='-fn terminus:bold:size=15 -h 20 -x 0' 12 | 13 | setxkbmap -layout es -option 'ctrl:nocaps,compose:menu' 14 | xsetroot -solid steelblue 15 | --------------------------------------------------------------------------------