commit f7645f0ed41b99c9e8dd61b7b84f68651ee38d61
parent 7389c237dc7cf9f4f0df9909e9e48710d3274496
Author: Josuah Demangeon <mail@josuah.net>
Date: Sat, 13 May 2017 19:18:21 +0200
posix with `...` instead of $(...)
Diffstat:
18 files changed, 94 insertions(+), 120 deletions(-)
diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc
@@ -1,8 +1,2 @@
-# ---, | |
-# / ,--. |-- |--. , , .,-- ,--.
-# / ,--| | | | | | | ,--|
-# '--- `--` ' ' ' `--` ' `--` 2016-10-08
-#-------------------------------------------------------------------------------
-
set recolor true
set recolor-keephue true
diff --git a/.tmux.conf b/.tmux.conf
@@ -1,36 +1,22 @@
-# Simple yet complete tmux configuration file 2016-12-13
-# _
-# |_ __ ., _ _ __ /_
-# | ||| |_| /\ . (_ (_) | | |
-#
-#_______________________________________________________________________________
+# it looks like dvtm(1)
-# Editing mode
+# --- keybindings --------------------------------------------------------------
-set -g status-keys vi
-
-# Leader
+# leader
set -g prefix C-Space
unbind C-b
bind C-Space send-key C-Space
-# Keybindings
-#_______________________________________________________________________________
-
+# copy mode
-# Copy mode
-
-bind -t vi-copy v begin-selection
-bind -t vi-copy C-v rectangle-toggle
-bind -t vi-copy y copy-pipe 'xclip -i'
bind -n PPage if -F '#{alternate_on}' 'send PPage' 'copy -e; send PPage'
-# Pane management
+# pane management
bind -r k select-pane -U
bind -r j select-pane -D
@@ -45,7 +31,7 @@ bind % split -h -c '#{pane_current_path}'
bind '"' split -v -c '#{pane_current_path}'
-# Window management
+# window management
bind -r < swap-window -t -
bind -r > swap-window -t +
@@ -56,17 +42,14 @@ bind -r c new-window -c '#{pane_current_path}'
bind -r C new-window
-# Global tmux state
+# global tmux state
bind -n C-z detach
bind r source ~/.config/tmux/conf\; display "Config loaded"
-# Hooks
-#_______________________________________________________________________________
-
+# --- hooks --------------------------------------------------------------------
-# Refresh status line
set-hook -g after-select-pane 'refresh-client -S'
set-hook -g after-select-window 'refresh-client -S'
set-hook -g after-select-window 'refresh-client -S'
@@ -77,8 +60,7 @@ set-hook -g after-switch-client 'refresh-client -S'
set-hook -g after-delete-buffer 'refresh-client -S'
-# Options
-#_______________________________________________________________________________
+# --- options ------------------------------------------------------------------
set -g base-index 1
set -g pane-base-index 1
@@ -88,59 +70,59 @@ set -g repeat-time 500
set -g detach-on-destroy off
-# Global appearance
+# global appearance
-# Messages
+# messages
set -g message-style bold,fg=red
set -g message-command-style bold,fg=white
-# Display-panes mode
+# display-panes mode
set -g display-panes-colour white
set -g display-panes-active-colour red
-# Clock mode
+# clock mode
set -g clock-mode-colour white
set -g clock-mode-style 24
-# Menus
+# menus
set -g mode-style bg=white,fg=black
-# Status
+# status
set -g status-interval 5
-# Global
+# global
set -g status-position top
set -g status-justify left
set -g status-style bg=black,fg=white
-# Left
+# left
set -g status-left-length 30
set -g status-left-style fg=white
set -g status-left "#[fg=black,bg=white] #S #[default] "
-# Right
+# right
set -g status-right-length 100
set -g status-right-style fg=white
set -g status-right "#(status)"
set -g window-status-separator " "
-# Background windows
+# background windows
set -g window-status-style bold,fg=black
set -g window-status-format " #I #W "
-# Foreground windows
+# foreground windows
set -g window-status-current-style bold,fg=white
set -g window-status-current-format " #I #W "
-# Urgent windows
+# urgent windows
set -g window-status-bell-style fg=white,bg=red
set -g window-status-activity-style fg=white,bg=yellow
-# Borders
+# borders
set -g pane-border-style bold,fg=white
set -g pane-active-border-style bold,fg=white
diff --git a/alias b/alias
@@ -6,10 +6,10 @@ alias ..='cd ..'
# iomenu
alias r='io-run'
-alias j='fg "%$(jobs | iomenu | sed -r "s/.([0-9]*).*/\1/")"'
+alias j='fg "%`jobs | iomenu | sed -r "s/.([0-9]*).*/\1/"`"'
alias f='find . ! -path "*/.git/*" -type f | iomenu -p file'
alias d='find . ! -path "*/.git/*" -type d | iomenu -p directory'
-alias c='cd "$(find "$HOME" -type d | iomenu -p cd)"'
+alias c='cd "`find "$HOME" -type d | iomenu -p cd`"'
# utilities
alias inv='printf "\033[?5%s" h'
@@ -18,6 +18,6 @@ alias ix='curl -F "f:1=<-" ix.io'
alias wttr='wget -qO- wttr.in'
alias lines='find . -name "*.[ch]" | xargs wc -l | sort -g'
alias count='echo "$((
- $(git diff | grep "^+" | wc -l) -
- $(git diff | grep "^-" | wc -l)
+ `git diff | grep "^+" | wc -l` -
+ `git diff | grep "^-" | wc -l`
))"'
diff --git a/bin/adagio b/bin/adagio
@@ -229,7 +229,7 @@ main()
read duration
kill -9 "$pid"
speaker-test -t sine -f $note & pid="$!"
- sleep "$(busybox dc "$duration" 10 / f)"
+ sleep "`busybox dc "$duration" 10 / f`"
done
}
diff --git a/bin/doc-wiki b/bin/doc-wiki
@@ -3,7 +3,7 @@
API='http://en.wikipedia.org/w/api.php?action=query&format=json'
WIKI='http://en.wikipedia.org/wiki'
-E="$(printf '\033')"
+E=`printf '\033'`
# search for a title
wget -qO- "$API&list=search&srsearch=$*" |
diff --git a/bin/edit-title b/bin/edit-title
@@ -7,9 +7,9 @@ esac
printf '%s--- %s ' "$start" "$2"
-for i in $(seq $((80 - ${#start} - ${#2} - ${#stop} - 5)))
+for i in `seq $((80 - ${#start} - ${#2} - ${#stop} - 5))`
do
- printf %s '-'
+ printf %s -
done
printf '%s\n' "$stop"
diff --git a/bin/fun-psyche b/bin/fun-psyche
@@ -1,11 +1,11 @@
-set -- $(
+set -- `
printf '%s\n' "$*" | fold -w 1 | sed 's/[\t ]/_/; /^$/ s/^/_/'
seq 10 | sed 's/.*/_/'
-)
+`
-b="$(printf '\033[31;1m')"
-e="$(printf '\033[0m')"
-r="$(printf '\033[7m')"
+b=`printf '\033[31;1m'`
+e=`printf '\033[0m'`
+r=`printf '\033[7m'`
printf '\033[2J'
diff --git a/bin/fun-saber b/bin/fun-saber
@@ -10,7 +10,7 @@ help()
COLOR
' "${0##*/}"
- for i in $(seq 7)
+ for i in `seq 7`
do
printf '\033[3%sm%s\033[0m ' "$i" "$i"
done
@@ -56,7 +56,7 @@ print_blade()
{
local color="$1" length="$2"
- for i in $(seq "$length")
+ for i in `seq "$length"`
do
sleep 0.003
printf '\033[1;4%s;3%sm_\033[m' "$color" "$color"
@@ -92,7 +92,7 @@ blink_blade()
printf '\033[s'
# generate the blinks from the blink chars
- for i in $(seq "$((length / 2))")
+ for i in `seq $((length / 2))`
do
top="$top_char $top"
bot="$bot_char $bot"
@@ -120,7 +120,7 @@ close_saber()
# ensure we are at the right position
printf '\033[u'
- for i in $(seq "$((length + 3))" -1 1)
+ for i in `seq $((length + 3)) -1 1`
do
printf '\033[%sC\033[A' "$i"
for j in 1 2 3
diff --git a/bin/fun-troll b/bin/fun-troll
@@ -1,4 +1,4 @@
-# troll
+#!/bin/sh
troll()
@@ -18,7 +18,7 @@ troll()
main()
{
- size="$(stty size)"
+ size=`stty size`
hexdump -d /dev/random |
sed 's/[^ ]* *//; s/[0 ]\+/\n/g' | sed '/^$/ d' |
diff --git a/bin/io b/bin/io
@@ -5,66 +5,62 @@
CACHE="${XDG_CACHE_DIR:-$HOME/.cache}"
mkdir -p "$CACHE/io"
-touch "$CACHE/io/io"
-# --- prompt -------------------------------------------------------------------
-
-selection="$({
-
- printf '# abduco\n'
- abduco | sed '1d; s/.*\t//; y|!|/|'
+# --- cache --------------------------------------------------------------------
-} | cat - "$CACHE/io/io" | iomenu -p io -s -h)"
+find "$HOME" `printf $MANPATH | tr ':' ' '` -L \
+ -path "/dev" -prune -o \
+ -path "/sys" -prune -o \
+ -path "/proc" -prune -o \
+ -path "$HOME/.*" -prune -o \
+ -path "*/.git/*" -prune -o \
+ -path "*/.hg/*" -prune -o \
+ -path "*/v" -prune -o \
+ -path "${MAIL%/*}/*/*" -prune -o \
+ -type d -exec printf '%s/\n' {} + -o \
+ -print 2> /dev/null | sort -u > "$CACHE/find" &
# --- history ------------------------------------------------------------------
printf '%s\n' "$selection" >> "$CACHE/io/files"
-printf '%s\n' "$(
+printf '%s\n' "`
awk '!line[$0] { line[$0] = 1; print }' "$CACHE/io/files" | tail
-)" > "$CACHE/io/files"
+`" > "$CACHE/io/files"
-# --- cache --------------------------------------------------------------------
+# --- selection ----------------------------------------------------------------
-list="$(
- find "$HOME" \
- -path "$HOME/.*" -prune -o \
- -path "*/.git/*" -prune -o \
- -path "*/v" -prune -o \
- -path "${MAIL%/*}/*/*" -prune -o \
- -type d -exec printf '%s/\n' {} + -o \
- -print | sort
-)" && {
+selection="`{
+ printf '# %s\n' abduco
+ abduco | sed '1d; s/.*\t//; y|!|/|'
- printf '# irc\n'
- printf '%s\n' "$list" | grep "$IRC/.*/$"
+ printf '# %s\n' irc
+ grep "$IRC/.*/$" "$CACHE/find"
- printf '# mail\n'
- printf '%s\n' "$list" | grep "${MAIL%/*}"
+ printf '# %s\n' mail
+ grep "${MAIL%/*}" "$CACHE/find"
- printf '# search\n'
- printf '%s\n' "$list" | grep '\.git/' | sed 's|.git/||'
- printf '%s\n' "$list" | grep '/src/[^/]*/$' | grep -v '/src/.*/src/'
+ printf '# %s\n' search
+# grep '\.git/$' "$CACHE/find" | sed 's|.git/||'
+# grep '/src/[^/]*/$' "$CACHE/find" | grep -v '/src/.*/src/'
- printf '# music\n'
- printf '%s\n' "$list" | grep "$MUSIC"
+ printf '# %s\n' music
+ grep "$MUSIC" "$CACHE/find"
- printf '# man\n'
- find / -maxdepth 4 -type d -name man 2> /dev/null |
- xargs -I % find % -type f -name '*.[1-9]' -o -name '*.[1-9].gz'
+ printf '# %s\n' man
+ grep '.[1-9](.gz)?$' "$CACHE/find"
- printf '# files\n'
- printf '%s\n' "$list" | grep '[^/]$'
+ printf '# %s\n' files
+ grep '[^/]$' "$CACHE/find"
-} > "$CACHE/io/io" &
+} | iomenu -p io -s -h | sed 's/^# //'`"
-selection="${selection#\# }"
command="io-${selection%% *}"
path="${selection#* }"
-name="$(printf %s "$path" | tr '/' '!')"
+name=`printf %s "$path" | tr '/' '!'`
# --- attach -------------------------------------------------------------------
diff --git a/bin/io-abduco b/bin/io-abduco
@@ -1,5 +1,5 @@
# just attach to an abduco session
-set -- "$(printf %s "$1" | tr '/' '!')"
+set -- "`printf %s "$1" | tr / !`"
-ABDUCO="$1" exec abduco -a "$1"
+ABDUCO=$1 exec abduco -a "$1"
diff --git a/bin/io-jobs b/bin/io-jobs
@@ -1 +1 @@
-fg $(jobs | iomenu | sed -r "s/\[(0-9)\].*/\1/")
+fg `jobs | iomenu | sed -r 's/\[(0-9)\].*/\1/'`
diff --git a/bin/io-music b/bin/io-music
@@ -1,3 +1,3 @@
# play all music from directories and files passed as argument with mplayer
-mplayer $(find "$1" -type f -name '*.flac' | sort)
+mplayer `find "$1" -type f -name '*.flac' | sort`
diff --git a/bin/io-run b/bin/io-run
@@ -1,12 +1,12 @@
# prompt for a programs to run
-CACHE="${XDG_CACHE_HOME:-$HOME/.cache}"
+CACHE=${XDG_CACHE_HOME:-$HOME/.cache}
# --- commands cache -----------------------------------------------------------
-IFS=':'
+IFS=:
stest -dqr -n "$CACHE/io/run" $PATH &&
stest -flx $PATH | sort -u > "$CACHE/io/run"
@@ -15,15 +15,17 @@ unset IFS
# --- run ----------------------------------------------------------------------
-command="$({
+command=`{
printf '# '
abduco | sed 's/.*\t//' | sed 's|!|/|g'
printf '# Commands\n'
cat "$CACHE/io/run"
} | iomenu -s -p run
-)"
-name="$(printf %s "$command" | sed 's|/|!|g')"
+`
+
+name=`printf %s "$command" | sed 's|/|!|g'`
+
[ "$SSH_TTY" ] && e='^\' || e='^Z'
-ABDUCO="$name" exec abduco -e "$e" -A "$name" $command
+ABDUCO=$name exec abduco -e "$e" -A "$name" $command
diff --git a/bin/io-setfont b/bin/io-setfont
@@ -1,6 +1,6 @@
# set tty font using iomenu -l 255 -p setfont
-setfont "$(
+setfont "`
xargs -I {} find {} -type f << EOF | sort | iomenu -l 255 -p setfont
/usr/share/kbd/consolefonts
/usr/share/consolefonts
@@ -8,4 +8,4 @@ setfont "$(
/share/consolefonts
$CONFIG/consolefonts
EOF
-)"
+`"
diff --git a/build/busybox/build b/build/busybox/build
@@ -1,5 +0,0 @@
-make defconfig
-make CONFIG_PREFIX="$PREFIX"
-
-./busybox --install -s "$LOCAL/bin"
-ln -sf "$PWD/busybox" "$LOCAL/bin/busybox"
diff --git a/build/busybox/url b/build/busybox/url
@@ -1 +0,0 @@
-http://busybox.net/downloads/busybox-1.25.1.tar.bz2
diff --git a/build/tmux/build b/build/tmux/build
@@ -0,0 +1,6 @@
+LIBEVENT_CFLAGS="-I$ROOT/include"
+LIBEVENT_LIBS="-l$ROOT/lib"
+export LIBEVENT_CFLAGS LIBEVENT_LIB
+
+./configure --prefix="$PREFIX"
+make install