Just a quick question. I couldn't find another issue about that. As I mentioned on the title how to specify a config as conditional form. For example, I want to use different column_ratios in my Android device.
So, I need to execute uname and load it correct config according to the its result.
Although it's not reliable, I did this as workaround in my shell configs. I could have set the --cmd to column_ratios.
.zshrc
if ([[ $(uname -o) == 'Android' ]] 2>/dev/null) {
alias ranger="ranger --cmd='set viewmode multipane'"
}
You could use eval for it. rc.conf by itself doesn't support any conditionals.
Could you please show me an example? I don't know Python that much. :(
A quick and dirty try:
eval import subprocess; fm.set_option_from_string("viewmode", "multipane") if subprocess.check_output(["uname", "-o"]) != "Android" else None
Consider using a different config on Android, for example by using some preprocessing. See:
Feel free to reuse my preprocessor (you may want to add some facts).
Nice preprocessor for general use cases but I always use latest versions of programs I use, so doing like so is kind of useless for me. I have no intention to support earlier versions of one program, like you did to tmux. Although, tmux has if-shell component I don't know if you know or not; it's not so syntax-beauty though.
Thanks for eval snippet also, it helped a lot.
I guess I should close the issue because seems like I can make conditional configs via eval.
Most helpful comment
A quick and dirty try:
Consider using a different config on Android, for example by using some preprocessing. See:
Feel free to reuse my preprocessor (you may want to add some facts).