LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Own shortcut like Strg-Alt-Del (https://www.linuxquestions.org/questions/linux-general-1/own-shortcut-like-strg-alt-del-381453/)

commster 11-09-2005 10:02 AM

Own shortcut like Strg-Alt-Del
 
Hello,

first of all, I'm a :newbie: and sorry for my english!

is there a way to configure a shortcut, which works in every situation like Strg-Alt-Del(shutdown)? :confused:

I've seen the inittab, where you can set the command for this shutdown-shortcut, but i have to make my own one.

I hope the question is written correctly!

Please help :(

CommSter

MensaWater 11-09-2005 11:58 AM

Your English is fine.

Strg? - Must be what it is marked in Germany - on English keyboards its marked "Ctrl" so the sequence is Ctrl-Alt-Del.

Anyway ctrlaltdel is a special state of inittab (type "man inittab" for more detail). It appears from my read that it might be possible to define your own. Have a look at this from the inittab man page:

kbrequest
The process will be executed when init receives a
signal from the keyboard handler that a special key
combination was pressed on the console keyboard.

The documentation for this function is not complete
yet; more documentation can be found in the kbd-
x.xx packages (most recent was kbd-0.94 at the time
of this writing). Basically you want to map some
keyboard combination to the "KeyboardSignal"
action. For example, to map Alt-Uparrow for this
purpose use the following in your keymaps file:

alt keycode 103 = KeyboardSignal

commster 11-10-2005 03:54 AM

Hello,

thank you for the fast reply. :)

You're right Strg is marked in Germany, so the hole sequence is Strg-Alt-Entf.

Strg -> Steuerung = Control
Entf -> Entfernen = Delete

What i need is more "global". I boot the system, but before the getty-processes start, i start my own daemon-proc,
a little program, where no input is needed instead of Ctrl-Alt-Del.

In future there will be another configurtion for this daemon and i need a shortcut to switch between the configurations.

i hope the problem is plain. :confused:

CommSter

MensaWater 11-10-2005 07:10 AM

If I understand your last post you are saying you do not want to define a special key sequence but rather just want to start a daemon automatically on boot. If you DO want to define a special key sequence you'll have to look at what I wrote before.

If however I am correct that all you want to do is start a daemon of your own:

Although you can start it from inittab you should not. This was the way most things were started back when I first started working on Unix (Linux is a Unix clone). Now however it is more usual to start things using init (rc) scripts. Mainly inittab is used to configure serial devices and to start very base level processes (including calling the rc setup).

You haven't listed your distro (distribution type) of Linux. For RedHat and some others the init scripts are in /etc/init.d (which may be a symbolic link to another directory). General setup:

1) /etc/init.d - Contains the script written for start/stop which may include other options such as status.

2) /etc/rc?.d - Contains symbolic links back to the files in /etc/init.d. The ? can be any run level (0,1,2,3,4) and the script within that run level is either run to start (if name begins with S) or to stop (if name begins with K) within that run level.

If you have a look at the scripts there you'll get an idea how it should be setup and there may be a template file for setting up a new one.

commster 11-11-2005 06:37 AM

Hi,

thx for your patience.

I have to define a special key sequence, and this allready works fine. (With the kbrequest-thing in inittab)

The problem now is, that i only have ONE kbrquest.

For example:

Ctrl+f -> starts the first shellscript ("kb:00001:kbrequest:sh first_script.sh")
Ctrl+s -> starts the second shellscript ("kb:00002:kbrequest:sh second_script.sh")

This is, what i want. And than i insert into my keymap something like:

control keycode "keycode for f" = KeyboardSignal(00001)
control keycode "keycode for s" = KeyboardSignal(00002)

Is there any way to do something like the above???

I hope not to bother.

CommSter


All times are GMT -5. The time now is 06:46 AM.