Shellcheck
This commit is contained in:
parent
092916966f
commit
71b9ace58a
|
@ -1,11 +1,11 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
NUM_DESKTOPS="$(xrq bspwm.num_desktops)"
|
NUM_DESKTOPS="$(xrq bspwm.num_desktops || echo '10')"
|
||||||
REVERSE_DESKTOP_ORDERING="$(xrq bspwm.reverse_desktop_ordering)"
|
REVERSE_DESKTOP_ORDERING="$(xrq bspwm.reverse_desktop_ordering)"
|
||||||
REVERSE_MONITOR_DESKTOPS="$(xrq bspwm.reverse_monitor_desktops)"
|
REVERSE_MONITOR_DESKTOPS="$(xrq bspwm.reverse_monitor_desktops)"
|
||||||
BSPWM_MONITORS=$(bspc query -M)
|
BSPWM_MONITORS=$(bspc query -M)
|
||||||
MONITOR_COUNT=$(echo "$BSPWM_MONITORS" | wc -w | awk '{ printf $1 }')
|
MONITOR_COUNT=$(echo "$BSPWM_MONITORS" | wc -w | awk '{ printf $1 }')
|
||||||
PER_MONITOR=$((NUM_DESKTOPS / MONITOR_COUNT))
|
PER_MONITOR="$(xrq bspwm.num_desktops_per_monitor || echo $((NUM_DESKTOPS / MONITOR_COUNT)))"
|
||||||
DESKTOPS=$(seq "$NUM_DESKTOPS")
|
DESKTOPS=$(seq "$NUM_DESKTOPS")
|
||||||
|
|
||||||
[ "$REVERSE_MONITOR_DESKTOPS" -eq 1 ] && BSPWM_MONITORS=$(echo "$BSPWM_MONITORS" | tac)
|
[ "$REVERSE_MONITOR_DESKTOPS" -eq 1 ] && BSPWM_MONITORS=$(echo "$BSPWM_MONITORS" | tac)
|
||||||
|
@ -26,11 +26,14 @@ bspc config remove_disabled_monitors true
|
||||||
bspc rule -a "*" split_dir=right
|
bspc rule -a "*" split_dir=right
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
|
total_screens=0
|
||||||
for mon in $BSPWM_MONITORS; do
|
for mon in $BSPWM_MONITORS; do
|
||||||
max=$((i + PER_MONITOR - 1))
|
max=$((i + PER_MONITOR - 1))
|
||||||
screens=""
|
screens=""
|
||||||
for j in $(seq $i $max); do
|
for j in $(seq $i $max); do
|
||||||
screens="${screens}${j} "
|
[[ "$total_screens" -ge "$NUM_DESKTOPS" ]] || screens="${screens}${j} "
|
||||||
|
total_screens=$((total_screens+1))
|
||||||
|
echo $NUM_DESKTOPS $total_screens $screens
|
||||||
done
|
done
|
||||||
bspc monitor "$mon" -d $screens
|
bspc monitor "$mon" -d $screens
|
||||||
i=$((max + 1))
|
i=$((max + 1))
|
||||||
|
|
|
@ -1,14 +1,2 @@
|
||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
feh --no-fehbg --bg-scale '/home/daniel/.home/.wallpaper'
|
||||||
feh --no-fehbg --bg-fill \
|
|
||||||
"${HOME}/.wallpaper" \
|
|
||||||
"${HOME}/.wallpaper2" \
|
|
||||||
"${HOME}/.wallpaper3" \
|
|
||||||
"${HOME}/.wallpaper4" \
|
|
||||||
"${HOME}/.wallpaper5" \
|
|
||||||
"${HOME}/.wallpaper6" \
|
|
||||||
"${HOME}/.wallpaper7" \
|
|
||||||
"${HOME}/.wallpaper8" \
|
|
||||||
"${HOME}/.wallpaper9" \
|
|
||||||
"${HOME}/.wallpaper_last" \
|
|
||||||
2>/dev/null
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
[ -f "$HOME/.xmodmap" ] && xmodmap "$HOME/.xmodmap"
|
[ -f "$HOME/.xmodmap" ] && xmodmap "$HOME/.xmodmap"
|
||||||
has_command libinput-gestures-setup && libinput-gestures-setup start
|
has_command libinput-gestures-setup && libinput-gestures-setup start
|
||||||
has_command autorandr && autorandr -c
|
has_command autorandr && autorandr -c
|
||||||
has_command redshift && redshift -r -l 39.1:-94.6 -t 6500K:3000K &
|
# has_command redshift && redshift -r -l 39.1:-94.6 -t 6500K:3000K &
|
||||||
has_command kdeconnect-indicator && kdeconnect-indicator &
|
has_command kdeconnect-indicator && kdeconnect-indicator &
|
||||||
|
|
||||||
has_command gnome-keyring-daemon && eval "$(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)"
|
has_command gnome-keyring-daemon && eval "$(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)"
|
||||||
|
|
|
@ -8,7 +8,7 @@ hide_kernel_threads=1
|
||||||
hide_userland_threads=1
|
hide_userland_threads=1
|
||||||
shadow_other_users=0
|
shadow_other_users=0
|
||||||
show_thread_names=0
|
show_thread_names=0
|
||||||
show_program_path=1
|
show_program_path=0
|
||||||
highlight_base_name=1
|
highlight_base_name=1
|
||||||
highlight_megabytes=1
|
highlight_megabytes=1
|
||||||
highlight_threads=1
|
highlight_threads=1
|
||||||
|
@ -24,4 +24,3 @@ left_meters=LeftCPUs2 Memory Swap
|
||||||
left_meter_modes=1 1 1
|
left_meter_modes=1 1 1
|
||||||
right_meters=RightCPUs2 Tasks LoadAverage Uptime
|
right_meters=RightCPUs2 Tasks LoadAverage Uptime
|
||||||
right_meter_modes=1 2 2 2
|
right_meter_modes=1 2 2 2
|
||||||
vim_mode=1
|
|
||||||
|
|
47
apps/mutt/rc
47
apps/mutt/rc
|
@ -1,33 +1,15 @@
|
||||||
# set imap_user = "wraithx2@gmail.com"
|
|
||||||
# set imap_pass = "`pass google | head -n 1`"
|
|
||||||
set realname = "Daniel Flanagan"
|
set realname = "Daniel Flanagan"
|
||||||
set from = "daniel@lytedev.io"
|
set from = "Daniel Flanagan <daniel@lyte.dev>"
|
||||||
set use_from = yes
|
set use_from = yes
|
||||||
set envelope_from = yes
|
set envelope_from = yes
|
||||||
|
set edit_headers = yes
|
||||||
|
|
||||||
|
set folder="~/../mail"
|
||||||
|
set sendmail="/usr/bin/esmtp"
|
||||||
set sidebar_visible
|
set sidebar_visible
|
||||||
set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
|
set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
|
||||||
set mail_check_stats
|
set mail_check_stats
|
||||||
|
|
||||||
set smtp_url = 'smtps://wraithx2@gmail.com@smtp.gmail.com:465/'
|
|
||||||
set smtp_pass = `pass google-app-password | head -n 1`
|
|
||||||
set imap_user = 'wraithx2@gmail.com'
|
|
||||||
set imap_pass = `pass google-app-password | head -n 1`
|
|
||||||
|
|
||||||
set mbox="imaps://imap.gmail.com/[Gmail]/All Mail"
|
|
||||||
|
|
||||||
set ssl_force_tls = yes
|
|
||||||
set folder = imaps://imap.gmail.com/
|
|
||||||
set spoolfile = +INBOX
|
|
||||||
# set record = "+[Gmail]/Sent Mail"
|
|
||||||
set postponed = "+[Gmail]/Drafts"
|
|
||||||
set editor = "nvim"
|
|
||||||
set timeout = 30
|
|
||||||
|
|
||||||
mailboxes =INBOX "=[Gmail]/All Mail" =[Gmail]/Sent\ Mail =[Gmail]/Drafts =[Gmail]/Spam =[Gmail]/Trash
|
|
||||||
|
|
||||||
set sort=reverse-date
|
|
||||||
|
|
||||||
bind index,pager \CD sync-mailbox
|
bind index,pager \CD sync-mailbox
|
||||||
bind index,pager \CP sidebar-prev
|
bind index,pager \CP sidebar-prev
|
||||||
bind index,pager \CN sidebar-next
|
bind index,pager \CN sidebar-next
|
||||||
|
@ -37,8 +19,6 @@ bind index,pager \CB sidebar-toggle-visible
|
||||||
bind pager g top
|
bind pager g top
|
||||||
bind pager G bottom
|
bind pager G bottom
|
||||||
|
|
||||||
# bind pager j top
|
|
||||||
# bind pager j top
|
|
||||||
bind pager \Cu half-up
|
bind pager \Cu half-up
|
||||||
bind pager \Cd half-down
|
bind pager \Cd half-down
|
||||||
bind pager k half-up
|
bind pager k half-up
|
||||||
|
@ -51,25 +31,6 @@ bind attach,index G last-entry
|
||||||
|
|
||||||
set header_cache = "~/.cache/mutt/headers"
|
set header_cache = "~/.cache/mutt/headers"
|
||||||
set message_cachedir = "~/.cache/mutt/bodies"
|
set message_cachedir = "~/.cache/mutt/bodies"
|
||||||
|
|
||||||
macro index,pager A s><return>y
|
macro index,pager A s><return>y
|
||||||
|
|
||||||
# C-R to get mail
|
|
||||||
bind index \CR imap-fetch-mail
|
bind index \CR imap-fetch-mail
|
||||||
|
|
||||||
# bind index g noop
|
|
||||||
# macro index ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
|
|
||||||
# macro index gd "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts"
|
|
||||||
# macro index gi "<change-folder>=INBOX<enter>" "Go to inbox"
|
|
||||||
# macro index gs "<change-folder>=[Gmail]/Starred<enter>" "Go to starred messages"
|
|
||||||
# macro index gt "<change-folder>=[Gmail]/Trash<enter>" "Go to trash"
|
|
||||||
# macro index,pager d "<save-message>=[Gmail]/Trash<enter><enter>" "Trash"
|
|
||||||
# macro index,pager y "<save-message>=[Gmail]/All Mail<enter><enter>" "Archive"
|
|
||||||
|
|
||||||
set record=""
|
set record=""
|
||||||
|
|
||||||
# bulk operations
|
|
||||||
# T - tag messages matching... [type in regex]
|
|
||||||
# ; - perform command on tagged messages
|
|
||||||
# <command> - A to archive!
|
|
||||||
|
|
||||||
|
|
|
@ -95,4 +95,5 @@ Plug 'google/vim-jsonnet', {'for': ['jsonnet', 'libsonnet']} " jsonnet
|
||||||
Plug 'sirtaj/vim-openscad', {'for': ['scad']} " openscad
|
Plug 'sirtaj/vim-openscad', {'for': ['scad']} " openscad
|
||||||
Plug 'jjo/vim-cue'
|
Plug 'jjo/vim-cue'
|
||||||
Plug 'chrisbra/csv.vim'
|
Plug 'chrisbra/csv.vim'
|
||||||
|
Plug 'calviken/vim-gdscript3', {'for': ['gdscript']} " godot scripts
|
||||||
" Plug 'ssh://git@git.lyte.dev:2222/lytedev/vim-lytlang.git'
|
" Plug 'ssh://git@git.lyte.dev:2222/lytedev/vim-lytlang.git'
|
||||||
|
|
|
@ -126,6 +126,7 @@ alias pbcopy="clip"
|
||||||
alias pt="htop -t" # experimental htop tree-view-by-default
|
alias pt="htop -t" # experimental htop tree-view-by-default
|
||||||
alias resrc="source \$HOME/.bashrc"
|
alias resrc="source \$HOME/.bashrc"
|
||||||
alias redshift="redshift -r -l 39.0997:-94.5786 -t 6500K:2500K"
|
alias redshift="redshift -r -l 39.0997:-94.5786 -t 6500K:2500K"
|
||||||
|
alias noredshift="killall redshift; redshift -P -O 5700"
|
||||||
alias gpmdpe="electron --app=/usr/share/gpmdp/resources/app.asar"
|
alias gpmdpe="electron --app=/usr/share/gpmdp/resources/app.asar"
|
||||||
alias t="task"
|
alias t="task"
|
||||||
alias sc="sc-im"
|
alias sc="sc-im"
|
||||||
|
|
|
@ -154,6 +154,7 @@ alias pbcopy "clip"
|
||||||
alias pt "htop -t" # experimental htop tree-view-by-default
|
alias pt "htop -t" # experimental htop tree-view-by-default
|
||||||
alias resrc "source $XDG_CONFIG_HOME/fish/config.fish"
|
alias resrc "source $XDG_CONFIG_HOME/fish/config.fish"
|
||||||
alias redshift "redshift -r -l 39.0997:-94.5786 -t 6500K:2500K"
|
alias redshift "redshift -r -l 39.0997:-94.5786 -t 6500K:2500K"
|
||||||
|
alias noredshift "killall redshift; redshift -P -O 5700"
|
||||||
alias gpmdpe "electron --app=/usr/share/gpmdp/resources/app.asar"
|
alias gpmdpe "electron --app=/usr/share/gpmdp/resources/app.asar"
|
||||||
alias t "task"
|
alias t "task"
|
||||||
alias sc "sc-im"
|
alias sc "sc-im"
|
||||||
|
|
3
bin/N
3
bin/N
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
fn="${1}"; shift
|
fn="${1}"; shift; nf "${fn}.md" "$@"
|
||||||
nf "${fn}.md" $*
|
|
||||||
|
|
6
bin/b
6
bin/b
|
@ -4,11 +4,11 @@ bbin="bible" # npm i -g bible
|
||||||
pbin="less"
|
pbin="less"
|
||||||
|
|
||||||
# bible args
|
# bible args
|
||||||
bargs=""
|
bargs=("")
|
||||||
|
|
||||||
# pager args
|
# pager args
|
||||||
pargs="-R"
|
pargs="-R"
|
||||||
|
|
||||||
[ "$1" = "s" ] && bargs="$bargs --search" && shift
|
[[ $1 = s ]] && { bargs+=("--search"); shift; }
|
||||||
|
|
||||||
"${bbin}" $bargs "$*" | "${pbin}" $pargs
|
"${bbin}" "${bargs[@]}" "$*" | "${pbin}" $pargs
|
||||||
|
|
2
bin/cdp
2
bin/cdp
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# TODO: needs fixing...?
|
# TODO: needs fixing...?
|
||||||
cd "$(dirname "$(fzf)")"
|
cd "$(dirname "$(fzf)")" || exit 1
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
if [[ $1 = t ]] || [[ $1 = tcp ]] || \
|
if [[ $1 = t ]] || [[ $1 = tcp ]] || \
|
||||||
[[ $1 = T ]] || [[ $1 = TCP ]]; then
|
[[ $1 = T ]] || [[ $1 = TCP ]]; then
|
||||||
echo "TCP is the default. You don't need to specify it."
|
echo "TCP is the default. You don't need to specify it." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ if [[ $1 = u ]] || [[ $1 = udp ]] || \
|
||||||
[[ $1 = U ]] || [[ $1 = UDP ]]; then
|
[[ $1 = U ]] || [[ $1 = UDP ]]; then
|
||||||
shift
|
shift
|
||||||
set -x
|
set -x
|
||||||
sudo nmap -sU $1 -p $2
|
sudo nmap -sU "$1" -p "$2"
|
||||||
else
|
else
|
||||||
set -x
|
set -x
|
||||||
nmap $1 -p $2
|
nmap "$1" -p "$2"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -49,23 +49,26 @@ fi
|
||||||
|
|
||||||
# main function
|
# main function
|
||||||
check_domain() {
|
check_domain() {
|
||||||
|
local tmp
|
||||||
|
local domain
|
||||||
|
|
||||||
if [ "$#" == "0" ]; then
|
if [ "$#" == "0" ]; then
|
||||||
echo "No domain specified."
|
echo "No domain specified."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local domain="$1"
|
domain="$1"
|
||||||
|
|
||||||
# create a unique temporary file
|
# create a unique temporary file
|
||||||
local tmp=$(mktemp "${domain}_XXX")
|
tmp=$(mktemp "${domain}_XXX")
|
||||||
|
|
||||||
# dump whois output into temp file
|
# dump whois output into temp file
|
||||||
whois "$domain" > "$tmp" 2>&1
|
whois "$domain" > "$tmp" 2>&1
|
||||||
|
|
||||||
# check contents and output appropriately
|
# check contents and output appropriately
|
||||||
if egrep -q "$AVAIL_REGEX" "$tmp" > /dev/null 2>&1; then
|
if grep -E -q "$AVAIL_REGEX" "$tmp" > /dev/null 2>&1; then
|
||||||
echo -e "$COLOR_GREEN$domain / probably available$COLOR_RESET"
|
echo -e "$COLOR_GREEN$domain / probably available$COLOR_RESET"
|
||||||
elif egrep -q "$TIMEOUT_REGEX" "$tmp" > /dev/null 2>&1; then
|
elif grep -E -q "$TIMEOUT_REGEX" "$tmp" > /dev/null 2>&1; then
|
||||||
echo -e "$COLOR_YELLOW$domain / timed out$COLOR_RESET"
|
echo -e "$COLOR_YELLOW$domain / timed out$COLOR_RESET"
|
||||||
else
|
else
|
||||||
echo -e "$COLOR_RED$domain / unavailable$COLOR_RESET"
|
echo -e "$COLOR_RED$domain / unavailable$COLOR_RESET"
|
||||||
|
@ -79,7 +82,7 @@ check_domain() {
|
||||||
# concurrently
|
# concurrently
|
||||||
elements=${#DOMAINS[@]}
|
elements=${#DOMAINS[@]}
|
||||||
while (( "$#" )); do
|
while (( "$#" )); do
|
||||||
for (( i=0;i<${elements};i++ )); do
|
for (( i=0;i<elements;i++ )); do
|
||||||
check_domain "$1${DOMAINS[${i}]}" &
|
check_domain "$1${DOMAINS[${i}]}" &
|
||||||
done
|
done
|
||||||
shift
|
shift
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
d=$((`date +%s` + $1));
|
d=$(($(date +%s) + $1));
|
||||||
echo "Countdown started $(date)"
|
echo "Countdown started at $(date)"
|
||||||
|
|
||||||
while [ "$d" -ge $(date +%s) ]; do
|
while [[ "$d" -ge "$(date +%s)" ]]; do
|
||||||
_dt=$(($d - `date +%s`))
|
_dt=$((d - $(date +%s)))
|
||||||
days=$((_dt / 86400))
|
days=$((_dt / 86400))
|
||||||
echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) ";
|
echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) ";
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
|
2
bin/dns
2
bin/dns
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
getent hosts $*
|
getent hosts "$@"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
SCROT_DIR="$NICE_HOME/img/scrots/"
|
scrot_dir="$NICE_HOME/img/scrots/"
|
||||||
LATEST_SCROT="$(\ls -Art "${SCROT_DIR}" | tail -n 1)"
|
# shellcheck disable=SC2012
|
||||||
krita "${SCROT_DIR}${LATEST_SCROT}"
|
latest_scrot="$(\ls -Art "${scrot_dir}" | tail -n 1)"
|
||||||
|
krita "${scrot_dir}${latest_scrot}"
|
||||||
|
|
|
@ -5,12 +5,12 @@ err() {
|
||||||
errpost=""
|
errpost=""
|
||||||
if test -t 1; then
|
if test -t 1; then
|
||||||
ncolors=$(tput colors)
|
ncolors=$(tput colors)
|
||||||
if test -n "$ncolors" && test $ncolors -ge 8; then
|
if test -n "$ncolors" && test "$ncolors" -ge 8; then
|
||||||
errpre="$(tput setaf 1)"
|
errpre="$(tput setaf 1)"
|
||||||
errpost="$(tput setaf 7)"
|
errpost="$(tput setaf 7)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
>&2 echo "${errpre}ERROR: $@${errpost}"; usage; exit 1
|
>&2 echo "${errpre}ERROR: $*${errpost}"; usage; exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
warn() {
|
warn() {
|
||||||
|
@ -18,12 +18,12 @@ warn() {
|
||||||
post=""
|
post=""
|
||||||
if test -t 1; then
|
if test -t 1; then
|
||||||
ncolors=$(tput colors)
|
ncolors=$(tput colors)
|
||||||
if test -n "$ncolors" && test $ncolors -ge 8; then
|
if test -n "$ncolors" && test "$ncolors" -ge 8; then
|
||||||
pre="$(tput setaf 3)"
|
pre="$(tput setaf 3)"
|
||||||
post="$(tput setaf 7)"
|
post="$(tput setaf 7)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
>&2 echo "${pre}WARNING: $@${post}"
|
>&2 echo "${pre}WARNING: $*${post}"
|
||||||
}
|
}
|
||||||
|
|
||||||
usage() { >&2 cat <<USAGEDOC
|
usage() { >&2 cat <<USAGEDOC
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
gawk '{print $'${1:-1}'}'
|
has_command gawk || ( echo "No gawk."; exit 1 )
|
||||||
|
index="${1:-1}"; shift; gawk '{print $'"${index}"'}' "$@"
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
op="${1:--c}"; shift &>/dev/null
|
|
||||||
cd ~/.password-store || ( echo "Could not cd to ~/.password-store" && exit 1 )
|
|
||||||
r="$(< "$HOME/.emoji.txt" fzf --height 40%)"
|
r="$(< "$HOME/.emoji.txt" fzf --height 40%)"
|
||||||
echo "Selected $r (it's in your clipboard)"
|
echo "$r" | awk '$0=$1' | tr -d '\n' | clip
|
||||||
<<< $r awk '$0=$1' | tr -d '\n' | clip
|
echo "Copied $r emoji to your clipboard"
|
||||||
cd - || return 1
|
|
||||||
|
|
6
bin/fzfp
6
bin/fzfp
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
op="${1:--c}"; shift &>/dev/null
|
op="${1:--c}"; shift >&2 2>/dev/null
|
||||||
cd ~/.password-store || ( echo "Could not cd to ~/.password-store" && exit 1 )
|
cd ~/.password-store || { echo "Could not cd to ~/.password-store"; exit 1; }
|
||||||
pp="$(fd gpg | sd ".gpg" "" | fzf --height 40%)"
|
pp="$(fd gpg | sd ".gpg" "" | fzf --height 40%)"
|
||||||
echo pass $op $pp
|
echo "pass $op $pp"
|
||||||
pass "$op" "$@" "$pp"
|
pass "$op" "$@" "$pp"
|
||||||
cd - || return 1
|
cd - || return 1
|
||||||
|
|
4
bin/grb
4
bin/grb
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
MAIN_BRANCH="master"
|
MAIN_BRANCH="master"
|
||||||
CUR_BRANCH="$(git branch | grep '\*' | cut -d ' ' -f2-)"
|
CUR_BRANCH="$(git branch | grep '\*' | cut -d ' ' -f2-)"
|
||||||
if [[ ! -z ${2+x} ]]; then
|
if [[ -n ${2+x} ]]; then
|
||||||
MAIN_BRANCH="$2"
|
MAIN_BRANCH="$2"
|
||||||
CUR_BRANCH="$1"
|
CUR_BRANCH="$1"
|
||||||
elif [[ ! -z ${1+x} ]]; then
|
elif [[ -n ${1+x} ]]; then
|
||||||
MAIN_BRANCH="$1"
|
MAIN_BRANCH="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
[ "$#" -lt 1 ] && { echo "No arguments provided" >&2 ; exit 1; }
|
||||||
command -v "$1" >/dev/null 2>&1
|
command -v "$1" >/dev/null 2>&1
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
[ "$#" -lt 1 ] && echo "Need a filename." && exit 1
|
[ "$#" -lt 1 ] && echo "Need a filename." && exit 1
|
||||||
cat "$1" | yq -s . | jq -S '
|
< "$1" yq -s . | jq -S '
|
||||||
sort_by(.metadata.name) |
|
sort_by(.metadata.name) |
|
||||||
sort_by(.kind) |
|
sort_by(.kind) |
|
||||||
.[] | .spec.template.spec.containers |=
|
.[] | .spec.template.spec.containers |=
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [[ ! -z "${1+x}" ]]; then
|
if [[ -n "${1+x}" ]]; then
|
||||||
while read r; do
|
while read -r line; do
|
||||||
<<< "${r}" "$@"
|
<<< "${line}" "$@"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "No reader program provided."
|
echo "No reader program provided."
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
f="$1"; shift
|
f="$1"; shift; . source_if_exists "$ENV_PATH/$f" "$@"
|
||||||
. source_if_exists "$ENV_PATH/$f" "$@"
|
|
||||||
|
|
3
bin/n
3
bin/n
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
fn="${1}"; shift
|
fn="${1}"; shift; N "$(date +%Y-%m-%d)_${fn}" "$@"
|
||||||
N "$(date +%Y-%m-%d)_${fn}" $*
|
|
||||||
|
|
3
bin/nd
3
bin/nd
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
fn="${1}"; shift
|
fn="${1}"; shift; N "$(date +%Y-%m-%d)_${fn}" "$@"
|
||||||
N "$(date +%Y-%m-%d)_${fn}" $*
|
|
||||||
|
|
|
@ -15,4 +15,4 @@ mogrify \
|
||||||
-define png:exclude-chunk=all \
|
-define png:exclude-chunk=all \
|
||||||
-interlace none \
|
-interlace none \
|
||||||
-colorspace sRGB \
|
-colorspace sRGB \
|
||||||
$1
|
"$1"
|
||||||
|
|
|
@ -8,6 +8,7 @@ if [ -n "${1+x}" ]; then
|
||||||
mkdir -p "$pdir"
|
mkdir -p "$pdir"
|
||||||
if [ -z ${1+x} ]; then
|
if [ -z ${1+x} ]; then
|
||||||
td="$(mktemp -p "$pdir" -d "tmp_pipeline.XXXXXXXX")"
|
td="$(mktemp -p "$pdir" -d "tmp_pipeline.XXXXXXXX")"
|
||||||
|
# shellcheck disable=SC2064
|
||||||
trap "rm -rf '$td'" EXIT
|
trap "rm -rf '$td'" EXIT
|
||||||
else
|
else
|
||||||
td="$pdir/$1"; shift
|
td="$pdir/$1"; shift
|
||||||
|
@ -17,6 +18,7 @@ if [ -n "${1+x}" ]; then
|
||||||
else
|
else
|
||||||
td="$(mktemp --tmpdir -d pipeline.XXXXXXXX)"
|
td="$(mktemp --tmpdir -d pipeline.XXXXXXXX)"
|
||||||
transform="$td/transform"
|
transform="$td/transform"
|
||||||
|
# shellcheck disable=SC2064
|
||||||
trap "rm -rf '$td'" EXIT
|
trap "rm -rf '$td'" EXIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -36,4 +38,4 @@ chmod +x "$transform"
|
||||||
# TODO: saved inputs?
|
# TODO: saved inputs?
|
||||||
echo "Hello World" > "$in"
|
echo "Hello World" > "$in"
|
||||||
|
|
||||||
env PIPELINE_IN="$id" PIPELINE_TRANSFORM="$transform" PIPELINE_OUT="$out" nvim --cmd "source $DOTFILES_PATH/apps/neovim/scripts/pipeline.vim"
|
env PIPELINE_IN="$in" PIPELINE_TRANSFORM="$transform" PIPELINE_OUT="$out" nvim --cmd "source $DOTFILES_PATH/apps/neovim/scripts/pipeline.vim"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
export GITHUB_UPSTREAM="$(git remote -vv | awk '{$0=$2}')"
|
GITHUB_UPSTREAM="$(git remote -vv | awk '{$0=$2}')"
|
||||||
|
|
||||||
git log --merges --ancestry-path --oneline $1..master \
|
git log --merges --ancestry-path --oneline "$1"..master \
|
||||||
| grep -i 'pull request' \
|
| grep -i 'pull request' \
|
||||||
| tail -n1 \
|
| tail -n1 \
|
||||||
| awk '{$0=$5}' \
|
| awk '{$0=$5}' \
|
||||||
| cut -c2- \
|
| cut -c2- \
|
||||||
| xargs -I % open https://github.com/$GITHUB_UPSTREAM/${PWD##*/}/pull/%
|
| xargs -I % open https://github.com/"$GITHUB_UPSTREAM"/"${PWD##*/}"/pull/%
|
||||||
|
|
|
@ -16,4 +16,5 @@ NICE_HOME="$HOME"
|
||||||
[ -e "${ENV_PATH}/.nice_home" ] && NICE_HOME="$(cat "${ENV_PATH}/.nice_home")"
|
[ -e "${ENV_PATH}/.nice_home" ] && NICE_HOME="$(cat "${ENV_PATH}/.nice_home")"
|
||||||
export NICE_HOME
|
export NICE_HOME
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090
|
||||||
. "$DOTFILES_PATH/bin/paths"
|
. "$DOTFILES_PATH/bin/paths"
|
||||||
|
|
4
bin/scn
4
bin/scn
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
EDITOR="sc-im" nf $*
|
EDITOR="sc-im" nf "$@"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
f="$1"; shift
|
[ "$#" -lt 1 ] && { echo "No arguments provided" >&2 ; exit 1; }
|
||||||
[ -f "$f" ] && . "$f" "$@"
|
[ "$#" -gt 1 ] && { echo "Too many arguments provided" >&2 ; exit 2; }
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
{ [ -f "$1" ] && . "$1"; } || { echo "$1 does not exist" >&2 ; exit 3; }
|
||||||
|
|
2
bin/sw
2
bin/sw
|
@ -4,7 +4,7 @@ d="$(date +%s)"
|
||||||
echo "Stopwatch started $(date)"
|
echo "Stopwatch started $(date)"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
_dt=$((`date +%s` - d))
|
_dt=$(($(date +%s) - d))
|
||||||
days=$((_dt / 86400))
|
days=$((_dt / 86400))
|
||||||
echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) "
|
echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) "
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
. ~/.config/dotfiles/bin/prelude
|
|
||||||
|
|
||||||
echo "${USER_LOGS_PATH}"
|
echo "${USER_LOGS_PATH}"
|
||||||
|
|
||||||
sess="$1"; shift
|
sess="$1"; shift
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ANY_SESSION_PREFIX="#[bg=colour18]#[fg=colour7]"
|
ANY_SESSION_PREFIX="#[bg=colour18]#[fg=colour7]"
|
||||||
CUR_SESSION_PREFIX="#[bg=colour4]#[fg=colour0]"
|
|
||||||
URG_SESSION_PREFIX="#[bg=colour1]#[fg=colour0]"
|
|
||||||
ANY_SESSION_SUFFIX="#[bg=default]#[fg=default] "
|
ANY_SESSION_SUFFIX="#[bg=default]#[fg=default] "
|
||||||
URG_SESSION_SUFFIX="${ANY_SESSION_SUFFIX}"
|
CUR_SESSION_PREFIX="#[bg=colour4]#[fg=colour0]"
|
||||||
CUR_SESSION_SUFFIX="${ANY_SESSION_SUFFIX}"
|
CUR_SESSION_SUFFIX="${ANY_SESSION_SUFFIX}"
|
||||||
|
# TODO: implement urgent session highlighting
|
||||||
|
# URG_SESSION_SUFFIX="${ANY_SESSION_SUFFIX}"
|
||||||
|
# URG_SESSION_PREFIX="#[bg=colour1]#[fg=colour0]"
|
||||||
|
|
||||||
CUR_TMUX_SESSION="$1"
|
CUR_TMUX_SESSION="$1"
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
@ -26,4 +27,5 @@ if(s==curSesh){
|
||||||
s=aspre" "s" "assuf
|
s=aspre" "s" "assuf
|
||||||
}printf s}')"
|
}printf s}')"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2001
|
||||||
echo "${TMUX_SESSION_LIST//\s*$/}" | sed -e 's/\s*$//'
|
echo "${TMUX_SESSION_LIST//\s*$/}" | sed -e 's/\s*$//'
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
archive_name="${1}"; shift
|
archive_name="${1}"; shift
|
||||||
to_dir="$(basename $archive_name)"
|
to_dir="$(basename "$archive_name")"
|
||||||
mkdir -p "${to_dir}"
|
mkdir -p "${to_dir}"
|
||||||
pushd "${to_dir}"
|
pushd "${to_dir}" || ( echo "${to_dir} does not exist" ; exit 1 )
|
||||||
tar --zstd -xvf "${archive_name}"
|
tar --zstd -xvf "${archive_name}"
|
||||||
echo "Unarchived to: ${to_dir}"
|
echo "Unarchived to: ${to_dir}"
|
||||||
popd
|
popd || exit 2
|
||||||
|
|
|
@ -21,6 +21,7 @@ fi
|
||||||
ssh ld mkdir -p "${internal_dir}"
|
ssh ld mkdir -p "${internal_dir}"
|
||||||
rsync --progress --no-owner --no-group --no-perms --stats --ignore-existing "${f}" "${HOST}:${internal_dir}/${fname}" | tee "${HOME}/.upload.log"
|
rsync --progress --no-owner --no-group --no-perms --stats --ignore-existing "${f}" "${HOST}:${internal_dir}/${fname}" | tee "${HOME}/.upload.log"
|
||||||
code="$?"
|
code="$?"
|
||||||
|
# shellcheck disable=SC2029
|
||||||
ssh ld chmod a+r "${internal_dir}/${fname}"
|
ssh ld chmod a+r "${internal_dir}/${fname}"
|
||||||
echo "Uploaded to: ${url}"
|
echo "Uploaded to: ${url}"
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ if ! pushd "$repo_root" &> /dev/null; then
|
||||||
echo "Repo doesn't exist!"
|
echo "Repo doesn't exist!"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
td="$(mktemp -p "$pdir" -d "vdiff.XXXXXXXX")"
|
td="$(mktemp -d "vdiff.XXXXXXXX")"
|
||||||
trap "rm -rf \"$td\"" EXIT
|
trap 'rm -rf '"$td" EXIT
|
||||||
files="$(git diff --name-only "$@")"
|
files="$(git diff --name-only "$@")"
|
||||||
|
|
||||||
args=()
|
args=()
|
||||||
|
@ -23,8 +23,8 @@ for f in $files; do
|
||||||
echo "<FILE CREATED>" > "$d/$fn"
|
echo "<FILE CREATED>" > "$d/$fn"
|
||||||
cp "$f" "$d/$cfn" 2>/dev/null || echo "<FILE DELETED>" > "$d/$cfn"
|
cp "$f" "$d/$cfn" 2>/dev/null || echo "<FILE DELETED>" > "$d/$cfn"
|
||||||
|
|
||||||
if [ -z "$args" ]; then
|
if [ -z "${args[0]}" ]; then
|
||||||
args+=($d/$fn -c)
|
args+=("$d/$fn -c")
|
||||||
vcmd="vert diffsplit $d/$cfn"
|
vcmd="vert diffsplit $d/$cfn"
|
||||||
else
|
else
|
||||||
vcmd="$vcmd | tabnew | e $d/$fn | vert diffsplit $d/$cfn"
|
vcmd="$vcmd | tabnew | e $d/$fn | vert diffsplit $d/$cfn"
|
||||||
|
|
4
bin/vman
4
bin/vman
|
@ -4,5 +4,5 @@
|
||||||
# `asmanviewer` variable, so launch vim that way when using vim as our man
|
# `asmanviewer` variable, so launch vim that way when using vim as our man
|
||||||
# page viewer
|
# page viewer
|
||||||
|
|
||||||
"$EDITOR" --cmd "let asmanviewer=1" -c "SuperMan $*"
|
"$EDITOR" --cmd "let asmanviewer=1" -c "SuperMan $*" || \
|
||||||
[ "$?" != "0" ] && echo "No manual entry for $*" && exit 1
|
( echo "No manual entry for $*" && exit 1 )
|
||||||
|
|
4
env/desktop/sway/config.d/main
vendored
4
env/desktop/sway/config.d/main
vendored
|
@ -1,3 +1,3 @@
|
||||||
output HDMI-A-1 res 2560x1440@60Hz pos 0 0
|
output DP-1 res 3440x1440@100Hz pos 0 0
|
||||||
|
output HDMI-A-1 res 2560x1440@60Hz pos 3440 -720
|
||||||
output HDMI-A-1 transform 270
|
output HDMI-A-1 transform 270
|
||||||
output DP-1 res 3440x1440@100Hz pos 1440 1120
|
|
||||||
|
|
3
env/desktop/x/resources
vendored
3
env/desktop/x/resources
vendored
|
@ -1,7 +1,8 @@
|
||||||
#define bar_font_size 12
|
#define bar_font_size 12
|
||||||
# TODO: this needs fixing
|
# TODO: this needs fixing
|
||||||
polybar.primary_font: iosevka\-lyte:pixelsize=bar_font_size;1
|
polybar.primary_font: iosevka\-lyte:pixelsize=bar_font_size;1
|
||||||
|
bspwm.num_desktops_per_monitor: 8
|
||||||
bspwm.reverse_desktop_ordering: 0
|
bspwm.reverse_desktop_ordering: 0
|
||||||
bspwm.reverse_monitor_desktops: 1
|
bspwm.reverse_monitor_desktops: 0
|
||||||
polybar.display_monitor: DisplayPort-0
|
polybar.display_monitor: DisplayPort-0
|
||||||
polybar.height: 40
|
polybar.height: 40
|
||||||
|
|
Reference in a new issue