summaryrefslogtreecommitdiff
path: root/.config/bash
diff options
context:
space:
mode:
Diffstat (limited to '.config/bash')
-rw-r--r--.config/bash/login.sh5
-rw-r--r--.config/bash/logout.sh3
-rw-r--r--.config/bash/rc.d/aliases.sh (renamed from .config/bash/aliases.sh)17
-rw-r--r--.config/bash/rc.d/emacs.sh2
-rw-r--r--.config/bash/rc.sh12
5 files changed, 21 insertions, 18 deletions
diff --git a/.config/bash/login.sh b/.config/bash/login.sh
index 1269a03..08f26b8 100644
--- a/.config/bash/login.sh
+++ b/.config/bash/login.sh
@@ -1,6 +1,5 @@
-# ~/.bash_login: executed by bash(1) when login shell starts.
-
-# I think this is sane default behavior
+#!/hint/bash
+# ~/.bash_login: Sourced by bash(1) when login shell starts
# Load user settings
. "$HOME/.profile"
diff --git a/.config/bash/logout.sh b/.config/bash/logout.sh
index 5dd8f7d..623f0a0 100644
--- a/.config/bash/logout.sh
+++ b/.config/bash/logout.sh
@@ -1,4 +1,5 @@
-# ~/.bash_logout: sourced by bash(1) when login shell exits.
+#!/hint/bash
+# ~/.bash_logout: Sourced by bash(1) when login shell exits
# Clear the screen for privacy's sake.
clear
diff --git a/.config/bash/aliases.sh b/.config/bash/rc.d/aliases.sh
index 28b9923..cd2cfd8 100644
--- a/.config/bash/aliases.sh
+++ b/.config/bash/rc.d/aliases.sh
@@ -1,6 +1,4 @@
-#!/bin/bash
-# The above line probably should never be *used* in this file, but it
-# lets text editors know that this is BASH syntax.
+#!/hint/bash
######################################################################
# Set up colors and settings for ls/dir/vdir #
@@ -48,7 +46,18 @@ alias userctl='systemctl --user'
######################################################################
alias lock="clear; away -C 'This terminal is locked'"
alias plock="term-title Terminal Locked;lock"
-mvln() { mv $1 $2; ln -s $2 $1; }
+mvln() {
+ if [[ ! -L "$1" ]]; then
+ libremessages error 'Not a soft link: %s' "$1"
+ fi
+ target=$(readlink -f -- "$1")
+ ln -srT -- "$target" "$2"
+ if cmp -- "$1" "$2"; then
+ rm -f -- "$1"
+ else
+ libremessages error 'Failed moving link: %s -> %s' "$1" "$2"
+ fi
+}
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 bb6454b..d8e1d80 100644
--- a/.config/bash/rc.d/emacs.sh
+++ b/.config/bash/rc.d/emacs.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/hint/bash
if [[ $TERM == eterm* ]]; then
SELECTED_EDITOR='emacsclient'
diff --git a/.config/bash/rc.sh b/.config/bash/rc.sh
index c7acaf8..a85d308 100644
--- a/.config/bash/rc.sh
+++ b/.config/bash/rc.sh
@@ -1,7 +1,6 @@
-# ~/.bashrc: executed by bash(1) for interactive non-login shells.
-# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
-# for examples
-
+#!/hint/bash
+# ~/.bashrc: Sourced by bash(1) for interactive non-login shells
+#
# I include this file for all interactive invocations of bash(1), whether
# they are login shells or not.
@@ -74,11 +73,6 @@ unset make_prompt
################################################################################
-# Load my aliases
-if [[ -f ${XDG_CONFIG_HOME}/bash/aliases.sh ]]; then
- . ${XDG_CONFIG_HOME}/bash/aliases.sh
-fi
-
# Include modular config files
if [[ -d ${XDG_CONFIG_HOME}/bash/rc.d ]]; then
for file in "${XDG_CONFIG_HOME}/bash/rc.d"/*.sh; do