diff options
-rwxr-xr-x | bin/www-browser | 42 | ||||
-rwxr-xr-x | bin/xvt | 57 | ||||
-rw-r--r-- | mandrake_desk.spec | 9 |
3 files changed, 101 insertions, 7 deletions
diff --git a/bin/www-browser b/bin/www-browser index 7575b84..2e8e1ae 100755 --- a/bin/www-browser +++ b/bin/www-browser @@ -9,18 +9,48 @@ # Purpose : launch a web browser #--------------------------------------------------------------- +strip_browser_var() { +if [[ -n "$BROWSER" ]]; then + if [[ `basename "$BROWSER"` == "www-browser" ]]; then + unset BROWSER + fi +fi +} + +strip_browser_var if [[ -z "$BROWSER" ]]; then - if /sbin/pidof gnome-session > /dev/null; then - BROWSER=`which epiphany 2> /dev/null` - [[ -z "$BROWSER" ]] && BROWSER=`which galeon 2> /dev/null` + + # using GNOME + if [[ -n "$GNOME_DESKTOP_SESSION_ID" ]]; then + BROWSER=`gconftool -g /desktop/gnome/url-handlers/http/command | sed -e 's/%s//'` + if [[ `gconftool -g /desktop/gnome/url-handlers/http/needs_terminal` == "true" ]]; then + BROWSER="xvt -e $BROWSER" + fi fi - [[ -z "$BROWSER" ]] && which kfmclient 2> /dev/null && BROWSER="kfmclient openProfile webbrowsing" + + #using KDE + if [[ -n "$KDE_FULL_SESSION" ]]; then + NEWBROWSER=`grep -m 1 'BrowserApplication=' $HOME/.kde/share/config/kdeglobals 2>/dev/null` + [[ -z "$NEWBROWSER" ]] && NEWBROWSER=`grep -m 1 'BrowserApplication=' /etc/kde/kdeglobals 2>/dev/null` + if [[ -n "$NEWBROWSER" ]]; then + BROWSER=`echo $NEWBROWSER | sed -e 's/BrowserApplication=//' -e 's/!//'` + fi + [[ -z "$BROWSER" ]] && which kfmclient 2> /dev/null && BROWSER="kfmclient openProfile webbrowsing" + fi + + strip_browser_var + + [[ -z "$BROWSER" ]] && BROWSER=`which mozilla-firefox 2> /dev/null` [[ -z "$BROWSER" ]] && BROWSER=`which epiphany 2> /dev/null` [[ -z "$BROWSER" ]] && BROWSER=`which galeon 2> /dev/null` [[ -z "$BROWSER" ]] && BROWSER=`which mozilla 2> /dev/null` + [[ -z "$BROWSER" ]] && which kfmclient 2> /dev/null && BROWSER="kfmclient openProfile webbrowsing" fi -echo "$BROWSER $@" -exec $BROWSER "$@" +if [[ -n "$BROWSER" ]]; then + exec $BROWSER "$@" +else + echo "no web browser detected" +fi # www-browser ends here @@ -0,0 +1,57 @@ +#!/bin/sh +#--------------------------------------------------------------- +# Project : Mandrakelinux +# Module : bin +# File : xvt +# Version : $Id$ +# Author : Frederic Lepied +# Created On : Tue Aug 31 16:26:54 2004 +# Purpose : launch a terminal emulator +#--------------------------------------------------------------- + +strip_terminal_var() { +if [[ -n "$TERMINAL" ]]; then + if [[ `basename "$TERMINAL"` == "xvt" ]]; then + unset TERMINAL + fi +fi +} + +strip_terminal_var +if [[ -z "$TERMINAL" ]]; then + + # using GNOME + if [[ -n "$GNOME_DESKTOP_SESSION_ID" ]]; then + TERMINAL=`gconftool -g /desktop/gnome/applications/terminal/exec` + fi + + #using KDE + if [[ -n "$KDE_FULL_SESSION" ]]; then + NEWTERMINAL=`grep -m 1 'TerminalApplication=' $HOME/.kde/share/config/kdeglobals 2>/dev/null` + [[ -z "$NEWTERMINAL" ]] && NEWTERMINAL=`grep -m 1 'TerminalApplication=' /etc/kde/kdeglobals 2>/dev/null` + if [[ -n "$NEWTERMINAL" ]]; then + TERMINAL=`echo $NEWTERMINAL| sed -e 's/TerminalApplication=//' -e 's/!//'` + fi + [[ -z "$TERMINAL" ]] && which kconsole 2> /dev/null && TERMINAL="konsole" + fi + + strip_terminal_var + + [[ -z "$TERMINAL" ]] && TERMINAL=`which rxvt 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which xterm 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which gnome-terminal 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which konsole 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which aterm 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which Eterm 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which kterm 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which multi-gnome-terminal 2> /dev/null` + [[ -z "$TERMINAL" ]] && TERMINAL=`which multixterm 2> /dev/null` +fi + +if [[ -n "$TERMINAL" ]]; then + exec $TERMINAL "$@" +else + echo "no terminal emulator detected" +fi + +# www-browser ends here diff --git a/mandrake_desk.spec b/mandrake_desk.spec index 21f03cf..95103ad 100644 --- a/mandrake_desk.spec +++ b/mandrake_desk.spec @@ -1,7 +1,7 @@ Summary: The Desktop configuration files for Mandrakelinux Name: mandrake_desk Version: 10.2 -Release: 1mdk +Release: 2mdk License: GPL URL: http://www.mandrakelinux.com/ Group: System/Configuration/Other @@ -53,6 +53,7 @@ install -m 0644 backgrounds/xfdrake-test-card.png %buildroot/%_datadir/mdk/xfdra install -d -m 0755 %buildroot/%_bindir/ for i in bin/*.sh ; do install -m 0755 $i %buildroot/%_bindir/ ; done install -m 0755 bin/www-browser %buildroot/%_bindir/ +install -m 0755 bin/xvt %buildroot/%_bindir/ # /usr/sbin/ install -d -m 0755 %buildroot/%_sbindir/ @@ -170,6 +171,12 @@ rm -fr %buildroot %changelog +* Wed Mar 09 2005 Frederic Crozat <fcrozat@mandrakesoft.com> 10.2-2mdk +- change www-browser to use BROWSER variable if set or use running environment + settings if set. +- xvt script to replace alternative : choose programs to start based on + running environment + * Mon Mar 07 2005 Laurent MONTEL <lmontel@mandrakesoft.com> 10.2-1mdk - Fix error into menu |