9

I know that setterm can be used to adjust parameters such as screen blanking time on a virtual console. How can I show the current setterm settings/values for all parameters?

SabreWolfy
  • 1,154
  • 4
  • 13
  • 26

1 Answers1

8

The least one can say is that the interface to set those VT attributes is very messy. Some are done with ioctls (a myriad of them), some with escape sequences (some that affect one VT some all at once), some are also accessible via /sys...

For the blanking time, you can have a look at /sys/module/kernel/parameters/consoleblank (in seconds).

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501
  • Thanks. Your answer suggests that there is no single place where all the settings are stored or viewable? – SabreWolfy Oct 15 '12 at 11:58
  • 2
    Yes, in this instance, it is set with an escape sequence (`printf '\033[9;10]'` to set a 10 **minute** blank time) which you can read as `600` seconds in a `/sys` file (though it can be set by the `/sys` file as well), some are done by ioctls. There might be a command to query all of them the same way as `setterm` can be used to **set** some of them, but I don't know what that is. And there's nothing in util-linux where setterm comes from. – Stéphane Chazelas Oct 15 '12 at 13:01
  • I have the exact same question but I'm not seeing this path/file on my CentOS 5.x server. There doesn't appear to be a `kernel` sub-directory under `/sys/module/`. There are plenty of other directories though. Would this consoleblank param exist somewhere else? – Mike B Jul 15 '14 at 21:26
  • @MikeB, you need kernel 2.6.31 (2009) or above, CentOS 5 is using 2.6.18 (2006) I believe. – Stéphane Chazelas Oct 02 '15 at 08:32