Re: [Slackbuilds-users] Admins - Question about Brave browser

2022-04-16 Thread Logan Rathbone
On Fri, Apr 15, 2022 at 05:54:56PM EDT, B. Watson wrote:
> On Fri, 15 Apr 2022, Andrew Payne wrote:
> > This slackbuild will adjust MIME settings for Brave. If you
> > wish to retain your current MIME settings, you can remove:
> > 
> > if [ -x /usr/bin/update-mime-database ]; then
> >/usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
> > fi
> > 
> > from the doinst.sh file before building.
> > 
> > ++
> > 
> > OR pull the MIME lines out of doinst.sh altogether.
> 
> You should remove the update-mime-database lines from the doinst.sh,
> since they don't do anything anyway, other than waste a bit of time.
> update-mime-database doesn't do what you thought it did...
[snip]
> Basically, the mime database in /usr/share/mime defines MIME types
> like image/png or text/plain. It doesn't have anything to do with user
> preferences (your doinst.sh won't make Brave the default browser)...
[snip]

In case anyone is perusing this list and wondering what *does* set user
preferences for app associations for MIME types pursuant to the XDG
standards, this section of an article on the Arch Wiki provides a good
summary:

https://wiki.archlinux.org/title/XDG_MIME_Applications#mimeapps.list

tldr: it's file called mimeapps.list, looked for in various directories
in a hierarchical fashion.
___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/



Re: [Slackbuilds-users] Admins - Question about Brave browser

2022-04-15 Thread Dave Woodfall
On 15/04/22 16:27,
Andrew Payne  put forth the proposition:
> >  Forwarded Message 
> > Subject:[Slackbuilds-users] Question about Brave browser
> > Date:   Thu, 24 Mar 2022 10:54:05 -0600
> > From:   Luveh Keraph <1.41...@gmail.com>
> > Reply-To:   SlackBuilds.org Users List 
> > To: SlackBuilds.org Users List 
> >
> >      $ xdg-mime query default x-scheme-handler/http
> >      brave-browser.desktop
> >
> >      $ xdg-mime query default x-scheme-handler/https
> >      brave-browser.desktop

I just installed brave-browser to see and the first time that I
started it a window popped up asking to make brave the default
browser, ticked yes by default, so I guess he missed that.

--
Dave
___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/



Re: [Slackbuilds-users] Admins - Question about Brave browser

2022-04-15 Thread Dave Woodfall
On 15/04/22 17:58,
B. Watson  put forth the proposition:
> Please, no. This is extra work and complexity for something that
> doesn't *do* anything at all (see my previous message).
> Adding this won't hurt the SlackBuild (it will still work), but it
> will act as a red herring, a thing that will confuse users and cause
> them to think it's somehow important, and waste their time trying to
> decide what option to choose.
> In reality both options are the same: nothing happens to
> /usr/share/mime/mime.cache at all, either way.

Yes, on thinking about it again, the command will run the next time
something is installed that updates the cache anyway.

--
Dave
___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/



Re: [Slackbuilds-users] Admins - Question about Brave browser

2022-04-15 Thread B. Watson




On Fri, 15 Apr 2022, Andrew Payne wrote:


You could make it optional and add something like the following to
the slackbuild:

if [ "${BRAVE_MIME:-yes}" = "yes" ]; then
  echo '
if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi' >> doinst.sh
fi

Thanks Dave, I'll do that.


Please, no. This is extra work and complexity for something that
doesn't *do* anything at all (see my previous message).

Adding this won't hurt the SlackBuild (it will still work), but it
will act as a red herring, a thing that will confuse users and cause
them to think it's somehow important, and waste their time trying to
decide what option to choose.

In reality both options are the same: nothing happens to
/usr/share/mime/mime.cache at all, either way.
___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/



Re: [Slackbuilds-users] Admins - Question about Brave browser

2022-04-15 Thread B. Watson




On Fri, 15 Apr 2022, Andrew Payne wrote:


This slackbuild will adjust MIME settings for Brave. If you
wish to retain your current MIME settings, you can remove:

if [ -x /usr/bin/update-mime-database ]; then
   /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

from the doinst.sh file before building.

++

OR pull the MIME lines out of doinst.sh altogether.


You should remove the update-mime-database lines from the doinst.sh,
since they don't do anything anyway, other than waste a bit of time.
update-mime-database doesn't do what you thought it did...

Explanation distilled from 'man update-mime-database' and the
freedesktop shared mime-info specification:

https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.21.html

Basically, the mime database in /usr/share/mime defines MIME types
like image/png or text/plain. It doesn't have anything to do with user
preferences (your doinst.sh won't make Brave the default browser)...
update-mime-database just reads the XML files in /usr/share/mime
and creates a /usr/share/mime/mime.cache file that's faster for
applications to use than it would be if they had to parse the XML
files every time.

Looking at the brave-browser package, there's nothing in
$PKG/usr/share/mime anyway, so update-mime-database won't actually
change anything when it runs. It will look at the XML files in
/usr/share/mime, and create a new /usr/share/mime/mime.cache... which
will be identical to the old one because no XML files get added,
deleted, or modified when you install the package.

Try this, on a system without brave-browser installed:

# rm -rf /usr/share/mime/mime.cache  # yes, it's OK to do this
# update-mime-database /usr/share/mime
# md5sum /usr/share/mime/mime.cache

...install your brave-browser package, with the update-mime-database
lines in the doinst.sh, then:

# md5sum /usr/share/mime/mime.cache

The md5sum should be identical to what it was before you installed the
package. Meaning, installing the package didn't modify the cache.
___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/



Re: [Slackbuilds-users] Admins - Question about Brave browser

2022-04-15 Thread Andrew Payne
> On 15/04/22 16:27,
> Andrew Payne  put forth the proposition:
>> I'll pose this to the admins.
>> I would be happy to add this to the readme:
>> This slackbuild will adjust MIME settings for Brave. If you
>> wish to retain your current MIME settings, you can remove:
>> if [ -x /usr/bin/update-mime-database ]; then
>> /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
>> fi
>> from the doinst.sh file before building.
>> ++
>> OR pull the MIME lines out of doinst.sh altogether.
>> Thoughts?
>> >
>> >
>> >  Forwarded Message 
>> > Subject:   [Slackbuilds-users] Question about Brave browser
>> > Date:  Thu, 24 Mar 2022 10:54:05 -0600
>> > From:  Luveh Keraph <1.41...@gmail.com>
>> > Reply-To:  SlackBuilds.org Users List
>> 
>> > To:SlackBuilds.org Users List 
>> >
>> >
>> >
>> > I have installed the Brave browser in my 15.0 system using the
>> > Slackbuilds software for the purpose. I noticed that, after the
>> > installation is completed, some MIME handling settings are silently
>> > changed:
>> >
>> >      $ xdg-mime query default x-scheme-handler/http
>> >      brave-browser.desktop
>> >
>> >      $ xdg-mime query default x-scheme-handler/https
>> >      brave-browser.desktop
>> >
>> > Before installing Brave, the output of these commands was, in my case,
>> > chromium.desktop. The default browser setting remains unchanged
>> though:
>> >
>> >      $ xdg-settings  get default-web-browser
>> >       chromium.desktop
>> >
>> > The above changes imply that when clicking on a link embedded in an
>> > email in Thunderbird, the Brave browser will be launched, instead
>> of
>> > whatever was the default before - Chromium, in my case.  This is OK
>> if
>> > you want to use the Brave browser for that purpose. It is, however, a
>> > bit annoying that the changes are carried out under the wraps and
>> > without asking the person in charge of the installation of this
>> browser
>> > whether such an action is what one wants to do - installing a browser
>> > does not necessarily mean that it is meant to become the default
>> browser
>> > for MIME data handling.
>> >
>> > It is easy enough to restore the MIME settings to what they were - in
>> my
>> > case I would do
>> >
>> >      $ xdg-mime default chromium.desktop x-scheme-handler/http
>> >      $ xdg-mime default chromium.desktop x-scheme-handler/https
>> >
>> > However, it would be nice if the installation software were not to
>> > change the MIME settings silently, or, at the very least, for the
>> > documentation in the Slackbuilds installer to warn about this action
>> and
>> > explain how to revert it.
>> >
>> > Looking into the files in the Slackbuilds installation software it
>> would
>> > seem that doinst.sh has something to do with all this, but being
>> totally
>> > ignorant about such issues, I wouldn't know - the xdg-mime recipes
>> that
>> > I mentioned I got from a network search, they work for me, and that's
>> > all I know about them.
>
> You could make it optional and add something like the following to
> the slackbuild:
>
> if [ "${BRAVE_MIME:-yes}" = "yes" ]; then
>   echo '
> if [ -x /usr/bin/update-mime-database ]; then
>   /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
> fi' >> doinst.sh
> fi
>
> to default to yes, or Change the first line to:
>
> if [ "${BRAVE_MIME:-no}" = "yes" ]; then
>
> to default to no.
>
> --
> Dave
> ___
> SlackBuilds-users mailing list
> SlackBuilds-users@slackbuilds.org
> https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/
>
>

Thanks Dave, I'll do that.

___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/



Re: [Slackbuilds-users] Admins - Question about Brave browser

2022-04-15 Thread Dave Woodfall
On 15/04/22 16:27,
Andrew Payne  put forth the proposition:
> I'll pose this to the admins.
> I would be happy to add this to the readme:
> This slackbuild will adjust MIME settings for Brave. If you
> wish to retain your current MIME settings, you can remove:
> if [ -x /usr/bin/update-mime-database ]; then
> /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
> fi
> from the doinst.sh file before building.
> ++
> OR pull the MIME lines out of doinst.sh altogether.
> Thoughts?
> >
> >
> >  Forwarded Message 
> > Subject:[Slackbuilds-users] Question about Brave browser
> > Date:   Thu, 24 Mar 2022 10:54:05 -0600
> > From:   Luveh Keraph <1.41...@gmail.com>
> > Reply-To:   SlackBuilds.org Users List 
> > To: SlackBuilds.org Users List 
> >
> >
> >
> > I have installed the Brave browser in my 15.0 system using the
> > Slackbuilds software for the purpose. I noticed that, after the
> > installation is completed, some MIME handling settings are silently
> > changed:
> >
> >      $ xdg-mime query default x-scheme-handler/http
> >      brave-browser.desktop
> >
> >      $ xdg-mime query default x-scheme-handler/https
> >      brave-browser.desktop
> >
> > Before installing Brave, the output of these commands was, in my case,
> > chromium.desktop. The default browser setting remains unchanged though:
> >
> >      $ xdg-settings  get default-web-browser
> >       chromium.desktop
> >
> > The above changes imply that when clicking on a link embedded in an
> > email in Thunderbird, the Brave browser will be launched, instead of
> > whatever was the default before - Chromium, in my case.  This is OK if
> > you want to use the Brave browser for that purpose. It is, however, a
> > bit annoying that the changes are carried out under the wraps and
> > without asking the person in charge of the installation of this browser
> > whether such an action is what one wants to do - installing a browser
> > does not necessarily mean that it is meant to become the default browser
> > for MIME data handling.
> >
> > It is easy enough to restore the MIME settings to what they were - in my
> > case I would do
> >
> >      $ xdg-mime default chromium.desktop x-scheme-handler/http
> >      $ xdg-mime default chromium.desktop x-scheme-handler/https
> >
> > However, it would be nice if the installation software were not to
> > change the MIME settings silently, or, at the very least, for the
> > documentation in the Slackbuilds installer to warn about this action and
> > explain how to revert it.
> >
> > Looking into the files in the Slackbuilds installation software it would
> > seem that doinst.sh has something to do with all this, but being totally
> > ignorant about such issues, I wouldn't know - the xdg-mime recipes that
> > I mentioned I got from a network search, they work for me, and that's
> > all I know about them.

You could make it optional and add something like the following to
the slackbuild:

if [ "${BRAVE_MIME:-yes}" = "yes" ]; then
  echo '
if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi' >> doinst.sh
fi

to default to yes, or Change the first line to:

if [ "${BRAVE_MIME:-no}" = "yes" ]; then

to default to no.

--
Dave
___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/



[Slackbuilds-users] Admins - Question about Brave browser

2022-04-15 Thread Andrew Payne


I'll pose this to the admins.

I would be happy to add this to the readme:

This slackbuild will adjust MIME settings for Brave. If you
wish to retain your current MIME settings, you can remove:

if [ -x /usr/bin/update-mime-database ]; then
/usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

from the doinst.sh file before building.

++

OR pull the MIME lines out of doinst.sh altogether.

Thoughts?


>
>
>  Forwarded Message 
> Subject:  [Slackbuilds-users] Question about Brave browser
> Date: Thu, 24 Mar 2022 10:54:05 -0600
> From: Luveh Keraph <1.41...@gmail.com>
> Reply-To: SlackBuilds.org Users List 
> To:   SlackBuilds.org Users List 
>
>
>
> I have installed the Brave browser in my 15.0 system using the
> Slackbuilds software for the purpose. I noticed that, after the
> installation is completed, some MIME handling settings are silently
> changed:
>
>      $ xdg-mime query default x-scheme-handler/http
>      brave-browser.desktop
>
>      $ xdg-mime query default x-scheme-handler/https
>      brave-browser.desktop
>
> Before installing Brave, the output of these commands was, in my case,
> chromium.desktop. The default browser setting remains unchanged though:
>
>      $ xdg-settings  get default-web-browser
>       chromium.desktop
>
> The above changes imply that when clicking on a link embedded in an
> email in Thunderbird, the Brave browser will be launched, instead of
> whatever was the default before - Chromium, in my case.  This is OK if
> you want to use the Brave browser for that purpose. It is, however, a
> bit annoying that the changes are carried out under the wraps and
> without asking the person in charge of the installation of this browser
> whether such an action is what one wants to do - installing a browser
> does not necessarily mean that it is meant to become the default browser
> for MIME data handling.
>
> It is easy enough to restore the MIME settings to what they were - in my
> case I would do
>
>      $ xdg-mime default chromium.desktop x-scheme-handler/http
>      $ xdg-mime default chromium.desktop x-scheme-handler/https
>
> However, it would be nice if the installation software were not to
> change the MIME settings silently, or, at the very least, for the
> documentation in the Slackbuilds installer to warn about this action and
> explain how to revert it.
>
> Looking into the files in the Slackbuilds installation software it would
> seem that doinst.sh has something to do with all this, but being totally
> ignorant about such issues, I wouldn't know - the xdg-mime recipes that
> I mentioned I got from a network search, they work for me, and that's
> all I know about them.


___
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/