Re: Editing firefox.desktop

2021-03-20 Thread Brian Cluff via PLUG-discuss
A desktop file is standardized configuration file for Linux desktops 
that describe how to represent a program in the menus (complete with 
multiple language support), and how to launch it.  So you can't just 
launch it directly because it doesn't mean anything to the command 
line.  It should however be showing up in your menus now and so you can 
put it in your favorites and easily launch it that way.


That being cause, you can kinda turn it into an executable by adding 
something like the following to the very top of the desktop file:

#!/usr/bin/kioclient5 exec

That will tell the system to execute the desktop file with kioclient... 
of course you need to be running KDE for that to work correctly.  I'm 
not sure what the GNOME equivalent of that command is.


Personally I would just pretty alt+F2 or alt+space may work as well and 
just start to type  "Sandboxed Web Browser" and you may only have to 
type Sand or so before you can press enter and have it launch.


Alternatives to starting it from the command line:
Create a file called sandfox in /usr/local/bin/ and put the following 
into it.

#!/bin/bash
/usr/bin/firejail --apparmor firefox $@

Then set it to be executable and then you can execute sandfox from anywhere.

You could also set and alias with:
alias sandfox="/usr/bin/firejail --apparmor firefox"

That will allow you to type sandfox and internally it will replace that 
with "/usr/bin/firejail --apparmor firefox".  That should also work in 
most places equally well, but only for your username.
That's a one shot way of making that available.  If you want it to be 
permanent you'll need to add that line to your .bashrc file with:

echo alias sandfox='"/usr/bin/firejail --apparmor firefox"' >>~/.bashrc

I can't remember what your original goals were, so I hope the above 
isn't completely shooting the dark.


Brian Cluff

On 3/19/21 10:25 PM, Steve B via PLUG-discuss wrote:
I took Brian's recommendation and created a file in 
~/.local/share/applications called sandfox.desktop. Contents of that 
file are:


[Desktop Entry]
Encoding=UTF-8
Type=Application
Icon=/home/steve/Pictures/firejailed_firefox128.png
Exec=/usr/bin/firejail --apparmor firefox
Name=Sandboxed Web Browser
Terminal=false

I have it set to executable but when i try to run it 
"./sandfox.desktop" I get the error:

./sandfox.desktop: line 1: [Desktop: command not found
./sandfox.desktop: line 5: --apparmor: command not found
./sandfox.desktop: line 6: Web: command not found

Is my file misconfigured or what do I not have correct?



On Fri, Dec 25, 2020 at 5:47 PM Brian Cluff via PLUG-discuss 
> wrote:


Under debian based distros, overriding an overwrite of ANY
installed file is easily done.
There's a really cool tool called dpkg-divert that the system uses
to take whatever files would normally be installed and steer them
into a different place so that you can put your own version of the
file in the same place without fear of it going away on the next
update.

Just do:
dpkg-divert --add --rename /usr/share/applications/firefox.desktop

In this case, that would be the overkill and less correct way of
handing the problem.  A better way would be to put your own
version of the firefox.desktop into certain directories and that
cause it to override the system version of the config.  Put them
in ~/.local/share/applications/ to change an individual user and||
/usr/local/share/applications/ to effect every user on the system.

Brian Cluff


---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss


---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss

Re: Editing firefox.desktop

2021-03-20 Thread Steve B via PLUG-discuss
On a side note, could use a little help with the restricted network
function. Something changed between earlier versions and 0.9.64.4. In
earlier versions I could use "firejail --apparmor --net=eno1 firefox" to
create a new network stack. When I try to use it now I do not get any
errors, but am unable to browse to any site. If I change restricted-network
to yes I get the error "Error: networking feature is disabled in Firejail
configuration file". Networking is enabled according to both the config
file and to "firejail --version".

The developers notes in /etc/firejail/firejail.config say "Restricted
networking grants access to --interface, --net=ethXXX and # --netfilter
only to root user. Regular users are only allowed --net=none. I'm guessing
that firejail sees me as a regular user and not as a root user?

On Sat, Mar 20, 2021 at 7:05 AM John Seberg via PLUG-discuss <
plug-discuss@lists.phxlinux.org> wrote:

> Not really sure, but I think you need to launch it with an application
> such as /usr/bin/gtk-launch.
>
>
> https://unix.stackexchange.com/questions/457410/start-desktop-launcher-from-command-line-on-mint
>
>
>
>
>
>
> On Friday, March 19, 2021, 10:26:06 PM MST, Steve B via PLUG-discuss <
> plug-discuss@lists.phxlinux.org> wrote:
>
>
>
>
>
> I took Brian's recommendation and created a file in
> ~/.local/share/applications called sandfox.desktop. Contents of that file
> are:
>
> [Desktop Entry]
> Encoding=UTF-8
> Type=Application
> Icon=/home/steve/Pictures/firejailed_firefox128.png
> Exec=/usr/bin/firejail --apparmor firefox
> Name=Sandboxed Web Browser
> Terminal=false
>
> I have it set to executable but when i try to run it "./sandfox.desktop" I
> get the error:
> ./sandfox.desktop: line 1: [Desktop: command not found
> ./sandfox.desktop: line 5: --apparmor: command not found
> ./sandfox.desktop: line 6: Web: command not found
>
> Is my file misconfigured or what do I not have correct?
>
>
>
> On Fri, Dec 25, 2020 at 5:47 PM Brian Cluff via PLUG-discuss <
> plug-discuss@lists.phxlinux.org> wrote:
> >
> >  Under debian based distros, overriding an overwrite of ANY installed
> file is easily done.
> > There's a really cool tool called dpkg-divert that the system uses to
> take whatever files would normally be installed and steer them into a
> different place so that you can put your own version of the file in the
> same place without fear of it going away on the next update.
> >
> > Just do:
> > dpkg-divert --add --rename /usr/share/applications/firefox.desktop
> >
> > In this case, that would be the overkill and less correct way of handing
> the problem.  A better way would be to put your own version of the
> firefox.desktop into certain directories and that cause it to override the
> system version of the config.  Put them in ~/.local/share/applications/ to
> change an individual user and /usr/local/share/applications/ to effect
> every user on the system.
> >
> > Brian Cluff
> >
>
> ---
> PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
> ---
> PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss

Re: Editing firefox.desktop

2021-03-20 Thread John Seberg via PLUG-discuss
Not really sure, but I think you need to launch it with an application such as 
/usr/bin/gtk-launch.

https://unix.stackexchange.com/questions/457410/start-desktop-launcher-from-command-line-on-mint






On Friday, March 19, 2021, 10:26:06 PM MST, Steve B via PLUG-discuss 
 wrote: 





I took Brian's recommendation and created a file in ~/.local/share/applications 
called sandfox.desktop. Contents of that file are:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Icon=/home/steve/Pictures/firejailed_firefox128.png
Exec=/usr/bin/firejail --apparmor firefox
Name=Sandboxed Web Browser
Terminal=false

I have it set to executable but when i try to run it "./sandfox.desktop" I get 
the error:
./sandfox.desktop: line 1: [Desktop: command not found
./sandfox.desktop: line 5: --apparmor: command not found
./sandfox.desktop: line 6: Web: command not found

Is my file misconfigured or what do I not have correct?



On Fri, Dec 25, 2020 at 5:47 PM Brian Cluff via PLUG-discuss 
 wrote:
>  
>  Under debian based distros, overriding an overwrite of ANY installed file is 
>easily done.
> There's a really cool tool called dpkg-divert that the system uses to take 
> whatever files would normally be installed and steer them into a different 
> place so that you can put your own version of the file in the same place 
> without fear of it going away on the next update.
> 
> Just do:
> dpkg-divert --add --rename /usr/share/applications/firefox.desktop
> 
> In this case, that would be the overkill and less correct way of handing the 
> problem.  A better way would be to put your own version of the 
> firefox.desktop into certain directories and that cause it to override the 
> system version of the config.  Put them in ~/.local/share/applications/ to 
> change an individual user and /usr/local/share/applications/ to effect every 
> user on the system.
> 
> Brian Cluff
> 

---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss