Right. I said that dictcli.py was not on the path. I understand that NixOS, through a bunch of symlinks, puts the appropriate store items on the path, but the .py script I want to run is bundled with qutebrowser and is not on the path. It would normally live in /usr/share, but we donāt have that path. So how do I find it and run it?
$ which qutebrowser
/nix/store/kbxmdyyl02p1jf3riv1dv838pdnj05lg-qutebrowser-2.5.2/bin/qutebrowser
$ cd /nix/store/kbxmdyyl02p1jf3riv1dv838pdnj05lg-qutebrowser-2.5.2/share/qutebrowser/scripts/
$ ./dictcli.py
I am using home-manager (I assume you are not), so I get this instead:
$ which qutebrowser
/home/username/.nix-profile/bin/qutebrowser
but I was able to do this:
$ cd /home/username/.nix-profile/share/qutebrowser/scripts/
$ ./dictcli.py install en-CA
however, I get errors:
$ ./dictcli.py install en-CA
Traceback (most recent call last):
File "/nix/store/2765jng4mw8x19i67f5hfqwc9vl207q4-qutebrowser-2.5.2/share/qutebrowser/scripts/./dictcli.py", line 269, in <module>
main()
File "/nix/store/2765jng4mw8x19i67f5hfqwc9vl207q4-qutebrowser-2.5.2/share/qutebrowser/scripts/./dictcli.py", line 252, in main
languages = available_languages()
File "/nix/store/2765jng4mw8x19i67f5hfqwc9vl207q4-qutebrowser-2.5.2/share/qutebrowser/scripts/./dictcli.py", line 166, in available_languages
api_list = language_list_from_api()
File "/nix/store/2765jng4mw8x19i67f5hfqwc9vl207q4-qutebrowser-2.5.2/share/qutebrowser/scripts/./dictcli.py", line 146, in language_list_from_api
with urllib.request.urlopen(listurl) as response:
File "/nix/store/hhk4wr7hwry854sq69chmrjqyi964p7y-python3-3.10.9/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/nix/store/hhk4wr7hwry854sq69chmrjqyi964p7y-python3-3.10.9/lib/python3.10/urllib/request.py", line 525, in open
response = meth(req, response)
File "/nix/store/hhk4wr7hwry854sq69chmrjqyi964p7y-python3-3.10.9/lib/python3.10/urllib/request.py", line 634, in http_response
response = self.parent.error(
File "/nix/store/hhk4wr7hwry854sq69chmrjqyi964p7y-python3-3.10.9/lib/python3.10/urllib/request.py", line 563, in error
return self._call_chain(*args)
File "/nix/store/hhk4wr7hwry854sq69chmrjqyi964p7y-python3-3.10.9/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/nix/store/hhk4wr7hwry854sq69chmrjqyi964p7y-python3-3.10.9/lib/python3.10/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
I found this entry in the NixOS wiki: https://nixos.wiki/wiki/Qutebrowser
which is quite useful and answers some of the question I had above.
But, following its suggestions, I get the same errors as above. Does anyone have a solution? Has anyone successfully installed a dictionary for qutebrowser?
Itās because of renaming branch from master to main.
Page on NixOS wiki with example running it has previous branch name .
Qutebrowser version in nixpkgs (v2.5.2) should have a fix for that:
I meant that as a reply to which seems to be broken on Googleās end.
If your current dictcli.py has: API_URL = 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries.git/+/main/'
Then most likely that is not the problem, as both urls that (from a quick look) script is using seem to work: curl 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries.git/+/main/?format=JSON' |less curl 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries.git/+/main/en-US-10-1.bdic?format=TEXT' |less
Looked through src for qutebrowser again and I misread date on v2.5.2 release, it was in Jun 22, 2022.
So only v2.5.3 has that fix and qutebrowser in nixpkgs is on v2.5.2