Last active
          November 29, 2020 19:00 
        
      - 
      
- 
        Save yzdann/a76ea51a269d748813f587d80dfa299c to your computer and use it in GitHub Desktop. 
Revisions
- 
        yzdann revised this gist Nov 29, 2020 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,18 @@ TMUX_WINDOW_ID=$(wmctrl -l | grep -i tmux | grep -i konsole | awk "/$rx/"'{print $1}' | head -1 ) TMUX_CURRENT_FIRST_SESSION=$(tmux list-session | cut -d':' -f1 | head -1) echo $TMUX_WINDOW_ID # activate the window terminal with tmux if existed if [[ ! -z "$TMUX_WINDOW_ID" ]]; then wmctrl -i -a $TMUX_WINDOW_ID else # attach to current session if [[ ! -z "$TMUX_CURRENT_FIRST_SESSION" ]]; then konsole -e "tmux attach -t $TMUX_CURRENT_FIRST_SESSION" else konsole -e tmux fi fi tmux new-window 
- 
        yzdann created this gist Nov 29, 2020 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ TMUX_WINDOW_ID=$(wmctrl -l | grep -i tmux | grep -i konsole | awk "/$rx/"'{print $1}' | head -1 ) # activate the window terminal with tmux if existed if [[ ! -z "$TMUX_WINDOW_ID" ]]; then wmctrl -i -a $TMUX_WINDOW_ID else konsole -e tmux fi tmux new-window