Skip to content
Permalink
Browse files

shellshot

  • Loading branch information...
neeasade committed May 5, 2019
1 parent e750069 commit 1aaef5d661e2450d26ca9e2410b38dfed11a410c
Showing with 13 additions and 2 deletions.
  1. +5 −1 bin/bin/elisp
  2. +3 −1 shell/.sh.d/environment_emacs
  3. +5 −0 shell/.sh.d/functions
@@ -21,7 +21,11 @@ if [ "$result" = "nil" ] || [ -z "$result" ]; then
else
if $trim; then
# trim a list, or quotes (surrounding characters).
echo "$result" | sed -e 's/^.//' -e 's/.$//'
echo "$result" | \
sed -e 's/^(//' \
-e 's/^"//' \
-e 's/"$//' \
-e 's/)$//'
else
echo "$result"
fi
@@ -5,7 +5,9 @@ if ! "$ESHELL"; then
ESHELL=$(iif '$REMOTE && [ "$TERM" = "dumb" ]')
fi

if has emacs && ! $REMOTE && silent emacsclient --eval "(progn t)"; then
# if emacs is non-responsive, blow past it.
emacs_timeout=$(iif 'has timeout' 'timout 1' '')
if has emacs && ! $REMOTE && silent $emacs_timeout emacsclient --eval "(progn t)"; then
eclient="emacsclient"

if $WINDOWS; then
@@ -34,6 +34,11 @@ shot() {
maim -g ${G} "$(shot_location)"
}

shellshot() {
# amazing
printf "$(elisp -r '(with-current-buffer (window-buffer) (s-clean (buffer-substring (window-start) (window-end))))' | sed 's/%/%%/g')" | pb 0x0
}

fullshot() {
[ ! -z "$1" ] && sleep $1
maim "$(shot_location)"

0 comments on commit 1aaef5d

Please sign in to comment.
You can’t perform that action at this time.