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 →
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | |||
utilisateurs:captnfab:tutos:i3wm-deplacer-workspace-x-vers-ecran-actif [02/08/2014 22:39] captnfab [Installation] |
utilisateurs:captnfab:tutos:i3wm-deplacer-workspace-x-vers-ecran-actif [03/08/2014 23:52] (Version actuelle) captnfab [Installation] |
||
---|---|---|---|
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 | ||
- | print ipc_query(msg="'workspace " + newworkspace + "; move workspace to output " + active_display + "; workspace " + newworkspace + "'")</code> | + | if active_display == old_display: |
+ | 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> | ||
* Rendre le script exécutable | * Rendre le script exécutable |