Advertisement
oxhak

Herbstluftwm + dzen2 + conky base configuration status bar

Mar 19th, 2013
1,734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.33 KB | None | 0 0
  1. Herbstluftwm + dzen2 + conky base configuration status bar:
  2. >>>>>>>>>>> panel.sh
  3.  
  4. #!/bin/bash
  5.  
  6. ## dzen stuff
  7. FG='#CCCCCC'
  8. BG='#333333'
  9. FONT="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
  10.  
  11. function uniq_linebuffered() {
  12.    awk '$0 != l { print ; l=$0 ; fflush(); }' "$@"
  13. }
  14.  
  15. {
  16.    conky -c ~/.conky/statusbar | while read -r; do
  17.       echo -e "conky $REPLY";
  18.      
  19.    done > >(uniq_linebuffered) &
  20.    childpid=$!
  21.    herbstclient --idle
  22.    kill $childpid
  23. } | {
  24.    TAGS=( $(herbstclient tag_status $monitor) )
  25.       conky=""
  26.       separator="^fg(#333333)^ro(1x16)^fg()"
  27.       while true; do
  28.          for i in "${TAGS[@]}"; do
  29.             echo -n "^ca(1,herbstclient use ${i:1}) "
  30.             case ${i:0:1} in
  31.             '#')
  32.                echo -n "^fg(#2290B5)[^fg(#CCCCCC)${i:1}^fg(#2290B5)]"
  33.                ;;
  34.             ':')
  35.                echo -n "^fg(#CCCCCC) ${i:1} "
  36.                ;;
  37.             *)
  38.                echo -n "^fg(#2290B5) ${i:1} "
  39.                ;;
  40.             esac
  41.             echo -n "^ca()"
  42.         done
  43.         echo -n " $separator"
  44.         conky_text_only=$(echo -n "$conky "|sed 's.\^[^(]*([^)]*)..g')
  45.         width=$(textwidth "$FONT" "$conky_text_only  ")
  46.         echo -n "^p(_RIGHT)^p(-$width)$conky"
  47.         echo
  48.         read line || break
  49.         cmd=( $line )
  50.    case "$cmd[0]" in
  51.                tag*)
  52.                   TAGS=( $(herbstclient tag_status $monitor) )
  53.                   ;;
  54.                conky*)
  55.                   conky="${cmd[@]:1}"
  56.                   ;;
  57.                esac
  58.      done
  59. } 2> /dev/null |dzen2 -ta l -y 0 -x 0 -h 16 -w 1920 -fg $FG -bg $BG -fn $FONT &
  60.  
  61. ---------------------------------
  62.  
  63. >>>>>>>>>>> ~/.conky/statusbar
  64.  
  65. ## No output to X <yes/no>
  66. out_to_x no
  67.  
  68. ## Create own window to draw <yes/no>
  69. own_window no
  70.  
  71. ## Print everything to console?
  72. out_to_console yes
  73.  
  74. ## Use double buffering (reduces flicker, not needed for console output)
  75. double_buffer no
  76.  
  77. ## Set to yes if you want Conky to be forked in the background
  78. background no
  79.  
  80. ## Update interval in seconds
  81. update_interval 1.0
  82.  
  83. ## This is the number of times Conky will update before quitting.
  84. ## Set to zero to run forever.
  85. total_run_times 0
  86.  
  87. ## How strict should if_up be when testing an interface for being up?
  88. ## The value is one of up, link or address, to check for the interface
  89. ## being solely up, being up and having link or being up, having link
  90. ## and an assigned IP address.
  91. if_up_strictness address
  92.  
  93.  
  94. ## Force UTF8? note that UTF8 support required XFT
  95. override_utf8_locale no
  96.  
  97. TEXT
  98. ARCH LINUX $kernel $machine UPTIME $uptime | CPU ${cpu}%  RAM ${memperc}% | TEMP CPU ${hwmon temp 1} GPU ${execi 2 nvidia-settings -query GPUCoreTemp | grep Attribute | cut -c44-45} MB ${hwmon temp 2} | /SYSTEM ${fs_used /}/${fs_free /} /HOME ${fs_used /home/}/${fs_free /home/} | Enp3s0 DOWN ${downspeed enp3s0} UP ${upspeed enp3s0} | ${time %A %d %B %Y, %H:%M:%S}
  99.  
  100. ------------------------
  101. Line for a laptop with wifi signal quality and battery % and left time.
  102.  
  103. CPU ${cpu}%  RAM ${memperc}% | TEMP CPU ${hwmon temp 1} | /SYSTEM ${fs_used /}/${fs_free /} /HOME ${fs_used /home/}/${fs_free /home/} | wlp4s0 SQ ${wireless_link_qual wlp4s0}% DOWN ${downspeed wlp4s0} UP ${upspeed wlp4s0} | BAT ${exec acpi -b | grep "Battery 0" | awk '{ print $4}'} ${battery_time BAT0} | ${time %A %d %B %Y, %H:%M:%S}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement