commit 1b84187ff075862625d68fdc00f854fce2362f14
parent abaeead30c74fafe3c349bee8180ad6ee107e17d
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 12 Sep 2019 14:39:25 +0200
Move profile and commands into XDG_CONFIG_DIR, remove Xresources
Diffstat:
8 files changed, 161 insertions(+), 258 deletions(-)
diff --git a/.Xresources b/.Xresources
@@ -1,94 +0,0 @@
-! Xcursor --------------------------------------------------------------------
-Xcursor.theme: Vanilla-DMZ-AA
-Xcursor.size:  16
-
-! terminal colors ------------------------------------------------------------
-! see https://ciembor.github.io/4bit
-
-*.foreground: #c5c8c6
-*.background: #1d1f21
-
-/* black */
-*color0: #434944
-*color8: #6c6d6b
-
-/* red */
-*color1: #da5673
-*color9: #dba2b4
-
-/* green */
-*color2:  #8cc16d
-*color10: #898e38
-
-/* yellow */
-*color3:  #eebf35
-*color11: #8a6b3d
-
-/* blue */
-*color4:  #5cabdc
-*color12: #126b8c
-
-/* magenta */
-*color5:  #b595cf
-*color13: #7457a2
-
-/* cyan */
-*color6:  #44a9ba
-*color14: #87c7d4
-
-/* white */
-*color7:  #fbfbf8
-*color15: #bfc2bc
-
-
-! fonts ----------------------------------------------------------------------
-Xft*dpi:        96
-Xft*antialias:  true
-Xft*rgba:       rgb
-Xft*hinting:    true
-Xft*hintstyle:  hintslight
-
-! urxvt ----------------------------------------------------------------------
-URxvt*perl-lib:         /usr/lib/urxvt/perl
-URxvt*perl-ext-common:  default,matcher
-URxvt*perl-matcher:     1
-URxvt*matcher-button:   1
-URxvt*urlLauncher:      /usr/bin/firefox
-URxvt*cursorUnderline:  0
-URxvt*cursorColor:      #FF00FF
-URxvt*fading:           0
-!URxvt*fadeColor:        #000000
-URxvt*cursorBlink:      false
-URxvt*scrollBar:        false
-URxvt*depth:            24
-URxvt*internalBorder:   2
-
-URxvt.meta8:            true
-URxvt.intensityStyles:  false
-URxvt.iso14755: false
-URxvt.iso14755_52: false
-
-URxvt.keysym.C-1: command:\033]710;xft:PragmataPro:size=7\007\033]711;xft:PragmataPro:size=7:style=Bold\007
-URxvt.keysym.C-2: command:\033]710;xft:PragmataPro:size=7.5\007\033]711;xft:PragmataPro:size=7.5:style=Bold\007
-URxvt.keysym.C-3: command:\033]710;xft:PragmataPro:size=8\007\033]711;xft:PragmataPro:size=8:style=Bold\007
-URxvt.keysym.C-4: command:\033]710;xft:PragmataPro:size=9\007\033]711;xft:PragmataPro:size=9:style=Bold\007
-URxvt.keysym.C-5: command:\033]710;xft:PragmataPro:size=10\007\033]711;xft:PragmataPro:size=10:style=Bold\007
-URxvt.keysym.C-6: command:\033]710;xft:PragmataPro:size=11\007\033]711;xft:PragmataPro:size=11:style=Bold\007
-URxvt.keysym.C-7: command:\033]710;xft:PragmataPro:size=12\007\033]711;xft:PragmataPro:size=12:style=Bold\007
-URxvt.keysym.C-8: command:\033]710;xft:PragmataPro:size=13\007\033]711;xft:PragmataPro:size=13:style=Bold\007
-URxvt.keysym.C-9: command:\033]710;xft:PragmataPro:size=16\007\033]711;xft:PragmataPro:size=16:style=Bold\007
-URxvt.keysym.C-0: command:\033]710;xft:PragmataPro:size=20\007\033]711;xft:PragmataPro:size=20:style=Bold\007
-
-! looks good with DejaVu Sans Mono:
-!URxvt.letterSpace: -1
-
-! looks good with PragmataPro
-URxvt.letterSpace: -2
-!URxvt.letterSpace: 0
-
-URxvt*font: xft:PragmataPro:size=10
-URxvt*boldFont: xft:PragmataPro:size=10:style=Bold
-
-! shading: 0-99 darkens, 101-200 lightens
-URxvt*transparent: true
-URxvt*shading:     20
diff --git a/.bashrc b/.bashrc
@@ -40,5 +40,4 @@ esac
 [ -f /usr/share/doc/fzf/key-bindings.bash ] && \
 	. /usr/share/doc/fzf/key-bindings.bash ] || :
 
-# shellcheck source=/dev/null
-. ~/.commands.sh
+. ~/.config/sh/commands
diff --git a/.commands.sh b/.commands.sh
@@ -1,154 +0,0 @@
-#!/bin/sh
-
-alias e='$EDITOR'
-alias se='sudo $EDITOR'
-alias n='$FILE'
-alias sx="sxiv -ft *"
-alias youtube-dl='youtube-dl -f bestvideo+bestaudio/best --all-subs --embed-subs'
-alias xq="xbps-query"
-alias xr="sudo xbps-remove"
-
-alias cg='c "$(git rev-parse --show-toplevel)"'  # cd under git repo
-alias ch='cd "$(dirs | sort -u | fzy)"'          # cd from history
-c() {
-	dir=$(find "${1:-.}" -type d | grep -v '/\.' | fzf)
-	[ -d "$dir" ] && cd "$dir" || return
-}
-
-alias ls=ls; unalias ls
-alias ls='ls -hF'
-alias l='ls'
-alias la='l -a'
-alias ll='l -l'
-alias lo='l -alo'
-
-alias r='fc -s'
-
-o() {
-	[ "$(uname)" = 'Darwin' ] && open="open" || open="xdg-open"
-	if [ "$#" -gt 0 ] && [ -f "$1" ]; then
-		setsid $open "$1" >/dev/null 2>&1
-	else
-		IFS= out=$(fzf --exit-0 \
-			--expect=ctrl-o,ctrl-e,ctrl-y \
-			--preview-window=hidden)
-		key=$(echo "$out" | sed 1q)
-		file=$(echo "$out" | sed 2q | tail -1)
-		if [ -n "$file" ]; then
-			if [ "$key" = ctrl-e ]; then
-				$EDITOR "$file"
-			elif [ "$key" = ctrl-y ]; then
-				printf "%s" "$PWD/$file" | xclip
-			elif [ "$key" = ctrl-o ]; then
-				cd "$(dirname "$file")" || return
-			else
-				setsid $open "$file" >/dev/null 2>&1
-			fi
-		fi
-	fi
-}
-
-alias dotfiles="git --git-dir=\$HOME/.dotfiles/ --work-tree=\$HOME"
-alias dotfiles-commit="dotfiles commit -a -S -v; dotfiles push"
-
-alias m="make"
-alias mc="make clean"
-alias me="make edit"
-alias mi="sudo make install"
-
-alias date-denmark='TZ=Europe/Copenhagen date'
-alias date-eastern='TZ=US/Eastern date'
-alias date-pacific='TZ=US/Pacific date'
-alias date-mountain='TZ=US/Mountain date'
-alias date-central='TZ=US/Central date'
-alias date-alaska='TZ=US/Alaska date'
-alias date-uk='TZ=Europe/London date'
-alias date-israel='TZ=Israel date'
-alias now="linkhandler https://imgs.xkcd.com/comics/now.png"
-
-alias gs='git status | less'
-alias ga='git add'
-alias gd='git diff --'
-alias gch='git diff HEAD^..HEAD'
-alias gc='git commit --verbose --gpg-sign'
-alias gca='git commit --all --verbose --gpg-sign'
-alias gp='git push'
-alias gpu='git pull && git fetch --all'
-alias gcgp='git commit --verbose --gpg-sign && git push'
-alias gcagp='git commit --all --verbose --gpg-sign && git push'
-alias gl="git log --graph --oneline --decorate --all --color=always |
-	fzf --ansi +s --preview='git show --color=always {2}' \
-	--bind='pgdn:preview-page-down' \
-	--bind='pgup:preview-page-up' \
-	--bind='enter:execute:git show --color=always {2} | less -R' \
-	--bind='ctrl-x:execute:git checkout {2} .'"
-
-alias w3m="w3m -B"
-alias w3mtor='torsocks w3m -B "$@"'
-
-alias wanip='curl https://ipinfo.io/ip'
-news() {
-	if [ $# -eq 0 ]; then
-		url="https://text.npr.org"
-	elif [ "$1" = "npr" ]; then
-		url="https://text.npr.org"
-	elif [ "$1" = "cnn" ]; then
-		url="https://lite.cnn.io/en"
-	else
-		url="$1"
-	fi
-	torsocks w3m "$url"
-}
-weather() { curl "wttr.in/?m"; }
-
-t_add() { transmission-remote --add --download-dir "$PWD" --encryption-required "$@"; }
-t_list() { transmission-remote --list; }
-t_remove() { transmission-remote --torrent "$@" --remove; }
-t_remove_all() { transmission-remote -tall --remove; }
-t_stop() { transmission-remote --torrent "$@" --stop; }
-t_stop_idle() {
-	for id in $(t-list | grep Done | grep Idle | awk '{ print $1 }' | tr '\n' ','); do
-		t-stop "$id"
-	done
-}
-
-m_all_sl() {
-	for d in ~/.local/lib/dwm ~/.local/lib/st ~/.local/lib/surf \
-	~/.local/lib/tabbed ~/.local/lib/nnn; do
-		echo
-		echo "## Building $d"
-		cd "$d" && make clean; make && sudo make install
-	done
-	cd - || return
-}
-
-gcagp_all_sl() {
-	msg="Update color scheme"
-	read -r "input?commit message [$msg]: "
-	msg="${input:-$msg}"
-	dotfiles add .Xresources
-	dotfiles commit -m "$msg" --verbose --gpg-sign && git push;
-	for d in ~/.local/lib/dwm ~/.local/lib/st ~/.local/lib/surf \
-		~/.local/lib/tabbed; do
-		cd "$d" && \
-			git branch && \
-			git commit --all -m "$msg" --verbose --gpg-sign && git push;
-		cd - || return
-	done
-}
-
-man9() {
-	if [ -d /usr/lib/plan9 ]; then
-		plan9mans="/usr/lib/plan9/man/man1"
-	elif [ -d /opt/plan9 ]; then
-		plan9mans="/opt/plan9/share/man/man1"
-	else
-		(>&2 echo "no plan9 port installed")
-		return 1
-	fi
-	if [ $# -lt 1 ]; then
-		1="$(cd "$plan9mans" && find -- * -type f | sed 's/\.1$//' | fzy)"
-	fi
-	f="$plan9mans/${1}.1"
-	[ -e "$f" ] && man "$f"
-}
diff --git a/.config/sh/commands b/.config/sh/commands
@@ -0,0 +1,156 @@
+#!/bin/sh
+
+alias e='$EDITOR'
+alias se='sudo $EDITOR'
+alias n='$FILE'
+alias sx="sxiv -ft *"
+alias youtube-dl='youtube-dl -f bestvideo+bestaudio/best --all-subs --embed-subs'
+
+alias xq="xbps-query"
+alias xr="sudo xbps-remove"
+
+alias cg='c "$(git rev-parse --show-toplevel)"'  # cd under git repo
+alias ch='cd "$(dirs | sort -u | fzy)"'          # cd from history
+c() {
+	dir=$(find "${1:-.}" -type d | grep -v '/\.' | fzf)
+	[ -d "$dir" ] && cd "$dir" || return
+}
+
+alias ls=ls; unalias ls
+alias ls='ls -hF'
+alias l='ls'
+alias la='l -a'
+alias ll='l -l'
+alias lo='l -alo'
+
+alias r='fc -s'
+
+o() {
+	[ "$(uname)" = 'Darwin' ] && open="open" || open="xdg-open"
+	if [ "$#" -gt 0 ] && [ -f "$1" ]; then
+		setsid $open "$1" >/dev/null 2>&1
+	else
+		IFS= out=$(fzf --exit-0 \
+			--expect=ctrl-o,ctrl-e,ctrl-y \
+			--preview-window=hidden)
+		key=$(echo "$out" | sed 1q)
+		file=$(echo "$out" | sed 2q | tail -1)
+		if [ -n "$file" ]; then
+			if [ "$key" = ctrl-e ]; then
+				$EDITOR "$file"
+			elif [ "$key" = ctrl-y ]; then
+				printf "%s" "$PWD/$file" | xclip
+			elif [ "$key" = ctrl-o ]; then
+				cd "$(dirname "$file")" || return
+			else
+				setsid $open "$file" >/dev/null 2>&1
+			fi
+		fi
+	fi
+}
+
+alias dotfiles="git --git-dir=\$HOME/.dotfiles/ --work-tree=\$HOME"
+alias dotfiles-commit="dotfiles commit -a -S -v; dotfiles push"
+
+alias m="make"
+alias mc="make clean"
+alias me="make edit"
+alias mi="sudo make install"
+
+alias date-denmark='TZ=Europe/Copenhagen date'
+alias date-eastern='TZ=US/Eastern date'
+alias date-pacific='TZ=US/Pacific date'
+alias date-mountain='TZ=US/Mountain date'
+alias date-central='TZ=US/Central date'
+alias date-alaska='TZ=US/Alaska date'
+alias date-uk='TZ=Europe/London date'
+alias date-israel='TZ=Israel date'
+alias now="linkhandler https://imgs.xkcd.com/comics/now.png"
+
+alias gs='git s'
+alias gss='git ss'
+alias ga='git add'
+alias gd='git diff --'
+alias gch='git diff HEAD^..HEAD'
+alias gc='git commit --verbose --gpg-sign'
+alias gca='git commit --all --verbose --gpg-sign'
+alias gp='git push'
+alias gpu='git pull && git fetch --all'
+alias gcgp='git commit --verbose --gpg-sign && git push'
+alias gcagp='git commit --all --verbose --gpg-sign && git push'
+alias gl="git log --graph --oneline --decorate --all --color=always |
+	fzf --ansi +s --preview='git show --color=always {2}' \
+	--bind='pgdn:preview-page-down' \
+	--bind='pgup:preview-page-up' \
+	--bind='enter:execute:git show --color=always {2} | less -R' \
+	--bind='ctrl-x:execute:git checkout {2} .'"
+
+alias w3m="w3m -B"
+alias w3mtor='torsocks w3m -B "$@"'
+
+alias wanip='curl https://ipinfo.io/ip'
+news() {
+	if [ $# -eq 0 ]; then
+		url="https://text.npr.org"
+	elif [ "$1" = "npr" ]; then
+		url="https://text.npr.org"
+	elif [ "$1" = "cnn" ]; then
+		url="https://lite.cnn.io/en"
+	else
+		url="$1"
+	fi
+	torsocks w3m "$url"
+}
+weather() { curl "wttr.in/?m"; }
+
+t_add() { transmission-remote --add --download-dir "$PWD" --encryption-required "$@"; }
+t_list() { transmission-remote --list; }
+t_remove() { transmission-remote --torrent "$@" --remove; }
+t_remove_all() { transmission-remote -tall --remove; }
+t_stop() { transmission-remote --torrent "$@" --stop; }
+t_stop_idle() {
+	for id in $(t-list | grep Done | grep Idle | awk '{ print $1 }' | tr '\n' ','); do
+		t-stop "$id"
+	done
+}
+
+m_all_sl() {
+	for d in ~/.local/lib/dwm ~/.local/lib/st ~/.local/lib/surf \
+	~/.local/lib/tabbed ~/.local/lib/nnn; do
+		echo
+		echo "## Building $d"
+		cd "$d" && make clean; make && sudo make install
+	done
+	cd - || return
+}
+
+gcagp_all_sl() {
+	msg="Update color scheme"
+	read -r "input?commit message [$msg]: "
+	msg="${input:-$msg}"
+	dotfiles add .Xresources
+	dotfiles commit -m "$msg" --verbose --gpg-sign && git push;
+	for d in ~/.local/lib/dwm ~/.local/lib/st ~/.local/lib/surf \
+		~/.local/lib/tabbed; do
+		cd "$d" && \
+			git branch && \
+			git commit --all -m "$msg" --verbose --gpg-sign && git push;
+		cd - || return
+	done
+}
+
+man9() {
+	if [ -d /usr/lib/plan9 ]; then
+		plan9mans="/usr/lib/plan9/man/man1"
+	elif [ -d /opt/plan9 ]; then
+		plan9mans="/opt/plan9/share/man/man1"
+	else
+		(>&2 echo "no plan9 port installed")
+		return 1
+	fi
+	if [ $# -lt 1 ]; then
+		1="$(cd "$plan9mans" && find -- * -type f | sed 's/\.1$//' | fzy)"
+	fi
+	f="$plan9mans/${1}.1"
+	[ -e "$f" ] && man "$f"
+}
diff --git a/.profile b/.config/sh/profile
diff --git a/.xprofile b/.xprofile
@@ -9,9 +9,6 @@ wallpaper
 # Set display color profile
 #[ -f ~/doc/colorprofile.icc ] && xcalib ~/doc/colorprofile.icc
 
-# X settings
-xrdb ~/.Xresources
-
 # Start auth deamons
 eval "$(ssh-agent)"
 eval "$(gpg-agent)"
diff --git a/.yashrc b/.yashrc
@@ -1,11 +1,8 @@
 #!/bin/yash
 
-[ -f ~/.profile ] && . ~/.profile
-
 HISTFILE=~/.yash_history
 HISTSIZE=65536
 
-set --vi
 set --brace-expand
 set --extended-glob
 set --no-clobber
@@ -14,6 +11,7 @@ set --hist-space
 set --notify-le
 set --le-no-conv-meta
 set --le-predict
+set --vi
 
 bindkey --vi-insert '\^D' eof-or-delete
 bindkey --vi-insert '\#'  eof-or-delete
@@ -124,4 +122,5 @@ _update_vcs_info() {
 # update $_vcs_info on each prompt
 PROMPT_COMMAND=("$PROMPT_COMMAND" '_update_vcs_info')
 
-. ~/.commands.sh
+. $HOME/.config/sh/profile
+. $HOME/.config/sh/commands
diff --git a/.zshrc b/.zshrc
@@ -231,7 +231,7 @@ _fzf_complete_pass() {
 	)
 }
 
-. ~/.commands.sh
+. ~/.config/sh/commands
 
 [ -f /usr/share/fzf/key-bindings.zsh ] && \
 	. /usr/share/fzf/key-bindings.zsh ] || :