@@ -61,7 +61,7 @@ call_wallbashScript() {
6161 local scriptName=$1
6262 shift
6363 local args=(" ${@ } " )
64- local dirs=(" ${wallbashDirs [@]} " )
64+ local dirs=(" ${WALLBASH_DIRS [@]} " )
6565 sanitized_dirs=()
6666 for dir in " ${dirs[@]} " ; do
6767 if [[ -d " $dir " ]]; then
@@ -193,7 +193,7 @@ get_completion_data() {
193193 done < <( list_script 2> /dev/null | sort -u)
194194
195195 # Get wallbash scripts
196- local dirs=(" ${wallbashDirs [@]} " )
196+ local dirs=(" ${WALLBASH_DIRS [@]} " )
197197 wallbash_scripts=(" --help" ) # Add --help as first option
198198 # Simplified - just --help for now since dynamic parsing is complex
199199
@@ -459,12 +459,27 @@ run_pypr() {
459459 if command -v pypr > /dev/null 2>&1 ; then
460460
461461 socket_path=" ${XDG_RUNTIME_DIR} /hypr/${HYPRLAND_INSTANCE_SIGNATURE} /.pyprland.sock"
462+ if [[ -f " ${XDG_CONFIG_HOME:- $HOME / .config} /hypr/pyprland.toml " ]]; then
463+ send_notifs " Missing pyprland.toml" " Please create a pyprland.toml file in ${XDG_CONFIG_HOME:- $HOME / .config} /hypr/ to configure PyPR."
464+ exit 1
465+ fi
462466
463467 if [[ -S " $socket_path " ]] && pgrep -u " $USER " pypr > /dev/null 2>&1 ; then
464- exec app2unit.sh pypr " $@ "
468+ message=" ${*:- " help" } "
469+ # Send the message to the socket and print the response
470+ if ! printf " %s" " ${message[@]} " | nc -N -U " $socket_path " ; then
471+ if ! printf " %s" " ${message[@]} " | socat - UNIX-CONNECT:" $socket_path " ; then
472+ print_log -sec " pypr" " Error communicating with socket: $socket_path "
473+ exit 1
474+ fi
475+
476+ fi
477+
465478 else
466479 print_log -sec " pypr" " PyPR is not running properly, starting fresh"
467- rm " $socket_path "
480+ [[ -S " $socket_path " ]] && print_log -y " Removing stale socket: $socket_path "
481+ pgrep -u " $USER " pypr > /dev/null && print_log -y " Killing existing pypr process"
482+ rm -f " $socket_path "
468483
469484 exec app2unit.sh -t service pypr
470485 fi
0 commit comments