Guest User

Untitled

a guest
May 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/bin/env bash
  2. run_or_raise() {
  3. local _raise=${1}
  4. local _run=${2}
  5. wmctrl -x -a ${_raise} || ${_run} &
  6. }
  7.  
  8. # tabs colors
  9. theme_light="tabbed -c -t #fafafa -T #9575cd -u #eeeeee -U #4d4d4d"
  10. theme_dark="tabbed -c -t #252525 -T #9575cd -u #2d2d2d -U #00997a"
  11.  
  12. # focus WM_CLASS tabbed.tabbed OR start new tabbed if not exist
  13. run_or_raise "tabbed.tabbed" "${theme_light}"
  14. until wmctrl -lx | grep "tabbed.tabbed"; do
  15. sleep 0.25
  16. done
  17.  
  18. #focus the current active window and start zathura
  19. wmctrl -r :ACTIVE:
  20. zathura -e $(wmctrl -lx | grep "tabbed.tabbed" | cut -d' ' -f1) "${1}"
Add Comment
Please, Sign In to add comment