You are not logged in.

#1 2017-05-25 07:47:50

SuperPrower
Member
Registered: 2017-05-21
Posts: 15

Prevent X from being killed while locked with i3lock or lock tty

I am running X server by typing 'startx' after login into my tty. I also have Ctrtl+Alt+Backspace shortcut to kill X server. So, if anyone comes to my PC and sees my i3lock, they can press this combination, kill my X server, and see tty with me being logged in, then just type startx and have access  to my system.

Is there a way to somehow either:

a) Lock or exit from tty where I started X server (it starts in the same tty, so I don't know if other advice I found on the internet can help) after starting it - I know about vlock, but people say it's locking everything, and hybernation, sleep and other things stop working.

b) Prevent this combination when i3lock script is running - I wouldn't want this because if my X hangs on lockscreen I couldn't kill it without rebooting

Thanks in advance.

Offline

#2 2017-05-25 07:51:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Prevent X from being killed while locked with i3lock or lock tty

Start X from your shell profile and include a logout command:

# startx if on tty1
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
  exec startx -- vt1 -keeptty &>/dev/null
  logout
fi

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-12-03 08:56:42

SuperPrower
Member
Registered: 2017-05-21
Posts: 15

Re: Prevent X from being killed while locked with i3lock or lock tty

jasonwryan wrote:

Start X from your shell profile and include a logout command

Hi, sorry for such late reply, can you please point me to wiki article that will tell me or just tell me where do I put this piece of code?

Offline

#4 2017-12-03 09:59:15

saf1
Member
Registered: 2011-04-04
Posts: 28

Re: Prevent X from being killed while locked with i3lock or lock tty

the first result if I searched for "startx" in the wiki:
Startx#Autostart_X_at_login

Offline

#5 2017-12-03 11:58:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,403
Website

Re: Prevent X from being killed while locked with i3lock or lock tty

There should be no need for an explicit `logout` command if one properly uses `exec startx` rather than just `startx`.

While automating this in a shell profile is handy, that seems completely orthogonal to the question at hand.  OP, instead of running `startx` from your tty, just use `exec startx` and the problem will be solved: if anyone uses Ctrl-Alt-Del from your lock screen, X may quit, but then they'll be dropped back to your logged out tty with a prompt for a username/password.

Last edited by Trilby (2017-12-03 11:59:59)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB