SHARE
TWEET

i3blocks (v4)

a guest Oct 2nd, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ######################
  2. #   Global properties     #
  3. ######################
  4. #
  5. command=$HOME/.config/i3/i3blocks/$BLOCK_NAME
  6. full_text=
  7. color=#7b5751
  8. separator=false
  9. separator_block_width=16
  10. markup=pango
  11.  
  12.  
  13. #####################
  14. #   Media player        #
  15. #####################
  16. #
  17. [mocp]
  18. command=$HOME/.config/i3/i3blocks/mocp
  19. interval=1
  20. color=#7b5751
  21.  
  22.  
  23. #########################
  24. #   Volume indicator        #
  25. #########################
  26. #
  27. [volume]
  28. label=
  29. instance=Master
  30. interval=once
  31. signal=1
  32. color=#88b090
  33. [separator]
  34.  
  35.  
  36. #################
  37. #   Disk usage  #
  38. #################
  39. #
  40. [disk-root]
  41. label=
  42. #command=echo "$(df -h / | grep dev | awk -F ' ' '{print $4}' | sed 's/\G//')""<span color='#4f6571'>G</span>"; [[ -z "${BLOCK_BUTTON}" ]] || pcmanfm -n / &
  43. command=echo "$(df -h / | grep dev | awk -F ' ' '{print $4}')"; [[ -z "${BLOCK_BUTTON}" ]] || pcmanfm -n / &
  44. interval=1
  45. color=#eeeeee
  46.  
  47. [disk-home]
  48. label=
  49. #command=echo "$(df -h /home | grep dev | awk -F ' ' '{print $4}' | sed 's/\G//')""<span color='#4f6571'>G</span>"; [[ -z "${BLOCK_BUTTON}" ]] || pcmanfm -n / &HOME &
  50. command=echo "$(df -h /home | grep dev | awk -F ' ' '{print $4}')"; [[ -z "${BLOCK_BUTTON}" ]] || pcmanfm -n &HOME &
  51. interval=1
  52. color=#eeeeee
  53.  
  54. [trash]
  55. label=
  56. interval=1
  57. color=#eeeeee
  58. [separator]
  59.  
  60.  
  61. #################
  62. #   Packages    #
  63. #################
  64. #
  65. [packages]
  66. label=
  67. command=echo "$(pacman -Q | wc -l)"; [[ -z "${BLOCK_BUTTON}" ]] || pamac-manager &
  68. color=#87a7af
  69. interval=1
  70. [separator]
  71.  
  72.  
  73. #################
  74. #   CPU usage   #
  75. #################
  76. #
  77. [cpu_usage]
  78. label=
  79. interval=1
  80. color=#eeeeee
  81.  
  82.  
  83. #####################
  84. #   Temperature     #
  85. #####################
  86. #
  87. [temperature]
  88. label=
  89. interval=1
  90. color=#eeeeee
  91.  
  92.  
  93. #####################
  94. #   Memory usage    #
  95. #####################
  96. #
  97. [memory]
  98. command=echo "$(free -m | awk 'NR==2{printf "%0.0f\n",$3/$2*100}')%"; [[ -z "${BLOCK_BUTTON}" ]] || lxtask &
  99. label=
  100. color=#eeeeee
  101. interval=1
  102. [separator]
  103.  
  104.  
  105. #################
  106. #   Date & Time    #
  107. #################
  108. #
  109. [date]
  110. command=date +'%a %d.%m.%Y'; [[ -z "${BLOCK_BUTTON}" ]] || gsimplecal &
  111. interval=1
  112. label=
  113. color=#88b090
  114.  
  115. [time]
  116. command=echo "`date +'%H:%M'`"
  117. interval=1
  118. label=
  119. color=#88b090
  120. [separator]
  121.  
  122.  
  123. #################
  124. #   Powermenu   #
  125. #################
  126. #
  127. [powermenu]
  128. command=echo "  " ; [[ -z "${BLOCK_BUTTON}" ]] || ~/.config/i3/powermenu &
  129. interval=once
  130. color=#eeeeee
  131.  
  132.  
  133.  
  134. MOCP:
  135. #!/bin/bash
  136.  
  137. STATUS=$(mocp -i | grep "State:" | sed -e "s/^.*: //")
  138. TITLE=$(mocp -i | grep "^Title:" | sed -e "s/^.*: //")
  139. ARTIST=$(mocp -i | grep "Artist:" | sed -e "s/^.*: //")
  140. SONGTITLE=$(mocp -i | grep "SongTitle:" | sed -e "s/^.*: //")
  141.  
  142. if [[ $STATUS == PLAY ]]; then
  143.   if [[ $TITLE != "" ]]; then
  144.     if [[ $ARTIST != "" ]]; then ARTIST="$ARTIST -"; fi
  145.       echo -e " $ARTIST $SONGTITLE  "
  146.     else echo -e " Prehráva sa  "
  147.     case $BLOCK_BUTTON in
  148.     1) mocp -f ;; # left click = next song
  149.     2) mocp -G ;; # middle click = toggle pause - play
  150.     3) mocp -r ;; # right click = previous song
  151.     esac
  152.     exit 0
  153.    fi
  154. fi
  155.  
  156. if (! pidof mocp ) &>/dev/null 2>&1; then
  157.   echo -e " "
  158. else echo -e " "
  159. fi
RAW Paste Data
Top