dot

packages and services management
Log | Files | Refs | README

commit 3209935d7470f0bf9553f2fd58ef4af43ba5723d
parent e0c68400d17b3fa8e80f148b63bb257dbbc1d1ba
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 19 May 2017 12:45:03 +0200

FreeBSD fixups

Diffstat:
M.profile | 10+++++++---
M.xinitrc | 2+-
Abin/chromium | 1+
Mbin/doc-rfc | 2+-
Mbin/doc-wiki | 2+-
Mbin/io | 13++++++-------
Mbin/io-abduco | 22++++++++++------------
Mbin/io-files | 2+-
Mbin/io-search | 2+-
Abin/manpager | 4++++
Mbuild/dwm/config.mk | 6+++---
Murl | 1+
12 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/.profile b/.profile @@ -65,16 +65,20 @@ export NAME EMAIL TZ # default commands -EDITOR='vi' -VISUAL='vi' +EDITOR='mg' +VISUAL='mg' PAGER='less' -MANPAGER='less -R' +MANPAGER='manpager' DVTM_PAGER='less -R' BROWSER='firefox' export EDITOR VISUAL PAGER MANPAGER DVTM_PAGER BROWSER +TERM=ansi +export TERM + + # prompts PS1='`prompt $?`' diff --git a/.xinitrc b/.xinitrc @@ -9,4 +9,4 @@ do sleep 5 done & -dwm +exec dwm diff --git a/bin/chromium b/bin/chromium @@ -0,0 +1 @@ +chrome --force-device-scale-factor=0.8 diff --git a/bin/doc-rfc b/bin/doc-rfc @@ -2,4 +2,4 @@ wget -q -O- http://www.ietf.org/rfc/rfc"$1".txt | awk -v RS='\n*[^\n]*\n\f\n[^\n]*\n*' '{ print $0 "\n"; }' | -less +$MANPAGER diff --git a/bin/doc-wiki b/bin/doc-wiki @@ -62,4 +62,4 @@ sed -r ' # double empty lines N; s/^\n$//; P; D -' | less -R +' | $PAGER diff --git a/bin/io b/bin/io @@ -2,8 +2,7 @@ [ "$ABDUCO" ] && exit 1 -CACHE="${XDG_CACHE_DIR:-$HOME/.cache}" -mkdir -p "$CACHE/io" +mkdir -p "$HOME/.cache/io" touch "$HOME/.abduco/names" @@ -62,10 +61,12 @@ END { print "# files"; for (i = 0; i < filesc; i++) print(filesv[i] ); -} -' "$CACHE/find" + +}' "$HOME/.cache/find" + printf '# %s\n' url cat "$HOME"/var/url/* "$ETC/url" + cut -d ' ' -f 1 "$HOME/.ssh/known_hosts" | sed -r 's|^|ssh://root@|' } | iomenu -p io -s -h | cut -c 3-` command="io-${selection%% *}" @@ -74,7 +75,6 @@ path="${selection#* }" # --- cache -------------------------------------------------------------------- -IFS=: nohup find "$HOME" \ -path "$HOME/.*" -prune -o \ -path "*/.git/*" -prune -o \ @@ -82,8 +82,7 @@ nohup find "$HOME" \ -path "*/v" -prune -o \ -path "${MAIL%/*}/*/*" -prune -o \ -type d -exec printf '%s/\n' {} + -o \ - -print 2> /dev/null | sort -o "$CACHE/find" & -unset IFS + -print 2> /dev/null | sort -o "$HOME/.cache/find" # --- attach ------------------------------------------------------------------- diff --git a/bin/io-abduco b/bin/io-abduco @@ -1,32 +1,30 @@ # attach to an abduco sessions and manage the names -DIR=${ABDUCO_SOCKET_DIR:-$HOME/.abduco} - -touch "$DIR/names" +touch "$HOME/.abduco/names" case $# in -( 0 ) attach=0 ;; -( 1 ) attach=1 command=less path=$1 ;; -( 2 ) attach=1 command=$1 path=$2 ;; -( * ) exit 1 ;; +( 0 ) attach=0 ;; +( 1 ) attach=1 command=$EDITOR path=$1 ;; +( 2 ) attach=1 command=$1 path=$2 ;; +( * ) exit 1 ;; esac # --- update names ------------------------------------------------------------- -hash=`printf %s "$path" | md5sum | cut -d ' ' -f 1` +hash=`printf %s "$path" | md5 | cut -d ' ' -f 1` { [ "$attach" = 1 ] && printf '%s %s\n' "$hash" "$path" { - abduco | sed '1d; s/.* /-e\n/' - printf '%s\n' "$DIR/names" + abduco | awk -v FS='\t' 'NR > 1 { printf("-e\n%s\n", $3); }' + printf '%s\n' "$HOME/.abduco/names" } | xargs grep -F -} | sort -k 1,1 -u -o "$DIR/names" +} | sort -k 1,1 -u -o "$HOME/.abduco/names" if [ "$attach" = 1 ] then @@ -34,5 +32,5 @@ then [ "$SSH_TTY" ] && e='^\' || e='^Z' ABDUCO=$1 exec abduco -e "$e" -A "$hash" "$command" "$path" else - sed 's/[^ ]* //' "$DIR/names" + sed 's/[^ ]* //' "$HOME/.abduco/names" fi diff --git a/bin/io-files b/bin/io-files @@ -1,3 +1,3 @@ # Attach to an abduco session -[ -f "$1" ] && less -M "$1" +[ -f "$1" ] && $EDITOR -R "$1" diff --git a/bin/io-search b/bin/io-search @@ -14,4 +14,4 @@ EOF path="${path#\# }" -exec less -M +"$number" "$path" +exec $EDITOR +"$number" "$path" diff --git a/bin/manpager b/bin/manpager @@ -0,0 +1,4 @@ +tmp=`mktemp` +sed 's/.//g' > "$tmp" +exec $EDITOR -R "$tmp" < /dev/tty + diff --git a/build/dwm/config.mk b/build/dwm/config.mk @@ -7,8 +7,8 @@ VERSION = 6.1 PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib +X11INC = /usr/local/include +X11LIB = /usr/local/lib # Xinerama, comment if you don't want it XINERAMALIBS = -lXinerama @@ -16,7 +16,7 @@ XINERAMAFLAGS = -DXINERAMA # freetype FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 +FREETYPEINC = /usr/local/include/freetype2 # OpenBSD (uncomment) #FREETYPEINC = ${X11INC}/freetype2 diff --git a/url b/url @@ -2,6 +2,7 @@ irc://irc.freenode.net:6697 irc://irc.oftc.net:6697 irc://unix.chat:6697 irc://irc.cyberia.is:6697 +irc://irc.scalix.gandi.net gopher://bitreich.org ssh://josuah@josuah.net ssh://josuahdemangeon@grex.org