unix command : how to insert text at the cursor location via command line?
Hi,
Well my title isn't very clear I think. So to understand my goal:
I have a script "test1"
with xbindkeys, I bind F5 key in order it runs my test1 script
So when I press F5, test1 runs.
I'm under Emacs/Vi and I press F5 in order to have "blabla" be written at the cursor location.
... but I dunno why when I use it through xbindkeys, "blabla" text isn't written when I press F5 but when I release it ... and I have to release the F5 key very fast else nothing is printed.
And what is more, in firefox it is printed at the same speed as I type... lol ... to much slow ... imagine If instead of "blabla" I have a complete sentence xD
Instead of xbindkeys , I tried gnome keybindings (in metacity) directly too ... but it was even worst concerning the timing
I didn't find a real command that would print a text at the cursor location.... instead of simulate the keyboard ... which doesn't seem to be a good idea :/
please , may someone know a such command or have a good idea ? ^^
Hi, I am looking for a unix command which inserts double quotes around all values in a text file. For example,
Input:
1234 200 4686 3506056
9646 457 5647 5066762
5656 366 5869 5978459
Output:
"1234" "200" "4686" "3506056"
"9646" "457" "5647" "5066762"
"5656" "366" "5869"... (2 Replies)
Hi,
When working in vi, the CTRL+j command for merging lines is very convenient. Is there an equivalent for splitting them (inserting a line break)? I often find myself pressing "i" + "return" + "esc", which I find a bit lengthy.
Thanks in advance! (3 Replies)
Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Hi, I am looking for a unix command which inserts double quotes around all values in a delimited file. For example,
Input File
153665031,abc,abc ,abc
131278839,def,def ,dec
179821481,efg,efg ,lmn ... (6 Replies)
How can I insert the command executed on the shell into the first line of my output file?
For example if I execute;
zcat *.gz |grep “User5501” > users.out
How can I make my users.out look like;
zcat *.gz |grep “User5501” > users.out
User5501 PA
User5501 UA
User5501 ZA... (3 Replies)
hi I am trying to use SED to replace the line matching a pattern using the command
sed 'pattern c\
new line
' <file1 >file 2
I got two questions
1. how do I insert a blank space at the beginning of new line?
2. how do I use this command to execute multiple command using the -e... (5 Replies)
In Perl. ***edited question below***
Hey all, I am teaching myself some simple CSV file manipulation and have become a little stuck. Say I have the following layout in the CSV file:
age,name,locationIs it possible to INSERT data into the CSV into the correct age order. For example, if I had... (1 Reply)
I'm trying to write a bash script called YN that looks like the following
YN "Specify a question" "doThis" "doThat"
where "doThis" will be executed if the answer is "y", otherwise "doThat".
For example
YN "Do you want to list the file dog?" "ls -al dog" ""
Here's my attempt... (3 Replies)
By using sed command, How to insert a new line before the last four lines of the file.
Old Line
Old Line
NEW LINE!
Old Line
Old Line
Old Line
Old Line (8 Replies)
Hi All,
I am trying to write a shell script where it should insert character 'I' in 180th position of each line(except first and last line) of the file. Below is the script
for file in /home/test/bharat/*.RET
do
# Process file
echo "File Name=" $file
#l_fileName="${file##*/}"
... (19 Replies)
Discussion started by: bharath561989
19 Replies
LEARN ABOUT DEBIAN
xbindkeys
XBindKeys(1) General Commands Manual XBindKeys(1)NAME
xbindkeys - a grabbing keys program for X
SYNOPSIS
xbindkeys [ options ]
DESCRIPTION
XbindKeys is a program that grab keys and mouse button events in X and starts associated shell command.
COMMAND LINE OPTIONS
Available command line options are as follows:
-d, --defaults
Print a default rc file
-f, --file
Use an alternative rc file
-h, --help
Short help on options plus version/author info.
-X, --display
Set X display to use
-v, --verbose
More information on xbindkeys when it run
-k, --key
Identify one key pressed (useful to fill the configuration file)
-mk, --multikey
Identify multi key pressed (useful to fill the configuration file)
-g, --geometry
size and position of window with -k|-mk option
-n, --nodaemon
don't start as daemon
If guile support have not been disabled:
-dg, --defaults-guile
Print a default guile configuration file
-fg, --file-guile
Use an alternative guile configuration file
XBINDKEYSRC
XBindKeys uses a configuration files. This file is $HOME/.xbindkeysrc, used only for one user. All whitespace is ignored in the files
except for within the commands names double quotes.
The configuration file consists of commands names in double quotes, and associated keys in the next line.
Comments are started with a pound (#) and extend to the end of the line.
You can see a default file with the --defaults option or create a default $HOME/.xbindkeysrc with
'xbindkeys --defaults > $HOME/.xbindkeysrc'.
KEYSYMS
The program expects combinations of keysyms to be used by using plus(+) characters to combine them together.
The format of a command line is:
"command to start &"
associated key
To specify an associated key, you can use 'xbindkeys --key' or
'xbindkeys --multikey' and put one of the two lines in the configuration file.
A list of keys is in /usr/include/X11/keysym.h and in /usr/include/X11/keysymdef.h. The XK_ is not needed.
List of modifiers:
Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
Mod3 (CapsLock), Mod4, Mod5 (Scroll).
The release modifier is not a standard X modifier, but you can use it if you want to catch release events instead of press events.
By defaults, xbindkeys does not pay attention with the modifiers NumLock, CapsLock and ScrollLock. Add the lines above in the configura-
tion file, if you want to pay attention to them.
keystate_numlock = enable
keystate_capslock = enable
keystate_scrolllock= enable
EXAMPLES
# control+shift+d starts an xterm (it's a comment)
"xterm"
control+shift + q
# Menu key starts xbindkeys_show
"xbindkeys_show"
Menu
# Control + mouse button 1 starts an xterm
"xterm"
Control + b:1
# Control+Shift+a release event starts rxvt
"rxvt"
release+control+shift + a
# Control + mouse button 2 release event starts rxvt
"rxvt"
Control + b:2 + Release
SCHEME CONFIGURATION STYLE
If the guile support have not been disabled, you can use an alternate configuration file written in scheme. xbindkeys read first the scheme
configuration file, and if this file doesn't exist, it read the standard configuration file.
For more details, please see here
http://www.gnu.org/software/guile/guile.html
Note: The guile configuration file is the prefered way if you have a non trivial
configuration like for example double click, timed click or keys combinations.
The defaults is ~/.xbindkeysrc.scm
Use xbindkeys --defaults-guile for more details.
And xbindkeys --defaults-guile > ~/.xbindkeysrc.scm to use this method.
NOTE
xbindkeys reload its configuration file each time it has changed. But if you want to force it reloading its configuration file, you can
send a HUP signal:
killall -HUP xbindkeys
When HUP signal is send to xbindkeys, changes in $HOME/.xbindkeysrc takes effect only after moving mouse.
BUGS
If you find a bug, please send a mail to <hocwp@free.fr>
HOMEPAGE
http://hocwp.free.fr/xbindkeys
AUTHOR
Philippe Brochard <hocwp@free.fr>
Marcello Mathias Herreshoff for the guile support <marcello@hummer.stanford.edu>
FILES
$HOME/.xbindkeysrc
The users configuration file.
$HOME/.xbindkeysrc.scm
The users configuration file in scheme style (if guile support have not been disabled).
SEE ALSO
xbindkeys_show
Utility for showing the actual keybinding with xbindkeys
xmodmap(1x)
Utility for modifying keymap & button mappings in X.
xev(1x)
Print contents of X events.
/usr/include/X11/keysymdef.h
X11 KeySym definitions.
3rd Berkeley Distribution Wed Apr 18 2007 XBindKeys(1)