Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 11 Dec 2019, 04:46
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
firefox logic in /usr/local/bin/defaultbrowser
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
s243a

Joined: 02 Sep 2014
Posts: 2203

PostPosted: Fri 19 Apr 2019, 22:35    Post subject:  firefox logic in /usr/local/bin/defaultbrowser
Subject description: s243a's adaption for tazpup64
 

Puppylinux uses the following command for the default browser:
Code:

#!/bin/ash
exec mozstart "$@"

/usr/local/bin/defaultbrowser

mozstart doesn't seem to be defined in woofCE. Anyway, I chose for TazPup64 to use defaultbrowser as a way of defining browser preferences.

Code:

if [ "$TEXTDOMAIN" = 'tazpanel' ]; then
  BROWSER_CHOICES=( tazweb midori palemoon firefox opera iron chomium chrome netsurf lynx )
else
  BROWSER_CHOICES=( opera palemoon firefox tazweb midori iron chomium chrome netsurf lynx )
fi

https://pastebin.com/aw5xBEWL
When "$TEXTDOMAIN" = 'tazpanel' then we call a lightweight browser, otherwise we call a full featured browser.

What I want to focus on here is the seciton for firefox:
Code:

for  BROWSER_OPTION in "${BROWSER_CHOICES[@]}"; do 
  case "$BROWSER_OPTION" in
...
  firefox*)
...
    elif [ ! -z `which "$BROWSER_OPTION"` ]; then #we expect $BROWSER_OPTION to be either firefox or firefox-official
      CMD="$BROWSER_OPTION"
    elif [ ! -z "which firefox" ]; then
      CMD=firefox
    else
      continue
    fi
    if [ -h "$CMD" ]; then
      CMD=`readlink "$CMD"`
    fi
    if [ ! -z "`which apulse`" ] && [ $(file $CMD | grep -c ELF ) -gt 0 ]; then
      CMD="apulse $CMD"
    fi   
    exec $CMD "$@"
    ;;

https://pastebin.com/aw5xBEWL

The idea here is that if BROWSER_OPTION points to a binary and apulse exists in the system then we call firefox with apulse, otherwise we assume that the script which the command points to decides properly whether or not apulse is needed.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0570s ][ Queries: 11 (0.0228s) ][ GZIP on ]