update
This commit is contained in:
parent
6f84d341bc
commit
6ad08b973b
3 changed files with 56 additions and 80 deletions
71
aliases.sh
71
aliases.sh
|
|
@ -1,27 +1,15 @@
|
|||
#!/bin/sh
|
||||
ALIASES_BLACK='\033[0;30m' # Black
|
||||
ALIASES_RED='\033[0;31m' # Red
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
ALIASES_GREEN='\033[0;32m' # Green
|
||||
ALIASES_YELLOW='\033[0;33m' # Yellow (or Brown)
|
||||
ALIASES_BLUE='\033[0;34m' # Blue
|
||||
ALIASES_MAGENTA='\033[0;35m' # Magenta
|
||||
ALIASES_CYAN='\033[0;36m' # Cyan
|
||||
ALIASES_LIGHT_GRAY='\033[0;37m' # Light Gray (or White)
|
||||
|
||||
ALIASES_DARK_GRAY='\033[1;30m' # Dark Gray
|
||||
ALIASES_LIGHT_RED='\033[1;31m' # Light Red
|
||||
ALIASES_LIGHT_GREEN='\033[1;32m' # Light Green
|
||||
ALIASES_LIGHT_YELLOW='\033[1;33m' # Light Yellow
|
||||
ALIASES_LIGHT_BLUE='\033[1;34m' # Light Blue
|
||||
ALIASES_LIGHT_MAGENTA='\033[1;35m' # Light Magenta
|
||||
ALIASES_LIGHT_CYAN='\033[1;36m' # Light Cyan
|
||||
ALIASES_WHITE='\033[1;37m' # White
|
||||
ALIASES_NC='\033[0m' # No Color
|
||||
|
||||
echo "Aliases added:"
|
||||
echo -e "${ALIASES_WHITE} cs venv"
|
||||
echo " n ns pc cdlf lfcd g gg gitknow disk-usage sx debug.log"
|
||||
echo " mc newsh smartresize"
|
||||
echo -e "${ALIASES_WHITE} cs pc venv cdlf lfcd"
|
||||
echo " e er et en ens ea ee"
|
||||
echo " g gg disk-usage debug.log"
|
||||
echo " backup update re mc"
|
||||
echo " mac red alice phthalo zirconia datapasa ultra kermit singsay pi4"
|
||||
echo -e " ${ALIASES_NC}client:${ALIASES_WHITE} crafty lv"
|
||||
echo -e "${ALIASES_NC}"
|
||||
|
|
@ -52,7 +40,6 @@ alias speak='/usr/local/src/kokora/speak'
|
|||
alias debug.log='clear && echo "" > debug.log && tail -f debug.log'
|
||||
alias g='git status'
|
||||
alias gg='git add . && git commit -m "update" && git push'
|
||||
alias gitknow='cd ~/knowledge-base && git add . && git status && git commit -m update && git push ; cd -'
|
||||
|
||||
alias ls='LC_COLLATE=C ls --color=auto -h --group-directories-first --time-style=+"%d.%m.%Y %H:%M" -F'
|
||||
|
||||
|
|
@ -99,49 +86,33 @@ else
|
|||
fi
|
||||
|
||||
cdlf() {
|
||||
cd "$(cat ~/.cache/lf-last-dir)"
|
||||
local last_dir
|
||||
[ -r "$HOME/.cache/lf-last-dir" ] || return 1
|
||||
IFS= read -r last_dir < "$HOME/.cache/lf-last-dir"
|
||||
[ -n "$last_dir" ] || return 1
|
||||
cd -- "$last_dir" || return
|
||||
}
|
||||
|
||||
lfcd() {
|
||||
lf -last-dir-path="$HOME"/.cache/lf-last-dir
|
||||
cdlf
|
||||
lf -last-dir-path="$HOME"/.cache/lf-last-dir && cdlf
|
||||
}
|
||||
|
||||
update() {
|
||||
echo -e "Executing \"${ALIASES_GREEN}pacman -Syu${ALIASES_NC}\" via \"${ALIASES_BLUE}archnews_wrap${ALIASES_NC}\" wrapper"
|
||||
|
||||
sudo ~/.src/archnews/archnews_wrap -Syu \
|
||||
&& systemctl --user start --no-block package-status-refresh.service
|
||||
}
|
||||
|
||||
# functions
|
||||
# $1 - output directory
|
||||
# $2 - size
|
||||
# $3 - filename
|
||||
smartresize() {
|
||||
mogrify -path "$3" -filter Triangle -define filter:support=2 -thumbnail "$2" -unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB "$1"
|
||||
sudo ~/.src/archnews/archnews_wrap -Syu || return
|
||||
systemctl --user start --no-block package-status-refresh.service >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
re() {
|
||||
git clone ssh://git@git.rayelliott.dev:3222/rayelliott/"$1".git $2
|
||||
if [ -n "${2:-}" ]; then
|
||||
git clone "ssh://git@git.rayelliott.dev:3222/rayelliott/$1.git" "$2"
|
||||
else
|
||||
git clone "ssh://git@git.rayelliott.dev:3222/rayelliott/$1.git"
|
||||
fi
|
||||
}
|
||||
|
||||
mc() {
|
||||
mkdir "$1" && cd "$1"
|
||||
}
|
||||
|
||||
newsh() {
|
||||
set -e
|
||||
|
||||
if [ -f "$1" ] ; then
|
||||
echo "Error: file exists: $1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "#!/bin/sh" > "$1"
|
||||
echo "" >> "$1"
|
||||
echo "$2" >> "$1"
|
||||
|
||||
chmod +x "$1"
|
||||
nvim "$1" +3
|
||||
mkdir "$1" || return
|
||||
cd "$1" || return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue