From 102a998d1c321870e5892066145900233da2f952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 14 Jun 2011 11:52:34 +0200 Subject: easy_e17.sh: move set_title, set_notification functions --- easy_e17.sh | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/easy_e17.sh b/easy_e17.sh index 709ac07..a0e9ec0 100644 --- a/easy_e17.sh +++ b/easy_e17.sh @@ -56,6 +56,31 @@ online_source="http://omicron.homeip.net/projects/easy_e17/easy_e17.sh" # URL of # VISUAL ############################################################################# + +function set_title () +{ + if [ "$1" ]; then message="- $1"; fi + if [ "$DISPLAY" ]; then + case "$TERM" in + xterm*|rxvt*|Eterm|eterm|Aterm|aterm) + echo -ne "\033]0;Easy_e17.sh $message\007" + ;; + esac + fi +} + +function set_notification () +{ + if [ -z "$DISPLAY" ] || [ "$notification_disabled" ]; then return; fi + notifier="$install_path/bin/e-notify-send" + urgency=$1 + text=$2 + if [ -x "$notifier" ]; then + $notifier -u "$urgency" -t 5000 -i "$install_path/share/enlightenment/data/images/enlightenment.png" \ + -n "easy_e17.sh" "easy_e17.sh" "$text" &>/dev/null + fi +} + function header () { clear @@ -923,32 +948,6 @@ function error () exit 2 } -function set_title () -{ - if [ "$1" ]; then message="- $1"; fi - - if [ "$DISPLAY" ]; then - case "$TERM" in - xterm*|rxvt*|Eterm|eterm|Aterm|aterm) - echo -ne "\033]0;Easy_e17.sh $message\007" - ;; - esac - fi -} - -function set_notification () -{ - if [ -z "$DISPLAY" ] || [ "$notification_disabled" ]; then return; fi - notifier="$install_path/bin/e-notify-send" - urgency=$1 - text=$2 - - if [ -e "$notifier" ]; then - $notifier -u "$urgency" -t 5000 -i "$install_path/share/enlightenment/data/images/enlightenment.png" \ - -n "easy_e17.sh" "easy_e17.sh" "$text" &>/dev/null - fi -} - function logfile_banner () { cmd=$1 -- cgit v1.1-2-g2b99