diff options
Diffstat (limited to 'config/ksh')
-rw-r--r-- | config/ksh/completions.ksh | 2 | ||||
-rw-r--r-- | config/ksh/diraliases | 27 | ||||
-rw-r--r-- | config/ksh/functions/pcl | 8 | ||||
-rw-r--r-- | config/ksh/functions/pct | 8 | ||||
-rw-r--r-- | config/ksh/functions/pkg_complete | 2 | ||||
-rw-r--r-- | config/ksh/kshrc | 10 |
6 files changed, 39 insertions, 18 deletions
diff --git a/config/ksh/completions.ksh b/config/ksh/completions.ksh index d241be8..d186615 100644 --- a/config/ksh/completions.ksh +++ b/config/ksh/completions.ksh @@ -36,6 +36,8 @@ update_complete_pass() { pass_list=$(pass ls) set -A complete_pass_1 -- init passphrase add import show export ls set -A complete_pass_2 -- $pass_list + set -A complete_pcl_1 -- $pass_list + set -A complete_pct_1 -- $pass_list } update_complete_pass pass_export() { pass export "$1" && update_complete_pass; } diff --git a/config/ksh/diraliases b/config/ksh/diraliases index 99f710d..4b469d6 100644 --- a/config/ksh/diraliases +++ b/config/ksh/diraliases @@ -1,12 +1,17 @@ #!/bin/ksh -alias -d "src=$HOME/src"\ - "vcs=$HOME/src/vcs"\ - "me=$HOME/src/me"\ - "ports=/usr/ports"\ - "conf=$XDG_CONFIG_HOME"\ - "data=$XDG_DATA_HOME"\ - "write=$HOME/doc/writing"\ - "crit=$HOME/doc/writing/critique"\ - "bin=$HOME/.local/bin"\ - "ksh=$HOME/.config/ksh"\ - "pass=$HOME/.local/share/pass" +alias -d src=~/src +alias -d git=~src/vcs +alias -d vcs=~/local/src +alias -d conf=$XDG_CONFIG_HOME +alias -d data=$XDG_DATA_HOME +alias -d cache=$XDG_CACHE_HOME +alias -d vis=~conf/vis +alias -d ksh=~conf/ksh +alias -d xdg=~/share/xdg +alias -d doc=~xdg/doc +alias -d pic=~xdg/pic +alias -d mus=~xdg/mus +alias -d vid=~xdg/vid +alias -d dl=~xdg/dl +alias -d bin=~/bin +alias -d pass=~data/pass diff --git a/config/ksh/functions/pcl b/config/ksh/functions/pcl new file mode 100644 index 0000000..42ad224 --- /dev/null +++ b/config/ksh/functions/pcl @@ -0,0 +1,8 @@ +#!/bin/ksh +function pcl { + if [ -z "$2" ]; then + pass show "$1"|head -1|xclip -l 1 -r + else + pass show "$1"|head -1|xclip -sel c -l 1 -r + fi +} diff --git a/config/ksh/functions/pct b/config/ksh/functions/pct new file mode 100644 index 0000000..b80abff --- /dev/null +++ b/config/ksh/functions/pct @@ -0,0 +1,8 @@ +#!/bin/ksh +function pct { + if [ -z "$2" ]; then + pass show "$1"|tail -1|xclip -l 1 -r + else + pass show "$1"|tail -1|xclip -sel c -l 1 -r + fi +} diff --git a/config/ksh/functions/pkg_complete b/config/ksh/functions/pkg_complete index ee1b9fb..2664527 100644 --- a/config/ksh/functions/pkg_complete +++ b/config/ksh/functions/pkg_complete @@ -1,5 +1,5 @@ #!/bin/ksh pkg_complete() { - set -A complete_pa -- $(<$HOME/.cache/ksh/precompletions/packages) + set -A complete_pa -- $(<~cache/ksh/precompletions/packages) set -A complete_pi -- $complete_pa } diff --git a/config/ksh/kshrc b/config/ksh/kshrc index 36350d0..e81bd97 100644 --- a/config/ksh/kshrc +++ b/config/ksh/kshrc @@ -1,14 +1,12 @@ #!/bin/ksh -. $HOME/.config/shrc +. $HOME/etc/shrc KSHCONFIG="$XDG_CONFIG_HOME/ksh" -if ! echo "$PATH"|grep -q ".local/bin"; then - export PATH="$HOME/.local/bin:$PATH" -fi FPATH=$XDG_CONFIG_HOME/ksh/functions +alias functions="cat \$FPATH/*|grep -vF '#!/bin/ksh'" HISTFILE=$XDG_DATA_HOME/ksh/histfile -if ! [[ -d $HISTFILE ]]; then - mkdir -p $HISTFILE; +if ! [[ -d $(dirname $HISTFILE) ]]; then + mkdir -p $(dirname $HISTFILE); fi HISTSIZE=5000 HISTCONTROL="ignoredups" |