| ... | ... |
@@ -1,8 +1,8 @@ |
| 1 | 1 |
# Title: .Rprofile |
| 2 | 2 |
# Author: Frédéric CHEVALIER <f15.chevalier@gmail.com> |
| 3 |
-# Version: 1.0 |
|
| 3 |
+# Version: 1.1 |
|
| 4 | 4 |
# Created in: 2014-07-06 |
| 5 |
-# Modified in: 2020-03-01 |
|
| 5 |
+# Modified in: 2020-08-27 |
|
| 6 | 6 |
|
| 7 | 7 |
|
| 8 | 8 |
|
| ... | ... |
@@ -19,6 +19,7 @@ |
| 19 | 19 |
# Versions # |
| 20 | 20 |
#==========# |
| 21 | 21 |
|
| 22 |
+# v1.1 - 2020-08-27: reconnect_X11 function added / repo link updated |
|
| 22 | 23 |
# v1.0 - 2020-03-01: library path set / specific library path depending on the environment / section executed in non interactive mode / repo link updated |
| 23 | 24 |
# v0.4 - 2016-10-02: hour display on prompt simplified / auto-update of terminal column value for display added |
| 24 | 25 |
# v0.3 - 2014-11-03: less function added |
| ... | ... |
@@ -50,7 +51,7 @@ if (! .startup$is.root && ! .startup$is.conda) {
|
| 50 | 51 |
if (interactive()) {
|
| 51 | 52 |
|
| 52 | 53 |
# Don't ask me for my CRAN mirror every time |
| 53 |
-options("repos" = c(CRAN = "https://cran.revolutionanalytics.com"))
|
|
| 54 |
+options("repos" = c(CRAN = "https://cloud.r-project.org/"))
|
|
| 54 | 55 |
|
| 55 | 56 |
|
| 56 | 57 |
#===========# |
| ... | ... |
@@ -130,6 +131,15 @@ addTaskCallback(.startup$updatePrompt) |
| 130 | 131 |
file.show(file, delete.file = TRUE) |
| 131 | 132 |
} |
| 132 | 133 |
|
| 134 |
+# Reconnect to X11 |
|
| 135 |
+.startup$reconnect_X11 <- function(port) {
|
|
| 136 |
+ if (missing(port)) {
|
|
| 137 |
+ port <- system("xauth list | grep $(hostname) | tail -1 | awk '{print $1}' | sed \"s/.*://\"", intern = TRUE)
|
|
| 138 |
+ } |
|
| 139 |
+ Sys.setenv(DISPLAY = paste0("localhost:", port, ".0"))
|
|
| 140 |
+} |
|
| 141 |
+ |
|
| 142 |
+ |
|
| 133 | 143 |
|
| 134 | 144 |
|
| 135 | 145 |
#=========# |