最近,我越来越多地在Firefox中使用配置文件。
我每个家庭成员都有一个,然后一些是代理防火墙(tor,i2p,freenet),然后是“来宾”默认配置文件,以及几个用于开发目的的配置文件。
因此,个人资料管理开始变得重要。我遇到的第一个问题是重新排序,例如,按照这个顺序:
Personal
Girlfriend
Children
Dev1
Dev2
Dev3
Testing
Freenet
Tor
etc ...那么,有什么话要说吗,有什么诀窍要点吗?我猜相反的方法是使用gnome / mate等菜单选项来启动这些配置文件并从那里管理它们。但我现在正在寻找一个火狐专用的解决方案。
发布于 2017-02-21 14:05:41
好的,在测试了许多加载项之后,我找到了重新排序我的配置文件的方法。它不是在一个插件(应该是火狐的主要功能,但无论如何.)。
诀窍是编辑profiles.ini文件。它位于linux中的~/.mozilla/firefox/profiles.ini中。
首先,备份:
cp ~/.mozilla/firefox/profiles.ini ~/.mozilla/firefox/profiles.ini.bak第二,编辑:
vim ~/.mozilla/firefox/profiles.ini然后,您可以复制和粘贴这些行,以便按照您想要的顺序执行以下操作:
[General]
StartWithLastProfile=1
[Profile0]
Name=Default
IsRelative=1
Path=fhsdjsufh.Default
Default=1
[Profile1]
Name=Myself
IsRelative=1
Path=dfhfkvldk.default
[Profile2]
Name=Children
IsRelative=1
Path=kfmfpoernv.Children
[Profile3]
Name=Friends
IsRelative=1
Path=fjvovbswk.Friends我不知道这是不是最好的方法,但有效。请注意保留格式和标题,只需复制[Profilex]标题之间的行。
来源:Mozillazine
发布于 2019-03-10 06:54:34
我也用了很多个人资料。我使用MozBackup来用我喜欢的加载项备份基本配置文件。在运行firefox.exe -P -no-remote时,我使用弹出窗口将该基础还原到我后来创建的配置文件上。
我还没有找到在火狐或MozBackup中弹出的配置文件列表的排序方法,所以我编写了一个python脚本,该脚本在profiles.ini中按名称对条目进行排序。
我在Windows上,但是我使用带有Debian风格的Linux子系统来运行这个脚本。要安装python 3.6:
apt-get install curl git build-essential zlib1g-dev libbz2-dev libreadline-dev libssl-dev libsqlite3-dev
curl https://pyenv.run | bash
pyenv install 3.6.8
pyenv local 3.6.8下面是脚本:
#!/usr/bin/env python3.6
import configparser
import re
config = configparser.ConfigParser()
config.optionxform = str
# this option is mandatory as list in popup will be blank
# if we let configparser default to lowercase option key.
config.read('profiles.ini')
nconfig = configparser.ConfigParser()
nconfig.optionxform = str
nconfig['General'] = config['General']
profiles = [section for section in config.sections() if re.match('^Profile', section)]
sorted_profiles = sorted(profiles, key=lambda profile: config[profile]['Name'])
for idx, profile in enumerate(sorted_profiles):
# 2020-08-25 - fixed this line which was generating syntax error
nconfig["Profile" + str(idx)] = config[profile]
# dict are sorted in python 3.6
# it seems profiles don't need to be renamed,
# but let's fake we created them in order anyway.
with open('profiles.ini.new', 'w') as f:
nconfig.write(f, space_around_delimiters=False)https://serverfault.com/questions/833933
复制相似问题