logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).


L'icône rouge permet de télécharger chaque page du wiki visitée au format PDF et la grise au format ODT → ODT PDF Export

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
utilisateurs:captnfab:tutos:i3wm-deplacer-workspace-x-vers-ecran-actif [02/08/2014 21:45]
captnfab [Déplacer un Workspace donné vers l'écran actif]
utilisateurs:captnfab:tutos:i3wm-deplacer-workspace-x-vers-ecran-actif [03/08/2014 23:52] (Version actuelle)
captnfab [Installation]
Ligne 22: Ligne 22:
  
 def ipc_query(req="​command",​ msg=""​):​ def ipc_query(req="​command",​ msg=""​):​
-    ans = popen("​i3-msg -t " + req + " " + msg).readlines()[0]+    ans = popen("​i3-msg -t " + req + " " +  msg).readlines()[0]
     return loads(ans)     return loads(ans)
  
Ligne 35: Ligne 35:
     # Retrieving active display     # Retrieving active display
     active_display = None     active_display = None
 +    old_display = None
     for w in ipc_query(req="​get_workspaces"​):​     for w in ipc_query(req="​get_workspaces"​):​
         if w['​focused'​]:​         if w['​focused'​]:​
             active_display = w['​output'​]             active_display = w['​output'​]
 +        if w['​name'​] == newworkspace:​
 +            old_display = w['​output'​]
 +        if newworkspace.isdigit() and w['​num'​] == int(newworkspace):​
 +            old_display = w['​output'​]
 +        print w
 +
 +    # Pre-computing commands
 +    if newworkspace.isdigit():​
 +        cmd_show = "​workspace number " + newworkspace
 +    else:
 +        cmd_show = "​workspace " + newworkspace
 +    cmd_move = "move workspace to output " + active_display
  
     # Moving workspace to active display     # Moving workspace to active display
-    ipc_query(msg="​workspace " + newworkspace+    ​if active_display == old_display:​ 
-    ​ipc_query(msg="move workspace to output ​" + active_display ​+ "; ​workspace ​" + newworkspace)+        print cmd_show 
 +        print ipc_query(msg=cmd_show
 +    ​else: 
 +        cmd="'" + cmd_show ​+ ";"​ + cmd_move + ";"​ + cmd_show + "'"​ 
 +        print cmd 
 +        print ipc_query(msg=cmd)
 </​code>​ </​code>​
  
utilisateurs/captnfab/tutos/i3wm-deplacer-workspace-x-vers-ecran-actif.1407008728.txt.gz · Dernière modification: 02/08/2014 21:45 par captnfab

Pied de page des forums

Propulsé par FluxBB