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

Failed to start keyswap for Terminal and GUI #7 follow up #11

Closed
rickdgit opened this issue Sep 4, 2019 · 9 comments
Closed

Failed to start keyswap for Terminal and GUI #7 follow up #11

rickdgit opened this issue Sep 4, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@rickdgit
Copy link

rickdgit commented Sep 4, 2019

Hi @rbreaves ,

This is the follow up from clost issue #7

I did the sudo apt install x11-utils the return indicates x11-utils is already the newest version (7.7+4).

Then I execute the cmd got following response with the most recent repo.

rickd-ubuntu% /bin/bash /home/rickd/.config/xactive.sh mac_only 0 0 0
xprop: error: Invalid window id format: 0x0.
1
internal term to gui
0
internal gui to term
xprop: error: Invalid window id format: 0x0.
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
0
internal gui to term
0
internal gui to term
xprop: error: Invalid window id format: 0x0.

Besides, I'd like to confirm for the install script.

What type of keyboard are you using? (If Mac and Windows then select Mac)
1) Windows
2) Chromebook
3) Mac

Does 1. Windows indicates the windows keyboard layout such as regular office keyboard(108 keys. e,g, amazon keyboard)?
If Im using such kind of keyboard, I should select Windows.

Besides,
image

Thanks!

@rbreaves
Copy link
Owner

rbreaves commented Sep 8, 2019

So when you are running that script manually is it not working or it is? If that scripts runs manually and your OS supports systemd then I am uncertain of why the service itself would fail to run.

It'd be useful for you to run the service (start) and a status argument as described in the readme and post that as well. The output from you running it manually looks pretty normal, sometimes you will see "xprop: error: Invalid window id format: 0x0." but that does not always indicate an actual problem with the keyswap. Sometimes xprop throws an error, but has no real impact on the script behaving properly.

And yes Option 1 is what you would want to select for your keyboard.

@rickdgit
Copy link
Author

It is working when manually runs.

@muhgrill
Copy link

muhgrill commented Oct 3, 2019

I'm seeing a similar issue of not being able to start the service successfully. Eventually it restarts on failure too many times and systemd puts a stop to it. Successfully running manually with ~/.config/xactive.sh mac 0 0 0

Oct 02 21:18:47 hostname bash[3689]: Invalid MIT-MAGIC-COOKIE-1 keyxprop:  unable to open display ':0'
Oct 02 21:18:47 hostname systemd[1651]: keyswap.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit UNIT has successfully entered the 'dead' state.
Oct 02 21:18:48 hostname systemd[1651]: keyswap.service: Service RestartSec=100ms expired, scheduling restart.
Oct 02 21:18:48 hostname systemd[1651]: keyswap.service: Scheduled restart job, restart counter is at 4.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit UNIT has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Oct 02 21:18:48 hostname systemd[1651]: Stopped keyswap for Terminal and GUI.
-- Subject: A stop job for unit UNIT has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit UNIT has finished.
-- 
-- The job identifier is 500 and the job result is done.
Oct 02 21:18:48 hostname systemd[1651]: Started keyswap for Terminal and GUI.
-- Subject: A start job for unit UNIT has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit UNIT has finished successfully.
-- 
-- The job identifier is 500.
Oct 02 21:18:48 hostname bash[3696]: Invalid MIT-MAGIC-COOKIE-1 keyCannot open display ":0"
Oct 02 21:18:48 hostname bash[3696]: Invalid MIT-MAGIC-COOKIE-1 keyError:            Cannot open display ":0"
Oct 02 21:18:48 hostname bash[3696]:                   Exiting
Oct 02 21:18:48 hostname bash[3696]: Invalid MIT-MAGIC-COOKIE-1 keyxprop:  unable to open display ':0'
Oct 02 21:18:48 hostname systemd[1651]: keyswap.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit UNIT has successfully entered the 'dead' state.
Oct 02 21:18:48 hostname systemd[1651]: keyswap.service: Service RestartSec=100ms expired, scheduling restart.
Oct 02 21:18:48 hostname systemd[1651]: keyswap.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit UNIT has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Oct 02 21:18:48 hostname systemd[1651]: Stopped keyswap for Terminal and GUI.
-- Subject: A stop job for unit UNIT has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit UNIT has finished.
-- 
-- The job identifier is 516 and the job result is done.
Oct 02 21:18:48 hostname systemd[1651]: keyswap.service: Start request repeated too quickly.
Oct 02 21:18:48 hostname systemd[1651]: keyswap.service: Failed with result 'start-limit-hit'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit UNIT has entered the 'failed' state with result 'start-limit-hit'.
Oct 02 21:18:48 hostname systemd[1651]: Failed to start keyswap for Terminal and GUI.
-- Subject: A start job for unit UNIT has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit UNIT has finished with a failure.

@rbreaves
Copy link
Owner

rbreaves commented Oct 4, 2019

Which distro are yall using? I may have to spin one up to figure this one out later.

@rickdgit
Copy link
Author

rickdgit commented Oct 7, 2019

ubuntu 19.04 (Disco Dingo)

@muhgrill
Copy link

I'm using Pop OS 19.04, so Ubuntu 19.04 base.

@aritas1
Copy link

aritas1 commented Oct 23, 2019

runs form console on ubuntu 19.10 but systemd logs looks like this

form journalctl --user:

Okt 24 00:29:26 systemd[1391]: keyswap.service: Scheduled restart job, restart counter is at 4.
Okt 24 00:29:26 systemd[1391]: Stopped keyswap for Terminal and GUI.
Okt 24 00:29:26 systemd[1391]: Started keyswap for Terminal and GUI.
Okt 24 00:29:26 bash[5380]: Invalid MIT-MAGIC-COOKIE-1 keyCannot open display ":0"
Okt 24 00:29:26 bash[5380]: Invalid MIT-MAGIC-COOKIE-1 keyError:            Cannot open display ":0"
Okt 24 00:29:26 bash[5380]:                   Exiting
Okt 24 00:29:26 bash[5380]: Invalid MIT-MAGIC-COOKIE-1 keyxprop:  unable to open display ':0'
Okt 24 00:29:26 systemd[1391]: keyswap.service: Succeeded.
Okt 24 00:29:26 systemd[1391]: keyswap.service: Service RestartSec=100ms expired, scheduling restart.
Okt 24 00:29:26 systemd[1391]: keyswap.service: Scheduled restart job, restart counter is at 5.
Okt 24 00:29:26 systemd[1391]: Stopped keyswap for Terminal and GUI.
Okt 24 00:29:26 systemd[1391]: keyswap.service: Start request repeated too quickly.
Okt 24 00:29:26 systemd[1391]: keyswap.service: Failed with result 'start-limit-hit'.
Okt 24 00:29:26 systemd[1391]: Failed to start keyswap for Terminal and GUI.

fix for me: setting the display env from "0" to "1.0"

ref: https://unix.stackexchange.com/a/492821

@rbreaves
Copy link
Owner

Updated the dev branch to also resolve these issues. I will leave this ticket open until I merge it with master. (Still need to do more testing.)

Kinto now has a kintox11 binary that resolves a lot, if not all, of the unexpected failures with xprop. The dev branch was also tested and confirmed working on Ubuntu 18.04-19.10.

git pull origin master && git pull origin dev
systemctl --user stop keyswap
git checkout 2d69c7b

@rbreaves
Copy link
Owner

rbreaves commented Feb 4, 2020

I was unable to duplicate the issue, however due to major changes with the v1.0 release I am closing this ticket. I doubt it is relevant any more.

@rbreaves rbreaves closed this as completed Feb 4, 2020
@rbreaves rbreaves added the bug Something isn't working label Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants