about summary refs log tree commit diff stats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fcard21
-rwxr-xr-xbin/fl12
-rwxr-xr-x[-rw-r--r--]bin/flc2
-rwxr-xr-xbin/op2
-rwxr-xr-xbin/shenv2
5 files changed, 15 insertions, 24 deletions
diff --git a/bin/fcard b/bin/fcard
index e4a851d..23edd30 100755
--- a/bin/fcard
+++ b/bin/fcard
@@ -20,17 +20,16 @@ grabbag() {
 	size="$(wc -l)"
 	oldlist="$(cat)"
 	newlist=""
-	a=0
-	while a="$size"; do
-	z="$(($(rand)%a))"
-	newlist="$(cut -d ' ' -f "$z"<<EOF
-$oldlist
-EOF
-) "
-	oldlist="$(cut -d ' ' -f "-$((z-1)),$((z+1))-" <<EOF
-$oldlist
-EOF
-)"
+	while [ ${a:="$size"} -gt 0]; do
+		z="$(($(rand)%a))"
+		newlist="$(cut -d ' ' -f "$z"<<-EOF
+		$oldlist
+		EOF
+	) "
+		oldlist="$(cut -d ' ' -f "-$((z-1)),$((z+1))-" <<-EOF
+		$oldlist
+		EOF
+	)"
 #	add z to space-delim'd list
 #	remove from input list
 	a=$((a-1))
diff --git a/bin/fl b/bin/fl
index cc8924a..1a2d0f7 100755
--- a/bin/fl
+++ b/bin/fl
@@ -5,7 +5,7 @@
 
 # from pure-sh-bible, strips from the start of a string
 lstrip() {
-	printf '%s\n' "${1##"$2"}"
+	printf '%s\n' "${1##$2}"
 }
 
 # url-finding regex
@@ -22,17 +22,7 @@ urlparse() {
 
 set -- $(urlparse "$@")
 
-# wipe IFS so dmenu handles being sent the links properly
-IFS=
-
 # send any found links to select so one can be chosen to be sent to the clipboard
-#select url;
-#do
-#	printf '%s' "$url"
-#done
 for url; do
 	printf '%s\n' "$url"
 done
-	
-#[ -n "$urls" ] &&
-#	echo $urls | dmenu -i -p 'copy which url?' -l 10 | xclip -r -sel c
diff --git a/bin/flc b/bin/flc
index 718d3ef..0358029 100644..100755
--- a/bin/flc
+++ b/bin/flc
@@ -1,4 +1,6 @@
 #!/bin/sh
+IFS=
 fl "$@"|
 dmenu -i -p 'copy which url?' -l 10|
+tr -d '\n'|
 xsel -ib
diff --git a/bin/op b/bin/op
index 7d426fc..84010d4 100755
--- a/bin/op
+++ b/bin/op
@@ -25,7 +25,7 @@ case "$FILEMIME" in
 		mpv "$FILEPATH" >/dev/null 2>&1 & ;;
 	#text
 	text/*)
-		${EDITOR:-vi} "$FILEPATH">/dev/null 2>&1 & ;;
+		${TERMINAL:-xterm} -e ${EDITOR:-vi} "$FILEPATH">/dev/null 2>&1 & ;;
 	#catchall
 	*)
 		echo "file $(basename "$FILEPATH") could not be opened. its type is $FILEMIME, go tell ensa that $(basename $0) didn't work" >/dev/stderr
diff --git a/bin/shenv b/bin/shenv
index b242955..6251155 100755
--- a/bin/shenv
+++ b/bin/shenv
@@ -1,5 +1,5 @@
 #!/bin/sh
 # simply sources the shrc and runs a shell with that as its environment.
 # passes through all arguments that sh takes. to be used instead of sh.
-. ${XDG_CONFIG_HOME:=$HOME/.config}/shrc
+. ${HOME_ETC:=$HOME/etc}/shrc
 exec /bin/sh "$@"