Skip to content

Commit

Permalink
shellshot
Browse files Browse the repository at this point in the history
  • Loading branch information
neeasade committed May 5, 2019
1 parent e750069 commit 1aaef5d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bin/bin/elisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion shell/.sh.d/environment_emacs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions shell/.sh.d/functions
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit 1aaef5d

Please sign in to comment.