summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-03-03 13:30:39 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-03-03 13:30:39 +0100
commitb760308984ad4c0a1d55041700024e8160b7755e (patch)
tree45af8f9ddff52f51deb391c763a7bc0b5c0ecf33
parent1fe0e500324ad02a5e6d0f730eb299f271cf8b43 (diff)
downloaddotfiles-b760308984ad4c0a1d55041700024e8160b7755e.tar.gz
dotfiles-b760308984ad4c0a1d55041700024e8160b7755e.tar.xz
dotfiles-b760308984ad4c0a1d55041700024e8160b7755e.zip
Bash config: make linkalias use elinks in non-graphical mode
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc12
1 files changed, 9 insertions, 3 deletions
diff --git a/.bashrc b/.bashrc
index 0c1da09..96b7f99 100644
--- a/.bashrc
+++ b/.bashrc
@@ -20,9 +20,15 @@ diralias () {
"$(basename "$1")"
}
-_linkalias () {
- gnome-open "$(printf "$1" "${@:2}")"
-}
+if test -n "${XAUTHORITY:-}"; then
+ _linkalias () {
+ gnome-open "$(printf "$1" "${@:2}")"
+ }
+else
+ _linkalias () {
+ elinks "$(printf "$1" "${@:2}")"
+ }
+fi
linkalias () { alias "$1=_linkalias $2"; }
# Source the other common definitions