You are not logged in.
I use the setterm command inside a file in /etc/profile.d so that I can prevent the screen from blanking when using a console, along with a couple of other things.
After the latest update to util-linux (2.25-3), whenever I open xfce4-terminal these lines show up:
setterm: terminal xterm does not support --blength
setterm: terminal xterm does not support --bfreq
setterm: terminal xterm does not support --blank
[gilmoreja@JamesPC ~]$
Is there a better way to handle making sure setterm runs when a console is used, but not necessarily when a terminal is opened? Or is there some other way to solve this issue? There doesn't seem to be a switch for setterm for any kind of "quiet mode."
Last edited by gilmoreja (2014-08-06 18:36:28)
Time you enjoy wasting isn't wasted time.
Offline
I think that the shell started in a console is a login shell, and it is not the case in a graphical terminal.
A login shell has a '-' at the start of $0; so you can test that and condition the execution of the setterm commands:
if [[ $0 == '-bash' ]]; then
setterm ...
setterm ...
...
fi
Offline
Or check $TERM env variable.
Offline
Thank you for the very simple solutions.
I ended up making the file check the $TERM environment variable because $0 returns "-bash" in both the console and terminal.
if [[ $TERM == "linux" ]]; then
setterm ...
fi
Time you enjoy wasting isn't wasted time.
Offline