Skip to content

Can't use --no-i3 at the same time as --show myconfig.config #3

@GuySartorelli

Description

@GuySartorelli

I'm running wayland, so I don't have i3. I intend to use this for macros that don't require i3 and I see this tool has a --no-i3 flag to assist with that.

When I try to run ./macropad.py --show myconfig.conf I get this error output:

Traceback (most recent call last):
  File "/home/gsartorelli/local-dev/macropad/./macropad.py", line 773, in <module>
    loadConfig(file)
  File "/home/gsartorelli/local-dev/macropad/./macropad.py", line 362, in loadConfig
    main(selectedDevice)
  File "/home/gsartorelli/local-dev/macropad/./macropad.py", line 727, in main
    i3.subscribe(['window'], focusHandler)
  File "/home/gsartorelli/local-dev/macropad/i3msg.py", line 51, in subscribe
    s.connect(get_i3sockpath())
  File "/home/gsartorelli/local-dev/macropad/i3msg.py", line 16, in get_i3sockpath
    i3sockpath = subprocess.check_output(['i3', '--get-socketpath']).strip()
  File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'i3'

When I try to run it with --no-i3 (i.e. ./macropad.py --no-i3 --show myconfig.conf) I get "Too many arguments." followed by usage instructions.

Possible solutions

  1. Auto-detect if i3 is available - if not, don't try to use it (i.e. remove the need for a --no-i3 flag at all)
  2. Don't try to use i3 when using the --show flag
  3. Allow using both --no-i3 and --show at the same time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions