Page 1 of 1

hotkeys for linux , what you assign is hot(key) you get ;)

Posted: Thu Oct 16, 2008 1:44 pm
by ashes
hi people ,

I have made a project to assign user defined HOTKEYS , which basically is targetted to a parametric user . i have uploaded the source code . Please test in on your PC . on any linux version , its stable . The code snippet is for hot keys till ctrl+h starting from ctrl+a.

please give me a feedback to this email : [email protected]
or within this thread

thank you

Code: Select all

#code ::
#!/bin/bash


echo  "\n##################             welcome to the AA-HOTKEY version 1.3‫               ########################\n"
echo  "IMPLEMENTED AS A PART OF OPERATING SYSTEM BY:"
echo  "                                               --abhirup dutta (06co04)"
echo  "                                               --ashish g bhat (06co15)"
echo  "                                                  NITK ,SURATHKAL      "
echo "/////////Enter the command/application which you want to set as a hot key in full//////////"
read var



echo "note : the following hotkeys already exist and inputting the same hot key may overwrite the program 
Ctrl+C = Kill process (Kill the current process in terminal, also used to copy elsewhere)
Ctrl+Z = Send process to background
Ctrl+D = Log out from the current terminal. In X, this may log you out after a shuting down the emulator.

Ctrl+A = Home (Move cursor to beginning of line)
Ctrl+E = End (Move cursor to end of line)
Tab = List available commands from typed letters (Ex: type iw and click tab, output = iwconfig iwevent iwgetid iwlist iwpriv iwspy)

Ctrl+U = Delete current line
Ctrl+K = Delete current line from cursor
Ctrl+W = Delete word before cursor in terminal (Terminal only, also used to close the current document elsewhere)

Arrows up and down = Browse command history
Ctrl+R = History search (Finds the last command matching the letters you type)

Shift+PageUp / PageDown = Scroll terminal output
Ctrl+L = Clears terminal output
Shift+insert = Paste"


echo "#########################################################################################################"



echo "*****************            SELECT FROM THE LIST OF THE MENU         ************************"
echo " ################                           MENU                             ################# "
echo " ########                   1.ctrl+ANY ALPHABET OF YOUR CHOICE                      ##########"
echo " ########                    2.alt+ANY ALPHBET OF YOUR CHOICE                        ##########"
#echo" ########                 3.ctrl+alt+ANY ALPHABET OF YOUR CHOICE                    ##########"
echo " #############################################################################################"



read hotin




grep "hotin" ~/.inputrc >> /dev/null

if [ $? -ge 0 ]
then 
echo " you have already assigned this hot key "
echo " press CTRL+C to exit "
echo " or continue to overwrite "
fi



if [ $hotin = "ctrl+p" ]
then
	echo " ||      CTRL+P       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
	 echo "\"\":\"$var\C-M\"""ctrl+p" >> ~/.inputrc
fi

if [ $hotin = "ctrl+a" ]
then
	echo " ||      CTRL+A       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc
fi
if [ $hotin = "ctrl+b" ]
then
	echo " ||      CTRL+B       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc 
fi
#if [ $hotin = "ctrl+c" ]
#then
#	echo " ||      CTRL       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
#	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc
#fi
# these are commented since these are already existing hotkeys in the konsol

#if [ $hotin = "ctrl+d" ]
#then
#	echo " ||      CTRL+D      || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
#	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc
#fi

if [ $hotin = "ctrl+e" ]
then
	echo " ||      CTRL+E       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc
fi
if [ $hotin = "ctrl+f" ]
then
	echo " ||      CTRL+F       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc
fi
if [ $hotin = "ctrl+g" ]
then
	echo " ||      CTRL+G       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc
fi
if [ $hotin = "ctrl+h" ]
then
	echo " ||      CTRL+h       || IS NOW YOUR SHORTCUT FOR ||      $var       ||\n\n"
	 echo "\"\":\"$var\C-M\"" >> ~/.inputrc
fi

Re: hotkeys for linux , what you assign is hot(key) you get ;)

Posted: Thu Oct 16, 2008 2:27 pm
by Brynet-Inc
What does this have to do with OS development, and why didn't you use

Code: Select all

[ /code] blocks?

Re: hotkeys for linux , what you assign is hot(key) you get ;)

Posted: Thu Oct 16, 2008 9:01 pm
by cr2
I agree with Brynet-Inc.

I also think that you should be on OSDEV.ORG if you are simply making a new linux distro. I wouldn't consider that OS Development in any stretch of the imagination. [-X

Re: hotkeys for linux , what you assign is hot(key) you get ;)

Posted: Thu Oct 16, 2008 11:24 pm
by ashes
oh sorry guys ... i am a new bie .. where do you intend me to post this and get the feed back
please reply

Re: hotkeys for linux , what you assign is hot(key) you get ;)

Posted: Fri Oct 17, 2008 1:41 am
by AJ
I was going to put this in general programming but think Test Requests is more appropriate.


@OP I would strongly recommend removing your e-mail address from your post content.

Cheers,
Adam

Re: hotkeys for linux , what you assign is hot(key) you get ;)

Posted: Fri Oct 17, 2008 7:54 am
by Brynet-Inc
ashes wrote:oh sorry guys ... i am a new bie .. where do you intend me to post this and get the feed back
please reply
Another forum? this is an operating system development forum... perhaps if you were an existing member trying to test something you wrote in your spare time.

But, how is it at all relevant to us? and as a first post? honestly I think you're lost or something.

Try http://www.ubuntuforums.org/