mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 20:29:47 +01:00
qutebrowser: add onChange ipc reloading
This commit is contained in:
parent
9ed7a73ae2
commit
3ab254aff4
1 changed files with 19 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue