diff --git a/bin/hidconsole b/bin/hidconsole index dfbbf461..40196281 100755 --- a/bin/hidconsole +++ b/bin/hidconsole @@ -1,7 +1,7 @@ #!/bin/sh LIB=`dirname "$0"`/../lib -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB/native/`uname -m` +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB/native/`arch` export PYTHONPATH=$LIB exec python -OOu -m hidapi.hidconsole "$@" diff --git a/bin/scan b/bin/scan index b9299a92..b81e0242 100755 --- a/bin/scan +++ b/bin/scan @@ -1,7 +1,7 @@ #!/bin/sh LIB=`dirname "$0"`/../lib -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB/native/`uname -m` +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB/native/`arch` export PYTHONPATH=$LIB exec python -OOu -m logitech.scanner "$@" diff --git a/bin/solaar b/bin/solaar index cd4b3e33..7d9608bb 100755 --- a/bin/solaar +++ b/bin/solaar @@ -5,7 +5,7 @@ APP=`readlink -f $(dirname "$Z")/../app` LIB=`readlink -f $(dirname "$Z")/../lib` SHARE=`readlink -f $(dirname "$Z")/../share` -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB/native/`uname -m` +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB/native/`arch` export PYTHONPATH=$APP:$LIB export XDG_DATA_DIRS=$SHARE:$XDG_DATA_DIRS diff --git a/lib/hidapi/hidconsole.py b/lib/hidapi/hidconsole.py index 8aeea3f5..8511c8db 100644 --- a/lib/hidapi/hidconsole.py +++ b/lib/hidapi/hidconsole.py @@ -45,7 +45,7 @@ def _continuous_read(handle, timeout=1000): if __name__ == '__main__': import argparse arg_parser = argparse.ArgumentParser() - arg_parser.add_argument('--history', default='.hidconsole-history', help='history file') + arg_parser.add_argument('--history', help='history file') arg_parser.add_argument('device', default=None, help='linux device to connect to') args = arg_parser.parse_args() @@ -60,7 +60,14 @@ if __name__ == '__main__': print (".. Press ^C/^D to exit, or type hex bytes to write to the device.") import readline - readline.read_history_file(args.history) + if args.history is None: + import os.path + args.history = os.path.join(os.path.expanduser("~"), ".hidconsole-history") + try: + readline.read_history_file(args.history) + except: + # file may not exist yet + pass start_time = time.time()