You are not logged in.

#1 2014-11-07 19:54:16

Da$aD
Member
Registered: 2014-10-01
Posts: 4

[SOLVED] Bind multiple programs for one hotkey (Openbox)

Hi all!

I'm using Openbox without any DE, and use hotkeys for launching applications: every program is bound to Ctrl-Alt-[First letter of program's name] hotkey. If there are multiple programs starting with the same letter, I wish to use one hotkey for them - for example, Ctrl-Alt-T for Terminal and Transmission, - and select, which of them is to be launched, by repeating pressing last key of combination (i.e. I want to use C-A-T for Terminal and C-A-T-T for Transmission in my example). I've tried to create keybind "C-A-T-T" for Transmission, but it isn't working. If I create two keybinds for "C-A-T", both of them are used at the same time when I press Crtl-Alt-T.

Is it possible to do such a trick, or I have to choose another keybind for Transmission?

Last edited by Da$aD (2014-11-08 09:27:13)

Offline

#2 2014-11-08 04:28:44

Kopkins
Member
Registered: 2012-07-01
Posts: 189

Re: [SOLVED] Bind multiple programs for one hotkey (Openbox)

You might be able to use dmenu. It wouldn't have C-A-T-T functionality but it would allow you to choose.

You could write a small script to execute a program based on dmenu selection

Install dmenu and run the following to see if its something you would like.

echo -e "terminal\ntransmission\n" | dmenu

The pseudo-code for the script would look like this.

#!/bin/bash
#you already have launched this with your keybind so launch dmenu
set result = $(echo -e "terminal\ntransmission\n" | dmenu)

#choose which you need
if [[ result == "terminal" ]] then
  terminal &
else
  transmission &
fi

Offline

#3 2014-11-08 04:45:03

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

Re: [SOLVED] Bind multiple programs for one hotkey (Openbox)


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

Offline

#4 2014-11-08 09:26:49

Da$aD
Member
Registered: 2014-10-01
Posts: 4

Re: [SOLVED] Bind multiple programs for one hotkey (Openbox)

Kopkins, nice, but, as I understand, It needs to choose menu entry manually, and it will be a bit boring, as the terminal is very frequently used.

Trilby, great, I think, it's good enough solution for me!


Thanks to all!

Offline

Board footer

Powered by FluxBB