Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. DMENU="rofi -p LoadLayout: -bg #222222 -dmenu"
  4.  
  5. if ! command -v "jshon" >/dev/null 2>&1; then
  6. printf "%s\\n" "you need to install 'jshon' to run this program" >&2
  7. exit 1
  8. fi
  9.  
  10. if ! command -v "rofi" >/dev/null 2>&1; then
  11. printf "%s\\n" "you need to install 'rofi' to run this program" >&2
  12. exit 1
  13. fi
  14.  
  15. LNAME="$(ls ~/.i3/layouts | ${DMENU})"
  16.  
  17. if [ -z "$LNAME" ]; then
  18. exit 1
  19. else
  20. WORKSPACE="$(i3-msg -t get_workspaces | jshon -a -e focused -u -p -e name -u | awk 'f{print;f=0} /true/{f=1}')"
  21. i3-msg "workspace ${WORKSPACE}; append_layout ~/.i3/layouts/${LNAME}"
  22. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement