dot

packages and services management
Log | Files | Refs | README

commit 4f389597a6533b6d9448bc1c887210f88986962c
parent a9773f50f282b7444c044c0a7267e65e3c98d90e
Author: sshbio <jd@ssh.bio>
Date:   Sun, 31 Jul 2016 15:21:34 +0200

Added binaries.

Diffstat:
Abin/armv7l/mbsync | 0
Abin/armv7l/s-nail | 0
Abin/armv7l/vis | 0
Abin/armv7l/vis-clipboard | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/armv7l/vis-menu | 0
Abin/armv7l/vis-open | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 168 insertions(+), 0 deletions(-)

diff --git a/bin/armv7l/mbsync b/bin/armv7l/mbsync Binary files differ. diff --git a/bin/armv7l/s-nail b/bin/armv7l/s-nail Binary files differ. diff --git a/bin/armv7l/vis b/bin/armv7l/vis Binary files differ. diff --git a/bin/armv7l/vis-clipboard b/bin/armv7l/vis-clipboard @@ -0,0 +1,104 @@ +#!/bin/sh + +# Copyright (C) 2016 Richard Burke, ISC licensed + +vc_fatal() { + echo "$@" >&2 + exit 1 +} + +vc_usage() { + vc_fatal "`basename $0` [--usable|--copy|--paste]" +} + +vc_determine_command() { + if [ -n "$DISPLAY" ]; then + for c in xclip xsel; do + if type "$c" >/dev/null 2>&1; then + echo "$c" + return 0 + fi + done + elif type pbcopy >/dev/null 2>&1; then + echo 'mac' + return 0 + elif [ -c /dev/clipboard ]; then + echo 'cygwin' + return 0 + fi + + return 1 +} + +vc_usable() { + if vc_determine_command >/dev/null 2>&1; then + exit 0 + fi + + exit 1 +} + +vc_copy() { + COPY_CMD="`vc_determine_command 2>/dev/null`" + + if [ $? -ne 0 ] || [ -z "$COPY_CMD" ]; then + vc_fatal 'System clipboard not supported' + fi + + vc_${COPY_CMD}_copy + + exit $? +} + +vc_paste() { + PASTE_CMD="`vc_determine_command 2>/dev/null`" + + if [ $? -ne 0 ] || [ -z "$PASTE_CMD" ]; then + vc_fatal 'System clipboard not supported' + fi + + vc_${PASTE_CMD}_paste + + exit $? +} + +vc_xsel_copy() { + xsel -bi +} + +vc_xsel_paste() { + xsel -bo +} + +vc_xclip_copy() { + xclip -selection clipboard -i >/dev/null 2>&1 +} + +vc_xclip_paste() { + xclip -selection clipboard -o +} + +vc_mac_copy() { + pbcopy +} + +vc_mac_paste() { + pbpaste +} + +vc_cygwin_copy() { + cat >/dev/clipboard +} + +vc_cygwin_paste() { + cat /dev/clipboard +} + +case "$1" in + --usable) vc_usable;; + --copy) vc_copy;; + --paste) vc_paste;; + *) ;; +esac + +vc_usage diff --git a/bin/armv7l/vis-menu b/bin/armv7l/vis-menu Binary files differ. diff --git a/bin/armv7l/vis-open b/bin/armv7l/vis-open @@ -0,0 +1,64 @@ +#!/bin/sh +set -e + +# Later, we're going to want to set $IFS to a single newline, so let's prepare one. +NL=' +' + +VIS_MENU_PROMPT="" +ALLOW_AUTO_SELECT=1 + +while [ $# -gt 0 ]; do + case "$1" in + -h|--help) + echo "usage: $(basename $0) [-h] [-p prompt] [-f] [--] [file-pattern]" + exit 0; + ;; + -p) + VIS_MENU_PROMPT=$2 + shift + shift + ;; + -f) + ALLOW_AUTO_SELECT="" + shift + ;; + --) + shift + break + ;; + *) + break + ;; + esac +done + +# At this point, all the remaining arguments should be the expansion of +# any globs that were passed on the command line. + +if [ $# -eq 1 -a "$ALLOW_AUTO_SELECT" = 1 ]; then + # If there were globs on the command-line, they've expanded to + # a single item, so we can just process it. + + if [ -d "$1" ]; then + # Recurse and show the contents of the named directory, + # We pass -f to force the next iteration to present the + # full list, even if it's just an empty directory. + cd "$1" + IFS=$NL # Don't split ls output on tabs or spaces. + exec "$0" -p "$VIS_MENU_PROMPT" -f .. $(ls -1) + else + # We've found a single item, and it's not a directory, + # so it must be a filename (or file-like thing) to open. + cd "$(dirname "$1")" + echo "$(pwd -P)"/"$(basename "$1")" + exit 0 + fi +fi + +# At this point, we have a bunch of options we need to present to the +# user so they can pick one. +CHOICE=$(printf "%s\n" "$@" | vis-menu -b -p "$VIS_MENU_PROMPT") + +# Did they pick a file or directory? Who knows, let's let the next iteration figure it out. +exec "$0" -p "$VIS_MENU_PROMPT" -- "$CHOICE"