1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-18 12:38:30 +02:00

qutebrowser: add onChange ipc reloading

This commit is contained in:
Gabriel Fontes 2021-07-09 00:24:21 -03:00 committed by Robert Helgesson
parent 9ed7a73ae2
commit 3ab254aff4
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -306,7 +306,25 @@ in {
};
xdg.configFile."qutebrowser/config.py" =
mkIf pkgs.stdenv.hostPlatform.isLinux { text = qutebrowserConfig; };
mkIf pkgs.stdenv.hostPlatform.isLinux {
text = qutebrowserConfig;
onChange = ''
hash="$(echo -n $USER | md5sum | cut -d' ' -f1)"
socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash"
if [ -S $socket ]; then
echo "Reloading qutebrowser"
command=${
escapeShellArg (builtins.toJSON {
args = [ ":config-source" ];
target_arg = null;
protocol_version = 1;
})
}
$DRY_RUN_CMD echo $command | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:$socket
fi
unset hash socket command
'';
};
xdg.configFile."qutebrowser/quickmarks" =
mkIf (cfg.quickmarks != { } && pkgs.stdenv.hostPlatform.isLinux) {