Conkytemplate.sh (en)

From Conky PitStop

Jump to: navigation, search

conkytemplate.sh

 Language   English   Français   


This original idea came to me while I read about users GIMPing their backgrounds in order to make their Conky easier to read. At the same time I was playing with overlaying my conky on HUGE size fonts to decorate. (as seen in my conkyheader.sh)

It occurred to me that if you made a semi-transparent font you could piece together a nice template to set the rest of the conky on top of. You can read more about this idea and get the fonts from Semi-Transparent Font here.
Many thanks to t-mo_ for creating the font that makes this part possible.

With the release of conky 1.7.1, which supports placing images with conky, I felt a need to update this script. Done this way you will not need the fonts mentioned above. but you will need a suitable transparent image… (I’ll add one to the bottom of the page for ease of use.) You can still use this script either way simply by altering the UseImage variable.

BUT: with the release of conky 1.7.2 which supports Lua scripting : a better solution (Background in color) has come along which makes this script obsolete. This script remains for those who want or need it.




A few items of note:

Enjoy!

#!/bin/bash
# conkytemplate.sh
# by Crinos512
# Usage:
#  ${execpi 3600 ~/.conky/conkyparts/conkytemplate.sh}
#
UseImage="1"
Image="/home/crinos/.conky/conkyparts/backdrop.png"
ImageSize="380x900"
BGColor="Black"
Columns=12
Rows=27
Layers=5

### FIX FOR KDE4 TRANSPARENCY
feh --bg-scale "`grep 'wallpaper=' ~/.kde/share/config/plasma-desktop-appletsrc | head -n1 | tail --bytes=+11`"

### DO NOT EDIT BELOW THIS LINE
if [ "$UseImage" -eq "1" ]; then
  echo "\${image $Image -p 0,0 -s $ImageSize}"
    g=1
    while [ $g -lt $Layers ]; do
      echo "\${voffset -10}\${image $Image -p 0,0 -s $ImageSize}"
      let g=g+1
    done
else 
  for ((x=1; x < =  $Rows; x++))
  do
    case "$x" in
      1)
        Prefix="\${font conkybackgroundfi:size=13.5}\${color $BGColor}"
        BeginPart="\${goto 0}E"
        MidPart=""
        EndPart="F"
        i=$((Columns-2))
        ;;
      $Rows)
        Prefix=""
        BeginPart="\${goto 0}G"
        MidPart=""
        EndPart="C"
        i=$((Columns-2))
        ;;
      *)
        Prefix=""
        BeginPart="\${goto 0}"
        MidPart=""
        EndPart=""
        i=$Columns
        ;;
    esac
    while [ $i -gt 0 ]; do
      MidPart="${MidPart}D"
      let i=i-1
    done
    Part="${BeginPart}${MidPart}${EndPart}"
    g=0
    Line=""
    while [ $g -lt $Layers ]; do
      Line="${Line}${Part}"
      let g=g+1
    done
    echo "\${voffset -2}$Prefix$Line"
  done
  echo "\$font\$color\${voffset -$( echo "scale=9; $Rows*32" | bc )}"
fi
exit 0

Here is the image I promised you... Right-click and save it where ever you like!

Script-crinos512-conkytemplate.jpg


[UPDATED: 12 Sept. 2009]

Personal tools
Namespaces
Variants
Actions
Navigation
English
Français
Toolbox