Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was just curious to know if any of you had any bindings for the following keys:
- Sys Rq
- Pause/break
- Scroll Lock
I'd like to use one of these keys in my inputrc to start capturing output from the terminal in a tmp file.
Another keypress on same key would toggle the function off.
I'd also like to use a second key combination to paste the content of last command directly in the command line (more here).
I just wanted to make sure that it was ok to bind these keys,
and also curious if anyone had any special keybindings already bound to them.
SysReq does. I have never actually got this thing to work, but apparently you are supposed to be able to get out of keyboard freezes by holding down SysReq and typing reisub.
Ok so here's code to capture output of last command.
The idea is to press C-x C-: to start capturing output,
then issue any command.
You can put the last line of output of that command to the clipboard with C-x C-x,
or paste it to the terminal with C-x C-v.
The only thing that doesn't work is toggling output capture with C-x C-:
I can't seem to use that key combination.
Anyone has an idea?
see code below
Code:
export CAPTUREOUTPUT=-1
sys.capture.output.on(){
exec > >(tee -a /tmp/output)
CAPTUREOUTPUT=0
debug "capture is on"
}
sys.capture.output.off(){
exec > /dev/tty
CAPTUREOUTPUT=-1
debug "capture is off"
}
sys.capture.output.toggle(){
if (( $CAPTUREOUTPUT == 0 ))
then
debug "turning off output capture"
sys.capture.output.off
else
debug "turning on output capture"
sys.capture.output.on
fi
}
sys.capture.output.last(){
n=${1:-1}
tail -n"$n" /tmp/output
}
sys.capture.output.last.copy(){
desktop.clipboard.set "$(sys.capture.output.last)"
}
debug(){
echo $@ > /dev/stderr
}
sys.capture.output.last.paste(){
READLINE_LINE="$READLINE_LINE$(sys.capture.output.last)";
READLINE_POINT=${#READLINE_LINE}
}
bind -x '"\C-x\C-v": sys.capture.output.last.paste'
bind -x '"\C-x\C-x": sys.capture.output.last.copy'
bind -x '"\C-x\C-:": sys.capture.output.toggle'
I have never actually got this thing to work, but apparently you are supposed to be able to get out of keyboard freezes by holding down SysReq and typing reisub.
You hold down both Alt and SysReq, release SysReq, and then type REISUB for reboot ot REISUO to shut down. Don't press the keys too quickly — each step obviously has to complete before the next one.
If the facility is set, the you should get the reply "1" from
I was just curious to know if any of you had any bindings for the following keys:
- Sys Rq
- Pause/break
- Scroll Lock
ScrollLock is one of keyboard layout switching keys for multilingual environments (setxkbmap -option grp:sclk_toggle), and ScrollLock LED can be set up to to indicate the current layout (grp_led:scroll). I always set it up this way.
Quote:
Originally Posted by DavidMcCann
You hold down both Alt and SysReq, release SysReq, and then type REISUB for reboot ot REISUO to shut down.
You hold down both Alt and SysReq, release SysReq, and then type REISUB for reboot ot REISUO to shut down. Don't press the keys too quickly — each step obviously has to complete before the next one.
Ah, that explains it! I thought you had to keep the alt+sysReq keys down throughout the sequence. Thanks a lot!
It used to work for me for years until I changed my keyboard -_-
The old keyboard had a clear label on the sysrq key,
but not this one,
so I can't tell which one it is.
Thanks to the kernel.org link,
now I know it's the same as the Print Screen key.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.