Jump to content


Photo

snippet: Reading theme/skin colors


  • Please log in to reply
3 replies to this topic

#1 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1863 posts
  • Gender:Not Telling

Posted 29 June 2018 - 13:38

This simple snippet seems to work under Windows (and probably macos). I stole the function for finding the user folder from cLib by Danoise, but I'm not sure if he finished it.

If someone could run it in testpad.lua under linux and confirm, that would be sweet.

Spoiler

Edited by joule, 13 August 2018 - 12:21.

  • danoise likes this

#2 4Tey

4Tey

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 555 posts
  • Gender:Male

Posted 29 June 2018 - 14:00

On my machine that cLib_get_userdata_folder() function fails.  I would've thought it should return a path string more like:

/home/*user*/.renoise/V3.1.1/

(Replace *user* with the users login name.)  That seems to be more where the config.xml file sits with Linux.  It seems to be fine once the path is corrected in this line...

-- import data from xml to document
  assert(prefs_model:load_from(cLib_get_userdata_folder().."Config.xml"), "Failed to find Config.xml")
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^

(N.B.  However take with a pinch of salt as I didn't use any installation script, don't know if that changes anything.)


Edited by 4Tey, 29 June 2018 - 14:12.


#3 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1863 posts
  • Gender:Not Telling

Posted 30 June 2018 - 10:50

Thanks! I'll fire up my old ubutu-laptop later to see if I have the same path, and that Config.xml is situated there also.

Hopefully the path can be found in package.path as well. Maybe it's just a matter of searching for ".renoise" instead of "/usr/" .....
  • 4Tey likes this

#4 4Tey

4Tey

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 555 posts
  • Gender:Male

Posted 15 September 2018 - 18:45

(Just a clarify post) We assume then that to get a bit more consistent path from the 'cLib_get_userdata_folder' function between Linux and Windows you can modify line 36 of cFilesystem.lua -> https://github.com/r...esystem.lua#L36 to read:

or string.find(str,".renoise") -- linux

But just mention about that function.  At the moment the way in which it is written is (looking at lines 34,35,36):

if string.find(str,"Users")  -- win 8
  or string.find(str,"Resources")  -- unix/osx/win
  or string.find(str,"/usr/") -- linux  (modify to ".renoise")

so you are assuming that '.renoise' gets seen in string variable 'str' before "Resources" (or even "Users" in a very unlikely event) in the package.path string.