Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home directory expansion '~' works only on some config entries #144

Closed
ohnonot opened this issue May 12, 2023 · 1 comment
Closed

Home directory expansion '~' works only on some config entries #144

ohnonot opened this issue May 12, 2023 · 1 comment

Comments

@ohnonot
Copy link

ohnonot commented May 12, 2023

There it is in the title.

E.g. under [Database], I can use ~ on the database_1 and keyfile_1 entries, but not on the password_cmd_1 entry - using a custom script, I need to type out my home directory as an absolute path, otherwise keepmenu throws this:

$> keepmenu
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/keepmenu/__main__.py", line 171, in main
    manager = client()
              ^^^^^^^^
  File "/usr/lib/python3.11/site-packages/keepmenu/__main__.py", line 76, in client
    mgr.connect()
  File "/usr/lib/python3.11/multiprocessing/managers.py", line 532, in connect
    conn = Client(self._address, authkey=self._authkey)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 501, in Client
    c = SocketClient(address)
        ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 629, in SocketClient
    s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/keepmenu", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/keepmenu/__main__.py", line 178, in main
    run(**args)
  File "/usr/lib/python3.11/site-packages/keepmenu/__main__.py", line 126, in run
    dmenu = DmenuRunner(server, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/keepmenu/keepmenu.py", line 275, in __init__
    self.database, self.open_databases = get_database(**kwargs)
                                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/keepmenu/keepmenu.py", line 114, in get_database
    dbs_cfg = get_databases()
              ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/keepmenu/keepmenu.py", line 84, in get_databases
    res = subprocess.run(shlex.split(cmd),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1917, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '~/.config/keepmenu/password_cmd_1'

(I also tried $HOME btw)

keepmenu version 1.3.1-3 on Arch Linux, python-pykeepass 4.0.3-2 and python 3.11.3-1.

@firecat53
Copy link
Owner

Try the develop branch and see if that works for you. ~/.config/keepmenu/password_cmd_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants