i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
920 stars 404 forks source link

Feature request: Allow on screen keyboards like onboard with i3lock #273

Closed arjunkc closed 4 years ago

arjunkc commented 4 years ago

I'm submitting a…

[ ] Bug
[X] Feature Request
[ ] Other (Please describe in detail)

Current Behavior

Currently, when I use i3lock to lock my 2-in-1 laptop, I have to move back to laptop mode to unlock my screen. So if there a way to have an on screen keyboard like 'onboard' work with i3lock, then that would be great.

Expected Behavior

After fixing, invoking i3lock with

i3lock --keyboard /usr/bin/onboard

would make onboard appear on the screen

stapelberg commented 4 years ago

In general, i3 and i3lock aren’t meant to be used without a keyboard.

That said, I don’t know what’s required to implement this. If it’s simple enough, I wouldn’t mind.

arjunkc commented 4 years ago

The main virtual keyboards I can find are here. You can run most of them on X, independent of DE. You simply click on the keyboard to enter keystrokes. They all work on lightdm or gdm login screens or any terminals. Is there any way for i3lock to call one of these programs and overlay them on the lockscreen? I think keystrokes would accepted just like a regular keyboard.

  1. gok (gnome onscreen keyboard). Depends on gnome.
  2. xvkbd. Doesnt seem to have too many dependencies, not dependent on gnome. Seems like an ideal candidate.
  3. onboard. written in python, and ubuntu's default onscreen keyboard.
  4. florence. Not dependent on gnome, but seems to have a few more dependencies than xvkbd.
  5. cellwriter (this would be ideal for a tablet since it allows you to enter characters by writing with a stylus).
stapelberg commented 4 years ago

Is there any way for i3lock to call one of these programs

Alternatively, can you start one of these immediately before starting i3lock?

arjunkc commented 4 years ago

If I do

onboard & 
i3lock

then i3lock screen covers the onscreen keyboard and I cannot see either the window or the mouse. For touchscreen input I would have to be able to see the on screen keyboard and the mouse.

nvllsvm commented 4 years ago
onboard & 
i3lock

This works. Ensure you do not have onboard set to start hidden. Also ensure you have onboard set to Force window to top.

EDIT: The above does not work if onboard is visible when locking. This is more reliable.

pkill -x onboard
onboard &
i3lock
arjunkc commented 4 years ago

I just tried this and it doesn't work for me: enable force window to top in onboard.

pkill -x onboard
onboard &
i3lock

I'm on i3lock 2.11.1 on debian buster running i3. Has there been a change in 2.12 that fixes this? I also tried it with and without a compositor.

nvllsvm commented 4 years ago

Hm, I'm having trouble replicating it on my desktop. Might be working on my Surface Go due to it being so slow. Perhaps adding a sleep before onboard would fix it - not sure.

arjunkc commented 4 years ago

Ok, I guess it's working for me now. Steps:

  1. Enable "force window on top" in onboard options.
  2. /usr/bin/i3lock & onboard &

Works perfectly for me now. I can leave it open until you confirm it works for you. It even works with my suspend script.

pkill -x onboard
/usr/bin/i3lock
onboard &
systemctl suspend
jackghg commented 4 years ago

yeah do this please!

jackghg commented 4 years ago

why is this closed ? the workaround is unreliable and doesnt work here (and if it works its a bug, a security flaw). I'd like this feature!

arjunkc commented 4 years ago

I can reopen it, but the developer ought to decide. Why is it a security flaw?

Quoting jackghg (2020-08-22 19:26:35)

why is this closed ? the workaround is unreliable and doesnt work here (and if it works its a bug, a security flaw).

— You are receiving this because you modified the open/close state. Reply to this email directly, [1]view it on GitHub, or [2]unsubscribe.

References

Visible links

  1. https://github.com/i3/i3lock/issues/273#issuecomment-678708285
  2. https://github.com/notifications/unsubscribe-auth/AALDMTT6YB6CHWIHTQUTW6LSCBH2XANCNFSM4N5GDYKA
jackghg commented 4 years ago

the purpose of a screen locker is to not allow any app to show or interact with! It doesnt work anyway, i tryed on 2 devices. For sure it doesn't work always and everywhere. But if it was a feature then it would work correctly. Yes please, reopen it.

arjunkc commented 4 years ago

Just to be sure, did you enable "force window on top" in onboard? And did you run it like I suggested, i3lock && pkill -x onboard && onboard &

For me, this works consistently on all my computers: a debian buster laptop and an ubuntu focal desktop.

Quoting jackghg (2020-08-22 20:18:40)

i think so. it doesnt work anyway, i tryed on 2 devices. For sure it doesn't work always and everywhere. But if it was a feature then it would work correctly. Yes please, reopen it.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.*

jackghg commented 4 years ago

I comfirm. But even if it works its a unpredictable behavior, and probably should not work.

root2185 commented 2 years ago

It doesn't work on sxmo-wm-dwm. After I enabled "force window on top" in onboard options, I tried /usr/bin/i3lock & onboard & and the script:

pkill -x onboard
/usr/bin/i3lock
onboard &

Can I make it work? Also a real implementation of a OSK for i3lock would be nice.

stapelberg commented 2 years ago

Also a real implementation of a OSK for i3lock would be nice.

We won’t add a built-in on-screen keyboard to i3lock. That’s a lot of effort to develop and maintain. In general, all i3 programs are made to be used with a keyboard primarily, or at the very least a keyboard present.

arjunkc commented 2 years ago

Is it possible to get it to play well with an osk like onboard?

On September 12, 2022 2:16:18 PM EDT, Michael Stapelberg @.***> wrote:

Also a real implementation of a OSK for i3lock would be nice.

We won’t add a built-in on-screen keyboard to i3lock. That’s a lot of effort to develop and maintain. In general, all i3 programs are made to be used with a keyboard primarily, or at the very least a keyboard present.

-- > Reply to this email directly or view it on GitHub:

https://github.com/i3/i3lock/issues/273#issuecomment-1244120493

You are receiving this because you modified the open/close state.

Message ID: @.***>

jackghg commented 2 years ago

Try my keyboard: https://codeberg.org/jackc/OnKey

root2185 commented 2 years ago

@arjunkc By doing as you said I can use onboard on my desktop, on openbox. But not on mobile on sxmo-wm-dwm.

@jackghg I tried i3lock & onkey &, i3lock & onkey -p & and

pkill -x onkey
i3lock
onkey & #I tried both with and without -p 

Any suggestion?

arjunkc commented 2 years ago

@Scorpion2185 Doesn't work for me anymore for some reason, that's why I was asking. Maybe some OS update borked it.

Quoting Scorpion2185 (2022-09-14 04:04:47)

@.*** By doing as you said I can use onboard on my desktop, on openbox. But not on mobile on sxmo-wm-dwm.

@.*** I tried i3lock & onkey &, i3lock & onkey -p & and

pkill -x onkey i3lock onkey & #I tried both with and without -p

Any suggestion?

— Reply to this email directly, [3]view it on GitHub, or [4]unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

References

Visible links

  1. https://github.com/arjunkc
  2. https://github.com/jackghg
  3. https://github.com/i3/i3lock/issues/273#issuecomment-1246394706
  4. https://github.com/notifications/unsubscribe-auth/AALDMTTZJQ2PB2V2AKINI5LV6GBJ7ANCNFSM4N5GDYKA
root2185 commented 2 years ago

@jackghg Maybe you can fork it and implement your keyboard or an option to use one.

jackghg commented 2 years ago

@Scorpion2185 Sorry i didnt see. try: i3lock & sleep 3 && onkey -p try it also for onboard ...try also my screen lock smlock :) also sflock isnt bad

root2185 commented 2 years ago

@jackghg That didn't work for both onboard and onkey.

I cannot start smlock/sflock on my device, a PinePhone.

jackghg commented 2 years ago

@Scorpion2185 I made them for my pinephone :) sflock doesnt work probably becuse u r using wayland...

root2185 commented 2 years ago

@jackghg No I am on x, as I said I am using sxmo-wm-dwm.

Edit: I had an error about missing font using xfontsel I found one, smlock -b "Welcome back user" -i "sxmo_keyboard.sh open" -f -urw-*-medium-r-normal-medium-0-360-0-0-p-0-iso8859-1 -g -urw-*-medium-r-normal-medium-0-1600-0-0-p-0-iso8859-1 -e "sxmo_keyboard.sh close" works.