New answers tagged

1

Presumably, you know about xset dpms which provides power management of the display, and brightd which does progressive backlight changes, but if these don't suffice you can detect movement once you are in idle mode by using xinput as follows. List the input devices with simply xinput and find the ids of the mouse and keyboard you want to listen to. In my ...


1

You can try using dbus. Specifically, use dbus-send to invoke the GetSessionIdleTime method on org.freedesktop.ScreenSaver: dbus-send --session --dest=org.freedesktop.ScreenSaver --type=method_call --print-reply=literal /ScreenSaver org.freedesktop.ScreenSaver.GetSessionIdleTime This will print out 4 spaces, then "uint32", then the number of milliseconds ...


3

For the question, where file1.pgm and file2.pgm are files whose contents you want sent to a.out as input: cat file1.pgm file2.pgm | ./a.out If file1.pgm and file2.pgm are executables that produce output for a.out: (file1.pgm; file2.pgm) | ./a.out


0

To provide an automatic answer, you could use one of the following: insaller.sh < an_input_file or command-line | installer.sh There is something to notice if the installer.sh script is using read -p, as in the example below: read -p "Press ENTER for default path or enter path to install software:" answer man bash specifies that nothing is ...


0

If you can provide all the inputs when the script starts, then do so, by redirecting the program's input. That is, instead of running /path/to/installer, run { echo '/the/path/where/to/install'; echo 'answer to the second prompt'; } | /path/to/installer or use a here document: /path/to/installer <<'EOF' /the/path/where/to/install answer to the ...


1

You can echo your answer into standard input of script by using a pipe. echo "My/Path/not/default"| yourscript.sh



Top 50 recent answers are included