parent
8d68dbd144
commit
5569770d1e
8 changed files with 24 additions and 31 deletions
|
|
@ -6,14 +6,6 @@ let
|
|||
|
||||
cfg = config.programs.i3status-rust;
|
||||
|
||||
restartI3 = ''
|
||||
i3Socket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*
|
||||
if [ -S $i3Socket ]; then
|
||||
echo "Reloading i3"
|
||||
$DRY_RUN_CMD ${config.xsession.windowManager.i3.package}/bin/i3-msg -s $i3Socket restart 1>/dev/null
|
||||
fi
|
||||
'';
|
||||
|
||||
settingsFormat = pkgs.formats.toml { };
|
||||
|
||||
in {
|
||||
|
|
@ -258,7 +250,12 @@ in {
|
|||
|
||||
xdg.configFile = mapAttrs' (cfgFileSuffix: cfg:
|
||||
nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({
|
||||
onChange = mkIf config.xsession.windowManager.i3.enable restartI3;
|
||||
onChange = mkIf config.xsession.windowManager.i3.enable ''
|
||||
i3Socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*"
|
||||
if [[ -S $i3Socket ]]; then
|
||||
${config.xsession.windowManager.i3.package}/bin/i3-msg -s $i3Socket restart >/dev/null
|
||||
fi
|
||||
'';
|
||||
|
||||
source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({
|
||||
theme = cfg.theme;
|
||||
|
|
|
|||
|
|
@ -309,10 +309,9 @@ in {
|
|||
mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||
text = qutebrowserConfig;
|
||||
onChange = ''
|
||||
hash="$(echo -n $USER | md5sum | cut -d' ' -f1)"
|
||||
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"
|
||||
if [[ -S $socket ]]; then
|
||||
command=${
|
||||
escapeShellArg (builtins.toJSON {
|
||||
args = [ ":config-source" ];
|
||||
|
|
@ -320,7 +319,7 @@ in {
|
|||
protocol_version = 1;
|
||||
})
|
||||
}
|
||||
$DRY_RUN_CMD echo $command | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:$socket
|
||||
echo "$command" | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:"$socket"
|
||||
fi
|
||||
unset hash socket command
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue