1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01: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) {