Compare commits
3 Commits
b6162bfea4
...
20c26aa681
Author | SHA1 | Date |
---|---|---|
hedy | 20c26aa681 | |
hedy | 4bb8bdace3 | |
hedy | f0e7282ef6 |
2
.aliases
2
.aliases
|
@ -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'
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"))))))
|
||||
|
|
|
@ -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"
|
|
@ -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"
|
Loading…
Reference in New Issue