dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.margiolis.net/dotfiles.git
Log | Files | Refs | README | LICENSE

commit cf3f9b37be8a219f16f72e8ab0d7e2c8c2180e1d
parent 353f8856d7df4fa2f09f7f7da2d31bd9397e796e
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sun,  3 Apr 2022 01:37:59 +0300

removed scripts from here

Diffstat:
Dscripts/.local/bin/ausplit | 74--------------------------------------------------------------------------
Dscripts/.local/bin/autocomp | 4----
Dscripts/.local/bin/batnfy | 10----------
Dscripts/.local/bin/doccomp | 27---------------------------
Dscripts/.local/bin/docprev | 14--------------
Dscripts/.local/bin/extr | 34----------------------------------
Dscripts/.local/bin/fontupd | 11-----------
Dscripts/.local/bin/irssi_torconf | 16----------------
Dscripts/.local/bin/namefmt | 6------
Dscripts/.local/bin/newsboat_bookmark | 3---
Dscripts/.local/bin/passget | 4----
Dscripts/.local/bin/push | 7-------
Dscripts/.local/bin/rssread | 4----
Dscripts/.local/bin/screencast | 8--------
Dscripts/.local/bin/se | 3---
Dscripts/.local/bin/setscreens | 13-------------
Dscripts/.local/bin/sysact | 11-----------
Dscripts/.local/bin/tag | 63---------------------------------------------------------------
Dscripts/.local/bin/unix | 26--------------------------
Dscripts/.local/bin/upd | 34----------------------------------
Dscripts/.local/bin/vdq | 18------------------
Dscripts/.local/bin/vds | 14--------------
Dscripts/.local/bin/vmstart | 46----------------------------------------------
Dscripts/.local/bin/vmstop | 24------------------------
Dscripts/.local/bin/walset | 6------
Dscripts/.local/bin/wttr | 3---
Msh/.profile | 1-
27 files changed, 0 insertions(+), 484 deletions(-)

diff --git a/scripts/.local/bin/ausplit b/scripts/.local/bin/ausplit @@ -1,74 +0,0 @@ -#!/bin/sh - -# ffmpeg and my `tag` script required. -main() -{ - test ${#} -ne 2 && usage - - auin="${1}" - local tfile="${2}" - total="$(wc -l < "${tfile}")" - # The extension must exist in `tag`. - ext="${1#*.}" - - xread "Album/book title: " album - xread "Artist/author: " author - xread "Publication year: " year - - namefmt="$(fmt_name "${album}")" - mkdir -p "${namefmt}" || exit 1 - - while read -r line; do - end="$(echo "${line}" | cut -d' ' -f1)" - test -n "${start}" && split_file - title="$(echo "${line}" | cut -d' ' -f 2-)" - titlefmt="$(fmt_name "${title}")" - track="$((track+1))" - start="${end}" - done < "${tfile}" - - # The last track must be done outside the loop. - split_file -} - -usage() -{ - echo "usage: ${0##*/} audio timecode_file" 1>&2 && exit 1 -} - -xread() -{ - printf "%s" "${1}" && read -r ${2} -} - -fmt_name() -{ - echo "${1}" | iconv -cf UTF-8 -t ASCII//TRANSLIT | - tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | - sed "s/-\+/-/g;s/\(^-\|-\$\)//g" -} - -split_file() -{ - echo "From ${start} to ${end}; ${track} ${title}" - echo "Splitting \"${title}\"..." - ofile="${namefmt}/$(printf "%.2d" "${track}")-${titlefmt}.${ext}" - ffmpeg \ - -nostdin -y -loglevel -8 \ - -i "${auin}" \ - -ss "${start}" \ - `test ${track} -eq ${total} || echo "-to ${end}"` \ - -vn -c copy \ - "${ofile}" && - echo "Tagging \"${title}\"..." && - tag \ - -a "${author}" \ - -A "${album}" \ - -t "${title}" \ - -n "${track}" \ - -N "${total}" \ - -d "${year}" \ - "${ofile}" -} - -main "${@}" diff --git a/scripts/.local/bin/autocomp b/scripts/.local/bin/autocomp @@ -1,4 +0,0 @@ -#!/bin/sh - -pkill -f "entr -n doccomp" -echo "${1}" | entr -n doccomp "${1}" diff --git a/scripts/.local/bin/batnfy b/scripts/.local/bin/batnfy @@ -1,10 +0,0 @@ -#!/bin/sh - -export DISPLAY=":0.0" # cron cannot open the display without this. -perc=$(sysctl -n hw.acpi.battery.life) -charg=$(sysctl -n hw.acpi.battery.state) -if [ ${perc} -le 10 ] && [ ${charg} -ne 2 ]; then - nfy "Low battery" -elif [ ${perc} -ge 99 ] && [ ${charg} -eq 2 ]; then - nfy "Battery fully charged" -fi diff --git a/scripts/.local/bin/doccomp b/scripts/.local/bin/doccomp @@ -1,27 +0,0 @@ -#!/bin/sh - -usage() -{ - echo "usage: ${0##*/} file" 1>&2 && exit 1 -} - -file_exists() -{ - test ! -f "${file}" && echo "${0##*/}: ${file}: file not found" 1>&2 && exit 1 -} - -test ${#} -eq 0 && usage - -file="$(readlink -f "${1}")" -dir="${file%/*}" -base="${file%.*}" -ext="${file##*.}" - -file_exists -cd "${dir}" || exit 1 - -case "${ext}" in - md) pandoc ${file} --pdf-engine=xelatex -V mainfont=Arial -o "${base}.pdf" ;; - # TODO: handle biber - tex) pdflatex ${file} && rm -f *.aux *.log *.out *.bcf *.run.xml ;; -esac diff --git a/scripts/.local/bin/docprev b/scripts/.local/bin/docprev @@ -1,14 +0,0 @@ -#!/bin/sh - -usage() -{ - echo "usage: ${0##*/} file" 1>&2 && exit 1 -} - -test ${#} -eq 0 && usage -base="${1%.*}" - -case "${1}" in - *.html) setsid -f "${BROWSER}" "${base}.html" ;; - *.tex) setsid -f xdg-open "${base}.pdf" ;; -esac diff --git a/scripts/.local/bin/extr b/scripts/.local/bin/extr @@ -1,34 +0,0 @@ -#!/bin/sh - -usage() -{ - echo "usage: ${0##*/} [-d dir] file" 1>&2 && exit 1 -} - -while getopts d: arg; do -case "${arg}" in - d) dir="${OPTARG}" ;; - *) usage ;; -esac -done -shift "$(expr ${OPTIND} - 1)" - -archive="$(readlink -f ${1})" -test -z "${archive}" && usage -test -n "${dir}" && mkdir -p "${dir}" && cd "${dir}" - -case "${archive}" in - *.tar.bz2|*.tbz2) tar xvjf "${archive}" ;; - *.tar.xz) tar -xf "${archive}" ;; - *.tar.gz|*.tgz) tar xvzf "${archive}" ;; - *.lzma) unlzma "${archive}" ;; - *.bz2) bunzip2 "${archive}" ;; - *.rar) unrar x -ad "${archive}" ;; - *.gz) gunzip "${archive}" ;; - *.tar) tar xvf "${archive}" ;; - *.zip) unzip "${archive}" ;; - *.Z) uncompress "${archive}" ;; - *.7z) 7z x "${archive}" ;; - *.xz) unxz "${archive}" ;; - *) echo "i don't know how to extract this" 1>&2 ;; -esac diff --git a/scripts/.local/bin/fontupd b/scripts/.local/bin/fontupd @@ -1,11 +0,0 @@ -#!/bin/sh - -dir=${HOME}/.fonts - -mkdir -p ${dir} -chmod 755 ${dir} -cd ${dir} -chmod 644 * -mkfontdir -xset fp+ ${dir} -xset fp rehash diff --git a/scripts/.local/bin/irssi_torconf b/scripts/.local/bin/irssi_torconf @@ -1,16 +0,0 @@ -#!/bin/sh - -echo "mapaddress 10.40.40.40 libera75jm6of4wxpxt4aynol3xjmbtxgfyjpu34ss4d7r7q2v5zrpyd.onion" >> /usr/local/etc/tor/torrc -service tor restart -mkdir -p ~/.irssi/certs && cd ~/.irssi/certs -openssl req -x509 -sha256 -new -newkey rsa:4096 -days 1000 -nodes -out libera.crt -keyout libera.key -cat libera.crt libera.key > ~/.irssi/certs/libera.pem -chmod 600 libera.pem -rm libera.key libera.crt -printf "/msg NickServ CERT ADD " -openssl x509 -in ~/.irssi/certs/libera.pem -outform der | sha1 | cut -d' ' -f1 -echo "/network add -sasl_username cmrg -sasl_password cmrgsasl -sasl_mechanism EXTERNAL LiberaTor" -echo "/server add -ssl -ssl_cert ~/.irssi/certs/libera.pem -net LiberaTor 10.40.40.40 6697" -echo "/ignore * CTCPS" -echo "/save" -echo "/quit" diff --git a/scripts/.local/bin/namefmt b/scripts/.local/bin/namefmt @@ -1,6 +0,0 @@ -#!/bin/sh - -# FIXME: give path/s from command line -for file in $(find .); do - mv ${file} $(echo ${file} | tr '-' '_') -done diff --git a/scripts/.local/bin/newsboat_bookmark b/scripts/.local/bin/newsboat_bookmark @@ -1,3 +0,0 @@ -#!/bin/sh - -printf "%s\t%s\n" "$1" "$2" | expand -t8 >> "${HOME}/shit/playlist" diff --git a/scripts/.local/bin/passget b/scripts/.local/bin/passget @@ -1,4 +0,0 @@ -#!/bin/sh - -pass "$(pass | sed 1d | awk '{print $2}' | dmenu -l 30)" | -xargs echo -n | xclip -sel clip diff --git a/scripts/.local/bin/push b/scripts/.local/bin/push @@ -1,7 +0,0 @@ -#!/bin/sh - -branch=$(git branch --show-current) -for remote in $(git remote); do - git push ${remote} ${branch} -done -gitupd diff --git a/scripts/.local/bin/rssread b/scripts/.local/bin/rssread @@ -1,4 +0,0 @@ -#!/bin/sh - -sfeed_update -sfeed_curses ${HOME}/.sfeed/feeds/* diff --git a/scripts/.local/bin/screencast b/scripts/.local/bin/screencast @@ -1,8 +0,0 @@ -#!/bin/sh - -ffmpeg -y \ - -f x11grab \ - -s $(xrandr | grep "connected primary" | awk '{print $4}' | sed 's/+0+0//') \ - -i :0.0 \ - -c:v libx264 -r 30 -c:a mp3 ${1} - #-f oss -i default \ diff --git a/scripts/.local/bin/se b/scripts/.local/bin/se @@ -1,3 +0,0 @@ -#!/bin/sh - -du -a ~/.local/bin/* | awk '{print $2}' | fzf | xargs -r ${EDITOR} diff --git a/scripts/.local/bin/setscreens b/scripts/.local/bin/setscreens @@ -1,13 +0,0 @@ -#!/bin/sh -xrandr \ - --output DVI-I-0 \ - --mode 1280x1024 \ - --pos 1920x56 \ - --rotate normal \ - --output HDMI-0 \ - --off \ - --output DVI-D-0 \ - --primary \ - --mode 1920x1080 \ - --pos 0x0 \ - --rotate normal diff --git a/scripts/.local/bin/sysact b/scripts/.local/bin/sysact @@ -1,11 +0,0 @@ -#!/bin/sh - -cmds="\ -lock slock -leave_dwm kill -TERM $(pidof -s dwm) -renew_dwm kill -HUP $(pidof -s dwm) -reboot ${reb:-doas reboot} -shutdown ${shut:-doas shutdown -p now}" - -choice="$(echo "${cmds}" | cut -d ' ' -f 1 | dmenu)" || exit 1 -`echo "${cmds}" | grep "^${choice}" | cut -d ' ' -f2-` diff --git a/scripts/.local/bin/tag b/scripts/.local/bin/tag @@ -1,63 +0,0 @@ -#!/bin/sh - -usage() -{ - echo "usage: ${0##*/} [-a artist] [-A album_title] [-c comment]" 1>&2 - echo " [-d year] [-g genre] [-n trackno] [-N totalno]" 1>&2 - echo " [-t song_title] file" 1>&2 - exit 1 -} - -xread() -{ - printf "%s" "${1}" && read -r ${2} -} - -while getopts "a:t:A:n:N:d:g:c:f:" arg; do -case "${arg}" in - a) artist="${OPTARG}" ;; - t) title="${OPTARG}" ;; - A) album="${OPTARG}" ;; - n) track="${OPTARG}" ;; - N) total="${OPTARG}" ;; - d) date="${OPTARG}" ;; - g) genre="${OPTARG}" ;; - c) comment="${OPTARG}" ;; - f) file="${OPTARG}" ;; - *) usage ;; -esac -done -shift $((OPTIND - 1)) - -file="${1}" -test ! -f "${file}" && echo "${0##*/}: file not found" && usage - -test -z "${title}" && xread "Title: " title -test -z "${artist}" && xread "Artist: " artist -test -z "${album}" && xread "Album: " album -test -z "${track}" && xread "Track number: " track - -info="Title=${title} -Artist=${artist} -Album=${album} -Track=${track} -Total=${total} -Date=${date} -Genre=${genre} -Comment=${comment}" - -echo "${info}" - -case "${file}" in - *.ogg) echo "${info}" | vorbiscomment -w "${file}" ;; - *.opus) echo "${info}" | opustags -i -S "${file}" ;; - *.mp3) eyeD3 -Q --remove-all \ - -a "${artist}" \ - -A "${album}" \ - -t "${title}" \ - -n "${track}" \ - -N "${total}" \ - -Y "${date}" \ - "${file}" ;; - *) echo "${0##*/}: file type not implemented yet" ;; -esac diff --git a/scripts/.local/bin/unix b/scripts/.local/bin/unix @@ -1,26 +0,0 @@ -#!/bin/sh - -#original artwork by http://www.sanderfocus.nl/#/portfolio/tech-heroes -#converted to shell by #nixers @ irc.unix.chat - -cat << 'eof' - ,_ ,_==▄▂ - , ▂▃▄▄▅▅▅▂▅¾. / / - ▄▆<´ "»▓▓▓%\ / / / / - ,▅7" ´>▓▓▓% / / > / >/% - ▐¶▓ ,»▓▓¾´ /> %/%// / / - ▓▃▅▅▅▃,,▄▅▅▅Æ\// ///>// />/ / - V║«¼.;→ ║<«.,`=// />//%/% / / - //╠<´ -²,)(▓~"-╝/¾/ %/>/ /> - / / / ▐% -./▄▃▄▅▐, /7//;//% / / - / ////`▌▐ %zWv xX▓▇▌//&;% / / - / / / %//%/¾½´▌▃▄▄▄▄▃▃▐¶\/& / - </ /</%//`▓!%▓%╣[38;5;255;╣WY<Y)y&/`\ - / / %/%//</%//\i7; ╠N>)VY>7; \_ UNIX IS VERY SIMPLE IT JUST NEEDS A - / /</ //<///<_/%\▓ V%W%£)XY _/%‾\_, GENIUS TO UNDERSTAND ITS SIMPLICITY - / / //%/_,=--^/%/%%\¾%¶%%} /%%%%%%;\, - %/< /_/ %%%%%;X%%\%%;, _/%%%;, \ - / / %%%%%%;, \%%l%%;// _/%;, dmr - / %%%;, <;\-=-/ / - ;, l -eof diff --git a/scripts/.local/bin/upd b/scripts/.local/bin/upd @@ -1,34 +0,0 @@ -#!/bin/sh - -# FIXME: trim random symbols -case $1 in - www) src="${HOME}/src/margiolis.net/" - dst="master@margiolis.net:/var/www/htdocs/margiolis.net" - ;; - ftp) src="${2}" - dst="master@margiolis.net:/var/www/htdocs/ftp.margiolis.net/${3}" - ;; - vps) src="${2}" - dst="master@margiolis.net:${3}" - ;; - lap) src="${2}" - dst="tpad:${3}" - ;; - desk) src="${2}" - dst="pleb:${3}" - ;; - old) src="${2}" - dst="old:${3}" - ;; - foo) src="${2}" - dst="foo:${3}" - ;; - # add disk, storage, all - *) echo "usage: ${0##*/} {www | ftp | vps | lap | desk | old | foo} src dst" 1>&2 && exit 1 ;; -esac -test -z "${src}" && echo "${0##*/}: src is empty" 1>&2 && exit 1 -test -z "${dst}" && echo "${0##*/}: dest is empty" 1>&2 && exit 1 - -# add directory error check -read -erp "${0##*/}: transfer '${src}' to '${dst}' (y/N)? " act -test "${act}" = "y" && rsync -Purv --delete-after "${src}" "${dst}" diff --git a/scripts/.local/bin/vdq b/scripts/.local/bin/vdq @@ -1,18 +0,0 @@ -#!/bin/sh - -QUEUE="${HOME}/shit/queue" -while getopts a:dfv arg; do -case "${arg}" in - a) echo "${OPTARG}" >> ${QUEUE} - exit 0 ;; - d) rm ${QUEUE} - exit 0 ;; - f) echo ${QUEUE} - exit 0 ;; - v) cat ${QUEUE} | dmenu -l 30 - exit 0 ;; - *) echo "usage: ${0##*/} [-dfv] [-a url]" 1>&2 - exit 1 ;; -esac -done -cat ${QUEUE} | awk '{print $1}' | xargs mpv diff --git a/scripts/.local/bin/vds b/scripts/.local/bin/vds @@ -1,14 +0,0 @@ -#!/bin/sh - -PLAYLIST="${HOME}/shit/playlist" -QUEUE="$(vdq -f)" -while getopts p:q arg; do -case "${arg}" in - p) PLAYLIST="${OPTARG}" ;; - q) vdq -a "$(cat ${PLAYLIST} | dmenu -l 30)" - exit 0 ;; - *) echo "usage: ${0##*/} [-q] [-p playlist]" 1>&2 - exit 1 ;; -esac -done -cat ${PLAYLIST} | dmenu -l 30 | awk '{print $1}' | xargs mpv diff --git a/scripts/.local/bin/vmstart b/scripts/.local/bin/vmstart @@ -1,46 +0,0 @@ -#!/bin/sh - -usage() -{ - echo "usage: ${0##*/} [-u] [-c cpu] [-C com] [-d disk] [-i img] [-m mem] [-t tap] name" 1>&2 - exit 1 -} - -cpu="2" -mem="2G" -disk="disk.img" -tap="tap0" - -# TODO: opt: disname, lpc, xhci -while getopts c:C:d:i:m:t:u arg; do -case "${arg}" in - c) cpu="${OPTARG}" ;; - C) com="${OPTARG}" ;; - d) disksiz="${OPTARG}" ;; - i) img="${OPTARG}" ;; - m) mem="${OPTARG}" ;; - t) tap="${OPTARG}" ;; - u) uefi="-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd" ;; - *) usage ;; -esac -done -shift $((OPTIND - 1)) - -name="${1}" -test -z "${name}" && usage - -test -n "${disksiz}" && truncate -s "${disksiz}" ${disk} -ifconfig "${tap}" up - -bhyve -c ${cpu} -m ${mem} -wH \ - -s 0,hostbridge \ - `test -n "${img}" && echo "-s 3,ahci-cd,${img}"` \ - -s 4,ahci-hd,${disk} \ - -s 5,virtio-net,${tap} \ - -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \ - -s 30,xhci,tablet \ - -s 31,lpc \ - `test -n "${com}" && echo "-l com1,${com}"` \ - `test -n "${uefi}" && echo ${uefi}` \ - ${name} - diff --git a/scripts/.local/bin/vmstop b/scripts/.local/bin/vmstop @@ -1,24 +0,0 @@ -#!/bin/sh - -usage() -{ - echo "usage: ${0##*/} [-t tap] name" 1>&2 - exit 1 -} - -tap="tap0" - -while getopts t: arg; do -case "${arg}" in - t) tap="${OPTARG}" ;; - *) usage ;; -esac -done -shift $((OPTIND - 1)) - -name="${1}" -test -z "${name}" && usage - -ifconfig ${tap} down -bhyvectl --force-poweroff --vm=${name} -bhyvectl --destroy --vm=${name} diff --git a/scripts/.local/bin/walset b/scripts/.local/bin/walset @@ -1,6 +0,0 @@ -#!/bin/sh - -bgloc="${HOME}/.local/share/bg" -test -f "${1}" && ln -sf "$(readlink -f "${1}")" "${bgloc}" && -nfy "${bgloc}" "Changing wallpaper..." -xwallpaper --zoom "$(readlink -f "${bgloc}")" >/dev/null diff --git a/scripts/.local/bin/wttr b/scripts/.local/bin/wttr @@ -1,3 +0,0 @@ -#!/bin/sh - -curl https://wttr.in/Athens+Greece | less -R diff --git a/sh/.profile b/sh/.profile @@ -9,7 +9,6 @@ # if wanted. # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH # BLOCKSIZE=K; export BLOCKSIZE -export PATH="${PATH}:$(du "${HOME}/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" # Setting TERM is normally done through /etc/ttys. Do only override # if you're sure that you'll never log in via telnet or xterm or a