summaryrefslogtreecommitdiff
path: root/.config/bash
diff options
context:
space:
mode:
Diffstat (limited to '.config/bash')
-rw-r--r--.config/bash/aliases.sh16
-rw-r--r--.config/bash/rc.d/emacs.sh8
2 files changed, 12 insertions, 12 deletions
diff --git a/.config/bash/aliases.sh b/.config/bash/aliases.sh
index c9a1987..28b9923 100644
--- a/.config/bash/aliases.sh
+++ b/.config/bash/aliases.sh
@@ -6,10 +6,11 @@
# Set up colors and settings for ls/dir/vdir #
######################################################################
if [ -x "`which dircolors`" ]; then
- eval "`dircolors -b`"
+ eval "$(dircolors -p | cat - "${XDG_CONFIG_HOME}/dir_colors" |
+ dircolors -b -)"
alias ls='ls -1v --color=auto'
alias dir='dir -v --color=auto'
- alias vdir='vdir -v--color=auto'
+ alias vdir='vdir -v --color=auto'
for xgrep in ${PATH//:/\/*grep }/*grep; do
if [ -f "$xgrep" ]; then
@@ -43,16 +44,11 @@ alias gitk='gitk --all --date-order'
alias userctl='systemctl --user'
######################################################################
-# Remember lat/long for redshift #
-######################################################################
-redshift='redshift -l39.9030:85.9979'
-alias gtk-redshift="gtk-$redshift"
-alias redshift="$redshift"
-unset redshift
-
-######################################################################
# Some almost-function aliases #
######################################################################
alias lock="clear; away -C 'This terminal is locked'"
alias plock="term-title Terminal Locked;lock"
mvln() { mv $1 $2; ln -s $2 $1; }
+jarls() { jar tf "$1" | sed -n 's/\.class$//p' | LC_ALL=C sort | xargs -r -d $'\n' javap -classpath "$1"; }
+tarls() { local file; for file in "$@"; do bsdtar tf "$file" | sed "s|^|$file:|"; done; }
+jarmain() { jarls "$1" 2>/dev/null | grep -E '(^[a-z]|public static void main\(java\.lang\.String\[\]\))' | grep -B1 '^ '; }
diff --git a/.config/bash/rc.d/emacs.sh b/.config/bash/rc.d/emacs.sh
index b402932..354c8f3 100644
--- a/.config/bash/rc.d/emacs.sh
+++ b/.config/bash/rc.d/emacs.sh
@@ -5,12 +5,13 @@ if [[ $TERM == eterm* ]]; then
EDITOR=$SELECTED_EDITOR
VISUAL=$SELECTED_EDITOR
export SELECTED_EDITOR EDITOR VISUAL
+ export PAGER=cat
## Primatives for interacting with Emacs ###############################
# _emacs_run LISP
_emacs_run() {
- emacsclient -f "$HOME/.emacs.d/server-$HOSTNAME/server" -e "$*" 2>/dev/null
+ emacsclient -f "$HOME/.emacs.d/server-$HOSTNAME/server" -a false -e "$*" 2>/dev/null
}
# _emacs_quote UNQUOTED_STRING
_emacs_quote() {
@@ -85,6 +86,7 @@ if [[ $TERM == eterm* ]]; then
# Set the shell's X11 display (emacs -> shell)
_emacs_set_shell_DISPLAY() {
export DISPLAY=$(_emacs_unquote "$(_emacs_run "(cdr (assoc 'display (frame-parameters)))")")
+ [[ $DISPLAY != nil ]] || unset DISPLAY
}
## Do those things #####################################################
@@ -94,5 +96,7 @@ if [[ $TERM == eterm* ]]; then
_emacs_set_remote_dir
_emacs_set_shell_DISPLAY
}
- PROMPT_COMMAND=_emacs_PROMPT_COMMAND
+ if _emacs_run '()' >/dev/null; then
+ PROMPT_COMMAND=_emacs_PROMPT_COMMAND
+ fi
fi