Compare commits

...

3 Commits

Author SHA1 Message Date
hedy 20c26aa681
Scripts: Add 2 new scripts 2023-10-10 16:45:46 +08:00
hedy 4bb8bdace3
Emacs: Use Vanilla as default profile
Hi doom bye doom
2023-09-28 09:44:14 +08:00
hedy f0e7282ef6
Fish: Selectively use bat for cat & Select default theme 2023-09-28 09:29:07 +08:00
5 changed files with 59 additions and 6 deletions

View File

@ -8,7 +8,7 @@ alias td=termdown
alias hdi=howdoi
alias bom=bombadillo
alias syscu='systemctl --user'
alias emacspure='emacs --with-profile=vanilla'
alias edoom='emacs --with-profile=doom'
alias g=git
alias acme='acme -f /mnt/font/FiraCode-Regular/15/font'

View File

@ -1,5 +1,7 @@
function cat --wraps=ccat --description 'alias cat=ccat'
if command -sq ccat
function cat --description 'alias cat to bat, ccat, or cat'
if command -sq bat
bat --theme Dracula $argv;
else if command -sq ccat
ccat $argv;
else
set catpath (which cat)

View File

@ -1,6 +1,5 @@
(
("vanilla" . ((user-emacs-directory . "~/.config/emacs")))
(("default" . ((user-emacs-directory . "~/.config/emacs")))
("test" . ((user-emacs-directory . "~/.config/emacstest")))
("default" . ((user-emacs-directory . "~/.doomemacs")
("doom" . ((user-emacs-directory . "~/.doomemacs")
(env . (("EMACSDIR" . "~/.doomemacs")
("DOOMDIR" . "~/.config/doom"))))))

27
bin/find-up Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# https://unix.stackexchange.com/questions/6463
# Modified:
# - Add usage
# - Don't print anything and exit 1 if not found
if [[ -z "$1" || "$1" == "--help" || "$1" == "-h" ]]; then
cat <<EOF
Usage: $(basename $0) [ file ]
Searches recursively for file from current directory
and parent directories until found or root reached.
EOF
exit
fi
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
if [[ -z "$path" ]]; then
exit 1
fi
echo "$path"

25
bin/lbin Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
if [[ -z "$1" || "$1" == "--help" || "$1" == "-h" ]]; then
cat <<EOF
Usage: $(basename $0) [ prog ]
Searches recursively for 'bin/prog' executable from current directory and
parent directories, and executes it if successfully found.
EOF
exit
fi
rootdir="$(pwd)"
while [[ "$rootdir" != "" && ! -x "$rootdir/bin/$1" ]]; do
rootdir=${path%/*}
done
if [[ ! -x "$rootdir/bin/$1" ]]; then
echo "No executable found in bin of parent directories."
exit 1
fi
"$rootdir/bin/$1"