about summary refs log tree commit diff stats
path: root/bin
diff options
context:
space:
mode:
authorensa <psii@riseup.net>2020-05-30 02:01:43 -0700
committerensa <psii@riseup.net>2020-05-30 02:27:02 -0700
commit310c76b161e680a698995d61b2a741a05b384fbe (patch)
tree39338035a918c2466d27f8041d3f6416830e84e1 /bin
parent7c28231047f1b9c07ce6b85366afe1dce821cc7a (diff)
downloadcfg-310c76b161e680a698995d61b2a741a05b384fbe.tar.gz
new functionality, themes, man page
bin/
	bar.sh: pipes spoon into dzen2
	lh: added gemini/gopher handling with bombadillo
	    shortened (no loss of functionality)
	opener: shortened (no loss of functionality)
config/
	X11/xprofile: added bar.sh
	aliasrc: just read it
	color/colors.sh: color environment variables, like wal's
	cwmrc: font specified as otb
	       swapped oxbar with bar.sh
	ksh/
		completions.ksh:
			added completions for shortcut functions
		diraliases:
			redone with self-references, more complete
		functions/
			pcl: copies password for $1 to selection
			     uses clip if two arguments
			pct: copies totp for $1 to selection
			     uses clip if two arguments
			pkg_complete:
				uses cache diralias
		kshrc: added functions command
		       fixed ensuring existence of HISTFILE's dir
	nvim/init.vim: deleted, no longer used
	vis/
		themes/causalagency.lua: good colorscheme for vis
		themes/fake256.lua: scrapped
		visrc.lua: removed change-256color disable
			   added cul nu ai
	youtube-dl/
		config, config-music: fixed output dir
	zathura/zathurarc: specified cozette otb
data/
	applications/text.desktop
		now uses xterm and vis
	man/man7/user-hier.7
		based off hier(7), describes structure of ..
			home directory
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bar.sh4
-rwxr-xr-xbin/lh19
-rwxr-xr-xbin/opener16
3 files changed, 24 insertions, 15 deletions
diff --git a/bin/bar.sh b/bin/bar.sh
new file mode 100755
index 0000000..49500ee
--- /dev/null
+++ b/bin/bar.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+# loads color envs, pipes spoon to dzen
+. $HOME_ETC/color/colors.sh
+spoon -t|dzen2 -ta r -fg "$color0" -bg "$color1" -fn "Terminus:style=Regular:pixelsize=12" -u -h 13 -w 1366 -l 0 -p
diff --git a/bin/lh b/bin/lh
index 25a2f62..016b37f 100755
--- a/bin/lh
+++ b/bin/lh
@@ -4,14 +4,27 @@
 
 # if $1 isn't provided, spawn $BROWSER and exit. this allows lh to be used as a pseudo-browser.
 [ -z "$1" ] && exec "$BROWSER"
+#from pure-sh-bible
+split() {
+	set -f
+	old_ifs=$IFS
+	IFS=$2
+	set -- $1
+	printf '%s\n' "$@"
+	IFS=$old_ifs
+	set +f
+}
+
 case "$1" in
+	gemini://*|gopher://*)
+		$TERMINAL -e bombadillo "$1" ;;
 	*mkv|*webm|*mp4)
 		mpv "$1" >/dev/null 2>&1 & ;;
 	*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*twitch.tv/videos/*|*twitch.tv/*/v/*)
 		mpv --ytdl "$1" >/dev/null 2>&1 & ;;
 	*twitch.tv/*)
-		STREAMQUAL="$(streamlink "$1"|\
-			grep "Available streams"|tr " " "\n"|grep -E "[0-9]"|tr -d ,|\
+		STREAMQUAL="$(split "$(streamlink "$1"|grep 'Available streams')" ", "|\
+			grep -E "[0-9]"|\
 			dmenu -p "choose stream quality for $1")"
 		streamlink -p mpv $1 $STREAMQUAL >/dev/null 2>&1 & ;;
 	*png|*jpg|*jpe|*jpeg|*gif)
@@ -28,7 +41,7 @@ case "$1" in
 		fi ;;
 	*)
 		if [ -f "$1" ]; then
-			$TERMINAL -e "$EDITOR $1"
+			$TERMINAL -e "${EDITOR:-vi} $1"
 		else
 			$BROWSER "$1" >/dev/null 2>&1 &
 		fi ;;
diff --git a/bin/opener b/bin/opener
index 755da51..4ae3446 100755
--- a/bin/opener
+++ b/bin/opener
@@ -13,27 +13,19 @@ echo() {
 case "$FILEMIME" in
 	#ebooks
 	application/epub*|application/pdf|application/postscript|image/vnd.djvu)
-		if [ -n "$READER" ]; then
-			$READER "$FILEPATH">/dev/null 2>&1 &
-		else
-			zathura "$FILEPATH" &
-		fi ;;
+		${READER:-zathura} "$FILEPATH">/dev/null 2>&1 & ;;
 	#videos
 	video/*)
-		mpv --input-ipc-server=/tmp/mpv-socket$(date +%s) --quiet "$FILEPATH" >/dev/null 2>&1 & ;;
+		mpv --quiet "$FILEPATH" >/dev/null 2>&1 & ;;
 	#images
 	image/*)
 		sxiv -a "$FILEPATH">/dev/null 2>&1 & ;;
 	#audio
 	audio/*)
-		mpv --input-ipc-server=/tmp/mpv-socket$(date +%s) "$FILEPATH" >/dev/null 2>&1 & ;;
+		mpv "$FILEPATH" >/dev/null 2>&1 & ;;
 	#text
 	text/*)
-		if [ -n "$EDITOR" ]; then
-			$EDITOR "$FILEPATH">/dev/null 2>&1 &
-		else
-			vi "$FILEPATH" &
-		fi ;;
+		${EDITOR:-vi} "$FILEPATH">/dev/null 2>&1 & ;;
 	#catchall
 	*)
 		echo "file $(basename "$FILEPATH") could not be opened. its type is $FILEMIME, go tell ensa that opener didn't work" >/dev/stderr