From 8fd263648f772783767ab6eab0ee25ac8772dcab Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Apr 2015 19:25:41 -0400 Subject: bash: aliases should just be a regular rc module --- .config/bash/aliases.sh | 54 -------------------------------------------- .config/bash/rc.d/aliases.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++ .config/bash/rc.sh | 5 ---- 3 files changed, 54 insertions(+), 59 deletions(-) delete mode 100644 .config/bash/aliases.sh create mode 100644 .config/bash/rc.d/aliases.sh diff --git a/.config/bash/aliases.sh b/.config/bash/aliases.sh deleted file mode 100644 index 28b9923..0000000 --- a/.config/bash/aliases.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# The above line probably should never be *used* in this file, but it -# lets text editors know that this is BASH syntax. - -###################################################################### -# Set up colors and settings for ls/dir/vdir # -###################################################################### -if [ -x "`which dircolors`" ]; then - 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' - - for xgrep in ${PATH//:/\/*grep }/*grep; do - if [ -f "$xgrep" ]; then - xgrep=`basename "$xgrep"` - if [ "$xgrep" != pgrep ]; then - alias $xgrep="$xgrep --color=auto" - fi - fi - done -else - alias ls='ls -1v' - alias dir='dir -v' - alias vdir='vdir -v' -fi - -###################################################################### -# Set up the standard aliases for ls # -###################################################################### -alias ll='ls -l' -alias la='ls -a' -alias l='ls -CF' - -###################################################################### -# Some preferences for miscellaneous stuff # -###################################################################### -#alias rm='gvfs-trash' -#alias sed='sed --follow-symlinks' # breaks sed 4.2.2 -alias tree='tree --charset utf8' -alias cd=pushd -alias gitk='gitk --all --date-order' -alias userctl='systemctl --user' - -###################################################################### -# 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/aliases.sh b/.config/bash/rc.d/aliases.sh new file mode 100644 index 0000000..28b9923 --- /dev/null +++ b/.config/bash/rc.d/aliases.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# The above line probably should never be *used* in this file, but it +# lets text editors know that this is BASH syntax. + +###################################################################### +# Set up colors and settings for ls/dir/vdir # +###################################################################### +if [ -x "`which dircolors`" ]; then + 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' + + for xgrep in ${PATH//:/\/*grep }/*grep; do + if [ -f "$xgrep" ]; then + xgrep=`basename "$xgrep"` + if [ "$xgrep" != pgrep ]; then + alias $xgrep="$xgrep --color=auto" + fi + fi + done +else + alias ls='ls -1v' + alias dir='dir -v' + alias vdir='vdir -v' +fi + +###################################################################### +# Set up the standard aliases for ls # +###################################################################### +alias ll='ls -l' +alias la='ls -a' +alias l='ls -CF' + +###################################################################### +# Some preferences for miscellaneous stuff # +###################################################################### +#alias rm='gvfs-trash' +#alias sed='sed --follow-symlinks' # breaks sed 4.2.2 +alias tree='tree --charset utf8' +alias cd=pushd +alias gitk='gitk --all --date-order' +alias userctl='systemctl --user' + +###################################################################### +# 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.sh b/.config/bash/rc.sh index 7df0373..ae55d5c 100644 --- a/.config/bash/rc.sh +++ b/.config/bash/rc.sh @@ -71,11 +71,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 -- cgit v1.1-4-g5e80 From 2f2900213cc8157590f11dcc7988c1a3bb7dc887 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Apr 2015 19:31:17 -0400 Subject: Be careful about shebangs, which shells are used, and what gets executed Use - #!/hint/bash for bash that gets sourced (non-executable) - #!/hint/sh for sh(1) that gets sourced (non-executable) - #!/bin/sh for sh(1) that gets executed - #!/usr/bin/env bash for bash that gets executed To this end, also - Clean up a couple of related comments - Fix a couple of bash-isms that I noticed in sh(1) files - Fix permissions on a couple of files that get sourced --- .config/X11/clientrc | 2 +- .config/X11/login | 9 ++------- .config/X11/serverrc | 2 +- .config/bash/login.sh | 5 ++--- .config/bash/logout.sh | 3 ++- .config/bash/rc.d/aliases.sh | 4 +--- .config/bash/rc.d/emacs.sh | 2 +- .config/bash/rc.sh | 4 +++- .config/login.d/00_coredumps.sh | 1 + .config/login.d/00_path.sh | 1 + .config/login.d/00_umask.sh | 1 + .config/login.d/01_xdg.sh | 2 +- .config/login.d/02_xdg_runtime_dir.sh | 2 +- .config/login.d/03_tmpdir.sh | 1 + .config/login.d/10_gpg.sh | 1 + .config/login.d/10_java.sh | 1 + .config/login.d/10_less.sh | 1 + .config/login.d/10_selected-editor.sh | 3 ++- .config/login.d/10_spell-check.sh | 3 ++- .config/login.d/10_xauthority.sh | 3 ++- .config/login.d/90_symlink_xdg_runtime_dir.sh | 1 + .config/login.sh | 17 ++++++----------- .config/symlinks | 1 + .config/wmii-hg/config.sh | 2 +- .config/wmii-hg/help-events | 2 +- .config/wmii-hg/help-keys | 2 +- .config/wmii-hg/include.sh | 2 +- .config/wmii-hg/quit | 2 +- .config/wmii-hg/rbar | 2 +- .config/wmii-hg/rbar.sh | 2 +- .config/wmii-hg/rbar_acpi | 2 +- .config/wmii-hg/rbar_clock | 2 +- .config/wmii-hg/rbar_wifi | 2 +- .config/wmii-hg/theme-solarized | 1 + .config/wmii-hg/theme-solarized-dark | 2 +- .config/wmii-hg/theme-tango | 1 + .config/wmii-hg/theme-tango-dark | 2 +- .config/wmii-hg/util.sh | 2 +- .config/wmii-hg/wmiirc | 2 +- 39 files changed, 52 insertions(+), 48 deletions(-) mode change 100755 => 100644 .config/X11/clientrc diff --git a/.config/X11/clientrc b/.config/X11/clientrc old mode 100755 new mode 100644 index 2c965da..88ae527 --- a/.config/X11/clientrc +++ b/.config/X11/clientrc @@ -1,4 +1,4 @@ -#!/bin/sh +#!/hint/sh # Load system xinit modules (disabled) # Remove "false &&" to enable diff --git a/.config/X11/login b/.config/X11/login index 84931df..d02088a 100755 --- a/.config/X11/login +++ b/.config/X11/login @@ -1,9 +1,4 @@ #!/bin/sh +# ~/.xsession: Executed by the XDM at login, maybe after sourcing ~/.xprofile -# -# ~/.xsession -# -# Executed by xdm/gdm/kdm at login -# - -exec bash --login -i ~/.xinitrc +exec bash --login ~/.xinitrc diff --git a/.config/X11/serverrc b/.config/X11/serverrc index 6b57eeb..e6f4c8f 100644 --- a/.config/X11/serverrc +++ b/.config/X11/serverrc @@ -1,4 +1,4 @@ -#!/bin/sh +#!/hint/sh if [ -z "$XDG_VTNR" ]; then exec /usr/bin/X -nolisten tcp "$@" else 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/rc.d/aliases.sh b/.config/bash/rc.d/aliases.sh index 28b9923..6b2460e 100644 --- a/.config/bash/rc.d/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 # 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 ae55d5c..70f1ce4 100644 --- a/.config/bash/rc.sh +++ b/.config/bash/rc.sh @@ -1,4 +1,6 @@ -# ~/.bashrc: executed by bash(1) for interactive non-login shells. +#!/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. diff --git a/.config/login.d/00_coredumps.sh b/.config/login.d/00_coredumps.sh index 8fcc61b..45d19b8 100644 --- a/.config/login.d/00_coredumps.sh +++ b/.config/login.d/00_coredumps.sh @@ -1 +1,2 @@ +#!/hint/sh ulimit -c unlimited # save core dumps diff --git a/.config/login.d/00_path.sh b/.config/login.d/00_path.sh index f4ca3a6..2d5f4a5 100644 --- a/.config/login.d/00_path.sh +++ b/.config/login.d/00_path.sh @@ -1,3 +1,4 @@ +#!/hint/sh if type config-path &>/dev/null; then config_path=config-path else diff --git a/.config/login.d/00_umask.sh b/.config/login.d/00_umask.sh index 8e71ad5..c6187dd 100644 --- a/.config/login.d/00_umask.sh +++ b/.config/login.d/00_umask.sh @@ -1 +1,2 @@ +#!/hint/sh umask 022 diff --git a/.config/login.d/01_xdg.sh b/.config/login.d/01_xdg.sh index 22bbc01..ed17ddb 100644 --- a/.config/login.d/01_xdg.sh +++ b/.config/login.d/01_xdg.sh @@ -1,4 +1,4 @@ -# This should be readable by /bin/sh +#!/hint/sh # Sets up XDG environmental variables, so programs using them don't have to # worry about checking if they are set. diff --git a/.config/login.d/02_xdg_runtime_dir.sh b/.config/login.d/02_xdg_runtime_dir.sh index 6d93359..6700669 100644 --- a/.config/login.d/02_xdg_runtime_dir.sh +++ b/.config/login.d/02_xdg_runtime_dir.sh @@ -1,4 +1,4 @@ -# This should be readable by /bin/sh +#!/hint/sh # Set XDG_RUNTIME_DIR if we can if [ -z "$XDG_RUNTIME_DIR" ] && shopt -q login_shell && type flock &>/dev/null; then diff --git a/.config/login.d/03_tmpdir.sh b/.config/login.d/03_tmpdir.sh index b94ef1a..62413a7 100644 --- a/.config/login.d/03_tmpdir.sh +++ b/.config/login.d/03_tmpdir.sh @@ -1,3 +1,4 @@ +#!/hint/sh if [ -n "$XDG_RUNTIME_DIR" ]; then mkdir -p -- "$XDG_RUNTIME_DIR/tmpdir" export TMPDIR="$XDG_RUNTIME_DIR/tmpdir" diff --git a/.config/login.d/10_gpg.sh b/.config/login.d/10_gpg.sh index cf3c88c..c1c5f82 100644 --- a/.config/login.d/10_gpg.sh +++ b/.config/login.d/10_gpg.sh @@ -1,3 +1,4 @@ +#!/hint/sh if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${GNUPG_HOME:-${HOME}/.gnupg}/gpg.conf"` fi diff --git a/.config/login.d/10_java.sh b/.config/login.d/10_java.sh index 3c49368..94452a9 100644 --- a/.config/login.d/10_java.sh +++ b/.config/login.d/10_java.sh @@ -1,3 +1,4 @@ +#!/hint/sh _JAVA_OPTIONS='' _JAVA_OPTIONS+=' -Dawt.useSystemAAFontSettings=on' _JAVA_OPTIONS+=' -Dswing.aatext=true' diff --git a/.config/login.d/10_less.sh b/.config/login.d/10_less.sh index c5934d6..314a8b9 100644 --- a/.config/login.d/10_less.sh +++ b/.config/login.d/10_less.sh @@ -1,2 +1,3 @@ +#!/hint/sh export LESSHISTFILE="$XDG_CACHE_HOME/less/histfile" mkdir -p -- "${LESSHISTFILE%/*}" diff --git a/.config/login.d/10_selected-editor.sh b/.config/login.d/10_selected-editor.sh index f176b8a..52696cd 100644 --- a/.config/login.d/10_selected-editor.sh +++ b/.config/login.d/10_selected-editor.sh @@ -1,4 +1,5 @@ -if [[ -f "$HOME/.selected_editor" ]]; then +#!/hint/sh +if [ -f "$HOME/.selected_editor" ]; then . "$HOME/.selected_editor" export SELECTED_EDITOR export ALTERNATE_EDITOR diff --git a/.config/login.d/10_spell-check.sh b/.config/login.d/10_spell-check.sh index 9a24b7e..3f67b8f 100644 --- a/.config/login.d/10_spell-check.sh +++ b/.config/login.d/10_spell-check.sh @@ -1,3 +1,4 @@ -if [[ -z "$DICTIONARY" ]] && [[ -n "$LANG" ]]; then +#!/hint/sh +if [ -z "$DICTIONARY" ] && [ -n "$LANG" ]; then export DICTIONARY="${LANG%%.*}" fi diff --git a/.config/login.d/10_xauthority.sh b/.config/login.d/10_xauthority.sh index a27202c..787b6ed 100644 --- a/.config/login.d/10_xauthority.sh +++ b/.config/login.d/10_xauthority.sh @@ -1,4 +1,5 @@ +#!/hint/sh # This was needed once with SSH and Fedora boxes. -if [[ -z $XAUTHORITY ]]; then +if [ -z $XAUTHORITY ]; then export XAUTHORITY="$HOME/.Xauthority" fi diff --git a/.config/login.d/90_symlink_xdg_runtime_dir.sh b/.config/login.d/90_symlink_xdg_runtime_dir.sh index bc6109d..7ee4bba 100644 --- a/.config/login.d/90_symlink_xdg_runtime_dir.sh +++ b/.config/login.d/90_symlink_xdg_runtime_dir.sh @@ -1,3 +1,4 @@ +#!/hint/sh # This is really only needed for ssh ControlPath; as I don't have a # way to communicate XDG_RUNTIME_DIR if [ -n "$XDG_RUNTIME_DIR" ]; then diff --git a/.config/login.sh b/.config/login.sh index 538920a..9499299 100644 --- a/.config/login.sh +++ b/.config/login.sh @@ -1,15 +1,10 @@ -#!/bin/bash -# ~/.profile: executed by the command interpreter for login shells. -# I like that graphical login scripts be configured to load this, so -# it always runs, graphical or not. +#!/hint/sh +# ~/.profile: Sourced by the command interpreter for login shells # -# This file should be executable by /bin/sh, but I'm going to assume bash(1) -# -# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login -# exists. - -# the default umask is set in /etc/profile; for setting the umask -# for ssh logins, install and configure the libpam-umask package. +# Other ~/.*profile scripts may take precedence, or be used instead +# (for example: ~/.bash_{profile,login} takes precidence, and +# ~/.xprofile is used for graphical logins). I dislike duplication, +# so I have them all configured to source this. if [ -z "$HOME" ]; then eval 'HOME=~' diff --git a/.config/symlinks b/.config/symlinks index af0f1af..066a7e0 100644 --- a/.config/symlinks +++ b/.config/symlinks @@ -26,6 +26,7 @@ .config/irbrc .irbrc .config/linphonerc .linphonerc # .config/selected_editor .selected_editor +.config/X11/login .vnc/xstartup .config/offlineimaprc .offlineimaprc .cache/offlineimap .offlineimap diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index ac0a349..6846920 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/hint/bash MODKEY=Mod4 # "super" UP=p diff --git a/.config/wmii-hg/help-events b/.config/wmii-hg/help-events index 08abd18..9aeb3e9 100755 --- a/.config/wmii-hg/help-events +++ b/.config/wmii-hg/help-events @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash . include.sh scansection Event | xmessage -file - diff --git a/.config/wmii-hg/help-keys b/.config/wmii-hg/help-keys index 6f4bd1c..f7a975e 100755 --- a/.config/wmii-hg/help-keys +++ b/.config/wmii-hg/help-keys @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash . include.sh scansection Key | xmessage -file - diff --git a/.config/wmii-hg/include.sh b/.config/wmii-hg/include.sh index f9e3078..4e86276 100644 --- a/.config/wmii-hg/include.sh +++ b/.config/wmii-hg/include.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/hint/bash if [[ -z "$WMII_NAMESPACE" ]]; then export WMII_NAMESPACE="$(wmiir namespace)" diff --git a/.config/wmii-hg/quit b/.config/wmii-hg/quit index 341468e..b34a913 100755 --- a/.config/wmii-hg/quit +++ b/.config/wmii-hg/quit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if type systemctl &>/dev/null; then systemctl --user stop "wmii@$DISPLAY.service" else diff --git a/.config/wmii-hg/rbar b/.config/wmii-hg/rbar index b95f9c4..0709ed3 100755 --- a/.config/wmii-hg/rbar +++ b/.config/wmii-hg/rbar @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash id=$1 name=${id#[0-9][0-9]_} diff --git a/.config/wmii-hg/rbar.sh b/.config/wmii-hg/rbar.sh index 8bff558..0c9efa6 100644 --- a/.config/wmii-hg/rbar.sh +++ b/.config/wmii-hg/rbar.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/hint/bash setup_trap() { trap "rm -f -- \"\${XDG_RUNTIME_DIR}\"/n/wmii*/rbar/${1}" EXIT } diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi index bdcdf0f..6348873 100755 --- a/.config/wmii-hg/rbar_acpi +++ b/.config/wmii-hg/rbar_acpi @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash update() { id=$1 diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock index a09f016..e84d5c3 100755 --- a/.config/wmii-hg/rbar_clock +++ b/.config/wmii-hg/rbar_clock @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash update() { id=$1 diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi index f83d921..dad4e61 100755 --- a/.config/wmii-hg/rbar_wifi +++ b/.config/wmii-hg/rbar_wifi @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash iwinfo() { local interface=$1 diff --git a/.config/wmii-hg/theme-solarized b/.config/wmii-hg/theme-solarized index 5dc830d..8c40e4d 100644 --- a/.config/wmii-hg/theme-solarized +++ b/.config/wmii-hg/theme-solarized @@ -1,3 +1,4 @@ +#!/hint/bash SOL_BASE03='#002b36' SOL_BASE02='#073642' SOL_BASE01='#586e75' diff --git a/.config/wmii-hg/theme-solarized-dark b/.config/wmii-hg/theme-solarized-dark index fde361b..fc74b6c 100644 --- a/.config/wmii-hg/theme-solarized-dark +++ b/.config/wmii-hg/theme-solarized-dark @@ -1,4 +1,4 @@ -#!/bin/sh +#!/hint/bash # Solarized-dark . theme-solarized diff --git a/.config/wmii-hg/theme-tango b/.config/wmii-hg/theme-tango index f4c20a2..6ba744f 100644 --- a/.config/wmii-hg/theme-tango +++ b/.config/wmii-hg/theme-tango @@ -1,3 +1,4 @@ +#!/hint/bash TANGO_butter=("#fce94f" "#edd400" "#c4a000") TANGO_orange=("#fcaf3e" "#f57900" "#ce5c00") TANGO_choc=( "#e9b96e" "#c17d11" "#8f5902") diff --git a/.config/wmii-hg/theme-tango-dark b/.config/wmii-hg/theme-tango-dark index 04a9fa6..efea1e9 100644 --- a/.config/wmii-hg/theme-tango-dark +++ b/.config/wmii-hg/theme-tango-dark @@ -1,4 +1,4 @@ -#!/bin/bash +#!/hint/bash # Tango-tark . theme-tango diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index b28a3b6..55344b2 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/hint/bash ################################################################################ # Added shell features # diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index 6fd348f..260aaa1 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash unset WMII_NAMESPACE unset WMII_DIR -- cgit v1.1-4-g5e80 From fcd53ef17d77057e51eb8e54e41c3e5d4b51ce3c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Apr 2015 19:32:13 -0400 Subject: Teach Emacs about X11/modmap --- .config/X11/modmap | 2 ++ .config/emacs/init.el | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/.config/X11/modmap b/.config/X11/modmap index 1736e09..b332204 100644 --- a/.config/X11/modmap +++ b/.config/X11/modmap @@ -1,3 +1,5 @@ +! -*- Mode: Xmodmap -*- + ! My desktop doesn't have a super key, so I map Caps_Lock to Super_L ! Also, use Caps_Lock for the compose key remove lock = Caps_Lock diff --git a/.config/emacs/init.el b/.config/emacs/init.el index eddd0b7..7b9be85 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -237,6 +237,16 @@ sh-script.el is broken." (smerge-mode 1)))) (add-hook 'find-file-hook 'try-smerge-mode t) +;; http://www.emacswiki.org/emacs/XModMapMode +(when (not (fboundp 'xmodmap-mode)) + (define-generic-mode 'xmodmap-mode + '(?!) + '("add" "clear" "keycode" "keysym" "pointer" "remove") + nil + '("[xX]modmap\\(rc\\)?\\'") + nil + "Simple mode for xmodmap files.")) + ;; All my weird mode-specific settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- cgit v1.1-4-g5e80 From b0fc73174a1142ff0ff30d187944aa5b86eb3595 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Apr 2015 19:32:43 -0400 Subject: Emacs: minor tweaks --- .config/emacs/custom.el | 1 + .config/emacs/init.el | 1 + 2 files changed, 2 insertions(+) diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el index 1fdb0d3..55af402 100644 --- a/.config/emacs/custom.el +++ b/.config/emacs/custom.el @@ -9,6 +9,7 @@ ("9f443833deb3412a34d2d2c912247349d4bd1b09e0f5eaba11a3ea7872892000" "bb08c73af94ee74453c90422485b29e5643b73b05e8de029a6909af6a3fb3f58" "82d2cac368ccdec2fcc7573f24c3f79654b78bf133096f9b40c20d97ec1d8016" "1b8d67b43ff1723960eb5e0cba512a2c7a2ad544ddb2533a90101fd1852b426e" "628278136f88aa1a151bb2d6c8a86bf2b7631fbea5f0f76cba2a0079cd910f7d" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" "71b172ea4aad108801421cc5251edb6c792f3adbaecfa1c52e94e3d99634dee7" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" default))) '(erc-nick "lukeshu") '(explicit-shell-file-name "/bin/bash") + '(graphviz-dot-auto-indent-on-semi nil) '(org-latex-default-packages-alist (quote (("" "fontspec" t) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 7b9be85..e14d0f5 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -297,3 +297,4 @@ sh-script.el is broken." (add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) (add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) +(add-to-list 'auto-mode-alist '("\\.jad\\'" . java-mode)) -- cgit v1.1-4-g5e80