Last active
March 7, 2016 17:24
-
-
Save rhoconlinux/31b1f1195ed0272addc2 to your computer and use it in GitHub Desktop.
hack window show de sublime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #getting sublime window | |
| wmctrl -l -p | grep -e "- Sublime" > .hacking-sublime-pre.txt; | |
| raw=$(cat .hacking-sublime-pre.txt) | |
| #getting the sublime app code to identify simultaneous windows | |
| echo $raw | sed 's/[^ ]* //' | sed 's/[^ ]* //' | sed 's/\s.*$//' > .hacking-sublime-apcode.txt; | |
| apcode=$(cat .hacking-sublime-apcode.txt) | |
| echo $apcode | |
| #getting the window that is not the main sublime window | |
| #esto es si está la ventanita. Excluye la linea buena que refiere e sublime | |
| wmctrl -l -p | grep $apcode | grep Sublime; | |
| wmctrl -l -p | grep $apcode | grep -v Sublime > .hacking-sublime.txt; | |
| #closing the app with the PID | |
| a=$(cat .hacking-sublime.txt) | |
| echo $a | |
| echo "cleaning the output" | |
| echo $a | sed 's/\s.*$//'; | |
| echo $a | sed 's/\s.*$//' > .hacking-sublime-pid.txt; | |
| cat .hacking-sublime-pid.txt; | |
| pid=$(cat .hacking-sublime-pid.txt) | |
| wmctrl -i -c $pid & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment