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

pkexec broken in chromeos + debian environment #977

Open
lumorin opened this issue Oct 18, 2024 · 12 comments
Open

pkexec broken in chromeos + debian environment #977

lumorin opened this issue Oct 18, 2024 · 12 comments

Comments

@lumorin
Copy link

lumorin commented Oct 18, 2024

Hi,
I don't have any experience with linux, just bought a chromebook that has debian and needed to install input-remapper to use my 8bitdo zero 2 controller to study my flashcards in Anki.

I have downloaded the input-remapper deb file and it installed, but I can't seen to run it. No icon in the applications menu to launch the app appeared, also tried to do it manually in terminal with no success.

Other apps that I have installed in my chromebook linux enviroment are working fine, such as VLC, ticktick, obsidian, Anki.

If someone could help me figure out what to do, I will be so grateful. Input-remapper seems to be the only app that can help me solving the keymapping for my controller!

This is what I got from runing sudo pkill -f input-remapper && input-remapper-gtk -d:

sudo pkill -f input-remapper && input-remapper-gtk -d
11:20:55.501021 4581 GUI INFO logger.py:107: input-remapper-gtk 2.0.1 08226a2 https://github.com/sezanzeb/input-remapper
11:20:55.501390 4581 GUI INFO logger.py:115: python-evdev 1.6.1
11:20:55.501492 4581 GUI WARNING logger.py:118: Debug level will log all your keystrokes! Do not post this output in the internet if you typed in sensitive or private information with your device!
11:20:55.501592 4581 GUI DEBUG input-remapper-gtk:71: Using locale directory: /usr/share/input-remapper/lang
11:20:55.590159 4581 GUI DEBUG global_uinputs.py:139: Creating FrontendUInputs
11:20:55.590450 4581 GUI DEBUG global_uinputs.py:91: creating fake UInput device: "input-remapper keyboard"
11:20:55.590554 4581 GUI DEBUG global_uinputs.py:91: creating fake UInput device: "input-remapper gamepad"
11:20:55.590680 4581 GUI DEBUG global_uinputs.py:91: creating fake UInput device: "input-remapper mouse"
11:20:55.590780 4581 GUI DEBUG global_uinputs.py:91: creating fake UInput device: "input-remapper keyboard + mouse"
11:20:55.594753 4581 GUI DEBUG pipe.py:70: Creating new pipe for "/tmp/input-remapper-/home/user/reader-results"
11:20:55.597497 4581 GUI DEBUG pipe.py:70: Creating new pipe for "/tmp/input-remapper-/home/user/reader-commands"
11:20:55.600954 4581 GUI DEBUG message_broker.py:96: adding new Listener for MessageType.terminate: <function ReaderClient.attach_to_events.. at 0x7f7ca7e75c60>
11:20:55.605642 4581 GUI DEBUG reader_service.py:144: Running pkexec input-remapper-control --command start-reader-service -d
sh: 1: pkexec: not found
11:20:55.610437 4581 GUI ERROR input-remapper-gtk:51: Failed to pkexec the reader-service, code 32512
user@penguin:~/input-remapper$

@sezanzeb
Copy link
Owner

try sudo apt install policykit-1

@lumorin
Copy link
Author

lumorin commented Oct 19, 2024

try sudo apt install policykit-1

It installed policykit-1 but nothing changed :(

user@penguin:~$` input-remapper
-bash: input-remapper: command not found

This is what I got from running sudo pkill -f input-remapper && input-remapper-gtk -d again

sudo pkill -f input-remapper && input-remapper-gtk -d
14:03:34.076430 7353 GUI INFO logger.py:265: input-remapper-gtk 2.0.1 568f56cdb438f4ad6db9e96b2900d1228ea736ee https://github.com/sezanzeb/input-remapper
14:03:34.095441 7353 GUI INFO logger.py:273: python-evdev 1.6.1
14:03:34.095715 7353 GUI WARNING logger.py:276: Debug level will log all your keystrokes! Do not post this output in the internet if you typed in sensitive or private information with your device!
14:03:34.095879 7353 GUI DEBUG input-remapper-gtk:67: Using locale directory: /usr/share/input-remapper/lang
14:03:34.196304 7353 GUI DEBUG global_uinputs.py:135: Creating FrontendUInputs
14:03:34.196507 7353 GUI DEBUG global_uinputs.py:103: creating fake UInput device: "input-remapper keyboard"
14:03:34.196643 7353 GUI DEBUG global_uinputs.py:103: creating fake UInput device: "input-remapper gamepad"
14:03:34.196755 7353 GUI DEBUG global_uinputs.py:103: creating fake UInput device: "input-remapper mouse"
14:03:34.196901 7353 GUI DEBUG global_uinputs.py:103: creating fake UInput device: "input-remapper keyboard + mouse"
14:03:34.197321 7353 GUI INFO paths.py:72: Creating dir "/tmp/input-remapper-user"
14:03:34.200315 7353 GUI DEBUG pipe.py:70: Creating new pipe for "/tmp/input-remapper-user/reader-results"
14:03:34.204136 7353 GUI DEBUG pipe.py:70: Creating new pipe for "/tmp/input-remapper-user/reader-commands"
14:03:34.205773 7353 GUI DEBUG message_broker.py:97: adding new Listener for MessageType.terminate: <function ReaderClient.attach_to_events.<locals>.<lambda> at 0x7f92a9b2bba0>
14:03:34.206824 7353 GUI DEBUG reader_service.py:144: Running `pkexec input-remapper-control --command start-reader-service -d`
Error executing command as another user: Not authorized

This incident has been reported.
14:03:34.401831 7353 GUI ERROR input-remapper-gtk:50: Failed to pkexec the reader-service, code 32512 

@sezanzeb
Copy link
Owner

Does pkexec echo asdf work?

@lumorin
Copy link
Author

lumorin commented Oct 19, 2024

Does pkexec echo asdf work?

Unfortunately, no.

~$ pkexec echo asdf
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/echo' as the super user
Authenticating as: user
Password: 
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.

@sezanzeb
Copy link
Owner

sezanzeb commented Oct 19, 2024

hm, I'd say something in the polkit stuff of your operating system must be somewhat broken or not configured properly, and I'm afraid I can't help you with that. I'm not an expert on most of that stuff, I just worked once with it long enough to get it to work a few years ago, and then never touched it again.

Since you are a beginner with Linux, I would probably recommend you to get Ubuntu. It is based on Debian, and has a good reputation for personal computers. A lot of people use it. Chances are that it works there. In Ubuntu, there is also a newer version of input-remapper in the repo, so you just have to do sudo apt install input-remapper. I really only use Debian when working with docker containerization.

@lumorin
Copy link
Author

lumorin commented Oct 19, 2024

hm, I'd say something in the polkit stuff of your operating system must be somewhat broken or not configured properly, and I'm afraid I can't help you with that. I'm not an expert on most of that stuff, I just worked once with it long enough to get it to work a few years ago, and then never touched it again.

Since you are a beginner with Linux, I would probably recommend you to get Ubuntu. It is based on Debian, and has a good reputation for personal computers. A lot of people use it. Chances are that it works there. In Ubuntu, there is also a newer version of input-remapper in the repo, so you just have to do sudo apt install input-remapper. I really only use Debian when working with docker containerization.

My chromebook runs ChromeOS with a linux development area that can be used to install linux programs. I'm not sure it's possible to use Ubuntu instead of Debian in this case. Honestly this app would be the only reason to make any changes, everything else is working perfectly. I just need to be able to use my 8bitdo controller to go through thounsands of flashcards in Anki :(((

Are you aware of any other solutions for keymapping that might work for me?

Thank you so much for the help!!

@sezanzeb
Copy link
Owner

sezanzeb commented Oct 19, 2024

This is discouraged (see https://wiki.archlinux.org/title/Running_GUI_applications_as_root), but you could try to run sudo input-remapper-gtk.

This doesn't work in wayland for example, lets see if this works in that development area of yours.

@lumorin
Copy link
Author

lumorin commented Oct 20, 2024

This is discouraged (see https://wiki.archlinux.org/title/Running_GUI_applications_as_root), but you could try to run sudo input-remapper-gtk.

This doesn't work in wayland for example, lets see if this works in that development area of yours.

Yep, no luck :(
(input-remapper-gtk:9711): Gtk-WARNING **: 23:27:38.266: cannot open display: :0

@sezanzeb sezanzeb changed the title Installed deb file but can't run the app pkexec broken Oct 20, 2024
@sezanzeb sezanzeb changed the title pkexec broken pkexec broken in chromeos + debian environment Oct 20, 2024
@sezanzeb
Copy link
Owner

sezanzeb commented Oct 20, 2024

Try installing from the separate-reader-service branch.

then do

sudo pkill -f input-remapper

# In 3 different terminals, in this order:
sudo input-remapper-service
input-remapper-gtk --separate-reader-service 
sudo input-remapper-reader-service

Once input-remapper-reader-service runs, the gui should automatically show all the devices.

@sezanzeb
Copy link
Owner

You might need to restart sudo input-remapper-reader-service sometimes, because it automatically stops if it has been idle for too long.

@sezanzeb
Copy link
Owner

Renamed the argument to input-remapper-gtk --without-reader-service

@sezanzeb
Copy link
Owner

sezanzeb commented Oct 27, 2024

once #990 is merged, all you need to do (probably) is to run

sudo input-remapper-reader-service &
sudo input-remapper-service &  # (if not already running)
input-remapper-gtk

however, beware that the reader-service may still time out and then the gui will attempt to ask for a password once more to restart it. I guess this improvement is usually only helpful for people who are developing input-remapper and often start and stop input-remapper.

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