You are not logged in.

#1 2019-06-26 18:22:53

minimalm
Member
From: Juneau, AK
Registered: 2011-09-08
Posts: 23
Website

Using multimedia keys to type a command in a terminal window.

Hello, I've been looking around for a bit to try and figure out how to use one of the multimedia keys [4] on my keyboard to type 'exit [Enter]'.  I am on the command line all day long and ssh'ing into multiple servers, I want to map my '4' multimedia key (on my Microsoft Natural Ergonomic Keyboard) to type the word 'exit' and hit [Enter] so I can close out of all my terminal windows quickly.  Searching for 'multimedia keys type command' brings back so many search results I can't find what I am looking for.  I know I'm in the right spot here (http://wiki.linuxquestions.org/wiki/Con … media_Keys), I just don't know what to put to make it do what I want it to do.

How do I say 'keycode 195 = type exit and hit Enter' in xmodmap.conf

Thank you

Last edited by minimalm (2019-06-26 18:23:28)

Offline

#2 2019-06-26 18:55:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Using multimedia keys to type a command in a terminal window.

You'd may to use xdotool or a similar tool to simulate all those key press events and send them to the terminal window.

You may want to consider other approaches rather than trying to send the command and enter.  If xmodmap can remap the key to send and EOF, that would be a much easier way to get the desired end result.

But what's wrong with just using Ctrl-L from within the terminal?

EDIT: oops, I meant Ctrl-D

Last edited by Trilby (2019-06-26 19:42:23)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-06-26 19:17:45

minimalm
Member
From: Juneau, AK
Registered: 2011-09-08
Posts: 23
Website

Re: Using multimedia keys to type a command in a terminal window.

Hi Trilby, Ctrl-L does nothing in the terminal window (except clear the screen).  I forgot to mention I use xfce4 as my window manager (and thus, xfce4terminal to do all my work) -- yeah that's what I'm trying (send 'exit' and EOF) to do in xmodmap and I just can't find the information I am looking for.

I am looking into xdotool - I'll let  you know if I get it working.

Thanks

Last edited by minimalm (2019-06-26 19:20:57)

Offline

#4 2019-06-26 19:20:59

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: Using multimedia keys to type a command in a terminal window.

EOF / EOT should normally be mapped to Ctrl-D.

Last edited by progandy (2019-06-26 19:24:15)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2019-06-26 19:32:16

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Using multimedia keys to type a command in a terminal window.

Ctrl+D

Edit - Ninja'd

Last edited by Slithery (2019-06-26 19:32:55)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2019-06-28 22:30:11

minimalm
Member
From: Juneau, AK
Registered: 2011-09-08
Posts: 23
Website

Re: Using multimedia keys to type a command in a terminal window.

Yes!!  Thank you!  This is exactly what I'm looking for.

Offline

#7 2019-06-28 22:38:49

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Using multimedia keys to type a command in a terminal window.

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

Board footer

Powered by FluxBB