about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorensa <@>2023-08-06 16:37:30 -0700
committerensa <@>2023-08-06 16:37:30 -0700
commit1ddfd9ba56511a4136dfe83e1f581ac52c79c0e9 (patch)
tree9940920dca61ab0ce2fd2dfe54d58f1c118313ed
parent75ee668954833ab6ba9287ed5eb16a9957edcac2 (diff)
downloadcfg-master.tar.gz
these commit titles don't have meaning anymore HEAD master
DEPENDENCIES.md:
	nixed. good riddance.
	i have no reason to think it was helpful and was a nightmare to update
bin/
	fcard: some tab changes. -z still broken
	fl: removed unnecessary lines from before flc's existence.
	flc: inherited IFS because of dmenu crap. tr -d to prevent pasting newlines.
	op: changed text/* to spawn a terminal. often op is invoked outside the terminal.
	shenv: looks at HOME_ETC for uniformity
etc/
	X11/xprofile: line for updating sfeed feeds
	aliasrc: colorizing lr
	ksh/kshrc:
		MANPATH extended to accommodate for user-specific packages, e.g python
		call_it_a_day updates packages and cleans the system, tracks how long that took
	mpv/mpv.conf: self-explanatory
	newsboat: not used anymore
	sfeedrc: new rss config, needs feed urls
	shrc: making room for sfeed, self-explanatory
	yt-dlp:
		mostly self-explanatory renaming
		new config for playlists, separate because you seemingly can't use directory markers in text substitution
-rw-r--r--DEPENDENCIES.md135
-rwxr-xr-xbin/fcard21
-rwxr-xr-xbin/fl12
-rwxr-xr-x[-rw-r--r--]bin/flc2
-rwxr-xr-xbin/op2
-rwxr-xr-xbin/shenv2
-rw-r--r--etc/X11/xprofile2
-rw-r--r--etc/aliasrc1
-rw-r--r--etc/ksh/kshrc11
-rw-r--r--etc/mpv/mpv.conf28
-rw-r--r--etc/newsboat/config38
-rw-r--r--etc/sfeedrc13
-rw-r--r--etc/shrc6
-rw-r--r--etc/yt-dlp/config3
-rw-r--r--etc/yt-dlp/config-music3
-rw-r--r--etc/yt-dlp/config-playlist4
16 files changed, 81 insertions, 202 deletions
diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md
deleted file mode 100644
index 868faef..0000000
--- a/DEPENDENCIES.md
+++ /dev/null
@@ -1,135 +0,0 @@
-# NOTE
-each and every file in this repository can be altered by anyone with any goal, including changing programs used. this, of course, will change the dependencies for every file that is altered.
-# KEY
-* `item`: a program
-  * NOTE: if `item` has a link, the link leads to either the official website if one exists, or its repository.
-  * if `item` does not have a link, it can likely be found in your OS's package manager.
-* `path/item`: one of the files in this repo
-* `$variable`: a shell variable set somewhere like shrc or .profile
-  * more specifically:
-  * `$TERMINAL`: value is the user's terminal of choice, e.g [xterm](https://invisible-island.net/xterm)
-  * `$EDITOR`: value is the user's terminal editor of choice, e.g [vis](https://github.com/martanne/vis)
-  * `$READER`: value is the user's ebook reader of choice, e.g [zathura](https://pwmt.org/projects/zathura)
-  * `$BROWSER`: value is the user's (non-terminal) web browser of choice, e.g [firefox](https://mozilla.org/firefox)
-  * `$HOME_ETC`: value is the user's config directory, usually `$HOME/.config`
-  * `$HOME_DATA`: value is the user's data directory, usually `$HOME/.local/share`
-* `opt: any of the previous bullets`: same meaning as before but optional
-* `(description)`: explains why it's necessary/what optional feature it enables if present
-# bin/
-* bar.sh: spawns a dzen status bar
-  * config/color/colors.sh
-  * [spoon](https://git.2f30.org/spoon)
-  * [dzen2](https://github.com/robm/dzen)
-* bother: notifies you with the contents of $HOME/today
-  * opt: `$XFILE`: the location of the file that starts your X session
-    * please define this if you don't use .xsession or .xinitrc
-  * bin/notif (the entire point of the script)
-  * `$HOME`/today (bother reads this file and sends it as a notification)
-  * pgrep (checks to see if your window manager is up yet)
-* comm-sel: a handy menu for spawning communication clients
-  * [catgirl](https://git.causal.agency/catgirl)
-  * [scli](https://github.com/isamert/scli)
-  * [dmenu](https://dmenu.suckless.org) (provides a menu for selecting which client to start)
-  * `$TERMINAL`
-* fl: finds links either in its arguments or piped to it, and has the user choose one to copy
-  * [dmenu](https://dmenu.suckless.org) (for the link chooser)
-  * xclip
-* lh: a script that takes a URL as input and does different things depending on what the URL links to
-  * [mpv](https://mpv.io) (video file streaming, streaming from sites like youtube, viewing livestreams from twitch)
-  * [youtube-dl](https://yt-dl.org) (hooked by mpv when streaming from the appropriate sites)
-  * [streamlink](https://streamlink.github.io) (used to view livestreams from twitch)
-  * [dmenu](https://dmenu.suckless.org) (used to pick stream quality when handling livestream URLs)
-  * [sxiv](https://github.com/muennich/sxiv) (used to view images)
-  * [curl](https://curl.haxx.se) (images, audio files, ebook files)
-  * [bombadillo](https://tildegit.org/sloum/bombadillo) (gemini, gopher)
-  * `$TERMINAL`
-  * `$READER`
-  * bin/op
-  * `$BROWSER`
-* mbsync-cron: populate local maildirs and notify the user if there is new mail
-  * [isync](https://isync.sourceforge.net)
-  * properly configured `$XDG_CONFIG_HOME/mbsync/mbsync` (One Group per email account)
-  * bin/notif (notifies the user for new mail and the subject line of said mail)
-  * `$XDG_DATA_HOME`
-* op: a script that uses file(1) to determine what a file is, then opens it with an appropriate program
-  * [mpv](https://mpv.io) (opens video and audio files)
-  * [sxiv](https://github.com/muennich/sxiv) (used to view images)
-  * `$READER`
-  * `$EDITOR`
-* prompt: makes prompting the user for particular actions easier
-  * [dmenu](https://dmenu.suckless.org)
-* pw: generates a password of variable length
-* rsschk: takes a URL as an argument and adds it to newsboat's url file, with an optional second argument specifying a category
-  * bin/notif (notifies the user of improper usage, and whether or not they should probably edit the url file manually to add a category.)
-  * [newsboat](https://newsboat.org)
-  * opt: `$XDG_CONFIG_HOME`
-* shenv: runs the shell with a specific environment file
-  * a shrc file located in `$XDG_CONFIG_HOME`, check config/shrc for an example
-* xbg: sets the background or changes the picture used for the background
-  * opt: xdg-user-dir (lets you change the directory bg.png has to be in)
-  * xwallpaper (sets the wallpaper)
-# config/
-* betteresc: xmodmap file setting up the groundwork for Hyper|Esc
-  * xmodmap
-* lf/lfrc: configuration file for [lf](https://github.com/gokcehan/lf)
-  * opt: `$OPENER` (for opening files)
-  * opt: curl (for uploading temporary content to the [ttm.sh](https://ttm.sh) site)
-* shrc: shell environment, particularly for bin/shenv
-  * vis (`$EDITOR`)
-  * lf (`$FILE`)
-  * xterm (`$TERMINAL`)
-  * bin/op (`$OPENER`)
-  * firefox (`$BROWSER`)
-  * bin/comm-sel (`$COMM`)
-  * zathura (`$READER`)
-  * neomutt (`$MAILER`)
-  * ncmpcpp (`$MUSIC`)
-  * newsboat (`$RSS`)
-  * ksh (`$ENV`)
-  * config/ksh (`$ENV`)
-  * maim (`$SCR`)
-  * slock (`$LOCK`)
-  * opt: [todo](https://git.tilde.institute/ensa/todo)
-  * opt: go (`$GOPATH`)
-  * opt: go (`$GOCACHE`)
-  * opt: go (`$GOBIN`)
-  * opt: cargo (`$CARGO_HOME`)
-  * opt: python (`$PYTHONUSERBASE`)
-  * opt: mednafen (`$MEDNAFEN_HOME`)
-* zathura/zathurarc
-  * [zathura](https://pwmt.org/projects/zathura)
-  * [hermit](https://pcaro.es/p/hermit/) font
-## ksh/
-configuration files for ksh
-* kshrc
-  * config/shrc (for the majority of variables set)
-  * opt: pfetch (`$PF_INFO`)
-* functions.ksh
-  * mpv (for mpvpin() to work)
-  * [pass](https://rgz.ee/pass.html) (for pcl and pct)
-  * xclip (for pcl and pct)
-* completions.ksh
-  * `$XDG_CACHE_HOME`
-  * [pass](https://rgz.ee/pass.html)
-## X11/
-configuration files for x11
-* xprofile: non-machine-specific x11 setup
-  * bin/kbsetup
-  * xset
-  * xrdb
-  * config/X11/xresources
-  * bin/xbg
-  * [xnotify](https://github.com/phillbush/xnotify)
-  * [tiramisu](https://github.com/Sweets/tiramisu)
-  * [xbanish](https://github.com/jcs/xbanish)
-  * [mpdas](https://www.50hz.ws/mpdas)
-  * bin/bar.sh
-  * bin/bother
-* xresources: X Resources Database file
-  * [hermit](https://pcaro.es/p/hermit/)
-  * [terminus](https://terminus-font.sourceforge.net)
-  * bin/fl (exec-selectable)
-# data/
-* mailcap: helps neomutt figure out what to do with particular MIME types
-  * lynx
-  * bin/op
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 "$@"
diff --git a/etc/X11/xprofile b/etc/X11/xprofile
index 9c9dc74..49dc6b0 100644
--- a/etc/X11/xprofile
+++ b/etc/X11/xprofile
@@ -28,5 +28,7 @@ xbanish &
 mpdas -c $HOME_ETC/mpdasrc &
 # remind user of important tasks
 XFILE="$HOME_ETC/X11/xsession" bother &
+# update rss
+sfeed_update "$HOME_ETC"/sfeedrc &
 # cleanup tabbed
 rm $HOME_CACHE/catgirl/tabbed-catgirl.xid
diff --git a/etc/aliasrc b/etc/aliasrc
index 43eb733..7db59df 100644
--- a/etc/aliasrc
+++ b/etc/aliasrc
@@ -4,6 +4,7 @@ alias \
 	ls='ls -Fh'\
 	ll='ls -Fhl'\
 	la='ls -Fha'\
+	lr='lr -G'\
 	lynx='lynx -cookies- -vikeys'\
 	df='df -h'\
 	du='du -h'\
diff --git a/etc/ksh/kshrc b/etc/ksh/kshrc
index 28b3c0c..3ab924b 100644
--- a/etc/ksh/kshrc
+++ b/etc/ksh/kshrc
@@ -22,9 +22,9 @@ export PF_INFO="ascii title os host shell editor wm pkgs palette"
 # fix manpath so local man pages work
 # crude *bsd detection
 if [[ -d /usr/X11R6 ]]; then
-export MANPATH="/usr/share/man:/usr/X11R6/man:/usr/local/man:$HOME_DATA/man"
+export MANPATH="/usr/share/man:/usr/X11R6/man:/usr/local/man:$HOME_DATA/man:$HOME_EXT_DATA/man"
 else
-export MANPATH="/usr/share/man:/usr/local/share/man:$HOME_DATA/man"
+export MANPATH="/usr/share/man:/usr/local/share/man:$HOME_DATA/man:$HOME_EXT_DATA/man"
 fi
 set -o vi
 
@@ -34,3 +34,10 @@ set -o vi
 [[ -f "$HOME_ETC/aliasrc" ]] && . "$HOME_ETC/aliasrc"
 [[ -f "$KSHCONFIG/completions.ksh" ]] && . "$KSHCONFIG/completions.ksh"
 [[ -f "$KSHCONFIG/prompt.ksh" ]] && . "$KSHCONFIG/prompt.ksh"
+
+call_it_a_day() {
+	date +%s > /tmp/start-update.time
+	doas sh -c 'pkg_add -Iu; pkg_delete -Ia'
+	echo "update took $(($(date +%s)-$(< /tmp/start-update.time))) seconds" > $HOME_LOG/call-it-a-day.log
+	doas poweroff
+}
diff --git a/etc/mpv/mpv.conf b/etc/mpv/mpv.conf
new file mode 100644
index 0000000..b21d06a
--- /dev/null
+++ b/etc/mpv/mpv.conf
@@ -0,0 +1,28 @@
+# Configuration file settings and the command line options use the same
+# underlying mechanisms. Most options can be put into the configuration file
+# by dropping the preceding '--'. See the man page for a complete list of
+# options.
+#
+# Profiles should be placed at the bottom of the configuration file to ensure
+# that settings wanted as defaults are not restricted to specific profiles.
+
+# use sndio
+ao=sndio
+
+# gpu-accel
+vo=gpu
+
+# Default audio volume is 100. Lower it to 75.
+volume=75
+
+# prefer english audio tracks
+alang=en,eng
+
+# Display English subtitles if available.
+slang=en,eng
+
+# Use Cozette for subtitle fonts.
+sub-font='Hermit'
+
+screenshot-directory=~/share/xdg/pic/
+screenshot-template=mpv-%f-%P
diff --git a/etc/newsboat/config b/etc/newsboat/config
deleted file mode 100644
index a6b49a9..0000000
--- a/etc/newsboat/config
+++ /dev/null
@@ -1,38 +0,0 @@
-#show-read-feeds no
-auto-reload yes
-
-external-url-viewer "flc"
-
-bind-key j down
-bind-key k up
-bind-key j next articlelist
-bind-key k prev articlelist
-bind-key J next-feed articlelist
-bind-key K prev-feed articlelist
-bind-key G end
-bind-key g home
-bind-key d pagedown
-bind-key u pageup
-bind-key l open
-bind-key h quit
-bind-key a toggle-article-read
-bind-key n next-unread
-bind-key N prev-unread
-bind-key D pb-download
-bind-key U show-urls
-bind-key x pb-delete
-bind-key ^t next-unread
-
-color listnormal cyan default
-color listfocus black yellow standout bold
-color listnormal_unread blue default
-color listfocus_unread yellow default bold
-color info red black bold
-color article cyan default
-
-browser lh
-macro , open-in-browser
-macro t set browser "yt-dlp --add-metadata -i"; open-in-browser ; set browser lh
-macro a set browser "yt-dlp --add-metadata -i --config-location ~/etc/yt-dlp/config-music"; open-in-browser ; set browser lh
-macro v set browser "mpv"; open-in-browser ; set browser lh
-macro w set browser "lynx -cookies- -vikeys"; open-in-browser ; set browser lh
diff --git a/etc/sfeedrc b/etc/sfeedrc
new file mode 100644
index 0000000..2c5686d
--- /dev/null
+++ b/etc/sfeedrc
@@ -0,0 +1,13 @@
+# some feeds don't like hidden user agent
+fetch() {
+	# fail on redirects, timeout is 15 seconds.
+	curl -L --max-redirs 0 -f -s -m 15 \
+		"$2" 2>/dev/null
+}
+
+sfeedpath="$HOME_DATA/sfeed/feeds"
+
+# list of feeds to fetch:
+feeds() {
+	# feed <name> <feedurl> [basesiteurl] [encoding]
+}
diff --git a/etc/shrc b/etc/shrc
index 9da8cef..ccd0ae2 100644
--- a/etc/shrc
+++ b/etc/shrc
@@ -27,9 +27,13 @@ export COMM="comm-sel"
 export READER="zathura"
 export MAILER="neomutt"
 export MUSIC="ncmpcpp"
-export RSS="newsboat"
+export RSS="sfeed_curses"
 export SCR="maim"
 export LOCK="xlock"
+#sfeed
+export SFEED_PLUMBER='lh'
+export SFEED_YANKER="xclip -sel c -r"
+export SFEED_URL_FILE="$HOME_DATA/sfeed/read"
 #less args
 export LESS='-iFMRX~ -x2'
 #locale info
diff --git a/etc/yt-dlp/config b/etc/yt-dlp/config
index 23171b9..60a5c77 100644
--- a/etc/yt-dlp/config
+++ b/etc/yt-dlp/config
@@ -1,6 +1,5 @@
---prefer-free-formats
 # always use aria2
---external-downloader aria2c
+--downloader aria2c
 # format
 --format bestvideo+bestaudio/best
 # format definition
diff --git a/etc/yt-dlp/config-music b/etc/yt-dlp/config-music
index b8109f8..a4be168 100644
--- a/etc/yt-dlp/config-music
+++ b/etc/yt-dlp/config-music
@@ -2,6 +2,9 @@
 --prefer-free-formats
 # only download audio stream
 --format bestaudio
+# fix dumb track names
+--restrict-filenames
 # dl to ~mus
 --paths ~/share/xdg/mus
+# coherent output format
 --output %(uploader_id,uploader,album_artist)s/%(release_year,release_date>%Y,upload_date>%Y|)s-%(album|singles)s/%(track_number,playlist_index|)02d%(track_number,playlist_index&-|)s%(track,title|title)s.%(ext)s
diff --git a/etc/yt-dlp/config-playlist b/etc/yt-dlp/config-playlist
new file mode 100644
index 0000000..528f5a3
--- /dev/null
+++ b/etc/yt-dlp/config-playlist
@@ -0,0 +1,4 @@
+# fix dumb track names
+--restrict-filenames
+# coherent output format
+--output %(uploader)s/%(playlist_title)s/%(playlist_index)02d-s%(track,title|title)s.%(ext)s