dots

git clone git://mattcarlson.org/repos/dots.git
Log | Files | Refs

commit 0297b6dce8e4990365f2ef6a47fac12533af19ea
parent 56665d67cc1de19791c4266317b37caa53e567cb
Author: Matthew Carlson <matt@mcarlson.xyz>
Date:   Thu, 22 Jul 2021 14:06:00 -0400

shellcheck

Diffstat:
M.config/mimeapps.list | 1+
M.config/mksh/mkshrc | 11+++++++++--
A.config/mpv/input.conf | 1+
A.config/mpv/scripts/sockets.lua | 36++++++++++++++++++++++++++++++++++++
A.config/mutt/muttrc | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.config/sh/aliasrc | 10+++++-----
M.config/sh/functionrc | 5+++--
M.config/sh/profile | 54++++++++++++++++++++++++++++++++++--------------------
M.config/x/xprofile | 7++++---
M.config/x/xresources | 14+++++++-------
A.local/bin/lock.sh | 22++++++++++++++++++++++
M.local/share/wp | 4++--
12 files changed, 207 insertions(+), 41 deletions(-)

diff --git a/.config/mimeapps.list b/.config/mimeapps.list @@ -10,6 +10,7 @@ application/x-tex=txt.desktop audio/flac=audio.desktop audio/m4a=audio.desktop audio/mp3=audio.desktop +audio/mpegapplication/octet-stream=audio.desktop audio/ogg=audio.desktop audio/wav=audio.desktop audio/x-m4a=audio.desktop diff --git a/.config/mksh/mkshrc b/.config/mksh/mkshrc @@ -2,6 +2,10 @@ # # mkshrc +if ! command -v pfetch >/dev/null; then pfetch() { :; }; fi + +pfetch + # tput COL0="$(tput setaf 0)" COL1="$(tput setaf 1)" @@ -23,10 +27,13 @@ BOLD="$(tput bold)" NORMAL="$(tput sgr0)" # prompt -export PS1=$'${BOLD}${COL4}$(pwd) $ ${NORMAL}${COL7}' +# bashism required b/c mksh doesn't support param expansion for PS1 +PS1='${BOLD}${COL4}${PWD} $ ${NORMAL}${COL7}' +export PS1 # gpg tty -export GPG_TTY=$(tty) +GPG_TTY="$(tty)" +export GPG_TTY # aliasrc [ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/sh/aliasrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/sh/aliasrc" diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf @@ -0,0 +1 @@ +I cycle-values vf "sub,lavfi=negate" "" diff --git a/.config/mpv/scripts/sockets.lua b/.config/mpv/scripts/sockets.lua @@ -0,0 +1,36 @@ +-- mpvSockets, one socket per instance, removes socket on exit + +local utils = require 'mp.utils' + +local function get_temp_path() + local directory_seperator = package.config:match("([^\n]*)\n?") + local example_temp_file_path = os.tmpname() + + -- remove generated temp file + pcall(os.remove, example_temp_file_path) + + local seperator_idx = example_temp_file_path:reverse():find(directory_seperator) + local temp_path_length = #example_temp_file_path - seperator_idx + + return example_temp_file_path:sub(1, temp_path_length) +end + +tempDir = get_temp_path() + +function join_paths(...) + local arg={...} + path = "" + for i,v in ipairs(arg) do + path = utils.join_path(path, tostring(v)) + end + return path; +end + +ppid = utils.getpid() +os.execute("mkdir " .. join_paths(tempDir, "mpv-sockets") .. " 2>/dev/null") +mp.set_property("options/input-ipc-server", join_paths(tempDir, "mpv-sockets", ppid)) + +function shutdown_handler() + os.remove(join_paths(tempDir, "mpv-sockets", ppid)) +end +mp.register_event("shutdown", shutdown_handler) diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc @@ -0,0 +1,83 @@ +# general +set arrow_cursor = 'no' +set askcc = 'yes' +set charset = 'utf-8' +set confirmappend = 'no' +set date_format = '%Y/%m/%d %I:%M %p' +set delete = 'yes' +set editor = `echo \${EDITOR:-vi}` +set fast_reply = 'yes' +set forward_quote = 'yes' +set header_cache = "${XDG_CACHE_HOME}/mutt/mail/headers" +set include = 'yes' +set index_format = '%-3C %Z %?X?A& ? %D %-15.15F %s (%c)' +set mail_check = 60 +set mail_check_stats = 'yes' +set mark_old = 'no' +set markers = 'no' +set menu_scroll = 'yes' +set message_cachedir = "${XDG_CACHE_HOME}/mutt/mail/bodies" +set mime_forward = 'yes' +set pager_stop = 'yes' +set quit = 'ask-yes' +set recall = 'no' +set sleep_time = 0 +set smart_wrap = 'yes' +set sort = threads +set sort_aux = reverse-last-date-received +set strict_threads = 'yes' +set text_flowed = 'yes' + +# bind +bind index,pager B sidebar-toggle-visible +bind index,pager \Cj sidebar-next +bind index,pager \Ck sidebar-prev +bind index,pager \Co sidebar-open + +# color +color attachment bold color6 default +color body bold color14 default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" +color body bold color14 default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" +color error bold color1 default +color hdrdefault bold color4 default +color index_date color4 default +color index_number color4 default +color index_size color4 default +color indicator bold default color4 +color markers color4 default +color quoted color4 default +color quoted1 color37 default +color quoted2 color38 default +color quoted3 color39 default +color quoted4 color43 default +color quoted5 color44 default +color quoted6 color45 default +color quoted7 color49 default +color quoted8 color50 default +color quoted9 color51 default +color sidebar_divider color0 default +color sidebar_highlight bold color3 default +color status bold default color4 +color tilde color0 default + +# sidebar +set sidebar_component_depth = '0' +set sidebar_delim_chars = '/' +set sidebar_divider_char = '|' +set sidebar_folder_indent = 'no' +set sidebar_format = '%D%?F? [%F]?%* %?N?%N/?%?S?%S?' +set sidebar_indent_string = '' +set sidebar_new_mail_only = 'no' +set sidebar_next_new_wrap = 'no' +set sidebar_on_right = 'no' +set sidebar_short_path = 'no' +set sidebar_sort_method = 'unsorted' +set sidebar_visible = 'yes' +set sidebar_width = '25' + +# source +source "gpg -dq ${XDG_DATA_HOME}/mutt/passwords.gpg |" +source "${XDG_CONFIG_HOME}/mutt/mattrc" +folder-hook $folder 'source ${XDG_CONFIG_HOME}/mutt/mattrc' +source "${XDG_CONFIG_HOME}/mutt/algomaurc" +folder-hook $folder 'source ${XDG_CONFIG_HOME}/mutt/algomaurc' diff --git a/.config/sh/aliasrc b/.config/sh/aliasrc @@ -25,7 +25,7 @@ alias \ free='free -m' # startx -[ -f "${XINITRC}" ] && alias startx="startx ${XINITRC}" +[ -f "${XINITRC}" ] && alias startx='startx ${XINITRC}' # directories alias \ @@ -41,7 +41,7 @@ alias \ gba='git branch -a' \ gbv='git branch -v' \ gca='git commit --amend' \ - gch='git checkout $@' \ + gch='git checkout' \ gcm='git commit -m' \ gd='git diff' \ gdc='git diff --cached' \ @@ -60,12 +60,12 @@ alias \ gstp='git stash pop' # dots -alias dots="/usr/bin/git --git-dir=${HOME}/.dots/ --work-tree=${HOME}" +alias dots='/usr/bin/git --git-dir=${HOME}/.dots/ --work-tree=${HOME}' # youtube alias \ - yt="youtube-dl -i -o \"${DOWNLOADS_DIR}/%(uploader)s/%(title)s.%(ext)s\" --add-metadata" \ + yt='youtube-dl -i -o \"${DOWNLOADS_DIR}/%(uploader)s/%(title)s.%(ext)s\" --add-metadata' \ yta='yt -f bestaudio/best -x' \ - ytp="youtube-dl -i -o \"${DOWNLOADS_DIR}/%(uploader)s/%(playlist_index)s-%(title)s.%(ext)s\" --add-metadata" \ + ytp='youtube-dl -i -o \"${DOWNLOADS_DIR}/%(uploader)s/%(playlist_index)s-%(title)s.%(ext)s\" --add-metadata' \ ytpa='ytp -f bestaudio/best -x' \ ytall='yt -cw -f best' diff --git a/.config/sh/functionrc b/.config/sh/functionrc @@ -2,5 +2,6 @@ # # functionrc -rands() { </dev/urandom tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c $1 ; echo ; } -shfm() { cd "$(command shfm "${@}")" ; } +f() { fff "${@}" && cd "$(cat "${XDG_CACHE_HOME:-${HOME}/.cache}/fff/.fff_d")" || exit ; } +s() { du -a "${HOME}" | awk '{ $1="" } { gsub("^ ", "", $0); print "\047" $0 "\047" }' | fzf | xargs -or xdg-open ; } +rands() { </dev/urandom tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c "${1}" ; echo ; } diff --git a/.config/sh/profile b/.config/sh/profile @@ -2,24 +2,18 @@ # # profile -# kiss linux path for repos -export KISS_PATH='' -KISS_PATH="${KISS_PATH}:${HOME}/repos/repo/core/" -KISS_PATH="${KISS_PATH}:${HOME}/repos/repo/extra/" -KISS_PATH="${KISS_PATH}:${HOME}/repos/repo/xorg/" -KISS_PATH="${KISS_PATH}:${HOME}/repos/community/community/" -KISS_PATH="${KISS_PATH}:${HOME}/repos/bin/bin/" - # add local scripts to path -export PATH="${PATH}:$(du "${HOME}/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" +PATH="${PATH}:$(du "${HOME}/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" +export PATH # programs export WM='dwm' -export STATUS_BAR='dwmblocks' +export BAR='dwmblocks' export MENU='dmenu_run -c -l 10' +export LOCKER='slock' export BROWSER='firefox' export TERMINAL='st' -export FILE_VIEWER='shfm' +export FILE_VIEWER='fff' export EDITOR='vim' export MUSIC_PLAYER='cmus' export MAIL_CLIENT='neomutt' @@ -53,16 +47,31 @@ export VIDEOS_DIR="${HOME}/vids/" export GNUPG="9CC4E75365C16465FFE752C94DDBF97211D4EA31" # colorful man pages -export LESS_TERMCAP_mb=$'\e[01;31m' -export LESS_TERMCAP_md=$'\e[01;38;5;74m' -export LESS_TERMCAP_me=$'\e[0m' -export LESS_TERMCAP_se=$'\e[0m' -export LESS_TERMCAP_so=$'\e[38;5;246m' -export LESS_TERMCAP_ue=$'\e[0m' -export LESS_TERMCAP_us=$'\e[04;38;5;146m' +LESS_TERMCAP_mb="$(printf '\e[01;31m')" +export LESS_TERMCAP_mb +LESS_TERMCAP_md="$(printf '\e[01;38;5;74m')" +export LESS_TERMCAP_md +LESS_TERMCAP_me="$(printf '\e[0m')" +export LESS_TERMCAP_me +LESS_TERMCAP_se="$(printf '\e[0m')" +export LESS_TERMCAP_se +LESS_TERMCAP_so="$(printf '\e[38;5;246m')" +export LESS_TERMCAP_so +LESS_TERMCAP_ue="$(printf '\e[0m')" +export LESS_TERMCAP_ue +LESS_TERMCAP_us="$(printf '\e[04;38;5;146m')" +export LESS_TERMCAP_us -# shfm opener -export SHFM_OPENER="${HOME}/.local/bin/open.sh" +# file explorer +export FFF_COL1=4 +export FFF_COL2=4 +export FFF_COL3=1 +export FFF_COL4=4 +export FFF_COL5=7 +export FFF_HIDDEN=1 +export FFF_LS_COLORS=1 +export FFF_OPENER="xdg-open" +export FFF_STAT_CMD="stat" # pash export PASH_KEYID="${GNUPG}" @@ -72,6 +81,11 @@ export PASH_DIR="${XDG_DATA_HOME:-${HOME}/.local/share}/pash/" export PASH_CLIP='xclip -sel c' export PASH_TIMEOUT=60 +# pfetch +export HOSTNAME='pc' +export PF_INFO='ascii title os host kernel uptime pkgs memory shell editor wm palette' +export PF_COL1=4 + # clean up export LESSHISTFILE=- diff --git a/.config/x/xprofile b/.config/x/xprofile @@ -2,7 +2,8 @@ # # xprofile -xrandr --output "DisplayPort-1" --mode "1920x1080" --rate "144" --primary -xset r rate 250 50 -feh --no-fehbg --bg-scale "${XDG_DATA_HOME:-${HOME}/.local/share}/wp" xrdb "${XDG_CONFIG_HOME:-${HOME}/.config}/x/xresources" +lock.sh & +"${BAR}" & +feh --no-fehbg --bg-scale "${XDG_DATA_HOME:-${HOME}/.local/share}/wp" +xset r rate 250 50 diff --git a/.config/x/xresources b/.config/x/xresources @@ -35,8 +35,8 @@ #define col15 #f8f8f2 ! dwm -dwm.font : monospace:size=18 -dwm.font2 : monospace:size=18 +dwm.font : monospace:size=16 +dwm.font2 : monospace:size=16 dwm.normbgcolor : col0 dwm.normbordercolor : col7 dwm.normfgcolor : col7 @@ -64,7 +64,7 @@ dwm.ulinevoffset : 0 dwm.ulineall : 0 ! dmenu -dmenu.font : monospace:size=18 +dmenu.font : monospace:size=16 dmenu.normfgcolor : col7 dmenu.normbgcolor : col0 dmenu.selfgcolor : col15 @@ -78,7 +78,7 @@ dmenu.border_width : 3 herbe.background_color : col0 herbe.border_color : col4 herbe.font_color : col7 -herbe.font_pattern : monospace:size=18 +herbe.font_pattern : monospace:size=16 herbe.line_spacing : 5 herbe.padding : 5 herbe.width : 350 @@ -96,11 +96,11 @@ slock.caps : col9 slock.failonclear : 1 slock.message : Type password to unlock slock.text_color : col7 -slock.font_name : monospace:size=18 +slock.font_name : monospace:size=16 ! st -st.font : monospace:size=18 -st.font2 : monospace:size=18 +st.font : monospace:size=16 +st.font2 : monospace:size=16 st.color0 : col0 st.color1 : col1 st.color2 : col2 diff --git a/.local/bin/lock.sh b/.local/bin/lock.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# lock + +SOCKETS_DIR="/tmp/mpv-sockets/" + +for socket in "${SOCKETS_DIR}"/*; do + [ -e "${socket}" ] || break + echo 'set pause yes' | socat - "${socket}"; +done + +[ -n "$(pgrep "${BROWSER}")" ] && pkill -STOP "${BROWSER}" + +"${LOCKER}" + +temp="$(mktemp)" + +jobs -p > "${temp}" + +wait < "${temp}" + +pkill -CONT "${BROWSER}" diff --git a/.local/share/wp b/.local/share/wp @@ -1 +1 @@ -/home/mc/pix/wp/out-of-this-world.jpg -\ No newline at end of file +/home/mc/pix/wp/retro-city.jpg +\ No newline at end of file