0

How to set a terminall command to run every time I start firefox? I perfer terminal way, not gui. Thanks!

2
  • are you trying to run firefox with command ?
    – hwez
    Jul 6, 2014 at 10:07
  • No, I'm trying to run the command rm -rf ~/.wine-pipelight/*; rm -rf ~/.wine-pipelight/./.*; cp -a ~/viewright_backup/. ~/.wine-pipelight/ every time I start firefox. Jul 6, 2014 at 10:09

2 Answers 2

1

You could create a custom wrapper for Firefox, like so:

#!/bin/bash
rm -rf ~/.wine-pipelight/*
rm -rf ~/.wine-pipelight/./.*
cp -a ~/viewright_backup/. ~/.wine-pipelight/
firefox $*

and save it as a script somewhere, e.g. in /usr/local/bin/firefox-wrapped

Next, create a custom starter that runs /usr/local/bin/firefox-wrapped. I use alacarte to create .desktop files.

4
  • And where is the .desktop file located? I'm trying to run the firefox locked to launcher. Will it work? Jul 6, 2014 at 10:30
  • Using alacarte should put it in all the right places automatically. If you prefer to write your .desktop files yourself, you can put them in ~/.local/share/applications. Jul 6, 2014 at 10:33
  • Does it work with unity or with GNOME only? Jul 6, 2014 at 14:17
  • many desktop environments and application launchers honor .desktop files in that directory, it's a default location. Jul 6, 2014 at 21:55
1

edit the firefox lunch properties
command

firefox %u; rm -rf ~/.wine-pipelight/*; rm -rf ~/.wine-pipelight/./.*; cp -a ~/viewright_backup/. ~/.wine-pipelight/

you can check the lunch in terminal but if you close the terminal the firefox shuts down too

5
  • Ok, so if i change the .desktop file of firefox and replace the command with this, will it work when I run firefox from launcher? Jul 6, 2014 at 10:20
  • So, is it possible to change the .desktop file(using terminal) to have this command? Thank you very much! Jul 6, 2014 at 10:23
  • yea & you are trying to make your brother re install the wine so many times :s
    – hwez
    Jul 6, 2014 at 10:24
  • No, the problem is that this wine extenssion(pipelight) works only the first time, only after install. So if you want it to run it again, you must reinstall it, which takes several minutes(to download and so on...) So just by doing this, you don't need to wait that long. Jul 6, 2014 at 10:26
  • ah ok sorry about the question
    – hwez
    Jul 6, 2014 at 10:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .