config/shell: texmex
This commit is contained in:
parent
81410fe313
commit
97024d9d97
|
@ -99,6 +99,7 @@ locate-zox() {
|
||||||
}
|
}
|
||||||
# Switch directory heuristically using zoxide and locate
|
# Switch directory heuristically using zoxide and locate
|
||||||
d() {
|
d() {
|
||||||
|
# TODO do not use expr, rather test, so there can be floats
|
||||||
test "$1" != "-" -a ! -d "$1" -a $# -eq 1 || { cd "$@" && return; }
|
test "$1" != "-" -a ! -d "$1" -a $# -eq 1 || { cd "$@" && return; }
|
||||||
local query="$(zoxide-list "$@")"
|
local query="$(zoxide-list "$@")"
|
||||||
# First find out whether there is an obvious match
|
# First find out whether there is an obvious match
|
||||||
|
@ -106,7 +107,7 @@ d() {
|
||||||
# which is not the current directory
|
# which is not the current directory
|
||||||
# If not select with fzf, using locate to find extra options
|
# If not select with fzf, using locate to find extra options
|
||||||
target="$(if test -n "$query" &&
|
target="$(if test -n "$query" &&
|
||||||
expr "$(echo "$query" | sed 's| \+\([^ ]\+\).*|\1|;q')" \> 20 \& \
|
echo "$(echo "$query" | sed 's| \+\([^ ]\+\).*|\1|;q')" \> 20 \& \
|
||||||
$(echo "$query" | sed 'N;s|/.* \([0-9]\+\)|> 10 * \1|;q' | sed 's| */.*||') >/dev/null &&
|
$(echo "$query" | sed 'N;s|/.* \([0-9]\+\)|> 10 * \1|;q' | sed 's| */.*||') >/dev/null &&
|
||||||
[[ ! "$(echo "$query" | head -1)" =~ ".*$PWD" ]]
|
[[ ! "$(echo "$query" | head -1)" =~ ".*$PWD" ]]
|
||||||
then echo "$query" | head -1
|
then echo "$query" | head -1
|
||||||
|
|
|
@ -262,7 +262,7 @@ curlh() {
|
||||||
|
|
||||||
u() {
|
u() {
|
||||||
# Line below handy for users of netkeeper
|
# Line below handy for users of netkeeper
|
||||||
sudo nft list ruleset | grep -q outall && echo "Suspending netkeeper" >&2 | echo sysupgrade | netkeeper 30 2>/dev/null
|
sudo nft list ruleset | grep -q outall && echo "Suspending netkeeper" >&2 | echo 'pausing netkeeper for sysupgrade' | netkeeper 30 2>/dev/null
|
||||||
if command -v pacman >/dev/null; then
|
if command -v pacman >/dev/null; then
|
||||||
if test "$(stat /etc/pacman.d/mirrorlist --printf=%y | cut -d'-' -f1-2)" != "$(date +%Y-%m)"
|
if test "$(stat /etc/pacman.d/mirrorlist --printf=%y | cut -d'-' -f1-2)" != "$(date +%Y-%m)"
|
||||||
then
|
then
|
||||||
|
@ -429,6 +429,9 @@ npm-reinstall() {
|
||||||
# Reconnect to ONKYO since it is buggy
|
# Reconnect to ONKYO since it is buggy
|
||||||
alias onkyo='bluetoothctl disconnect 00:09:B0:1D:DC:98 && sleep 1 && bluetoothctl connect 00:09:B0:1D:DC:98'
|
alias onkyo='bluetoothctl disconnect 00:09:B0:1D:DC:98 && sleep 1 && bluetoothctl connect 00:09:B0:1D:DC:98'
|
||||||
|
|
||||||
|
alias pdfcon='TEXMF="" pdfjam -o $(date +%F).pdf'
|
||||||
|
alias pdfwor='TEXMF="" pdfjam -o collections/$(date +%F)_Akkorde.pdf'
|
||||||
|
|
||||||
# Custom tools {{{1
|
# Custom tools {{{1
|
||||||
|
|
||||||
sedcomment() { sed -i "s/$1/#\0/" "${@:2}"; }
|
sedcomment() { sed -i "s/$1/#\0/" "${@:2}"; }
|
||||||
|
|
Loading…
Reference in New Issue