You are not logged in.

#1 2016-07-28 11:08:46

mazhar
Member
From: Sanandaj
Registered: 2016-07-12
Posts: 60

[solved] run a command in a specific terminal using wmctrl

Hi, i made a script which runs three different terminals on my desktop (with no border and stuff)
heres my script:

   

#!/bin/bash
    xfce4-terminal --hide-borders --hide-toolbar --hide-menubar --title=terminaldesktop --geometry=80x27+20+20 &
    sleep 2
    wmctrl -r terminaldesktop -b add,below,sticky
    wmctrl -r terminaldesktop -b add,skip_taskbar,skip_pager
    xfce4-terminal --hide-borders --hide-toolbar --hide-menubar --title=terminaldesktop2 --geometry=80x27+20+880 &
    sleep 2
    wmctrl -r terminaldesktop2 -b add,below,sticky
    wmctrl -r terminaldesktop2 -b add,skip_taskbar,skip_pager
    xfce4-terminal --hide-borders --hide-toolbar --hide-menubar --title=terminaldesktop3 --geometry=111x55+1310+20 &
    sleep 2
    wmctrl -r terminaldesktop3 -b add,below,sticky
    wmctrl -r terminaldesktop3 -b add,skip_taskbar,skip_pager

it works fine untill here, but now i want to run a command in a specific terminal (ex: terminaldesktop)
i tried "wmctrl -r <desktop_title> <command>" which was useless.
i also got focus by "wmctrl -a <terminal_title>" then the command, result: gives focus properly but the command runs in the terminal im starting my script with not the one i switched focus to.

im looking for a way to run my command exclusively in one of the terminals.
any solution/hint ? smile

Last edited by mazhar (2016-07-29 09:07:59)


We are archers, we live in dark to serve the light.

Offline

#2 2016-07-29 05:08:43

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

Re: [solved] run a command in a specific terminal using wmctrl

Why don't you run the command while launching the terminal itself?

Try using the --command switch with the relevant xfce4-terminal command.

Edit: Also use code tags for posting output.

Offline

#3 2016-07-29 09:07:28

mazhar
Member
From: Sanandaj
Registered: 2016-07-12
Posts: 60

Re: [solved] run a command in a specific terminal using wmctrl

x33a wrote:

Why don't you run the command while launching the terminal itself?

Try using the --command switch with the relevant xfce4-terminal command.

omg i can't believe how silly my mistake was. Thank you so much. And sure, i changed to use code tags. Again thanks smile


We are archers, we live in dark to serve the light.

Offline

Board footer

Powered by FluxBB