SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#5526 2013-06-17 13:45:25

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Deegan wrote:

Hi boys  big_smile

I have changed the components of my pc

Thanks   big_smile    big_smile    big_smile

Oops! I responded here.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Be excellent to each other!

#5527 2013-06-18 00:50:13

triphex
Member
Registered: 2013-06-12
Posts: 33

Re: Conky v1.9 Thread

How do I get my system to show the CPU temperature by using conky?

Offline

#5528 2013-06-18 00:55:53

pidsley
Window Mangler
Registered: 2012-05-23
Posts: 1,752

Re: Conky v1.9 Thread

You need to install lm-sensors, and then run sensors-detect.

sudo apt-get install lm-sensors
sudo sensors-detect

answer "yes" (the default) to all the search questions. If no sensors are found, your machine does not support CPU temp. If sensors-detect finds sensors, allow it to add them to your modules. Then reboot. After you reboot, run

sensors

to make sure the sensors are working.
Now go to the conky docs to see how to add CPU temp to conky.

here is the string that works on my machine:

${hwmon 0 temp 1}

You may need to use some other number for "temp." If you have more questions, the conky wizards hang out in the "monster conky" thread.

Last edited by pidsley (2013-06-18 01:06:49)

Offline

#5529 2013-06-18 04:23:42

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: Conky v1.9 Thread

I didn't have to install lm-sensors.  I just added the following lines to the .conkyrc file under my home folder:

CPU Core0:$alignr${platform coretemp.0 temp 2}
CPU Core1:$alignr${platform coretemp.0 temp 3}
CPU Core2:$alignr${platform coretemp.0 temp 4}
CPU Core3:$alignr${platform coretemp.0 temp 5}


Linux User #586672
Come and Die -- Kyle Idleman

Offline

#5530 2013-06-18 07:32:21

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky v1.9 Thread

I want conky to display current cpu governor so I put this in:

${execi 60 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor}$voffset

However, because there are two cores, it displays two identical values. How can I limit it to only the first line?

Offline

#5531 2013-06-18 07:42:40

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Conky v1.9 Thread

Maybe replace "cpu*" with either "cpu0" or "cpu1", assuming you set both cores to the same governor?

Offline

#5532 2013-06-18 07:48:55

lockheed
Member
Registered: 2013-06-13
Posts: 40

Re: Conky v1.9 Thread

Of course... Thanks!

Offline

#5533 2013-06-18 08:40:02

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

@Sector 11
Hi;
I'm going home
Sorry I'm out...  lol

Offline

#5534 2013-06-18 10:16:34

triphex
Member
Registered: 2013-06-12
Posts: 33

Re: Conky v1.9 Thread

installing lm-sensors worked. This is what shows when running sensors in the terminal:

 gtk@crunchbang:~$ sensors
smsc47b397-isa-0480
Adapter: ISA adapter
fan1:        3976 RPM
fan2:           0 RPM
fan3:           0 RPM
fan4:        2452 RPM
temp1:        +64.0°C  
temp2:         +0.0°C  
temp3:        +34.0°C  
temp4:         +0.0°C  

Using ${hwmon 0 temp 1} works for showing CPU temperature. Why does it show two CPU temps? For the fans, which one is the case fan and which one is the CPU fan?

Offline

#5535 2013-06-18 13:02:10

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

ragamatrix wrote:

@Sector 11
Hi;
I'm going home
Sorry I'm out...  lol

I'd reply but I'm on the road goin' home  big_smile
Thanks


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5536 2013-06-18 13:39:43

iann
#! Die Hard
Registered: 2010-09-10
Posts: 720

Re: Conky v1.9 Thread

lm-sensors should have given you the option at the end to load those modules.  If not then you'll have to do it yourself.  modprobe them in, and ideally configure your system to do it on every boot.

Multiple temperatures and fans is very typical.  They might not all be connected to anything.  There is no single answer to which one is which, it depends how they were wired up.  On my system, the first one in each case is the main CPU temperature and fan.  Looks to me like that is true for you also.  The second temperature may be an ambient case temperature.  Then the second fan is perhaps the case fan or PSU fan.  Try cranking up the CPU to make the fan run faster and see which one changes.

Offline

#5537 2013-06-19 14:00:20

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

I modified a script wich display a seismic map with quakes of past 24hrs. I don't use it in conky but you will can with executing script by "texeci" something like that :

${texeci 1200 /home/YOU/.conky/script/03-carte-seismes.sh}
${image /tmp/carte-seismes.png -p 16,610 -f 60}

I've made it for Euro but I can do it for US
1371643214.png
link_pic

Edit:
Script for us:
Scripts "pagecurl" and "map-seismic-us.sh" must be in the same folder:
pagecurl:

#!/bin/bash
#
# USAGE: pagecurl [options] infile outfile
#
# pagecurl - Applies a pagecurl effect to the lower right corner of an image.
#
# This program generates a pagecurl effect to the lower right corner of an
# image. The apex of the curl is nominally in the upper right corner of the
# image, but can be adjusted. The curl is always right to left. The curl can
# be shaded and/or colored. The removed area can be colored or transparent.
# Note that this is a 2D simulation and not a true 3D effect.
#
# OPTIONS:
#
#      -a amount       amount of pagecurl expressed as percent of image
#                      width; integer>=5; default=50
#      -m mode         mode of shading curl; plain, grad or doublegrad;
#                      default=grad
#      -c color        color to apply to curl; any valid IM color;
#                      default=white
#      -b bgcolor      background color to apply to image where curled away;
#                      any valid IM color; default=none (transparent)
#      -e ellipticity  curl flattening from circle to ellipse;
#                      0<=float<1; default=0 for circle; recommended value
#                      other 0 is 0.5 for ellipse shape
#      -x xcoord       x coordinate for apex of curl;
#                      default=right image edge
#      -y ycoord       y coordinate for apex of curl;
#                      default=upper image edge
#      -g gcontrast    contrast adjustment for mode=grad; 0<=integer<=100;
#                      increases contrast only; default=15
#      -d dcontrast    contrast adjustment for mode=doublegrad;
#                      -100<=integer<=100; positive increase contrast;
#                      negative decreases contrast; default=0
#      -i prefix       generate and save the overlay and masking images
#                      in PNG format using the filename prefix provided.
#
#      -help           output this documentation
#
###
#
# -a amount ... AMOUNT of pagecurl expressed as percent of image width. Values
# are in range integer>=5. The default=50
#
# -m mode ... MODE shading on the curl. Choices are: plain (or p), grad (or g)
# for gradient, or doublegrad (or d) for double gradient. Default=grad.
#
# -c color ... COLOR is the color to apply to curl. Any valid IM color is
# allowed. The default=white.
#
# -b bgcolor ... BGCOLOR is the color to apply to curled away part of the image.
# Any valid IM color is allowed. The default=none for transparent.
#
# -e ellipticity ... ELLIPTICITY is the amount of curl flattening from a circle
# to an ellipse. Values are in range 0<=float<1. The default=0 for circle.
# Recommended value other 0 is 0.5 for ellipse shape.
#
# -x xcoord ... XCOORD is the X coordinate for the apex of the curl. Values
# are 0<integers<width. The default is the right edge of the image.
#
# -y ycoord ... YCOORD is the Y coordinate for the apex of the curl. Values
# are integers. The default is the upper edge of the image.
#
# -g gcontrast ... GCONTRAST is the contrast adjustment for mode=grad. Values
# are in range 0<=integer<=100. This increases contrast only. The default=15
#
# -d dcontrast ... DCONTRAST is the contrast adjustment for mode=doublegrad.
# Values are in range -100<=integer<=100. Positive values increase contrast.
# Negative values decrease contrast. The default=0
#
# -i prefix ... save the overlay and masking images generated using the
# prefix/path provided. Filename created are "{prefix}_overlay.png" and
# "{prefix}_mask.png".
#
#
# Thanks to Anthony Thyssen for critiqing the original version and for
# several useful suggestions for improvement.
#
# CAVEAT: No guarantee that this script will work on all platforms,
# nor that trapping of inconsistent parameters is complete and foolproof.
# Use At Your Own Risk.
#
######
#
# Original script by Fred Weinhaus, 23 May 2010
# Re-developed by Anthony Thyssen, 4 December 2010
#

# set default values
amount=50            # approx percentage of curl of image width; 5 to 100
mode="grad"          # plain, grad, doublegrad
color="white"        # color for plain or gradients
bgcolor="none"       # background color
ellipticity=0        # how circular the curl is 0 circle 0.5 is elliptical
xcoord=""            # apex of cone; default=width (UL corner)
ycoord=""            # apex of cone; default=0 (UL corner)
gcontrast=15         # gradient contrast values; non-neg interger percent
dcontrast=0          # doublegrad contrast values; pos or neg integer percent
swidth=2             # strokewidth; thickness of curl

# set up functions to report Usage and Usage with Description
PROGNAME=`type $0 | awk '{print $3}'`  # search for executable on path
PROGDIR=`dirname $PROGNAME`            # extract directory of program
PROGNAME=`basename $PROGNAME`          # base name of program
usage1() {
  echo >&2 ""
  echo >&2 "$PROGNAME:" "$@"
  sed >&2 -n '/^###/q;  /^#/!q;  s/^#//;  s/^ //;  3,$p' \
      "$PROGDIR/$PROGNAME"
  exit 1
}
usage2() {
  echo >&2 ""
  echo >&2 "$PROGNAME:" "$@"
  sed >&2 -n '/^######/q;  /^#/!q;  s/^#*//;  s/^ //;  3,$p' \
      "$PROGDIR/$PROGNAME"
  exit 0
}


# function to report error messages
errMsg() {
  echo ""
  echo $1
  echo ""
  usage1
}


# function to test for minus at start of value of second part of option 1 or 2
checkMinus() {
  test=`echo "$1" | grep -c '^-.*$'`   # returns 1 if match; 0 otherwise
  [ $test -eq 1 ] && errMsg "$errorMsg"
}

# test for correct number of arguments and get values
if [ $# -eq 0 ]; then
  echo ""
  usage2
elif [ $# -gt 20 ]; then
  errMsg "--- TOO MANY ARGUMENTS WERE PROVIDED ---"
fi

while [ $# -gt 0 ]
  do
    # get parameter values
    case "$1" in
    -help)    # help information
        echo ""
        usage2
        exit 0
        ;;
    -a)  # get amount
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        errorMsg="--- INVALID AMOUNT SPECIFICATION ---"
        checkMinus "$1"
        amount=`expr "$1" : '\([0-9]*\)'`
        [ "$amount" = "" ] && errMsg "--- AMOUNT=$amount MUST BE A NON-NEGATIVE INTEGER (with no sign) ---"
        test1=`echo "$amount < 5" | bc`
        [ $test1 -eq 1 ] && errMsg "--- AMOUNT=$amount MUST BE AN GREATER THAN 4 ---"
        ;;
    -m) # get  mode
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        errorMsg="--- INVALID MODE SPECIFICATION ---"
        checkMinus "$1"
        mode=`echo "$1" | tr '[A-Z]' '[a-z]'`
        case "$mode" in
          plain|p) mode=plain ;;
          grad|g) mode=grad ;;
          doublegrad|d) mode=doublegrad ;;
          *) errMsg "--- MODE=$mode IS AN INVALID VALUE ---" ;;
        esac
        ;;
    -c) # get color
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        errorMsg="--- INVALID COLOR SPECIFICATION ---"
        checkMinus "$1"
        color="$1"
        ;;
    -b) # get bgcolor
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        errorMsg="--- INVALID BGCOLOR SPECIFICATION ---"
        checkMinus "$1"
        bgcolor="$1"
        ;;
    -e) # get ellipticity
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        errorMsg="--- INVALID ELLIPTICITY SPECIFICATION ---"
        checkMinus "$1"
        ellipticity=`expr "$1" : '\([.0-9]*\)'`
        [ "$ellipticity" = "" ] && errMsg "--- ELLIPTICITY=$arc MUST BE A NON-NEGATIVE FLOAT (with no sign) ---"
        test1=`echo "$ellipticity < 0" | bc`
        test2=`echo "$ellipticity >= 1" | bc`
        [ $test1 -eq 1 -o $test2 -eq 1 ] && errMsg "--- ELLIPTICITY=$arc MUST BE A FLOAT GREATER THAN OR EQUAL 0 AND LESS THAN 1 ---"
        ;;
    -x) # get xcoord
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        errorMsg="--- INVALID XCOORD SPECIFICATION ---"
        checkMinus "$1"
        xcoord=`expr "$1" : '\([0-9]*\)'`
        [ "$xcoord" = "" ] && errMsg "--- XCOORD=$xcoord MUST BE A NON-NEGATIVE INTEGER ---"
        ;;
    -y) # get ycoord
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        #errorMsg="--- INVALID YCOORD SPECIFICATION ---"
        #checkMinus "$1"
        ycoord=`expr "$1" : '\([-0-9]*\)'`
        [ "$ycoord" = "" ] && errMsg "--- YCOORD=$ycoord MUST BE AN INTEGER ---"
        ;;
    -g) # get gcontrast
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        errorMsg="--- INVALID GCONTRAST SPECIFICATION ---"
        checkMinus "$1"
        gcontrast=`expr "$1" : '\([0-9]*\)'`
        [ "$gcontrast" = "" ] && errMsg "--- GCONTRAST=$gcontrast MUST BE A NON-NEGATIVE INTEGER (with no sign) ---"
        test1=`echo "$gcontrast < 0" | bc`
        test2=`echo "$gcontrast > 100" | bc`
        [ $test1 -eq 1 -o $test2 -eq 1 ] && errMsg "--- GCONTRAST=$gcontrast MUST BE AN INTEGER BETWEEN 0 AND 100 ---"
        ;;
    -d) # get dcontrast
        shift  # to get the next parameter
        # test if parameter starts with minus sign
        #errorMsg="--- INVALID DCONTRAST SPECIFICATION ---"
        #checkMinus "$1"
        dcontrast=`expr "$1" : '\([-0-9]*\)'`
        [ "$dcontrast" = "" ] && errMsg "--- DCONTRAST=$dcontrast MUST BE AN INTEGER ---"
        test1=`echo "$dcontrast < -100" | bc`
        test2=`echo "$dcontrast > 100" | bc`
        [ $test1 -eq 1 -o $test2 -eq 1 ] && errMsg "--- DCONTRAST=$dcontrast MUST BE AN INTEGER BETWEEN -100 AND 100 ---"
        ;;
    -i) # save overlay and masking images
        shift
        prefix="$1"
        ;;

    --) shift; break ;;  # end of arguments
    -)  break ;;         # STDIN and end of arguments
    -*) errMsg "--- UNKNOWN OPTION ---" ;;
    *)  break ;;         # end of arguments
  esac
  shift   # next option
done
#
# get infile and outfile
infile="$1"
outfile="$2"

# test that infile provided
[ "X$infile" = "X" ] && errMsg "NO INPUT FILE SPECIFIED"

# test that outfile provided
[ "X$outfile" = "X" ] && errMsg "NO OUTPUT FILE SPECIFIED"

# create directory for temporary files in /tmp or $TMPDIR
tmp=`mktemp -d "${TMPDIR:-/tmp}/$PROGNAME.XXXXXXXXXX"` ||
  { echo >&2 "$PROGNAME: Unable to create temporary file"; exit 10;}
trap 'rm -rf "$tmp"' 0   # remove on any exit
trap 'exit 2' 1 2 3 15   # error exit on interupt

tmp1="$tmp/pagecurl_1.mpc"  # input file
tmp2="$tmp/pagecurl_2.mpc"  # overlay image
tmp3="$tmp/pagecurl_3.mpc"  # ellipse / transparency mask

# test input image
convert -quiet -regard-warnings "$infile" +gravity +repage "$tmp1" ||
        errMsg "--- FILE $infile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"

ww=`convert $tmp1 -ping -format "%w" info:`
hh=`convert $tmp1 -ping -format "%h" info:`
wm1=`convert xc: -format "%[fx:$ww-1]" info:`
hm1=`convert xc: -format "%[fx:$hh-1]" info:`
xc=`convert xc: -format "%[fx:$ww/2]" info:`
yc=`convert xc: -format "%[fx:$hh/2]" info:`

if [ "X$xcoord" = "X" -a "X$ycoord" = "X" ]; then
  xcoord=$wm1
  ycoord=0
elif [ "X$xcoord" = "X" -a "X$ycoord" != "X" ]; then
  xcoord=$wm1
elif [ "X$xcoord" != "X" -a "X$ycoord" = "X" ]; then
  ycoord=0
fi

# set vertex nominally at upper left corner
x1=$xcoord
y1=$ycoord

# compute approx right angle
# dx=pixel distance from lower right corner along bottom edge
dx=`convert xc: -format "%[fx:$ww*$amount/100]" info:`
rangle=`convert xc: -format "%[fx:(180/pi)*atan($dx/($hh-$y1))]" info:`

# compute a=rx as semicircle arc length = dx
# compute b from a and ellipticity
a=`convert xc: -format "%[fx:($dx+$ww-$x1)/pi]" info:`
b=`convert xc: -format "%[fx:$a*(1-$ellipticity)]" info:`

# get diameter by sqrt(2) and a bit more to use for initial ellipse image as it will be trimmed
a2=`convert xc: -format "%[fx:3*$a]" info:`
a2h=`convert xc: -format "%[fx:$a2/2]" info:`

# compute approx center angle from p1 to dx and a
prx=`convert xc: -format "%[fx:$ww-$dx]" info:`
pry=$(($hh-1))
lenr=`convert xc: -format "%[fx:hypot(($y1-$pry),($x1-$prx))]" info:`
dangle=`convert xc: -format "%[fx:(180/pi)*asin(($a/2)/$lenr)]" info:`
angle=`convert xc: -format "%[fx:$rangle+$dangle]" info:`


# create ellipse (and mask) for curl
convert -size ${a2}x${a2} xc:none -fill white \
        -draw "translate $a2h,$a2h rotate $angle ellipse 0,0 $a,$b 0,360" \
        -trim +repage $tmp3

# get width, height of ellipse image
eww=`convert $tmp3 -ping -format "%w" info:`
ehh=`convert $tmp3 -ping -format "%h" info:`

# get center and upper left corner of trimmed ellipse image
# for inserting into full size image for mask
y2=`convert xc: -format "%[fx:$hh-$ehh/2]" info:`
x2=`convert xc: -format "%[fx:$x1-($y2-$y1)*tan(pi*$angle/180)]" info:`
x0=`convert xc: -format "%[fx:$x2-$eww/2]" info:`
y0=`convert xc: -format "%[fx:$y2-$ehh/2]" info:`

# insert ellipse image in white background at correct location to form mask
testx=`convert xc: -format "%[fx:sign($x0)]" info:`
testy=`convert xc: -format "%[fx:sign($y0)]" info:`
if [ $testx -eq 1 -a $testy -eq 1 ]; then
        offsets="+${x0}+${y0}"
elif [ $testx -eq -1 -a $testy -eq 1 ]; then
        offsets="${x0}+${y0}"
elif [ $testx -eq 1 -a $testy -eq -1 ]; then
        offsets="+${x0}${y0}"
elif [ $testx -eq -1 -a $testy -eq -1 ]; then
        offsets="${x0}${y0}"
fi

# get length from apex p1 to center of ellipse p2
len=`convert xc: -format "%[fx:hypot(($x2-$x1),($y2-$y1))]" info:`

# get complement rotation angle
angle2=`convert xc: -format "%[fx:-90+$angle]" info:`


# compute tangent points as if ellipse at origin and apex vertically above at len
# ellipse (x/a)^2 + (y/b)^2 = 1, where a and b are semi-major and semi-minor radii
# differentiate: dy/dx = slope at tangent = -(x*b^2)/(y*a^2)
# tangent line to apex (x1,y1): y-y1=-(x-x1)*(x*b^2)/(y*a^2)
# solve for y and substitute into equation of ellipse to find x from quadratic equation
p0x=0
p0y=-$len
A=`convert xc: -format "%[fx:$a*$a*$p0y*$p0y + $b*$b*$p0x*$p0x]" info:`
B=`convert xc: -format "%[fx:-2*$a*$a*$b*$b*$p0x]" info:`
C=`convert xc: -format "%[fx:$a*$a*$a*$a*($b*$b-$p0y*$p0y)]" info:`
p3x=`convert xc: -format "%[fx:(-$B-sqrt($B*$B-4*$A*$C))/(2*$A)]" info:`
p4x=`convert xc: -format "%[fx:(-$B+sqrt($B*$B-4*$A*$C))/(2*$A)]" info:`
p3y=`convert xc: -format "%[fx:($a*$a*$b*$b-$b*$b*$p0x*$p3x)/($a*$a*$p0y)]" info:`
p4y=`convert xc: -format "%[fx:($a*$a*$b*$b-$b*$b*$p0x*$p4x)/($a*$a*$p0y)]" info:`

# rotate p2 and p3 relative to p1 by angle3
x3=`convert xc: -format "%[fx:($p3x)cos(pi*$angle/180)-($p3y+$len)sin(pi*$angle/180)+$x1]" info:`
y3=`convert xc: -format "%[fx:($p3x)sin(pi*$angle/180)+($p3y+$len)cos(pi*$angle/180)+$y1]" info:`
x4=`convert xc: -format "%[fx:($p4x)cos(pi*$angle/180)-($p4y+$len)sin(pi*$angle/180)+$x1]" info:`
y4=`convert xc: -format "%[fx:($p4x)sin(pi*$angle/180)+($p4y+$len)cos(pi*$angle/180)+$y1]" info:`

# create triangle mask (using the color posibly given by user)
convert -size ${ww}x${hh} xc:none \
        -fill $color -stroke $color -strokewidth $swidth \
        -draw "polygon $x1,$y1 $x3,$y3 $x4,$y4" $tmp2

# Cut out an elliptical shape from trianglar overlay
convert $tmp2 $tmp3 -geometry $offsets -compose DstOut -composite $tmp2

# At this point the ellipse mask in no longer needed!

# setup for grad or doublegrad
if [ "$mode" = "grad" ]; then
  lo=$gcontrast
  hi=$((100-$lo))
  process="-level ${lo}x${hi}% +level-colors black,$color"
elif [ "$mode" = "doublegrad" ]; then
  lo=`convert xc: -format "%[fx:abs($dcontrast)]" info:`
  hi=$((100-$lo))
  test=`convert xc: -format "%[fx:sign($dcontrast)]" info:`
  if [ $test -eq 1 ]; then
    process="-level ${lo}x${hi}%"
  else
    process="+level ${lo}x${hi}%"
  fi
  process="$process -solarize 50% -level 0x50% +level-colors black,$color"
fi

# IF not generating a plain paper curl, recolor the overlay,
# using a -sparse-color gradient, with appropiate processing.
if [ "$mode" != "plain" ]; then
  convert -size ${ww}x${hh} xc: -sparse-color Barycentric \
          "$x3,$y3 white $x4,$y4 black" \
          $process \
          $tmp2 +swap -compose In -composite $tmp2
fi

# FUTURE add a offset shadow to to the overlay image.

# create the transparency mask (using an ellipse and tangent line)
convert -size ${ww}x${hh} xc:white \
        -fill red -draw "line $x1,$y1 $x4,$y4" \
        -draw "translate $x2,$y2 rotate $angle ellipse 0,0 $a,$b 0,360" \
        -fill black -draw "color $wm1,$hm1 floodfill" \
        -fill white +opaque black -blur 2x65000 -level 50x100% \
        -alpha shape $tmp3


# Output overlay and transparency masks
if [ "X$prefix" != "X" ]; then
  convert $tmp2 "${prefix}_overlay.png"   # shaped overlay image
  convert $tmp3 "${prefix}_mask.png"      # shaped masking image
fi

# Do a "paint 'n' mask" of the original image, outputing the final image
convert $tmp1 $tmp2 -composite \
        $tmp3 -compose DstIn -composite \
        -compose over -bordercolor $bgcolor -border 0 \
        "$outfile"

exit 0

map-seismic-us.sh:

#!/bin/bash

# Crée par JPDipsy et modifié par ragamatrix
# script de recupération carte-seismes "euromed" http://www.emsc.eu/#2
# et mise en forme polaroïd imagemagick et pagecurl  doivent être installés
# ce script et le script pagecurl doivent être dans le même rep.
#----------------------------------------------------------------------------------
path=`dirname $0`
if [ -z "$1" ];then
reptemp="/tmp"
else
reptemp="$1"
fi

heuremodif=`date +%H`; minmodif=`date +%M`
# ce que vous voulez
fonte=Times-Bold
nomimage=map-seismic-us
tailleimage=60 # ceci est en pourcentage
tailledecoupe=350x200
libelle="Seismic map at: "
#----------------------------------------------------------------------------------
# recup image sat
wget -q -O  $reptemp/$nomimage.jpg "http://www.emsc-csem.org/Images/map_zoom/WEBMAPS/24H/TNAM.24hours.jpg?dt=1371649525198"

function mise_en_forme_image {
convert  $reptemp/$nomimage.png -background white -bordercolor white  -border 5%  -gravity South -splice 0x22 -density 150 \
-font $fonte  -pointsize 10 -annotate 0x10+0+10 "$libelle $heuremodif h $minmodif"   $reptemp/$nomimage.png
#creation coin et masque à l'aide du script pagecurl
convert -size 128x128 xc: miff:- | $path/pagecurl  -m doublegrad -a 60 -e 0.3 -i $reptemp/"pagecurl" - null:
#composition image finale
convert $reptemp/$nomimage.png -background  none -alpha set -gravity SouthEast -define compose:outside-overlay=false \
$reptemp/pagecurl_overlay.png -composite $reptemp/pagecurl_mask.png  -compose DstIn -composite -virtual-pixel background  \
+distort ScaleRotateTranslate 90 +repage $reptemp/$nomimage.png
convert -size 256x32 xc: miff:- | $path/pagecurl  -m doublegrad -a 5 -e 0.5 -i $reptemp/"pagecurl" - null:
convert $reptemp/$nomimage.png -background  none -alpha set -gravity SouthEast -define compose:outside-overlay=false \
$reptemp/pagecurl_overlay.png -composite $reptemp/pagecurl_mask.png  -compose DstIn -composite  -virtual-pixel background  \
+distort ScaleRotateTranslate -90  +repage -resize $tailleimage% $reptemp/$nomimage.png
rm $reptemp/pagecurl_overlay.png ; rm $reptemp/pagecurl_mask.png	
}

function ombre {
convert   $reptemp/$nomimage.png  -background  black  \( +clone -shadow 60x4+14+14 \) +swap -background  none   -flatten $reptemp/$nomimage.png	
}	

if [[ -e $reptemp/$nomimage.jpg ]] ; then
	# decoupage de la partie utile
	
	convert $reptemp/$nomimage.jpg -filter Lanczos -crop  $tailledecoupe+215+220\!  -resize 200% $reptemp/$nomimage.png
	mise_en_forme_image ; ombre ; #rm $reptemp/$nomimage.gif
else
	# comme ça votre conky aura toujours une image au cas ou 
	convert -size $tailledecoupe plasma:  $reptemp/$nomimage.png
	libelle="Désolé pas d'image radar à "
	mise_en_forme_image ; ombre
fi

result
edit:: the name of the picture you have to call in conky in /tmp is "map-seismic-us.png"

Last edited by ragamatrix (2013-06-19 14:43:37)

Offline

#5538 2013-06-21 10:44:42

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

New setup for June. A bit of Philately smile   
9097969537_4a0f423bed_m.jpg
I was looking for something that would be visible on all wallpapers and wont cover them a lot.
I liked metro style conky but that turned out to be too big.
The stamps are drawn by the lua script and text by the conky. So it is a mess with all the $voffsets and $gotos.
In case you're interested, here is a zip archive with the configs and images: https://docs.google.com/file/d/0B_kBhzo … sp=sharing

Offline

#5539 2013-06-21 10:48:18

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

Well...
I'd like to run these conky and scripts to display random pictures of the website "devianart" but I've absolutely nothing understood how...  lol
If someone is interested and make it works help apreciate smile
Here are the files:
random-slideshow-devianart-pics-conky-pack
what's that ?
Big thanx  wink

Offline

#5540 2013-06-21 11:20:49

arcum
#! Junkie
From: Belgium
Registered: 2013-06-11
Posts: 279
Website

Re: Conky v1.9 Thread

And here's my conky... Found it somewhere on the net - source unknown sorry...

screenshot-06202013-081048pm0.png

Code for the Lua-script => Here...

Conky Code => Here...

Last edited by arcum (2013-06-21 11:44:04)


playtime's over - shit just got real

Offline

#5541 2013-06-21 11:33:04

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

@Deegan
Hi;
Quite big earthquake in North Italia few hours ago...
conky earthquake map

Offline

#5542 2013-06-21 11:48:47

arcum
#! Junkie
From: Belgium
Registered: 2013-06-11
Posts: 279
Website

Re: Conky v1.9 Thread


playtime's over - shit just got real

Offline

#5543 2013-06-21 12:13:29

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

is there an other (shorter) way to convert the time?

-- convert 24h-format into 12h-format, for example 16:00 -> 4:00 pm
function convert12(value,format) 

local stunden=nil
local minuten=nil
local zeit=nil
local sekunden=nil

local stunden=string.sub(value,1,2) 	-- hours
local stunden=tonumber(stunden) 		-- convert hours into numbers
local minuten=string.sub(value,4,5)	 	-- minutes
local sekunden=string.sub(value,7,8) 	-- seconds

-- still calculate if string doesn't exists
if not sekunden then sekunden=''; end

if stunden > 12 and stunden < 24 then
	if sekunden ~= '' then
	zeit=(stunden-12)..':'..minuten..':'..sekunden..' pm'
	elseif sekunden == '' then
	zeit=(stunden-12)..':'..minuten..' pm'
	end
elseif stunden < 12 then
	if sekunden ~= '' then
	zeit=stunden..':'..minuten..':'..sekunden..' am'
	elseif sekunden == '' then
	zeit=stunden..':'..minuten..' am'
	end
elseif stunden == 12 then
	if sekunden ~= '' then
	zeit=stunden..':'..minuten..':'..sekunden..' pm'
	elseif sekunden == '' then
	zeit=stunden..':'..minuten..' pm'
	end
elseif stunden == 24 or stunden == 0 then
	if sekunden ~= '' then
	zeit=(stunden-12)..':'..minuten..':'..sekunden..' am'
	elseif sekunden == '' then
	zeit=(stunden-12)..':'..minuten..' am'
	end
end

return zeit

end

this function works but if there is a shorter way that does the same ... do u have an idea (sample code) how i could replace this function? smile i want to learn lua that's why i would like to have an alternative!

Offline

#5544 2013-06-21 13:32:09

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

convTime function that automatically convert 24h to 12h and back:

function convTime(timeS)
	local i, word = 1, nil
	local tstring = { nil, nil, nil }
	local t = os.date('*t')

	for word in string.gmatch(timeS, "%d+") do tstring[i] = word; i = i+1 end
	for word in string.gmatch(timeS, "%a+") do tstring[3] = word end

	if tstring[3]==nil then _strftime = "%I:%M %p" else _strftime = "%H:%M" end
	if tstring[3] and string.upper(tstring[3])=="PM" then i = 12 else i = 0 end

	t.hour, t.min = tstring[1]+i, tstring[2]

	return os.date(_strftime, (os.time(t)))
end

usage:

print(convTime("15:35"))
3:35 PM
print(convTime("3:25 pM"))
15:25
print(convTime("11:17am"))
11:17

Last edited by dk75 (2013-06-21 13:34:36)


Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

#5545 2013-06-21 15:55:18

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

triphex wrote:

installing lm-sensors worked. This is what shows when running sensors in the terminal:

 gtk@crunchbang:~$ sensors
smsc47b397-isa-0480
Adapter: ISA adapter
fan1:        3976 RPM
fan2:           0 RPM
fan3:           0 RPM
fan4:        2452 RPM
temp1:        +64.0°C  
temp2:         +0.0°C  
temp3:        +34.0°C  
temp4:         +0.0°C  

Using ${hwmon 0 temp 1} works for showing CPU temperature. Why does it show two CPU temps? For the fans, which one is the case fan and which one is the CPU fan?

Install inxi then run:

semsors && inxi -s

to get them both together, inxi matches the output with the equipment, the last bit starting with Sensors is inxi in action:

 21 Jun 13 | 12:25:19 ~
    $ sensen
acpitz-virtual-0
Adapter: Virtual device
temp1:        +30.0°C  (crit = +110.0°C)

k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +29.5°C  (high = +70.0°C)

f71862fg-isa-0a00
Adapter: ISA adapter
+3.3V:        +3.44 V  
in1:          +1.35 V  
in2:          +1.51 V  
in3:          +0.85 V  
in4:          +0.00 V  
in5:          +0.00 V  
in6:          +0.00 V  
3VSB:         +3.41 V  
Vbat:         +2.85 V  
fan1:        2029 RPM
fan2:           0 RPM  ALARM
fan3:           0 RPM  ALARM
temp1:        +38.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +70.0°C, hyst = +66.0°C)  sensor = transistor
temp2:        +34.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +100.0°C, hyst = +96.0°C)  sensor = thermistor
temp3:       +127.0°C  (high = +70.0°C, hyst = +68.0°C)  ALARM (CRIT)
                       (crit = +85.0°C, hyst = +83.0°C)  sensor = transistor

Sensors:   System Temperatures: cpu: 38.0C mobo: 34.0C gpu: 0.0:43C 
           Fan Speeds (in rpm): cpu: 2029 fan-2: 0 fan-3: 0 
 
 21 Jun 13 | 12:46:42 ~
    $ 

my bash alias:

alias sensen='sensors && inxi -s -x -c5'

Also I recommend not using hwmon - it's not constant - use platform.  Read Using Sensors


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5546 2013-06-21 17:19:37

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

Thanks
weather outside and weather inside ...

Offline

#5547 2013-06-21 19:39:19

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

dk75 wrote:

convTime function that automatically convert 24h to 12h and back:

function convTime(timeS)
	local i, word = 1, nil
	local tstring = { nil, nil, nil }
	local t = os.date('*t')

	for word in string.gmatch(timeS, "%d+") do tstring[i] = word; i = i+1 end
	for word in string.gmatch(timeS, "%a+") do tstring[3] = word end

	if tstring[3]==nil then _strftime = "%I:%M %p" else _strftime = "%H:%M" end
	if tstring[3] and string.upper(tstring[3])=="PM" then i = 12 else i = 0 end

	t.hour, t.min = tstring[1]+i, tstring[2]

	return os.date(_strftime, (os.time(t)))
end


usage:

print(convTime("15:35"))
3:35 PM
print(convTime("3:25 pM"))
15:25
print(convTime("11:17am"))
11:17

thank you for your help. a modified version will be part of my custom v9000. i post it when it's done!

Offline

#5548 2013-06-21 23:34:14

Deegan
Member
From: Italy Varese
Registered: 2011-11-19
Posts: 36

Re: Conky v1.9 Thread

ragamatrix wrote:

@Deegan
Hi;
Quite big earthquake in North Italia few hours ago...
conky earthquake map

Here all ok... smile

Offline

#5549 2013-06-22 04:00:48

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Deegan wrote:
ragamatrix wrote:

@Deegan
Hi;
Quite big earthquake in North Italia few hours ago...
conky earthquake map

Here all ok... smile

Glad to hear that amico!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Be excellent to each other!

#5550 2013-06-22 09:32:00

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

is the output of the variable 'memmax' always in mb? i can not test it here.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo