config: Update aliases & set theme default to dark

This commit is contained in:
xerus2000 2020-09-19 09:34:47 +02:00
parent 34a5261eed
commit 52d427b103
4 changed files with 17 additions and 9 deletions

View File

@ -91,6 +91,8 @@
ready = rebase -i @{u} ready = rebase -i @{u}
format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop
sm = !git submodule init && git submodule update
# yadm # yadm
add-git = !git add $XDG_CONFIG_HOME/git/config $CONFIG_SHELLS/git add-git = !git add $XDG_CONFIG_HOME/git/config $CONFIG_SHELLS/git
add-vim = !git add $XDG_CONFIG_HOME/nvim/init* add-vim = !git add $XDG_CONFIG_HOME/nvim/init*

View File

@ -49,6 +49,7 @@ cd() { builtin cd "$@" && command ls --file-type --group-directories-first --col
# Task management & time tracking # Task management & time tracking
alias t='task' alias t='task'
alias tl='tasklite'
alias tw='timew' alias tw='timew'
twsm() { timew summary $(date --date="Monday $1 week ago" -I) to tomorrow :ids ${@:2} } twsm() { timew summary $(date --date="Monday $1 week ago" -I) to tomorrow :ids ${@:2} }
alias twtest='( TIMEWARRIORDB=/tmp/timewarriordb && rm -rf ${TIMEWARRIORDB} && mkdir -p ${TIMEWARRIORDB}/data && :> ${TIMEWARRIORDB}/timewarrior.cfg && $SHELL )' alias twtest='( TIMEWARRIORDB=/tmp/timewarriordb && rm -rf ${TIMEWARRIORDB} && mkdir -p ${TIMEWARRIORDB}/data && :> ${TIMEWARRIORDB}/timewarrior.cfg && $SHELL )'
@ -74,6 +75,8 @@ alias vlch="vlc -H | ${PAGER:-less}"
alias sc='sudo systemctl' alias sc='sudo systemctl'
alias scrw='sudo systemctl restart display-manager' alias scrw='sudo systemctl restart display-manager'
alias drag='dragon -x -a'
alias grp='grep --line-number --ignore-case --binary-files=without-match' alias grp='grep --line-number --ignore-case --binary-files=without-match'
alias grpr='grp --recursive' alias grpr='grp --recursive'
# Use grep and sed to replace $1 with $2 recursively # Use grep and sed to replace $1 with $2 recursively
@ -123,8 +126,9 @@ mozedit() (
cat "$tmpfile2" | sed "$2" | lz4 -l | dd bs=1 skip=8 seek=12 of="$file" conv=notrunc cat "$tmpfile2" | sed "$2" | lz4 -l | dd bs=1 skip=8 seek=12 of="$file" conv=notrunc
) )
theme_save="/tmp/theme" theme_save="$XDG_CACHE_HOME/theme"
theme_default="$(d=$(date +%H) && test $d -gt 7 && test $d -lt 19 && echo light || echo dark)" #theme_default="$(d=$(date +%H) && test $d -gt 7 && test $d -lt 19 && echo light || echo dark)"
theme_default="dark"
theme() { theme() {
theme="$1" theme="$1"
if test "$2" = "kde" if test "$2" = "kde"
@ -220,7 +224,7 @@ b() {
arg=$(test $# -gt 0 && echo "${@: -1}" || echo .) arg=$(test $# -gt 0 && echo "${@: -1}" || echo .)
file $arg | grep -v --color=never directory file $arg | grep -v --color=never directory
case "$(file --dereference $arg)" in case "$(file --dereference $arg)" in
*directory) ls -l --all --human-readable --dereference-command-line "$@";; *directory) ls -l --almost-all --human-readable --group-directories-first --file-type --dereference-command-line "$@";;
*text*) bat --style=numbers "$@";; *text*) bat --style=numbers "$@";;
esac esac
} }

View File

@ -35,7 +35,7 @@ projects() {
# Builds all found gradle projects in parallel and then prints the results in batches - WARNING: This is likely to considerably slow down your computer! # Builds all found gradle projects in parallel and then prints the results in batches - WARNING: This is likely to considerably slow down your computer!
listprojects $all | while read d; do listprojects $all | while read d; do
if test "$(find $d -maxdepth 1 -name "*gradle*")"; then if test "$(find $d -maxdepth 1 -name "*gradle*")"; then
cd $d builtin cd $d
buildlog="/tmp/build-$(basename $d)" buildlog="/tmp/build-$(basename $d)"
(nohup gradle build --no-daemon --console=rich &>$buildlog; highlight $(basename $d | awk '{print toupper($0)}') && cat $buildlog) & (nohup gradle build --no-daemon --console=rich &>$buildlog; highlight $(basename $d | awk '{print toupper($0)}') && cat $buildlog) &
fi fi
@ -53,7 +53,7 @@ projects() {
"status") "status")
# Sets the current branch upstream to a remote branch of the same name, updates it and shows "git status -s -b" # Sets the current branch upstream to a remote branch of the same name, updates it and shows "git status -s -b"
listprojects $all | while read d; do listprojects $all | while read d; do
cd $d builtin cd $d
highlight $(basename $d) highlight $(basename $d)
git branch --set-upstream-to=origin/$(git curbranch)>/dev/null git branch --set-upstream-to=origin/$(git curbranch)>/dev/null
git pull --all | grep -v "Already up to date." git pull --all | grep -v "Already up to date."
@ -64,7 +64,7 @@ projects() {
# Just provide a one-line summary of the status of each project and execute the command entered on every project # Just provide a one-line summary of the status of each project and execute the command entered on every project
com="$@" com="$@"
listprojects $all | while read d; do listprojects $all | while read d; do
cd $d builtin cd $d
if [[ $com != gradle* ]] || (( $(f1 -name "*gradle*" | wc -l) > 0 )); then if [[ $com != gradle* ]] || (( $(f1 -name "*gradle*" | wc -l) > 0 )); then
local st=() local st=()
local ahead=$(command git rev-list "${branch_name}"@{upstream}..HEAD 2>/dev/null | wc -l) local ahead=$(command git rev-list "${branch_name}"@{upstream}..HEAD 2>/dev/null | wc -l)
@ -79,5 +79,5 @@ projects() {
fi fi
done done
esac esac
cd $projects_dir builtin cd $projects_dir
} }

View File

@ -18,6 +18,8 @@ export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# red stderr # red stderr
export LD_PRELOAD="/opt/stderred/build/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}" export LD_PRELOAD="/opt/stderred/build/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"
# software config # software config
# enable pass extensions
export PASSWORD_STORE_ENABLE_EXTENSIONS="true"
# fzf defaults # fzf defaults
export FZF_DEFAULT_OPTS='--select-1 --exit-0 --tiebreak=end,length --history=/var/tmp/fzf-history --ansi --bind="alt-enter:execute(test -O {} && $EDITOR {} || sudoedit {}),del:execute(gio trash {}),change:top,left-click:execute(xdg-open {})"' export FZF_DEFAULT_OPTS='--select-1 --exit-0 --tiebreak=end,length --history=/var/tmp/fzf-history --ansi --bind="alt-enter:execute(test -O {} && $EDITOR {} || sudoedit {}),del:execute(gio trash {}),change:top,left-click:execute(xdg-open {})"'
export FZF_DEFAULT_COMMAND="fd --hidden --type file --color=always" export FZF_DEFAULT_COMMAND="fd --hidden --type file --color=always"