From ac3541c28ce44fb9ce992c605d1f6ca00557fd8e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 29 Dec 2011 00:01:49 +0100 Subject: [PATCH] update i3-sensible-* (Thanks Han) --- .../patches/manpage-x-terminal-emulator.patch | 12 ++++----- debian/patches/use-x-terminal-emulator.patch | 26 ++++++++----------- i3-sensible-editor | 18 +++++++------ i3-sensible-pager | 19 ++++++++------ i3-sensible-terminal | 16 ++++++------ man/i3-sensible-editor.man | 6 +++++ man/i3-sensible-pager.man | 3 ++- man/i3-sensible-terminal.man | 6 ++++- 8 files changed, 58 insertions(+), 48 deletions(-) diff --git a/debian/patches/manpage-x-terminal-emulator.patch b/debian/patches/manpage-x-terminal-emulator.patch index 61ff0160..ed6cb465 100644 --- a/debian/patches/manpage-x-terminal-emulator.patch +++ b/debian/patches/manpage-x-terminal-emulator.patch @@ -1,14 +1,12 @@ -## Description: Document Debian-specific x-terminal-emulator in the manpage. -## Origin/Author: Michael Stapelberg -Index: i3-4.1/man/i3-sensible-terminal.man +Index: i3-4.1.1/man/i3-sensible-terminal.man =================================================================== ---- i3-4.1.orig/man/i3-sensible-terminal.man 2011-11-11 22:38:06.508025537 +0000 -+++ i3-4.1/man/i3-sensible-terminal.man 2011-11-11 22:38:04.752994892 +0000 +--- i3-4.1.1.orig/man/i3-sensible-terminal.man 2011-12-28 23:56:55.487581000 +0100 ++++ i3-4.1.1/man/i3-sensible-terminal.man 2011-12-28 23:57:06.725802633 +0100 @@ -22,6 +22,7 @@ It tries to start one of the following (in that order): * $TERMINAL (this is a non-standard variable) -+* x-terminal-emulator (only on Debian) - * xterm ++* x-terminal-emulator * urxvt * rxvt + * terminator diff --git a/debian/patches/use-x-terminal-emulator.patch b/debian/patches/use-x-terminal-emulator.patch index 28e9200d..0d71f7c4 100644 --- a/debian/patches/use-x-terminal-emulator.patch +++ b/debian/patches/use-x-terminal-emulator.patch @@ -1,21 +1,17 @@ -## Description: Use Debian-specific x-terminal-emulator in i3-sensible-terminal -## Origin/Author: Michael Stapelberg ---- a/i3-sensible-terminal.O 2011-11-11 22:03:52.414218386 +0000 -+++ b/i3-sensible-terminal 2011-11-11 22:04:38.372020210 +0000 -@@ -1,13 +1,11 @@ - #!/bin/sh +Index: i3-4.1.1/i3-sensible-terminal +=================================================================== +--- i3-4.1.1.orig/i3-sensible-terminal 2011-12-28 23:51:52.455610236 +0100 ++++ i3-4.1.1/i3-sensible-terminal 2011-12-28 23:52:00.826775027 +0100 +@@ -4,11 +4,7 @@ + # # This script tries to exec a terminal emulator by trying some known terminal # emulators. -# -# Distributions/packagers should enhance this script with a -# distribution-specific mechanism to find the preferred terminal emulator. On -# Debian, there is the x-terminal-emulator symlink for example. --# Please don't touch the first line, though: - [ -n "$TERMINAL" ] && which $TERMINAL >/dev/null && exec $TERMINAL "$@" - -+# Debian-specific: use x-terminal-emulator -+which x-terminal-emulator >/dev/null && exec x-terminal-emulator "$@" -+ - # Hopefully one of these is installed: - which xterm >/dev/null && exec xterm "$@" - which urxvt >/dev/null && exec urxvt "$@" +-for terminal in $TERMINAL urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm; do ++for terminal in $TERMINAL x-terminal-emulator urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm; do + if which $terminal > /dev/null 2>&1; then + exec $terminal "$@" + fi diff --git a/i3-sensible-editor b/i3-sensible-editor index d71a440b..b3afceb7 100755 --- a/i3-sensible-editor +++ b/i3-sensible-editor @@ -1,14 +1,16 @@ #!/bin/sh +# +# This code is released in public domain by Han Boetes +# # This script tries to exec an editor by trying some known editors if $EDITOR is # not set. # -# Distributions/packagers can enhance this script with a -# distribution-specific mechanism to find the preferred pager. -[ -n "$VISUAL" ] && which $VISUAL >/dev/null && exec $VISUAL "$@" -[ -n "$EDITOR" ] && which $EDITOR >/dev/null && exec $EDITOR "$@" +# Distributions/packagers can enhance this script with a distribution-specific +# mechanism to find the preferred editor # Hopefully one of these is installed (no flamewars about preference please!): -which nano >/dev/null && exec nano "$@" -which vim >/dev/null && exec vim "$@" -which vi >/dev/null && exec vi "$@" -which emacs >/dev/null && exec emacs "$@" +for editor in $VISUAL $EDITOR nano vim vi emacs pico qe mg jed gedit mc-edit; do + if which $editor > /dev/null 2>&1; then + exec $editor "$@" + fi +done diff --git a/i3-sensible-pager b/i3-sensible-pager index 32f30aff..df463251 100755 --- a/i3-sensible-pager +++ b/i3-sensible-pager @@ -1,15 +1,18 @@ #!/bin/sh +# +# This code is released in public domain by Han Boetes + # This script tries to exec a pager by trying some known pagers if $PAGER is # not set. # # Distributions/packagers can enhance this script with a # distribution-specific mechanism to find the preferred pager. -[ -n "$PAGER" ] && which $PAGER >/dev/null && exec $PAGER "$@" -# Hopefully one of these is installed: -which most >/dev/null && exec most "$@" -which less >/dev/null && exec less "$@" -# we don't use 'more' because it will exit if the file is 'too short' - -# If no pager is installed, try an editor -exec i3-sensible-editor "$@" +# Hopefully one of these is installed (no flamewars about preference please!): +# We don't use 'more' because it will exit if the file is too short. +# Worst case scenario we'll open the file in your editor. +for pager in $PAGER less most w3m i3-sensible-editor; do + if which $pager > /dev/null 2>&1; then + exec $pager "$@" + fi +done diff --git a/i3-sensible-terminal b/i3-sensible-terminal index e5bf2718..a9975740 100755 --- a/i3-sensible-terminal +++ b/i3-sensible-terminal @@ -1,15 +1,15 @@ #!/bin/sh +# +# This code is released in public domain by Han Boetes +# # This script tries to exec a terminal emulator by trying some known terminal # emulators. # # Distributions/packagers should enhance this script with a # distribution-specific mechanism to find the preferred terminal emulator. On # Debian, there is the x-terminal-emulator symlink for example. -# Please don't touch the first line, though: -[ -n "$TERMINAL" ] && which $TERMINAL >/dev/null && exec $TERMINAL "$@" - -# Hopefully one of these is installed: -which xterm >/dev/null && exec xterm "$@" -which urxvt >/dev/null && exec urxvt "$@" -which rxvt >/dev/null && exec rxvt "$@" -which roxterm >/dev/null && exec roxterm "$@" +for terminal in $TERMINAL urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm; do + if which $terminal > /dev/null 2>&1; then + exec $terminal "$@" + fi +done diff --git a/man/i3-sensible-editor.man b/man/i3-sensible-editor.man index 86fbf840..2a044881 100644 --- a/man/i3-sensible-editor.man +++ b/man/i3-sensible-editor.man @@ -23,6 +23,12 @@ It tries to start one of the following (in that order): * vim * vi * emacs +* pico +* qe +* mg +* jed +* gedit +* mc-edit Please don’t complain about the order: If the user has any preference, he will have $VISUAL or $EDITOR set. diff --git a/man/i3-sensible-pager.man b/man/i3-sensible-pager.man index 73bd2fda..6b04c431 100644 --- a/man/i3-sensible-pager.man +++ b/man/i3-sensible-pager.man @@ -18,8 +18,9 @@ i3-sensible-pager is used by i3-nagbar(1) when you click on the view button. It tries to start one of the following (in that order): * $PAGER -* most * less +* most +* w3m * i3-sensible-editor(1) Please don’t complain about the order: If the user has any preference, he will diff --git a/man/i3-sensible-terminal.man b/man/i3-sensible-terminal.man index 140e412b..7e32aab4 100644 --- a/man/i3-sensible-terminal.man +++ b/man/i3-sensible-terminal.man @@ -22,9 +22,13 @@ is appropriate for the distribution. It tries to start one of the following (in that order): * $TERMINAL (this is a non-standard variable) -* xterm * urxvt * rxvt +* terminator +* Eterm +* aterm +* xterm +* gnome-terminal * roxterm Please don’t complain about the order: If the user has any preference, he will