Update config_explorer()

This should hopefully prevent new explorer windows from being opened and
instead just reload the shell
This commit is contained in:
2Shirt 2024-04-21 19:11:37 -07:00
parent 709ceef2b7
commit 8dcbcfc6cb
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -25,7 +25,7 @@ from wk.cfg.setup import (
REG_WINDOWS_EXPLORER,
UBLOCK_ORIGIN_URLS,
)
from wk.exe import kill_procs, run_program, popen_program
from wk.exe import get_procs, kill_procs, run_program, popen_program
from wk.io import case_insensitive_path, get_path_obj
from wk.kit.tools import (
ARCH,
@ -688,7 +688,12 @@ def config_explorer() -> None:
"""Configure Windows Explorer and restart the process."""
reg_write_settings(REG_WINDOWS_EXPLORER)
kill_procs('explorer.exe', force=True)
popen_program(['explorer.exe'])
popen_program([fr'{SYSTEMDRIVE}\Windows\explorer.exe'])
sleep(3)
for _ in range(30):
if get_procs('explorer.exe'):
break
sleep(1)
def config_open_shell() -> None: