From d96c7fefb94843022d4cd6990424f53dda8fc1aa Mon Sep 17 00:00:00 2001 From: chayleaf Date: Mon, 25 Dec 2023 08:17:39 +0700 Subject: [PATCH] fix keepass unlock https://keepassxc.org/docs/KeePassXC_UserGuide#_automatic_database_opening --- home/modules/i3-sway.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/home/modules/i3-sway.nix b/home/modules/i3-sway.nix index caced24..aa8551a 100644 --- a/home/modules/i3-sway.nix +++ b/home/modules/i3-sway.nix @@ -104,16 +104,27 @@ commonConfig = { startup = [ { command = toString (pkgs.writeShellScript "init-wm" '' ${lib.optionalString config.phone.enable '' - ${pkgs.squeekboard}/bin/squeekboard& + ${pkgs.procps}/bin/pkill -x wvkbd-mobintl ${pkgs.wvkbd}/bin/wvkbd-mobintl --hidden -l full,special,cyrillic,emoji& + ${pkgs.procps}/bin/pkill -x squeekboard + ${pkgs.squeekboard}/bin/squeekboard& /run/current-system/sw/bin/busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true ''} + ${pkgs.procps}/bin/pkill -x home-daemon ${pkgs.home-daemon}/bin/home-daemon system76-scheduler& - ${pkgs.gnome.zenity}/bin/zenity --password | ${pkgs.coreutils}/bin/tee /dev/stdout | (${pkgs.keepassxc}/bin/keepassxc --pw-stdin ~/Nextcloud/keepass.kdbx ~/var/local.kdbx&) + ${pkgs.procps}/bin/pkill -x keepassxc + ${pkgs.gnome.zenity}/bin/zenity --password | (${pkgs.keepassxc}/bin/keepassxc --pw-stdin ~/var/local.kdbx &) + # sleep to give keepassxc time to take the input + sleep 1 # nextcloud and nheko need secret service access + ${pkgs.procps}/bin/pkill -x nextcloud ${pkgs.nextcloud-client}/bin/nextcloud --background& + ${pkgs.procps}/bin/pkill -x nheko ${pkgs.nheko}/bin/nheko& + ${pkgs.procps}/bin/pkill -x telegram-desktop ${pkgs.tdesktop}/bin/telegram-desktop -startintray& + # and final sleep just in case + sleep 1 ''); } ]; colors = { @@ -360,7 +371,7 @@ in fi ''}"; }); - startup = commonConfig.startup ++ [ + startup = [ { always = true; command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"; @@ -368,7 +379,7 @@ in { command = "${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${pkgs.clipman}/bin/clipman store --no-persist"; } - ]; + ] ++ commonConfig.startup; output = { "*" = { bg = "~/var/wallpaper.jpg fill";