random scripts I use
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
689B

  1. #!/usr/bin/env fish
  2. function fish_prompt
  3. set _stat $status
  4. echo -n (set_color 70a9ff)(date +%H:%M:%S)
  5. echo -n (set_color normal)(
  6. if test $_stat -eq 0
  7. echo '@'
  8. else
  9. echo '!'
  10. end)
  11. echo -n (
  12. if test $_agw_chroot
  13. set_color f54f4c
  14. else
  15. set_color c792ea
  16. end)$hostname
  17. echo (set_color normal)"% "
  18. end
  19. function fish_right_prompt
  20. echo -n (set_color c3e88d)(pwd)
  21. echo (set_color normal)
  22. end
  23. function fish_greeting
  24. if test -f /usr/share/dict/words && test (which shuf) && test (which ruby)
  25. set_color c50ed2
  26. echo -n "Word of the moment: "(shuf -n1 /usr/share/dict/words) |
  27. ruby -e 'puts $stdin.read.center ARGV[0].to_i' $COLUMNS
  28. set_color normal
  29. end
  30. end
  31. ## EOF