Guest User

Untitled

a guest
Jun 24th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. # Customizing iTerm badges
  2.  
  3. There are two variables available to use in the badge field with
  4.  
  5. \(user.gitBranch) \n \(user.humpDay)
  6. - gitBranch shows the current branch the folder opened in the terminal is
  7. - humpDay shows an icon according to the date
  8.  
  9. This code goes into ~/.bash_profile
  10.  
  11. #iTerm setup
  12. function iterm2_print_user_vars() {
  13. iterm2_set_user_var gitBranch $((git branch 2> /dev/null) | grep \* | cut -c3-)
  14. iterm2_set_user_var humpDay $(what_day_is_it)
  15. }
  16.  
  17. function random_emoji {
  18. # Array with emojis
  19. emojis=("๐Ÿน" "๐Ÿ " "๐Ÿ" "๐Ÿฆ‘" "๐ŸŒด" "โญ๏ธ" "๐Ÿ„" "๐ŸŒป" "๐ŸŒ" "๐ŸŒ™" "๐Ÿ”ฅ" "๐ŸŒˆ" "๐ŸŒช" "๐Ÿ‘" "๐Ÿฅ‘" "๐Ÿฑ" "๐Ÿฃ" "๐ŸŽญ" "๐ŸŽจ" "๐ŸŽฌ" "๐ŸŽง" "๐ŸŽผ" "๐ŸŽน" "๐ŸŽฎ" "๐Ÿšœ" "๐Ÿ›ซ" "๐Ÿš‚" "๐Ÿš€" "๐Ÿ—บ" "๐Ÿ—ฟ" "๐Ÿฏ" "๐Ÿ•" "๐Ÿ”" "โ›ฉ" "๐Ÿ›" "๐Ÿ“€" "๐Ÿ“ผ" "๐Ÿ“ฝ" "๐ŸŽž" "โฐ" "๐Ÿ’ก" "๐Ÿ’Ž" "โš–๏ธ" "๐Ÿ› " "โš™๏ธ" "๐Ÿ’ฃ" "โš”๏ธ" "๐Ÿ”ฎ" "๐Ÿ’ˆ" "๐Ÿ”ญ" "๐Ÿ”ฌ" "๐Ÿ•ณ" "๐Ÿšฝ" "๐Ÿ›€๐Ÿฝ" "๐Ÿ—" "๐Ÿšช" "๐Ÿ–ผ" "๐ŸŽˆ" "โœ‰๏ธ" "๐Ÿ’Œ" "๐Ÿ–‡" "๐Ÿ”" "๐Ÿ’ฏ" "๐ŸŽถ" "๐Ÿ”" "โ™ž" "๐Ÿ‚ฑ" "โœ“" "โฆ" "โŒ˜" "โ™ป๏ธŽ" "๐Ÿ˜…" "๐Ÿคฃ" "๐Ÿ˜‹" "๐Ÿ˜™" "๐Ÿค“" "๐Ÿ˜Ž" "๐Ÿ™ƒ" "๐Ÿ˜ณ" "๐Ÿ˜ฑ" "๐Ÿ™„" "๐Ÿค–" "๐Ÿ‘พ" "๐Ÿ’€" "๐Ÿ‘๐Ÿผ" "๐Ÿ‘€" "๐Ÿ’ƒ๐Ÿป" "๐Ÿ‘“")
  20.  
  21. # Seed random generator
  22. RANDOM=$$$(date +%s)
  23.  
  24. # Get random expression...
  25. selectedemoji=${emojis[$RANDOM % ${#emojis[@]}]}
  26. # Write to Shell
  27. echo $selectedemoji
  28.  
  29. }
  30.  
  31. function what_day_is_it {
  32. case "$(date +%A)" in
  33. "lunes")
  34. if [[ $(date +%H) > 15 ]]
  35. then
  36. random_emoji
  37. else
  38. echo "๐ŸŒฑ"
  39. fi
  40. ;;
  41. "miรฉrcoles")
  42. if [[ $(date +%H) < 15 ]]
  43. then
  44. random_emoji
  45. else
  46. echo "๐Ÿช"
  47. fi
  48. ;;
  49. "jueves")
  50. echo "๐Ÿณ"
  51. ;;
  52. "viernes")
  53. echo "๐Ÿฆ„"
  54. ;;
  55. "sรกbado" | "domingo")
  56. echo "โ˜ ๏ธ"
  57. ;;
  58. *)
  59. random_emoji
  60. ;;
  61. esac
  62. }
Add Comment
Please, Sign In to add comment