the-via / releases

GNU General Public License v3.0
2.08k stars 223 forks source link

Mistaken attempt to add udev rule #122

Open mt-inside opened 3 years ago

mt-inside commented 3 years ago

I'm trying to run via for the first time. I get a GUI prompt asking me to add a udev rule, and saying it needs sudo.

Clicking "cancel" quits via, rather than just continuing. Clicking "continue" crashes via with

Error: No polkit authentication agent found.
    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:203:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  killed: false,
  code: 127,
  signal: null,
  cmd: `cd "/home/matt/work/personal/src/qmk_firmware/keyboards/massdrop/alt/keymaps/via"; "/usr/bin/pkexec" --disable-internal-agent /bin/bash -c "echo SUDOPROMPT; printf 'KERNEL==\\"hidraw*\\", SUBSYSTEM==\\"hidraw\\", MODE=\\"0666\\", TAG+=\\"uaccess\\", TAG+=\\"udev-acl\\"' > /etc/udev/rules.d/92-viia.rules && udevadm control --reload-rules && udevadm trigger"`
}

I'm on arch linux so I can well believe I don't have some software from ubuntu that via is assuming. Helpfully the attempted command is printed, so I've added the file it wants manually. However I'm still getting the prompt - would seem that detection of the udev rule being in place is broken?

$ cat /etc/udev/rules.d/92-viia.rules 
KERNEL="hidraw*", SUBSYSTEM="hidraw", MODE="0666", TAG+="uaccess", TAG+="udev-acl"

Either way, I'm confident the rule is in place so I'd like to be able to skip the prompt, however via seems to have no command-line flags at all? via --help etc all just run the programme as normal.

I've tried running via under sudo so it has the permissions it needs (big trust here), but I get an error

[2146536:0831/220333.623394:FATAL:atom_main_delegate.cc(211)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Trace/breakpoint trap
mt-inside commented 3 years ago

If anyone else lands on this issue, you can get via running with $ DISABLE_SUDO_PROMPT=1 via

However I would say

Doomsk commented 2 years ago

I'm having the same issue on linux mint

mbana commented 8 months ago

This done the trick for me:

setup_keychron_k10_pro() {
    cat<<EOF | sudo tee -a /etc/udev/rules.d/92-viia.rules
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", TAG+="uaccess", TAG+="udev-acl"
EOF
    sudo udevadm control --reload
    sudo udevadm trigger
}
setup_keychron_k10_pro

Paste that into your shell, go to https://usevia.app and if still does not work, close and reload your browser and if THAT does not work, reboot your machine.

You might also need to load in this, https://github.com/Keychron/qmk_firmware/blob/bluetooth_playground/keyboards/keychron/k10_pro/via_json/k10_pro_iso_rgb.json, file as well. You can do so by clicking the DESIGN tab then clicking Load next to Load Draft Definition.

Good luck, - Bana