Guest User

Untitled

a guest
Jun 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. #!/bin/bash
  2. #version 0.1
  3. cd ~/browser-installs/profile/
  4.  
  5. #Opera tab count
  6. if [ -e "sessions/autosave.win" ]; then
  7. tab_opera_c=`egrep 'window count=([0-9]*)' sessions/autosave.win | awk '{split($2, s, "="); print s[2]}'`
  8. window_opera_c=`grep -c 'type=0' sessions/autosave.win`
  9. actual_opera_c=$(($tab_opera_c - $window_opera_c))
  10. echo "- "$actual_opera_c" tabs in "$window_opera_c" windows"
  11. fi
  12.  
  13. #Opera bookmark count
  14. if [ -e "bookmarks.adr" ]; then
  15. bkmk_bookmarks_c=`grep -c '#URL' bookmarks.adr`
  16. fldr_bookmarks_c=`grep -c '#FOLDER' bookmarks.adr`
  17. echo "- "$bkmk_bookmarks_c" bookmarks in "$fldr_bookmarks_c" folders"
  18. fi
  19.  
  20. #Opera notes count
  21. if [ -e "notes.adr" ]; then
  22. nts_notes_c=`grep -c '#NOTE' notes.adr`
  23. fldr_notes_c=`grep -c '#FOLDER' notes.adr`
  24. echo "- "$nts_notes_c" notes in "$fldr_notes_c" folders"
  25. fi
  26.  
  27. #Opera search engine count
  28. if [ -e "search.ini" ]; then
  29. search_opera_c=`grep -c '\[Search\ Engine' search.ini`
  30. echo "- "$search_opera_c" saved search engines"
  31. fi
  32.  
  33. #Opera speed dial count
  34. if [ -e "speeddial.ini" ]; then
  35. spd_opera_c=`grep -c '\[Speed\ Dial' speeddial.ini`
  36. spd_x=`egrep 'Rows=([0-9]*)' speeddial.ini | awk '{split($1, s, "="); print s[2]}'`
  37. spd_y=`egrep 'Columns=([0-9]*)' speeddial.ini | awk '{split($1, s, "="); print s[2]}'`
  38. if [ "$spd_x" != "" ] && [ "$spd_y" != "" ]; then
  39. echo "- "$spd_opera_c" saved speed dials ("$spd_x"x"$spd_y")"
  40. fi
  41. fi
  42.  
  43. #Opera blocked content count
  44. if [ -e "urlfilter.ini" ]; then
  45. bc_opera_c=$(expr $(sed -n '/\[exclude\]/,/\[/p' urlfilter.ini | sed -e '/./!d' | wc -l) - 1)
  46. echo "- "$bc_opera_c" blocked content urls"
  47. fi
  48.  
  49. #Opera cache size
  50. if [ -d "cache" ]; then
  51. cache_opera_c=`du -hs cache/ | awk '{print $1}'`
  52. echo "- "$cache_opera_c" in cache"
  53. fi
  54.  
  55. #Opera memory size (not perfect)
  56. mem_opera_c=`ps aux | egrep 'opera -pd' | awk '{print $5}'`
  57. if [ "$mem_opera_c" != "" ]; then
  58. mem_opera_c=$(($mem_opera_c / 1024))
  59. echo "- "$mem_opera_c"M in virtual memory"
  60. fi
Add Comment
Please, Sign In to add comment