Giter VIP home page Giter VIP logo

Comments (7)

rileytwo avatar rileytwo commented on August 27, 2024

Do you have two RStudios installed, by chance? I'm curious as to why activate() is returning TRUE but isn't actually doing anything.

Can you type this into RStudio's console and check for a darkstudio folder? You'll need fs installed, if you don't already.

system2("/usr/bin/open", args = fs::path_join(c(rstudioapi::dictionariesPath(), "../../www")))

from darkstudio.

domiden avatar domiden commented on August 27, 2024

Yes, I have two version installed. But it haven't been a problem before. About the darstudio folder, there is none in there. Interestingly, the path point to the correct application folder. Unfortunately, I cannot reconstruct what might change to the situation before the issue appeared.

from darkstudio.

rileytwo avatar rileytwo commented on August 27, 2024

So there isn't a darkstudio folder in either application? Can you run darkstudio::deactivate() and then remove.packages('darkstudio') for good measure?

Another area that may be causing trouble is the index.htm file. darkstudio works by injecting a <link/> handle to darkstudio/darkstudio.css, which loads the styles. I'm wondering if index.htm was modified incorrectly and wasn't restored properly.

from darkstudio.

domiden avatar domiden commented on August 27, 2024

I just checked the other RStudio version in /Applications, and it work there, however, if I uninstall it, there and install it with the version in ~/Applications it still modified and activate it for the version in /Applications.

Location ~/Applications:

<html lang="en">
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <meta name="gwt:property" content="compiler.stackMode=#compiler_stack_mode#"/>
    #!viewport_tag#
    <meta name="csrf-token" content="#csrf_token#" />
    <link rel="shortcut icon" href="images/favicon.ico" />
    <title>RStudio</title>
    #!head_tags#
    <link type="text/css" rel="stylesheet" href="css/icons.css" />
    <link type="text/css" rel="stylesheet" href="css/focus-visible.css" />
    <script type="text/javascript" language="javascript" src="js/text.min.js"></script>
    <script type="text/javascript" language="javascript" src="js/inert-polyfill.min.js"></script>
    <script type="text/javascript" language="javascript" src="js/focus-visible.min.js"></script>
    <script type="text/javascript" language="javascript" src="#!gwt_prefix#rstudio/rstudio.nocache.js"></script>
  </head>

  <body>
  </body>

</html>

Location /Applications:

<html lang="en">
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <meta name="gwt:property" content="compiler.stackMode=#compiler_stack_mode#"/>
    #!viewport_tag#
    <meta name="csrf-token" content="#csrf_token#" />
    <link rel="shortcut icon" href="images/favicon.ico" />
    <title>RStudio</title>
    #!head_tags#
    <link type="text/css" rel="stylesheet" href="css/icons.css" />
    <link type="text/css" rel="stylesheet" href="css/focus-visible.css" />
    <script type="text/javascript" language="javascript" src="js/text.min.js"></script>
    <script type="text/javascript" language="javascript" src="js/inert-polyfill.min.js"></script>
    <script type="text/javascript" language="javascript" src="js/focus-visible.min.js"></script>
    <script type="text/javascript" language="javascript" src="#!gwt_prefix#rstudio/rstudio.nocache.js"></script>
  </head>

  <body>
  </body>

<link rel="stylesheet" href="darkstudio/darkstudio.css" type="text/css"/>
</html>

So it seems the installation process don't differ between the app locations, and assumed /Applications folder only? Of course I could install the necessary files manually, but it would be nice if the package would do it for me.

from darkstudio.

rileytwo avatar rileytwo commented on August 27, 2024

So, it does look for both paths, but will only modify the RStudio.app in /Applications if both are present. I plan on changing the behavior, but haven't found a solution that's reliable.

In a perfect world, I'd be able to detect (using R, only) which RStudio is running when darkstudio::activate() is executed. I haven't found a way to do this yet, unfortunately. The only solutions I've found are workarounds at best, most of which are similar to the rstudioapi::dictionariesPath() function I asked you to run above.

All that being said, you can still "override" the RStudio being changed by providing a path argument in activate(). If you want to activate ~/Applications/RStudio.app, do the following:

darkstudio::activate(path = "~/Applications/RStudio.app/Contents/Resources/www/index.htm")

path lets you control where darkstudio is activated. Can you try running the above, and let me know if that works for you? Sorry for the trouble so far.

from darkstudio.

domiden avatar domiden commented on August 27, 2024

Thanks, that works! It is actually a very nice workaround I haven't considered. Perhaps you may add an option (local = TRUE) looking for a local version of RStudio assuming it at ~/Applications in most cases (at least for macOS), I guess. Alternative you may reduce the path option to just the app location, path = "~/Applications", so it would internally complete the path with "/RStudio.app/Contents/Resources/www/index.htm". Again, many thanks for this awesome extension!

from darkstudio.

rileytwo avatar rileytwo commented on August 27, 2024

I 100% agree. I wanted an option that worked the same way for both macOS and Windows. macOS is much simpler, as you noted above, since most of the time, user-only installations take place in ~/Applications. I don't know of the user-only equivalent in Windows that's consistent (ie ~/AppData/Local, ~/AppData/LocalLow or ~/AppData/Roaming).

Thanks for being patient!

from darkstudio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.