Skip to content

Commit

Permalink
FvwmCommand: look for FVWMMFL_SOCKET_PATH
Browse files Browse the repository at this point in the history
Needed since commit da4387b.

Fixes fvwmorg#1034
  • Loading branch information
ThomasAdam committed Jun 22, 2024
1 parent dfc46dd commit f6dd682
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions bin/FvwmCommand.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ import json
# or anything fancy and new from FVWM3 new command processing interface.

def mflclnt(verbose, read_from_stdin, info, fvwm_socket, args):
def_socket = False

# Check DISPLAY is defined, else bail:
if not 'DISPLAY' in os.environ:
print("$DISPLAY not set, is xorg/fvwm running?")
sys.exit(1)
if verbose:
print ("DISPLAY set as: " + str(os.environ.get('DISPLAY')))
sock_file_name = '/fvwm_mfl_' + str(os.environ.get('DISPLAY')) + '.sock'

# Create a unix domain socket
Expand All @@ -31,17 +35,24 @@ def mflclnt(verbose, read_from_stdin, info, fvwm_socket, args):
# + Use TMPDIR/fvwmmfl/fvwm_mfl_DISPLAY.sock if defined.
# + Last use default location /tmp/fvwmmfl/fvwm_mfl_DISPLAY.sock
if not fvwm_socket:
if 'FVWMMFL_SOCKET_PATH' in os.environ:
if 'FVWMMFL_SOCKET' in os.environ:
fvwm_socket = str(os.environ.get('FVWMMFL_SOCKET'))
if verbose:
print ("Looking up 'FVWMMFL_SOCKET': " + fvwm_socket)
elif 'FVWMMFL_SOCKET_PATH' in os.environ:
fvwm_socket = str(os.environ.get('FVWMMFL_SOCKET_PATH'))
if verbose:
print ("Looking up 'FVWMMFL_SOCKET_PATH': " + fvwm_socket)
fvwm_socket += sock_file_name
elif 'TMPDIR' in os.environ:
fvwm_socket = str(os.environ.get('TMPDIR'))
if verbose:
print ("Looking up 'TMPDIR': " + fvwm_socket)
fvwm_socket += '/fvwmmfl' + sock_file_name
else:
fvwm_socket = '/tmp/fvwmmfl' + sock_file_name
def_socket = True
else:
def_socket = False

try:
if verbose:
print ("Trying to determine if", fvwm_socket, "exists as MFL socket ...")
Expand Down

0 comments on commit f6dd682

Please sign in to comment.