Question regarding toggling between workspaces

Lukasz Majewski l.majewski at majess.pl
Fri Jul 12 15:29:30 CEST 2019


Hi Olivier,

> On Fri, 12 Jul 2019 at 09:42, Lukasz Majewski <l.majewski at majess.pl>
> wrote:
> > If I may ask - what is then the difference between previous/next
> > workspace and move to workspace left and right?
> >
> > They do the same operation.  
> 
> That's layout dependent...
> 
> [ 1 ][ 2 ]
> [ 3 ][ 4 ]
> 
> or
> 
> [ 1 ][ 2 ][ 3 ][ 4 ]
> 
> or
> 
> [ 1 ]
> [ 2 ]
> [ 3 ]
> [ 4 ]
> 
> Depending on those layouts, previous/next and left/right are
> different.

Ok. Thanks for the explanation.

> 
> > I (apparently) wrongly assumed that I could use "previous" workspace
> > key binding to get the one on which I was previously working.
> >  
> > > "remember previous workspace" means that pressing *the same
> > > shortcut* twice will take you back to the previous workspace.  
> >
> > Yes, this works as expected.
> >  
> > >
> > > For example, you have 4 workspaces, and you're on workspace 1:
> > >
> > >  [_1_][ 2 ] [ 3 ][ 4 ]
> > >
> > > You press [Ctrl]+[F4] to get to workspace 4:
> > >
> > >  [ 1 ][ 2 ] [ 3 ][_4_]  
> >
> > And this is what I do expect and how it works now.
> >  
> > >
> > > Now, if "remember previous workspace" is set, pressing
> > > [Ctrl]+[F4] a second time will take you back to Workspace 1:
> > >
> > >  [_1_][ 2 ] [ 3 ][ 4 ]  
> >
> > Instead of remembering the exact number of the workspace
> > ([CTRL]+[F4] in this case) I would like to press e.g. Super+ESC
> > (always the same key combination) to go to previous workspace (in
> > this case [_4_]).
> >
> > The problematic part is to avoid second pressing of [Ctrl]+[F4] (or
> > any other Fx key) and replace it with a single key - e.g. Super +
> > ESC.  
> 
> No, that's not how it works, there is no dedicated shortcut for that,
> you just use the same shortcut multiple times.

Ok. I see.

So it seems like I need to provide solution for this with some xdotool
scripting.

I'm wondering if there is any API/way to get the necessary information
from xfce4? For example to know the previously used workspace/display ?

One solution would be to (by using xdotool):

1. Map keys which I use to switch workspaces to an external command:

Super+1 -> switch_display.sh 1

...

Super+9 -> switch_display.sh 9

(And unmap default xfce keybindings to switch workspaces)

In that script store in file [*] "current" (i.e. last display) and
switch to the new one.

Then map 'Super+ESC' to "switch_display.sh previous" , which would:
xdotool set_display $(cat /tmp/prev_display).


[*] - echo $(xdotool get_display) > /tmp/prev_display
      xdotool set_display ${1}



Is this the only way to achieve this or is there any more recommended
way (in terms of xfce4 API/usage) ?

> 
> Cheers,
> Olivier
> _______________________________________________
> Xfce mailing list
> Xfce at xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce
> http://www.xfce.org


-- 
Best regards,

Ɓukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://mail.xfce.org/pipermail/xfce/attachments/20190712/07f5be95/attachment.sig>


More information about the Xfce mailing list