Profile-sync-daemonとは

Profile-sync-daemon is a script that relocates browser profiles from the drive to the RAM disk. A browser profile is the files that is read/written at runtime, such as browser settings (including bookmarks and extensions), cache, cookies, etc. It is often about 100 MB or more for an ordinary browser.
By using profile-sync-daemon(psd), you will get faster operation and less I/O to the SSD (longer life).
As you can see from the high praise on the Arch wiki, it was created by one of the Arch Linux developer, so if you are using an Arch distribution, there is no reason not to use it. Of course, official packages are available for many major distributions such as Debian, Ubuntu, Fedora, and Gentoo, in addition to Arch.
How to use
Arch can install it from official extra repo by pacman.
sudo pacman -S profile-sync-daemon
Edit the config file.
nano ~/.config/psd/psd.conf
Add the browsers in the parentheses of
BROWSERS
, separating by spaces. Supported
browsers are limited to those listed under
Possible values:
.
BROWSERS=(firefox icecat chromium)
It is controlled by systemd. Make sure do it with
--user
.
systemd --user start psd.service
systemd --user enable psd.service
You can check how much memory is actually being used by
psd preview
, but you can also use the
ps
command.
ps aux | grep "/usr/share/psd"
Add browsers on your own
Here’s the main point. Add browsers that is not supported by psd. Please be aware that future updates may destroy your environment, so please do so at your own risk.
Browsers to add this time
- Firefox-ESR
- LibreWolf
Firefox-ESR is a long-term support version of Firefox, and although Mozilla emphasizes that it is for “enterprise” it is highly stable and I recommend to use ESR if you are not particular about it. Internally, it runs as a separate software from the regular version of Firefox, so it can be used together with the regular version.
LibreWolf is a browser that eliminates Mozilla-specific sponsored links and telemetry from Firefox and applies the strictest privacy settings. Recommended for those who value privacy but feel IceCat bit too much.
Psd specification
Looking at the source code, it
seems that a shell script for each browser is placed in
/usr/share/psd/browsers
and that it is executed
after checking for the existence of a file with the same name
as the argument of BROWSERS
.

/usr/share/psd/browsers
This could be applied by simply putting my own shell
scripts in /usr/share/psd/browsers
. I really
appreciate this kind of design. I really appreciate this kind
of design, because I don’t have to build, package, and install
it myself.
Check the shell scripts
if [[ -d "$HOME"/.mozilla/firefox ]]; then
index=0
PSNAME="$browser"
while read -r profileItem; do
if [[ $(echo "$profileItem" | cut -c1) = "/" ]]; then
# path is not relative
DIRArr[$index]="$profileItem"
else
# we need to append the default path to give a
# fully qualified path
DIRArr[$index]="$HOME/.mozilla/firefox/$profileItem"
fi
(( index=index+1 ))
done < <(grep '[Pp]'ath= "$HOME"/.mozilla/firefox/profiles.ini | sed 's/[Pp]ath=//')
fi
check_suffix=1
It seems to extract full path of the profiles.
Check Firefox specification
Since all the browsers to be added this time are Firefox-based, check the Firefox profile specifications.

about:profiles
Information on where the profiles are located and which one
is currently applied can be found at
about:profiles
.
Information for managing profiles is compiled in the file
profile.ini
in the directory where the profiles
are located.
[Profile1]
Name=default
IsRelative=1
Path=lekocygz.default
Default=1
[Profile0]
Name=default-release
IsRelative=1
Path=wymt0yba.default-release
[General]
StartWithLastProfile=1
Version=2
[Install3B6073811A6ABF12]
Default=wymt0yba.default-release
Locked=1
The profile usually used is default-release
,
where default
is the profile in the old
specification, and is meant to be a backup in case of
emergency.
Firefox seems to distinguish multiple profiles by their
suffix like default-release-1
, which requires
check_suffix=1
in the shell script.
Deploy shell scripts.
For ESR, simply rewrite “Firefox” to “Firefox-ESR”.
if [[ -d "$HOME"/.mozilla/firefox-esr ]]; then
index=0
PSNAME="$browser"
while read -r profileItem; do
if [[ $(echo "$profileItem" | cut -c1) = "/" ]]; then
# path is not relative
DIRArr[$index]="$profileItem"
else
# we need to append the default path to give a
# fully qualified path
DIRArr[$index]="$HOME/.mozilla/firefox-esr/$profileItem"
fi
(( index=index+1 ))
done < <(grep '[Pp]'ath= "$HOME"/.mozilla/firefox-esr/profiles.ini | sed 's/[Pp]ath=//')
fi
check_suffix=1
LibreWolf had a profile directory
~/.librewolf
, not ~/.mozilla
, so fix
that.
if [[ -d "$HOME"/.librewolf ]]; then
index=0
PSNAME="$browser"
while read -r profileItem; do
if [[ $(echo "$profileItem" | cut -c1) = "/" ]]; then
# path is not relative
DIRArr[$index]="$profileItem"
else
# we need to append the default path to give a
# fully qualified path
DIRArr[$index]="$HOME/.librewolf/$profileItem"
fi
(( index=index+1 ))
done < <(grep '[Pp]'ath= "$HOME"/.librewolf/profiles.ini | sed 's/[Pp]ath=//')
fi
check_suffix=1
You can leave owner as root
and the permission
as 644
.
If there is no error after restarting, you have succeeded.
systemctl --user stop psd
systemctl --user start psd
Check how it works by psd preview
.

Conclusion
If you do it, you really do it at your own risk.