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

Cannot change linux ttys #80

Open
oblivikun opened this issue Jun 14, 2024 · 28 comments
Open

Cannot change linux ttys #80

oblivikun opened this issue Jun 14, 2024 · 28 comments

Comments

@oblivikun
Copy link

when pressing ctrl+alt+f1-f6 i cannot switch to a diffirent tty like in other wayland compositors such as sway. i have tried manually adding the bindings in the cagebreak config but it does nothing

@sodface
Copy link

sodface commented Jun 14, 2024

It works for me on Alpine with Cagebreak version 2.3.1. What distro are you running?

@oblivikun
Copy link
Author

gentoo linux musl, wlroots compiled with vulkan,libinput,drm and x11 backend support

@oblivikun
Copy link
Author

im running cagebreak 2.2.3

@oblivikun
Copy link
Author

i should probably update cagebreak then check

@oblivikun
Copy link
Author

still occurs on cagebreak 2.3.1

@sodface
Copy link

sodface commented Jun 14, 2024

We have musl in common. My wlroots version is 0.17.3.

@oblivikun
Copy link
Author

im running wlroots 0.17.2, il try updating it

@sodface
Copy link

sodface commented Jun 14, 2024

I've actually been switching ttys with those keys a lot recently on my laptop, and it's fast. I'm doing it on my multi monitor desktop and it's a little slow to switch back and forth but it does work.

@sodface
Copy link

sodface commented Jun 14, 2024

Well I should say on the desktop it's fast to switch to a different tty but then a bit slow for the Cagebreak session to reappear when I switch back to tty1. By slow though I only mean about 1-2 seconds.

@oblivikun
Copy link
Author

still running into that issue

@sodface
Copy link

sodface commented Jun 14, 2024

And sway works ok on the same hardware?

@sodface
Copy link

sodface commented Jun 14, 2024

Did you back out those key bindings from your config?

@oblivikun
Copy link
Author

yes, on sway i can change with the keys, but on cagebreak i have to manually call it with the chvt command

@sodface
Copy link

sodface commented Jun 14, 2024

Weird. I'm on my laptop now and it's working fine, same component versions as my desktop.

@oblivikun
Copy link
Author

it apears that it may be the C-A key combination that is not being recognized, as i can change ttys by binding L-[1,2,3] to exec sudo chvt (number)

@sodface
Copy link

sodface commented Jun 14, 2024

keybinding_switch_vt(struct cg_server *server, unsigned int vt) {

There's a couple if's there, one of which might be false?

@oblivikun
Copy link
Author

i removed that if statement and im still not able to switch ttys

@sodface
Copy link

sodface commented Jun 14, 2024

I don't know if it matters, but I'm starting cagebreak from tty1 (no login manager) and in my .profile I have:

 exec dbus-run-session -- cagebreak -e > cagebreak.log 2>&1

@oblivikun
Copy link
Author

im not running cagebreak with socket or dbus, will try that.

@oblivikun
Copy link
Author

still no luck

@sodface
Copy link

sodface commented Jun 14, 2024

I'm running out of ideas. Sway seems to use the same function to change vt:

https://github.com/swaywm/sway/blob/cc342107690631cf1ff003fed0b1cdb072491c63/sway/input/keyboard.c#L272-L276

But a difference in how the vt number is calculated... not really sure what that's doing.

@sodface
Copy link

sodface commented Jun 14, 2024

evtest for me:

Event: time 1718399096.500469, -------------- SYN_REPORT ------------
Event: time 1718399097.643815, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1718399097.643815, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1718399097.643815, -------------- SYN_REPORT ------------
Event: time 1718399097.964859, type 4 (EV_MSC), code 4 (MSC_SCAN), value 38
Event: time 1718399097.964859, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1
Event: time 1718399097.964859, -------------- SYN_REPORT ------------
Event: time 1718399098.181675, type 4 (EV_MSC), code 4 (MSC_SCAN), value 3c
Event: time 1718399098.181675, type 1 (EV_KEY), code 60 (KEY_F2), value 1
Event: time 1718399098.181675, -------------- SYN_REPORT ------------
Event: time 1718399098.323515, type 4 (EV_MSC), code 4 (MSC_SCAN), value 3c
Event: time 1718399098.323515, type 1 (EV_KEY), code 60 (KEY_F2), value 0

@oblivikun
Copy link
Author

then i will copy what sway does

@sodface
Copy link

sodface commented Jun 14, 2024

I guess I should have asked if you started with the example Cagebreak config? Mine has:

definekey top XF86_Switch_VT_1 switchvt 1
definekey top XF86_Switch_VT_2 switchvt 2
definekey top XF86_Switch_VT_3 switchvt 3
definekey top XF86_Switch_VT_4 switchvt 4
definekey top XF86_Switch_VT_5 switchvt 5
definekey top XF86_Switch_VT_6 switchvt 6

@oblivikun
Copy link
Author

after applying the logic that sway did, it worked

@sodface
Copy link

sodface commented Jun 14, 2024

Hmmm, and your non working config had the above default key bindings?

@oblivikun
Copy link
Author

yes

@project-repo
Copy link
Owner

Hi,
Sorry for the long response time. I have two questions that might help us figure out what's going on here:

  1. What does pressing ctrl+alt+fn+f1-6 do?
  2. You said that "applying the logic that sway did" makes it work. What do you mean by this exactly?

Cheers,
project-repo

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

3 participants