Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
figurine patch possibility and how to handle environment variables
06-06-2012, 02:23 PM
Post: #1
figurine patch possibility and how to handle environment variables
I'm looking at the code for figurine to see if it needs a patch for the browser selection. (PKGBUILD for it was listed here:
http://delicate-linux.net/forum/showthre...=figurine) Netscape really isn't the most intuitive default browser anymore.

Does DeLicate have a default way of handling browser selection or did the developers want to discuss such a system? I've been looking at Debian's system. It looks like they put a string of possible user browsers in the BROWSER environment variable and then use '/usr/bin/x-www-browser' or '/usr/bin/www-browser' (depending on whether X is running or not). (See http://lists.debian.org/debian-policy/20...189.html). x-www-browser is probably a link to a default browser chosen by the user and set up by their alternatives program.

The figurine program assumes the BROWSER variable only contains one browser (and doesn't parse a list). If no browser is given, it defaults to netscape. Was wondering if I should change it to default to another browser or to default to x-www-browser (which could be a link on the system to a desired browser). Was also wondering if I should have it check if mutiple browsers are in the BROWSER environment variable, so it doesn't fail in that case. If you notice any other hard-coding in figurine, let me know and I can look into the possibility of changing it. Thanks.

Would appreciate some opinions on best way to handle environment variables. I've also been looking into patching where configuration files are. Some programs check $HOME/.applicationname. Some check $XDG_CONFIG_HOME/applicationname first (with $XDG_CONFIG_HOME typically defined as $HOME/.config). I've been looking into using the $XDG_CONFIG_HOME check followed by the $HOME check and then defaulting to . (which would be current directory) if neither is found. Thought about defaulting to directory where the exe was, but that would be much harder to determine in the code. Would be curious to hear pros and cons, other ideas or if this sounds like it would be fine.
Find all posts by this user
Quote this message in a reply
06-08-2012, 08:45 AM
Post: #2
RE: figurine patch possibility and how to handle environment variables
DeLi(cate) doesn't even have solved the question of final browser packages set yet :]
x-www-browser is managed by the update-alternatives script (written in Perl) and belonging to an identically called package. I haven't checked if it is easily possible to adopt this solution yet. If you believe this could be easily done while not affecting DeLi(cate) negatively, then feel free to investigate that :]
Visit this user's website Find all posts by this user
Quote this message in a reply
06-08-2012, 12:03 PM
Post: #3
RE: figurine patch possibility and how to handle environment variables
(06-08-2012 08:45 AM)tavvva Wrote:  DeLi(cate) doesn't even have solved the question of final browser packages set yet :]
x-www-browser is managed by the update-alternatives script (written in Perl) and belonging to an identically called package. I haven't checked if it is easily possible to adopt this solution yet. If you believe this could be easily done while not affecting DeLi(cate) negatively, then feel free to investigate that :]

I wasn't thinking of using the entire update-alternatives package. Just the naming conventions. As long as there's a script out there in a bin directory with x-www-browser for a program to find, then the program should be able to run it as the default browser. Someone could edit the x-www-browser by hand and make a bash script that calls the desired browser. If we find another operating system (example was from Debian) that has a solution we like, we could adapt it instead (and maybe simplify it).

Was curious if anyone had any suggestions which ways they'd prefer to see this done. Am going through some of the programs I'm building now and would like to add in the code to provide infrastructure for this to the patches. We can always flesh out some tools to manage changing the default browser information later as long as the basics such as naming conventions are ironed out. Any opinions or preferences on handling default applications (such as calls to browsers, editors, etc.) in other programs?
Find all posts by this user
Quote this message in a reply
06-08-2012, 08:35 PM
Post: #4
RE: figurine patch possibility and how to handle environment variables
On my Debian workstation, /usr/bin/x-www-browser is symlinked to /etc/alternatives/x-www-browser, which then contains information to start the browser (Opera, in my case [source here]). And also /bin/sh is symlinked to /bin/dash. update-alternatives sounds like a viable choice but I'm not too sure how it'll fit in with Delicate. I'm thinking, just throwing this out there, that there could be generic symlinks in /usr/bin to the specified program. Of course, it would be best to follow some sort of standard.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | DeLi(cate) Linux | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication