dotfiles

My dotfiles used for LARBS
Log | Files | Refs | README | LICENSE

commit 2b5df860ded1412a0c0be0d140d138616e926dfc
parent a25e8b640ac83b6eb345977e59803e999bc42202
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sat,  8 Feb 2020 18:43:37 -0500

#!/bin/sh shebang. newline after universalized.

Diffstat:
M.local/bin/compiler | 2+-
M.local/bin/cron/checkup | 3++-
M.local/bin/cron/cronbat | 3++-
M.local/bin/cron/crontog | 3++-
M.local/bin/cron/newsup | 3++-
M.local/bin/displayselect | 2+-
M.local/bin/dmenuhandler | 3++-
M.local/bin/dmenumount | 2+-
M.local/bin/dmenupass | 2+-
M.local/bin/dmenurecord | 2+-
M.local/bin/dmenuumount | 3++-
M.local/bin/dmenuunicode | 2+-
M.local/bin/ext | 2+-
M.local/bin/getkeys | 3++-
M.local/bin/i3cmds/ddspawn | 2+-
M.local/bin/i3cmds/dropdowncalc | 3++-
M.local/bin/i3cmds/hover | 3++-
M.local/bin/i3cmds/i3resize | 3++-
M.local/bin/i3cmds/tmuxdd | 3++-
M.local/bin/ifinstalled | 3++-
M.local/bin/launch_polybar | 2+-
M.local/bin/linkhandler | 2+-
M.local/bin/maimpick | 2+-
M.local/bin/mpd-module-update | 2+-
M.local/bin/opout | 2+-
M.local/bin/pauseallmpv | 2+-
M.local/bin/podentr | 3++-
M.local/bin/prompt | 3++-
M.local/bin/qndl | 3++-
M.local/bin/queueandnotify | 3++-
M.local/bin/refbar | 2+-
M.local/bin/remaps | 3++-
M.local/bin/rotdir | 2+-
M.local/bin/rssadd | 3++-
M.local/bin/samedir | 3++-
M.local/bin/setbg | 2+-
M.local/bin/shortcuts | 1+
M.local/bin/showclip | 2+-
M.local/bin/statusbar/battery | 2+-
M.local/bin/statusbar/clock | 2+-
M.local/bin/statusbar/cpu | 2+-
M.local/bin/statusbar/disk | 2+-
M.local/bin/statusbar/help | 3++-
M.local/bin/statusbar/internet | 2+-
M.local/bin/statusbar/iplocate | 2+-
M.local/bin/statusbar/mailbox | 2+-
M.local/bin/statusbar/memory | 2+-
M.local/bin/statusbar/music | 2+-
M.local/bin/statusbar/news | 2+-
M.local/bin/statusbar/pacpackages | 2+-
M.local/bin/statusbar/popupgrade | 2+-
M.local/bin/statusbar/torrent | 2+-
M.local/bin/statusbar/volume | 2+-
M.local/bin/statusbar/weather | 3++-
M.local/bin/td-toggle | 3++-
M.local/bin/texclear | 2+-
M.local/bin/torwrap | 3++-
M.local/bin/transadd | 2+-
M.local/bin/tutorialvids | 3++-
M.local/bin/unix | 6+++---
M.local/bin/vifmimg | 1+
M.local/bin/vu | 2+-
62 files changed, 88 insertions(+), 62 deletions(-)

diff --git a/.local/bin/compiler b/.local/bin/compiler @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # This script will compile or run another finishing operation on a document. I # have this script run via vim. diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # Syncs repositories and downloads updates, meant to be run as a cronjob. ping -q -c 1 1.1.1.1 > /dev/null || exit diff --git a/.local/bin/cron/cronbat b/.local/bin/cron/cronbat @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # Notify me with notify-send if my battery is below 25%. # You can set this to run via cron. diff --git a/.local/bin/cron/crontog b/.local/bin/cron/crontog @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # Toggles all cronjobs off/on. # Stores disabled crontabs in ~/.consaved until restored. diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # Set as a cron job to check for new RSS entries for newsboat. # If newsboat is open, sends it an "R" key to refresh. diff --git a/.local/bin/displayselect b/.local/bin/displayselect @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/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 diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # Feed this script a link and it will give dmenu # some choice programs to use to open it. diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # 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 diff --git a/.local/bin/dmenupass b/.local/bin/dmenupass @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # This script is the SUDO_ASKPASS variable, meaning that it will be used as a # password prompt if needed. diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Usage: # `$0`: Ask for recording type via dmenu diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # A dmenu prompt to unmount drives. # Provides you with mounted partitions, select one to unmount. # Drives mounted at /, /boot and /home will not be options to unmount. diff --git a/.local/bin/dmenuunicode b/.local/bin/dmenuunicode @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # The famous "get a menu of emojis to copy" script. diff --git a/.local/bin/ext b/.local/bin/ext @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # A general, all-purpose extraction script. Not all extraction programs here # are installed by LARBS automatically. diff --git a/.local/bin/getkeys b/.local/bin/getkeys @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + cat ~/.local/share/larbs/getkeys/"$1" 2>/dev/null && exit echo "Run command with one of the following arguments for info about that program:" ls ~/.local/share/larbs/getkeys diff --git a/.local/bin/i3cmds/ddspawn b/.local/bin/i3cmds/ddspawn @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Toggle floating dropdown terminal in i3, or start if non-existing. # $1 is the script run in the terminal. diff --git a/.local/bin/i3cmds/dropdowncalc b/.local/bin/i3cmds/dropdowncalc @@ -1,2 +1,3 @@ -#!/usr/bin/env sh +#!/bin/sh + ifinstalled bc && echo "Welcome to the Calculator." && bc -lq diff --git a/.local/bin/i3cmds/hover b/.local/bin/i3cmds/hover @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + [ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right current=$(xdotool getwindowfocus) newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3)) diff --git a/.local/bin/i3cmds/i3resize b/.local/bin/i3cmds/i3resize @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # This script was made by `goferito` on Github. # Some cleanup by Luke. diff --git a/.local/bin/i3cmds/tmuxdd b/.local/bin/i3cmds/tmuxdd @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # This is the script that i3 runs to either start tmux in # the dropdown terminal or log into a previous session. tmux a || tmux diff --git a/.local/bin/ifinstalled b/.local/bin/ifinstalled @@ -1,3 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh + # If $1 command is not available, error code and notify. command -v "$1" >/dev/null || { notify-send "📦 $1" "must be installed for this function." && exit 1 ;} diff --git a/.local/bin/launch_polybar b/.local/bin/launch_polybar @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Terminate already running bar instances killall -q polybar diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Feed script a url or file location. # If an image, it will view in sxiv, diff --git a/.local/bin/maimpick b/.local/bin/maimpick @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/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 diff --git a/.local/bin/mpd-module-update b/.local/bin/mpd-module-update @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # This loop will update the mpd statusbar module whenever a command changes the # music player's status. mpd must be running on X's start for this to work. diff --git a/.local/bin/opout b/.local/bin/opout @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # opout: "open output": A general handler for opening a file's intended output, # usually the pdf of a compiled document. I find this useful especially diff --git a/.local/bin/pauseallmpv b/.local/bin/pauseallmpv @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # You might notice all mpv commands are aliased to have this input-ipc-server # thing. That's just for this particular command, which allows us to pause diff --git a/.local/bin/podentr b/.local/bin/podentr @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # entr command to run `queueandnotify` when newsboat queue is changed [ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit diff --git a/.local/bin/prompt b/.local/bin/prompt @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # A dmenu binary prompt script. # Gives a dmenu prompt labeled with $1 to perform command $2. # For example: diff --git a/.local/bin/qndl b/.local/bin/qndl @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # $1 is a url; $2 is a command [ -z "$1" ] && exit base="$(basename "$1")" diff --git a/.local/bin/queueandnotify b/.local/bin/queueandnotify @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # Podboat sucks. This script replaces it. # It reads the newsboat queue, queuing downloads with taskspooler. # It also removes the junk from extentions. diff --git a/.local/bin/refbar b/.local/bin/refbar @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Refresh the dwmbar. # Send SIGTRAP signal to dwmbar script, which will handle it with a trap. diff --git a/.local/bin/remaps b/.local/bin/remaps @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # This script is called on startup to remap keys. # Increase key speed via a rate change xset r rate 300 50 diff --git a/.local/bin/rotdir b/.local/bin/rotdir @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/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 diff --git a/.local/bin/rssadd b/.local/bin/rssadd @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + ! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && notify-send "That doesn't look like a full URL." && exit RSSFILE="$HOME/.config/newsboat/urls" diff --git a/.local/bin/samedir b/.local/bin/samedir @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) PID=$(echo "$(pstree -lpA "$PID" | tail -n 1)" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g') cd "$(readlink /proc/"$PID"/cwd)" diff --git a/.local/bin/setbg b/.local/bin/setbg @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # 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 diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts @@ -1,4 +1,5 @@ #!/usr/bin/env bash + # Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="$HOME/.config/shortcutrc" ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" diff --git a/.local/bin/showclip b/.local/bin/showclip @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Display contents of selection via dunst if running. # Separate script for i3. diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Give a battery name (e.g. BAT0) as an argument. case $BLOCK_BUTTON in diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh date '+%Y %b %d (%a) %I:%M%p' diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh case $BLOCK_BUTTON in 1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Status bar module for disk space # $1 should be drive mountpoint diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + case $BLOCK_BUTTON in 1) groff -mom ~/.local/share/larbs/readme.mom -Tpdf | zathura - ;; 2) i3 restart ;; diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh case $BLOCK_BUTTON in 1) $TERMINAL -e nmtui ;; diff --git a/.local/bin/statusbar/iplocate b/.local/bin/statusbar/iplocate @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Gets your public ip address checks which country you are in and # displays that information in the statusbar diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # i3blocks mail module. # Displays number of unread mail and an loading icon if updating. diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh case $BLOCK_BUTTON in 1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh filter() { sed "/^volume:/d" | tac | sed -e "s/\\&/&amp;/g;s/\\[paused\\].*/<span color=\"gray\" font_style=\"italic\">/g;s/\\[playing\\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # i3blocks newsboat module. # Displays number of unread news items and an loading icon if updating. diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # i3blocks module for pacman upgrades. # Displays number of upgradeable packages. diff --git a/.local/bin/statusbar/popupgrade b/.local/bin/statusbar/popupgrade @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh printf "Beginning upgrade.\\n" diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh transmission-remote -l | grep % | sed " # This first sed command is to ensure a desirable order with sort diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e alsamixer & ;; diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + location="$1"; [ -z "$location" ] || { location="$location+" && rm -f "$HOME/.local/share/weatherreport" ;} getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 diff --git a/.local/bin/td-toggle b/.local/bin/td-toggle @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + # If transmission-daemon is running, will ask to kill, else will ask to start. if pgrep -x transmission-da >/dev/null ; then diff --git a/.local/bin/texclear b/.local/bin/texclear @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Clears the build files of a LaTeX/XeLaTeX build. # I have vim run this file whenever I exit a .tex file. diff --git a/.local/bin/torwrap b/.local/bin/torwrap @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + ifinstalled transmission-remote-cli transmission-cli || exit ! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}" diff --git a/.local/bin/transadd b/.local/bin/transadd @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running. diff --git a/.local/bin/tutorialvids b/.local/bin/tutorialvids @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + vidlist=" status bar https://www.youtube.com/watch?v=gKumet6b-WY sxiv (image viewer) https://www.youtube.com/watch?v=GYW9i_u5PYs diff --git a/.local/bin/unix b/.local/bin/unix @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/bin/sh + #original artwork by http://www.sanderfocus.nl/#/portfolio/tech-heroes #converted to shell by #nixers @ irc.unix.chat @@ -22,4 +23,4 @@ cat << 'eof' / / %%%%%%;, \%%l%%;// _/%;, dmr / %%%;, <;\-=-/ / ;, l -eof- \ No newline at end of file +eof diff --git a/.local/bin/vifmimg b/.local/bin/vifmimg @@ -1,4 +1,5 @@ #!/usr/bin/env bash + [ -z "$FIFO_UEBERZUG" ] && exit readonly ID_PREVIEW="preview" diff --git a/.local/bin/vu b/.local/bin/vu @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # This is a wrapper for vifm to allow ueberzug images.