0

What I want is to have a shortcut to initiate things like vifm, cmus, htop etc. These apps require being initiate from a terminal.

I know for create a shortcut in Awesome WM I should:

awful.key({ modkey },            "my_hotkey",     function () awful.util.spawn(...here goes the app) end,
          {description = "the_description", group = "my custom group"}),

But I can't simply put there:

awful.util.spawn("vifm")

I doesn't work. So how could I make a shortcut that initiates let's say vifm, taking in consideration this code have to run a terminal first and then inside that terminal launch "vifm".

Also, is there a more efficient way to do this? I mean maybe initiating directly vifm instead of having to rely on running first a terminal?

PD: My shell is bash, my terminal is Konsole.

2 Answers 2

0

Most terminals allow running a command which, when finished, will also exit the terminal. I don't know Konsole, but in GNOME Terminal this is as simple as gnome-terminal -- vim.

If you want the terminal to hang around after the command is finished, you can use this hack: gnome-terminal -- bash -c 'vim; bash'.

1
  • But for being able to use those apps, I need the terminal to stay. Maybe I didn't explain myself well enough. Basically what I want is set a hotkey from Awesome to initiate a terminal(CLI) based apps. Commented Aug 6, 2020 at 22:45
0

I feel a little embarrassed for not having realize the solution before. In fact it was in the very help page of konsole, anyways the command is (for konsole):

konsole -e cli_based_app

So for example

konsole -e vim

Then you can put that in your rc.lua and assign a hotkey for it.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.