Guest User

guake_like_terminal

a guest
May 4th, 2021
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.43 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. newterm=N
  4. [ "$1" = "-n" ] && newterm=Y
  5. program=tilix
  6.  
  7. if [[ -z "$(pgrep $program)" || "$newterm" = "Y" ]] ; then
  8.     exec $program
  9. else
  10.     wids=$(xdotool search --class $program)
  11.     active_wid=$(xdotool getactivewindow)
  12.     for wid in $wids ; do
  13.         if [ $wid -eq $active_wid ] ; then
  14.             xdotool keydown alt key Tab
  15.         else
  16.             xdotool windowactivate $wid
  17.         fi
  18.     done
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment