Hot answers tagged

19

vlock will do as you ask. However, if you want to run background processes, consider screen instead, which will let you also log off and keep processes running in the background, and then reattach -- even when logged in from alternate places.


17

After some research, I think I've got enough information to post an answer to my own question. In Gnome Shell 3.6 and earlier, the old gnome-screensaver program was present, and if GDM was not running, gnome-screensaver would be invoked - allowing you to lock the screen. Starting in Gnome Shell 3.8 (included in Fedora 19), gnome-screensaver support has ...


10

There are a couple of examples on the Arch Wiki systemd page. Basically, it involves creating a service file for your screen locker and ensuring it is hooked to either the suspend, hibernate or sleep targets. If you use a simple screen locker like slock, your file would look like this: [Unit] Description=Lock the screen on resume from suspend [Service] ...


9

Maybe there is easier solution for this, but my first guess was to use actkbd - keyboard (but not only) shortcut daemon that works outside of X server. In config file you can bind any keys combination to any command. More details about running actkbd you can find in this answer. Rhythmbox can be controlled over dbus interface, so if you bind that command ...


8

That you cannot install xdotool because you are not root doesn't mean you cannot run the program, for that you don't need any special privileges. Just download and compile from source. If you don't have access to a compiler then you can download the package for your system directly and extract the file from the package (for .deb first use ar, extracting ...


7

xscreensaver has a -watch option: -watch    Prints a line each time the screensaver changes state: when the screen blanks, locks, unblanks, or when the running hack is changed. This option never returns; it is intended for use by shell scripts that want to react to the screensaver in some way.1 The UNBLANK state is what you are looking for. ...


7

You can prevent console switches from Xorg by adding the Option "DontVTSwitch" "yes" to your Xorg config file. To prevent Ctrl+Alt+Backspace you have to add the DontZap option to your Xorg config file. Of course this will not completely prevent access to the console. If X terminates for some reason, e.g. problem with a driver the attacker will still have ...


7

The details on how to do this were found here in this blog post titled: Locking the screen from the command line in Gnome 3.8. Manually triggering The dbus-send command can be used to send this message, in this case we're sending the "Lock" message to the screensaver. $ dbus-send --type=method_call --dest=org.gnome.ScreenSaver \ ...


6

This works for me in Gnome 3.14. Standard installation, no customization. gnome-screensaver-command --lock


6

You could check if you are running in a graphical terminal and only set TMOUT if you are not. An easy way to do this is the tty command: tty - print the file name of the terminal connected to standard input When run from a GUI terminal emulator: $ tty /dev/pts/5 When run from a virtual console: $ tty /dev/tty2 So, adding these lines to your ...


6

Do I need to install a screensaver package or something? Yes, according to the wiki, you need to choose and install a locker. xflock4 will then activate it.


6

ps aux | grep screen revealed that gnome-screensaver was running. whereis gnome-screensaver found it in /usr/bin (among other places). Also in /usr/bin/ was gnome-screensaver-preferences Solution: run /usr/bin/gnome-screensaver-preferences and uncheck "Lock screen when screensaver is active". Optionally uncheck "Activate screensaver when computer is ...


6

If you run screen in the terminal, you can lock the terminal with the command Ctrl-a x.


6

According to this answer you can move the pointer of your mouse with command-line with the following procedure: First you need to find mouse input device with grep mouse /proc/bus/input/devices | grep event You should see something like H: Handlers=mouse0 event7 in my case. It could output more then one line if you have more then one mouse (e.g. ...


4

Since you use low ressources, I'm gonna guess the default screenlocker is xlock without any screensaver turned on. In that case. You'll have to edit the command for screen locking from "xlock" to "xlock && pkill firefox" or "xlock && pkill chromium". I dont know more on this but basically, if you add " && " after a command, you ...


4

(I assume you mean after a certain amount of time with no activity) slock doesn't have that capability built-in; you have to use another tool that watches X and tracks how long there's been no activity. For example, using xautolock with a delay of 15 minutes: $ xautolock -time 15 -locker slock


4

I Googled/emailed around a bit and got these two commands. To lock the screen: xflock4 To activate user switching: gdmflexiserver For Lightdm, this file resides in a strange spot (at least on Arch Linux): /usr/lib/lightdm/lightdm/gdmflexiserver I merged these two into XFCE's logout button dialog, in case anyone's interested, so the patch is ...


3

This varies depending on desktop environment. In Gnome and KDE, you can use ctrl+alt+L by default.


3

See this command line option: -n,--new Switch to a new virtual console before locking all console sessions. What I always do is sudo vlock -ans, works inside / outside Xorg. It will jump back to the original VT when you unlocked it. EDIT Too bad, Arch Linux replaced the original vlock package with the one provided by kbd package. That one ...


3

If your heart is not set on using vlock, you should take a look at physlock. Physlock does exactly what it seems that you are looking for: it switches to a new VT, locks it and disables console switching. Upon unlocking, you are returned to whatever console you were on when you invoked it (and it can be invoked from X or from a TTY). It has a great set of ...


3

A quick check of the source code of the current version, xautolock 2.2, shows that it doesn't support this feature, although it wouldn't be too hard to implement it yourself if you know a little bit about C and how to write X programs. The reason is probably this: whenever you want to know the status of xautolock, you also know what status you would like it ...


3

In the terminal type mate-screensaver-preferences &, or from the Control Panel, select Screensaver - then deselect Lock screen when screensaver is active. You can find timeout settings there, too.


3

If your system is running systemd, you could create a unit which would trigger when the network interface goes down which would lock your screen in the simple case where the machine is physically unplugged from the network. But you want your work computer to verify that you are still connected to your work computer, not merely that your work computer can ...


2

Found an answer which works for me here. The problems seems to be: Apparently xfce4-power-manager and systemd were both creating suspend events at the same time, causing problems loading modules like keyboard drivers upon resuming. If the xfce-power-manager is used to handle suspend, it is suggested to edit /etc/systemd/logind.conf and add: ...


2

You could just disable your keyboard and mouse for the duration. First, get your keyboard and mouse IDs: $ xinput --list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Logitech M325 id=14 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ ...


2

You can use xrandr. For example if your display is HDMI1 you can do xrandr --output HDMI1 --off sleep 2 xrandr --output HDMI1 --auto You can find the name with xrandr|grep ' connected'


2

vlock might be what you're searching for.


2

If vlock doesn't work for you, try physlock. It doesn't inhibit suspension and hibernation which is nice if you want to lock automatically when the computer sleeps. Also, physlock locks all tty's by default.


2

You can use the functionality built into most media players to manage this; it works efectively with xautolock and it's lockers. mpv and mplayer both have a screensaver options: --stop-screensaver, --no-stop-screensaver Turns off the screensaver (or screen blanker and similar mechanisms) at startup and turns it on again on exit (default: yes). The ...


2

You can do this via PAM configuration. For example, if you use XScreenSaver, you'd edit /etc/pam.d/xscreensaver and change the @include common-auth line. Rather than repeat all the details, I'll point you to my answer to Set sudo password differently from login one. The procedure is almost exactly the same, except that you'll be editing the PAM config for ...



Only top voted, non community-wiki answers of a minimum length are eligible