1
Fork 0

firefox: rework config file extensions

This commit is contained in:
Alan Faubert 2021-10-16 18:14:15 -04:00
parent c980865882
commit 1b8972b21e
7 changed files with 9 additions and 9 deletions

View File

@ -102,8 +102,8 @@ while :; do
truncate --size=0 firefox/"$config"
IFS='+' read -a pieces <<< "$config"
for piece in "${pieces[@]}"; do
[ -f firefox/"$piece" ] && cat firefox/"$piece" >> firefox/"$config"
[ -f firefox/"$piece".proxy ] && echo 'user_pref("network.proxy.autoconfig_url", "'file:///"${root_win//\\//}"/firefox/"$piece".proxy$'");\nuser_pref("network.proxy.type", 2);' >> firefox/"$config"
[ -f firefox/"$piece".js ] && cat firefox/"$piece".js >> firefox/"$config"
[ -f firefox/"$piece".pac ] && echo 'user_pref("network.proxy.autoconfig_url", "'file:///"${root_win//\\//}"/firefox/"$piece".pac$'");\nuser_pref("network.proxy.type", 2);' >> firefox/"$config"
done
done
true

2
firefox/.gitignore vendored
View File

@ -1,2 +1,2 @@
/*+*
/*.proxy
/*.pac

View File

@ -2,18 +2,18 @@
## `.gitignore`'d
- `*+*` - files whose names are `+`-separated filenames of other files in this directory - these will be constructed by concatenation of the base files, and will be symlinked to from various Firefox profiles' `user.js` files
- `*.proxy` - proxy auto-config files - these too can be referred to in the above `configs/*` files, without the `.proxy` extension
- `*+*` - files whose names are `+`-separated filenames of base names of other files in this directory - these will be constructed by concatenation of the base files, and will be symlinked to from various Firefox profiles' `user.js` files
- `*.pac` - proxy auto-config files - these too can be referred to in the above `configs/*` files
## `user.js` handling (Windows-specific)
Create `*.proxy` files containing proxy auto-config files.
Create `*.pac` files containing proxy auto-config files.
Create empty `configs/*` files whose names are assembled by concatenating the names of templates in this directory (or `*.proxy` files without the `.proxy` extension) separated by `+`s.
Create empty `*+*` files whose names are assembled by concatenating the base names of templates in this directory (without the `.js` or `.pac` extension) separated by `+`s.
There is a menu option in `config.sh` to generate (or regenerate) the `configs/*` files from their constituent templates, including adding the appropriate configuration to point to a particular `*.proxy` file.
There is a menu option in `config.sh` to generate (or regenerate) the `*+*` files from their constituent templates, including adding the appropriate configuration to point to a particular `*.pac` file.
There is also a menu option in `config.sh` for creating symlinks from various Firefox profiles' `user.js` files to the assembled `configs/*` files.
There is also a menu option in `config.sh` for creating symlinks from various Firefox profiles' `user.js` files to the assembled `*+*` files.
## Additional manual setup