Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-08-18 19:22:46

Reconsidered
Member
Registered: 2020-08-18
Posts: 4

[Solved] Switching with hotkeys opens new window

Good day,

I recently installed XFCE, bear with me, please.
When I use a hotkey to try and switch to my browser (FireFox), to a terminal (XFCE-Terminal) or to a new file-manager (Thunar) , it opens up a new browser-, file-manager- or terminal-window.
With other shortcuts like for mail (Thunderbird) or a messenger (Skype), the problem does not appear.
What can I do to just switch to the already open application, instead of opening a new window?

Thank you. smile

Last edited by Reconsidered (2020-09-07 19:56:09)

Offline

#2 2020-08-18 21:53:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,025

Re: [Solved] Switching with hotkeys opens new window

Hello and welcome.

When you say hotkey, are you referring to a keyboard shortcut command that you set up? And if so, what command does your hotkey run?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2020-08-18 22:23:54

Reconsidered
Member
Registered: 2020-08-18
Posts: 4

Re: [Solved] Switching with hotkeys opens new window

Yes, I set the hotkeys up under the "Keyboard : Application Shortcuts"
Command for FF: "firefox"
Command for Skype: "skypeforlinux"
Command for Thunar: "Thunar"
Command for xfce-Terminal: "xfce4-terminal

Thank you for the quick reply.

Offline

#4 2020-08-18 23:00:47

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,025

Re: [Solved] Switching with hotkeys opens new window

You could use a wrapper launch script such as this. Basically, drop the script somewhere on your system in your PATH and make it executable, then for each hotkey, call the script and pass as a parameter the name of the application.

For example, if the script is called xlaunch:
FF = xlaunch firefox
SK = xlaunch skypeforlinux
...etc

Note the logic of this script as indicated in the top comments:

# This script acts as a launcher for apps that observes the following rules:
#   1. If the app is not running, then start it up
#   2. If the app is running, don't start a second instance, instead:
#     2a. If the app does not have focus, give it focus
#     2b. If the app has focus, minimize it

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2020-08-19 17:48:30

Reconsidered
Member
Registered: 2020-08-18
Posts: 4

Re: [Solved] Switching with hotkeys opens new window

Hello again, and thank you.

I had to first learn what PATH does, how to write into it and make the script executable with the command line.
I managed that and the problem is solved now. Thank you for the script.

Have a nice day. smile

Offline

#6 2020-08-23 15:27:53

vinox14
Member
Registered: 2020-05-25
Posts: 14

Re: [Solved] Switching with hotkeys opens new window

Offline

#7 2020-08-26 20:33:36

Reconsidered
Member
Registered: 2020-08-18
Posts: 4

Re: [Solved] Switching with hotkeys opens new window

vinox14 wrote:

I think there the hotkeys seem to be limited to be in relation with the super-key. I don't think I'd like that, but thank you.

Offline

Board footer

Powered by FluxBB