move from one xterm and back again using wmctrl

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm running fvwm and have multiple virtual desktops open. I'd like to be able to write a bash script that would take me from one xterm to another---this part is easy, using wmctrl -a ---and then back again, which is the hard part.



I imagine that if I could execute a command in the new window once I've passed control to it, then the rest would be easy, but as far as I can tell from the documentation, wmctrl doesn't give me the option to do this.



Here's the basic idea of the script I'd like to write



#!/bin/bash
TmpScreen=CAMILLE
CurrScreen=ANDREW
wmctrl -R $TmpScreen
#echo this line on CAMILLE not ANDREW
echo "Type 'GoBack' to return to $CurrScreen" &
#Do something on CAMILLE
#Type GoBack, which would then execute
wmctrl -a $CurrScreen
#Be back to where I started


Is there a way to accomplish this? Any help would be most appreciated







share|improve this question




















  • you should be able to get the current window id with xprop -root _NET_ACTIVE_WINDOW, and so save it before moving to the new window.
    – meuh
    Feb 7 at 22:25










  • Thanks @meuh, I need something in addition though. I need to be able to pass an echo command to the new window, i.e., starting in the Current window, i want to write an echo (containing information from your xprop command) that shows up in the new window
    – Leo Simon
    Feb 8 at 3:21














up vote
0
down vote

favorite












I'm running fvwm and have multiple virtual desktops open. I'd like to be able to write a bash script that would take me from one xterm to another---this part is easy, using wmctrl -a ---and then back again, which is the hard part.



I imagine that if I could execute a command in the new window once I've passed control to it, then the rest would be easy, but as far as I can tell from the documentation, wmctrl doesn't give me the option to do this.



Here's the basic idea of the script I'd like to write



#!/bin/bash
TmpScreen=CAMILLE
CurrScreen=ANDREW
wmctrl -R $TmpScreen
#echo this line on CAMILLE not ANDREW
echo "Type 'GoBack' to return to $CurrScreen" &
#Do something on CAMILLE
#Type GoBack, which would then execute
wmctrl -a $CurrScreen
#Be back to where I started


Is there a way to accomplish this? Any help would be most appreciated







share|improve this question




















  • you should be able to get the current window id with xprop -root _NET_ACTIVE_WINDOW, and so save it before moving to the new window.
    – meuh
    Feb 7 at 22:25










  • Thanks @meuh, I need something in addition though. I need to be able to pass an echo command to the new window, i.e., starting in the Current window, i want to write an echo (containing information from your xprop command) that shows up in the new window
    – Leo Simon
    Feb 8 at 3:21












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm running fvwm and have multiple virtual desktops open. I'd like to be able to write a bash script that would take me from one xterm to another---this part is easy, using wmctrl -a ---and then back again, which is the hard part.



I imagine that if I could execute a command in the new window once I've passed control to it, then the rest would be easy, but as far as I can tell from the documentation, wmctrl doesn't give me the option to do this.



Here's the basic idea of the script I'd like to write



#!/bin/bash
TmpScreen=CAMILLE
CurrScreen=ANDREW
wmctrl -R $TmpScreen
#echo this line on CAMILLE not ANDREW
echo "Type 'GoBack' to return to $CurrScreen" &
#Do something on CAMILLE
#Type GoBack, which would then execute
wmctrl -a $CurrScreen
#Be back to where I started


Is there a way to accomplish this? Any help would be most appreciated







share|improve this question












I'm running fvwm and have multiple virtual desktops open. I'd like to be able to write a bash script that would take me from one xterm to another---this part is easy, using wmctrl -a ---and then back again, which is the hard part.



I imagine that if I could execute a command in the new window once I've passed control to it, then the rest would be easy, but as far as I can tell from the documentation, wmctrl doesn't give me the option to do this.



Here's the basic idea of the script I'd like to write



#!/bin/bash
TmpScreen=CAMILLE
CurrScreen=ANDREW
wmctrl -R $TmpScreen
#echo this line on CAMILLE not ANDREW
echo "Type 'GoBack' to return to $CurrScreen" &
#Do something on CAMILLE
#Type GoBack, which would then execute
wmctrl -a $CurrScreen
#Be back to where I started


Is there a way to accomplish this? Any help would be most appreciated









share|improve this question











share|improve this question




share|improve this question










asked Feb 7 at 19:00









Leo Simon

17426




17426











  • you should be able to get the current window id with xprop -root _NET_ACTIVE_WINDOW, and so save it before moving to the new window.
    – meuh
    Feb 7 at 22:25










  • Thanks @meuh, I need something in addition though. I need to be able to pass an echo command to the new window, i.e., starting in the Current window, i want to write an echo (containing information from your xprop command) that shows up in the new window
    – Leo Simon
    Feb 8 at 3:21
















  • you should be able to get the current window id with xprop -root _NET_ACTIVE_WINDOW, and so save it before moving to the new window.
    – meuh
    Feb 7 at 22:25










  • Thanks @meuh, I need something in addition though. I need to be able to pass an echo command to the new window, i.e., starting in the Current window, i want to write an echo (containing information from your xprop command) that shows up in the new window
    – Leo Simon
    Feb 8 at 3:21















you should be able to get the current window id with xprop -root _NET_ACTIVE_WINDOW, and so save it before moving to the new window.
– meuh
Feb 7 at 22:25




you should be able to get the current window id with xprop -root _NET_ACTIVE_WINDOW, and so save it before moving to the new window.
– meuh
Feb 7 at 22:25












Thanks @meuh, I need something in addition though. I need to be able to pass an echo command to the new window, i.e., starting in the Current window, i want to write an echo (containing information from your xprop command) that shows up in the new window
– Leo Simon
Feb 8 at 3:21




Thanks @meuh, I need something in addition though. I need to be able to pass an echo command to the new window, i.e., starting in the Current window, i want to write an echo (containing information from your xprop command) that shows up in the new window
– Leo Simon
Feb 8 at 3:21















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422626%2fmove-from-one-xterm-and-back-again-using-wmctrl%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422626%2fmove-from-one-xterm-and-back-again-using-wmctrl%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?