You are not logged in.

#1 2016-03-31 19:59:51

dumbl3d0re
Member
From: Gothenburg, Sweden
Registered: 2016-03-09
Posts: 17

[SOLVED] Add keybinding in Gnome with same effect as if used launcher

I want to bind some function keys (F8-12) to start or focus on applications. I.e. I want the keys to have the same effect as if I pressed on the icon from the launcer.

User case 1: I want to start a terminal window, but haven't one running yet. When pressing FX (function key X) it should start the predefined terminal emulator.

User case 2: I already have a terminal window opened in one of my workspaces, and then pressing FX I'm automatically transported to the correct workspace and the terminal window is focused.

Is this possible? Can only find documentation and information regarding simple commands, i.e. to always start a new instance of the application.

Last edited by dumbl3d0re (2016-04-02 20:56:28)

Offline

#2 2016-04-01 06:36:43

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] Add keybinding in Gnome with same effect as if used launcher

I am not sure if Gnome has a built-in option to do this. But you can write a wrapper script which will spawn a new process if no matching process is already running. As for bringing focus to an already running application, you can use something like xdotool.

Offline

#3 2016-04-01 19:34:32

dumbl3d0re
Member
From: Gothenburg, Sweden
Registered: 2016-03-09
Posts: 17

Re: [SOLVED] Add keybinding in Gnome with same effect as if used launcher

x33a wrote:

I am not sure if Gnome has a built-in option to do this. But you can write a wrapper script which will spawn a new process if no matching process is already running. As for bringing focus to an already running application, you can use something like xdotool.

It seems that it's what I've to do if Gnome doesn't provide the tools. Thanks for the tip about xdotools! I planned to search for tools that did that, but you did my work for me. smile

Offline

#4 2016-04-02 20:56:17

dumbl3d0re
Member
From: Gothenburg, Sweden
Registered: 2016-03-09
Posts: 17

Re: [SOLVED] Add keybinding in Gnome with same effect as if used launcher

I've found a plugin what does (nearly) that I want. The Gnome extension AppKeys does enable shortcuts for favorites in dash.

I'm going to submit a feature request on the Gnome bug tracker.

Offline

Board footer

Powered by FluxBB