puppylinux-woof-CE / woof-CE

woof - the Puppy builder
GNU General Public License v2.0
389 stars 278 forks source link

global default browser #2361

Open mrfricks opened 3 years ago

mrfricks commented 3 years ago

puppyapps sets the default browser. however some browsers i.e. palemoon can set itself as the default browser and it overrides our puppyapps one if different.

fossapup has xdg-mime from xdg-utils and has a modified puppyapps that sets the browser globaly.

lines 276-286

        wordprocessor) change_default 'wordprocessor' "$WORDPROCESSOR" ;;
      esac
    done
    xdg-mime default defaultbrowser-mime.desktop x-scheme-handler/http
    xdg-mime default defaultbrowser-mime.desktop x-scheme-handler/https
    xdg-mime default defaultbrowser-mime.desktop x-scheme-handler/ftp
    xdg-mime default defaultbrowser-mime.desktop x-scheme-handler/chrome
    xdg-mime default defaultbrowser-mime.desktop text/html
    xdg-mime default defaultbrowser-mime.desktop application/x-extension-htm
    xdg-mime default defaultbrowser-mime.desktop application/x-extension-html
    xdg-mime default defaultbrowser-mime.desktop application/x-extension-shtml
    xdg-mime default defaultbrowser-mime.desktop application/xhtml+xml
    xdg-mime default defaultbrowser-mime.desktop application/x-extension-xhtml
    xdg-mime default defaultbrowser-mime.desktop application/x-extension-xht
    . /usr/lib/gtkdialog/box_ok "$(gettext 'Default apps')" complete "$(gettext 'Your default apps have been updated.')"

and the defaultbrowser-mime.desktop

[Desktop Entry]
Encoding=UTF-8
Type=Application
NoDisplay=true
Name=Default browser
Exec=defaultbrowser %u
Icon=/usr/share/pixmaps/puppy/internet.svg

now that the the problematic xdg-open is removed in 'packages-templates' xdg-utils should probably be including in all pups and puppyapps could then be updated

dimkr commented 3 years ago

Duplicate of #2267?

mrfricks commented 3 years ago

hi @dimkr no .... but related in a way.

xdg-utils wasn't used in puppy because it contained xdg-open breaking puppys one, which you've now fixed in packages-templates 👍

the other stuff in xdg-utils is useful though such as xdg-mime.

case example....

launch palemoon and it asks you if you want to make it the default browser. if you tick yes it writes /root/.local/share/applications/userapp-Pale Moon-***.desktop which if nothing else is set becomes the default browser globally in applications.

now say i want dissenter browser as my default and set it with /usr/sbin/puppyapps (default application chooser).... this sets it for puppy specific stuff like the desktop icon but hexchat or thunderbird will still launch palemoon for links because of the userapp-Pale Moon-***.desktop file.

using xdg-mime to "globaly" set the default browser in /usr/sbin/puppyapps sorts this.