dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6b334b59fc9f681fd16fe437c363213bba80f640
parent ae327871d27157d29dffe25ef4aa0502e54bf4e1
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Fri, 31 May 2019 19:38:43 -0400

script documentation

Diffstat:
M.local/bin/compiler | 6+++---
M.local/bin/ext | 4+++-
M.local/bin/maimpick | 5+++++
M.local/bin/rotdir | 10+++++++++-
M.local/bin/setbg | 7++++++-
5 files changed, 26 insertions(+), 6 deletions(-)

diff --git 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") diff --git 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/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 @@ -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 @@ -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