darkstudio icon indicating copy to clipboard operation
darkstudio copied to clipboard

Installation instructions completely broken for Linux

Open salim-b opened this issue 4 years ago • 7 comments

To summarise the current situation:

  • The recommended installation method is broken, at least on Linux. This is because (on almost any contemporary distro) you need system rights in order to modify files under RStudio's default installation path.

  • The old installation method is broken, too. This is mainly because you removed the referenced files in https://github.com/rileytwo/darkstudio/commit/84d0303796fd5e312ae0b48015ccc46a544127ab.

    Besides, the destination paths for Linux are wrong (as long as RStudio is installed through one of the official Linux packages). At least on Debian-based distros (and I think it's the same for Fedora/RHEL, SUSE and Co.) it's /usr/lib/rstudio/, without a version number.

Apart from the above issues, I like your work very much! I've manually copied the last version of index.htm in the repo and the current version of darkstudio.css to /usr/lib/rstudio/www/ and it works fine! 👍🏽

To resolve the problems mentioned above, I'd recommend to have a look at the rscodeio theme. It seems it's enough to run RStudio with root privileges to be able to install the theme (although your darkstudio::activate() function still didn't work that way when I tried it; IIRC because it tries to copy a file to a folder which doesn't exist; rscodeio's (de)activate_menu_theme functions seem to do a better job in this regard).

And anyway, I think it would make a lot of sense to join forces with the developer(s) of rscodeio since the two packages basically share the same goal: Copying some files to RStudio's installation directory with as little user interaction as possible 😉.

salim-b avatar Jun 20 '20 12:06 salim-b

Hey @salim-b! I'm sorry about the Linux installation method being broken... I don't have a way to test for Linux, and I figured if anything was wrong, someone would raise an issue and I'd work with them to make the necessary adjustments.

I looked for documentation about the default installation path for Linux but didn't find anything concrete. Do you have a source for /usr/lib/rstudio being the default installation path for Debian-based distros? If not, I'll just take your word on it and update the package accordingly.

Regarding rscodeio, much of the inspiration for the finer details of darkstudio came from that package. For awhile I didn't bother with scrollbars, buttons, etc. because I couldn't find a way to theme those elements consistently and stably(sp?), but anthonynorth's code made it look trivial. It's nice work.

I'll admit that the installation and de/activation is not so great. This is my first "real"(ish) R package, and was put together quickly in an attempt to get something working. Most of my attention so far has been focused on the activation and making that process simple and smooth, but I do intend to make some changes to the deactivation function and making that more reliable.

And yes, that would make sense. I've thought about reaching out but just haven't gotten around to it yet 😅 .

rileytwo avatar Jun 26 '20 17:06 rileytwo

(...) and I figured if anything was wrong, someone would raise an issue and I'd work with them to make the necessary adjustments. (...)

Sure, here we go... 😄

Do you have a source for /usr/lib/rstudio being the default installation path for Debian-based distros?

I don't know about any documentation about this from RStudio's side, but you can easily determine that path on any Debian-based distro by running dpkg -c on the downloaded DEB file. The command lists all the files in the package:

$ dpkg -c rstudio-1.3.959-amd64.deb 
drwxr-xr-x root/root         0 2020-05-18 21:18 ./
drwxr-xr-x root/root         0 2020-05-18 21:17 ./usr/
drwxr-xr-x root/root         0 2020-05-18 21:17 ./usr/lib/
drwxr-xr-x root/root         0 2020-05-18 21:17 ./usr/lib/rstudio/
-rw-r--r-- root/root     35057 2020-05-18 20:37 ./usr/lib/rstudio/COPYING
-rw-r--r-- root/root      6124 2020-05-18 20:37 ./usr/lib/rstudio/INSTALL
-rw-r--r-- root/root    177648 2020-05-18 20:37 ./usr/lib/rstudio/NOTICE
drwxr-xr-x root/root         0 2020-05-18 21:17 ./usr/lib/rstudio/R/
...

For the RPM packages (Fedora, RHEL, SUSE Linux) it's the same path, I've just checked the RPM packages of the same RStudio release.

And yes, that would make sense. I've thought about reaching out but just haven't gotten around to it yet :sweat_smile: .

Cool! The rscodeio theme seems to only work with the shipped rscodeio editor theme (at least in current RStudio versions), so there's still room for improvement...

And your package definitively has a more catchy name. 😜

salim-b avatar Jun 26 '20 17:06 salim-b

Working on this now.

Can you run ls -lah /usr/lib/rstudio/ for me? Can you also provide the full path to the index.htm file on your machine? On macOS and Windows, the file is in a folder named www; /Applications/RStudio.app/Contents/Resources/www/index.htm and C:\\Program Files\\RStudio\\www\\index.htm, respectively. I assume Linux is setup similarly, but I'm not positive.

PS: The name actually came from a Redditor who said that I missed the chance to name it darkstudio. Originally the project didn't really have a name, and was just "RStudio-Customizations" (which goes to show how creative I am).

rileytwo avatar Jun 27 '20 16:06 rileytwo

Can you run ls -lah /usr/lib/rstudio/ for me?

$ ls -lah /usr/lib/rstudio/
total 304K
drwxr-xr-x  11 root root 4.0K Jun 29 23:49 .
drwxr-xr-x 148 root root  12K Jun 26 20:05 ..
drwxr-xr-x   4 root root 4.0K Jun 29 23:49 bin
-rw-r--r--   1 root root  35K Jun 27 00:02 COPYING
-rw-r--r--   1 root root 6.0K Jun 27 00:02 INSTALL
drwxr-xr-x   2 root root 4.0K Jun 29 23:49 lib
drwxr-xr-x   2 root root 4.0K Jun 29 23:49 libexec
-rw-r--r--   1 root root 188K Jun 27 00:02 NOTICE
drwxr-xr-x   9 root root 4.0K Mai 16 15:01 plugins
drwxr-xr-x   3 root root 4.0K Jun 29 23:49 R
-rw-r--r--   1 root root 2.1K Jun 27 00:02 README.md
drwxr-xr-x  18 root root 4.0K Jun 29 23:49 resources
-rw-r--r--   1 root root 4.1K Jun 27 00:02 rstudio.png
-rw-r--r--   1 root root  495 Jun 27 00:47 SOURCE
drwxr-xr-x   3 root root 4.0K Jun 29 23:49 translations
-rw-r--r--   1 root root    9 Jun 27 00:03 VERSION
drwxr-xr-x  10 root root 4.0K Jun 29 23:49 www
drwxr-xr-x   2 root root 4.0K Jun 29 23:49 www-symbolmaps

Can you also provide the full path to the index.htm file on your machine? On macOS and Windows, the file is in a folder named www;

It's the same on Linux. Full path:

/usr/lib/rstudio/www/index.htm

salim-b avatar Jun 29 '20 21:06 salim-b