diff options
| -rwxr-xr-x | .local/bin/compiler | 7 | ||||
| -rwxr-xr-x | .local/bin/displayselect | 7 | ||||
| -rwxr-xr-x | .local/bin/dmenumount | 11 | ||||
| -rwxr-xr-x | .local/bin/dmenupass | 4 | ||||
| -rwxr-xr-x | .local/bin/ext | 4 | ||||
| -rwxr-xr-x | .local/bin/linkhandler | 2 | ||||
| -rwxr-xr-x | .local/bin/maimpick | 5 | ||||
| -rwxr-xr-x | .local/bin/rotdir | 10 | ||||
| -rwxr-xr-x | .local/bin/setbg | 7 |
9 files changed, 41 insertions, 16 deletions
diff --git a/.local/bin/compiler b/.local/bin/compiler index 7d3bf1d..dcf79f1 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -1,10 +1,10 @@ #!/bin/sh + # This script will compile or run another finishing operation on a document. I # have this script run via vim. # -# Compiles .tex. groff (.mom, .ms), .rmd, .md. -# Opens .sent files as sent presentations. -# Runs scripts based on extention or shebang +# Compiles .tex. groff (.mom, .ms), .rmd, .md. Opens .sent files as sent +# presentations. Runs scripts based on extention or shebang file=$(readlink -f "$1") dir=$(dirname "$file") @@ -25,6 +25,7 @@ textype() { \ case "$file" in *\.ms) refer -PS -e "$file" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; *\.mom) refer -PS -e "$file" | groff -mom -kejpt -T pdf > "$base".pdf ;; + *\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;; *\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; *\.tex) textype "$file" ;; *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; diff --git a/.local/bin/displayselect b/.local/bin/displayselect index e526014..c0e3479 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -1,9 +1,8 @@ #!/bin/sh -# A UI for detecting and selecting all displays. -# Probes xrandr for connected displays and lets user select one to use. -# User may also select "manual selection" which opens arandr. -# I plan on adding a routine from multi-monitor setups later. +# A UI for detecting and selecting all displays. Probes xrandr for connected +# displays and lets user select one to use. User may also select "manual +# selection" which opens arandr. twoscreen() { # If multi-monitor is selected and there are two screens. diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index 0de5f0f..1feb204 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -1,8 +1,9 @@ #!/bin/sh -# Gives a dmenu prompt to mount unmounted drives. -# If they're in /etc/fstab, they'll be mounted automatically. -# Otherwise, you'll be prompted to give a mountpoint from already existsing directories. -# If you input a novel directory, it will prompt you to create that directory. + +# Gives a dmenu prompt to mount unmounted drives and Android phones. If +# they're in /etc/fstab, they'll be mounted automatically. Otherwise, you'll +# be prompted to give a mountpoint from already existsing directories. If you +# input a novel directory, it will prompt you to create that directory. getmount() { \ [ -z "$chosen" ] && exit 1 @@ -51,7 +52,7 @@ if [ -z "$usbdrives" ]; then else if [ -z "$anddrives" ]; then echo "USB drive(s) detected." - mountusb + mountusb else echo "Mountable USB drive(s) and Android device(s) detected." asktype diff --git a/.local/bin/dmenupass b/.local/bin/dmenupass index 4fc464f..8631a13 100755 --- a/.local/bin/dmenupass +++ b/.local/bin/dmenupass @@ -1,2 +1,6 @@ #!/bin/sh + +# This script is the SUDO_ASKPASS variable, meaning that it will be used as a +# password prompt if needed. + dmenu -fn Monospace-18 -sb "#d79921" -sf "#1d2021" -nf "#000000" -nb "#000000" -p "$1" <&- && echo diff --git a/.local/bin/ext b/.local/bin/ext index a63ab10..c2e0f5c 100755 --- a/.local/bin/ext +++ b/.local/bin/ext @@ -1,5 +1,7 @@ #!/bin/sh -# A general, all-purpose extraction script. + +# A general, all-purpose extraction script. Not all extraction programs here +# are installed by LARBS automatically. # # Default behavior: Extract archive into new directory # Behavior with `-c` option: Extract contents into current directory diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index c616d04..b839da2 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -10,7 +10,7 @@ [ -z "$1" ] && { "$BROWSER"; exit; } case "$1" in - *mkv|*webm|*mp4|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*) + *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*) setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;; *png|*jpg|*jpe|*jpeg|*gif) curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; diff --git a/.local/bin/maimpick b/.local/bin/maimpick index 07d032f..7125e61 100755 --- a/.local/bin/maimpick +++ b/.local/bin/maimpick @@ -1,4 +1,9 @@ #!/bin/sh + +# This is bound to Shift+PrintScreen by default, requires maim. It lets you +# choose the kind of screenshot to take, including copying the image or even +# highlighting an area to copy. scrotcucks on suicidewatch right now. + case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in "a selected area") maim -s pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;; "current window") maim -i "$(xdotool getactivewindow)" pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;; diff --git a/.local/bin/rotdir b/.local/bin/rotdir index e7103db..7313a42 100755 --- a/.local/bin/rotdir +++ b/.local/bin/rotdir @@ -1,4 +1,12 @@ #!/bin/sh + +# When I open an image from the file manager in sxiv (the image viewer), I want +# to be able to press the next/previous keys to key through the rest of the +# images in the same directory. This script "rotates" the content of a +# directory based on the first chosen file, so that if I open the 15th image, +# if I press next, it will go to the 16th etc. Autistic, I know, but this is +# one of the reasons that sxiv is great for being able to read standard input. + [ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 -base="$(basename $1)" +base="$(basename "$1")" ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$base$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }" diff --git a/.local/bin/setbg b/.local/bin/setbg index 950ae7c..6125654 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -1,4 +1,9 @@ #!/bin/sh -# Sets the background. If given an argument, will set file as background. + +# In LARBS, ~/.config/wall.png is the location of the system wallpaper. This +# script, if given an argument, moves it there. This script without an +# argument sets ~/.config/wall.png as the wallpaper, which is required on login +# if you don't want a blakc screen. + [ ! -z "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." xwallpaper --zoom ~/.config/wall.png |
