Skip to content

Commit b507f3c

Browse files
committed
Fix [Bug]: rofi bug #1066
Fixes #1006
1 parent 38e9b99 commit b507f3c

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Configs/.local/bin/hyde-shell

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,20 @@ python_initialized() {
2121

2222
python "${LIB_DIR}/hyde/pyutils/pip_env.py" rebuild
2323
}
24-
python_env="${XDG_STATE_HOME:-$HOME/.local/state}/hyde/pip_env/bin/activate"
25-
if [[ -r "${python_env}" ]]; then
26-
# shellcheck disable=SC1090
27-
source "${python_env}"
28-
else
29-
printf "Warning: Python virtual environment not found at %s\n" "${python_env}"
30-
printf "You may need to run 'hyde-shell pyinit' to set it up.\n"
31-
python_initialized
32-
fi
24+
25+
python_activate() {
26+
27+
local python_env="${XDG_STATE_HOME:-$HOME/.local/state}/hyde/pip_env/bin/activate"
28+
if [[ -r "${python_env}" ]]; then
29+
# shellcheck disable=SC1090
30+
source "${python_env}"
31+
else
32+
printf "Warning: Python virtual environment not found at %s\n" "${python_env}"
33+
printf "You may need to run 'hyde-shell pyinit' to set it up.\n"
34+
python_initialized
35+
fi
36+
37+
}
3338

3439
initialized() {
3540
cat <<EOF
@@ -42,7 +47,7 @@ HYDE_SCRIPTS_PATH=${HYDE_SCRIPTS_PATH}
4247
export BIN_DIR LIB_DIR SHARE_DIR PATH HYDE_SCRIPTS_PATH HYDE_SHELL_INIT
4348
EOF
4449
#? Use sed to remove any shebang hints to avoid conflicts with "eval"
45-
command cat "${LIB_DIR}/hyde/globalcontrol.sh"
50+
command cat "${LIB_DIR}/hyde/globalcontrol.sh"
4651
}
4752

4853
# If args is init or --init, print initialization script
@@ -439,6 +444,7 @@ run_command() {
439444
exec bash "$dir/${1}.sh" "${@:2}"
440445
# Try .py extension
441446
elif [[ -f "$dir/${1}.py" ]]; then
447+
python_activate
442448
exec python "$dir/${1}.py" "${@:2}"
443449
# Try exact name (executable)
444450
elif [[ -f "$dir/${1}" && -x "$dir/${1}" ]]; then

0 commit comments

Comments
 (0)