SEARCH

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

You are not logged in.

#1 2009-08-26 00:47:42

hailukahh
#! Member
From: Texas
Registered: 2009-07-27
Posts: 87

Bible Verses in Conky

With much determination (and of course God's help) here is a script and conkyrc to display a random bible verse on your desktop.

verse.sh:

#!/bin/bash

############################################################
# 
# This is a script to output bible verses from
# Diatheke for use in a conky script.
# 
# This script depends on diatheke and rand.
# In Ubuntu and it's derivatives use:
# sudo apt-get install diatheke rand
# 
# Visit http://www.crosswire.org/sword/diatheke/
# to learn more about Diatheke and the Sword Project.
# 
# Usage:
# When called by itself this script will choose
# a verse at random from the list at $List.  The
# list should be plain text with one verse or a
# group of verses per line.  Examples of
# acceptable lines are as follows:
# 
#     Jn 3:16
#     1 Corinthians 12:8-10,12
#     Revelation 22:20
# 
# When called with an argument this script will
# attempt to use the argument as a verse and
# display the results.
# 
# Feeding the script any other input will give 
# unpredictable results.
# 
# A suitable list of verses can be found at:
# http://www.gnpcb.org/esv/share/rss2.0/?show-verses=true
# 
# The sample conkyrc can be invoked with
# conky -c verse.conkyrc
# 
# Help with configuring conky can be found at:
# http://conky.sourceforge.net/documentation.html
# 
# To learn about Jesus visit:
# http://www.christianity.com/Essentials/
# 
############################################################

# Module must be an installed Sword Module.
# Install new modules with bibletime.
Module=NETfree

# Location of plain text file with verses to choose from.
List=~/bin/bibleverse/verse.list

# Height and Width of output to keep the conky display sane.
OutputHeight=17
OutputWidth=48

# When set to true padding will be added to top of output.
# Otherwise the padding will be added to the bottom.
AlignBottom=true

# We use a temp file to speed up the script run time.
TempFile=/tmp/conky-verse

getVerse (){

    case $1 in
       "")    ListLength=`wc -l $List | cut -d " " -f 1`
        RandomNumber=`rand -M $ListLength -N 1`
        VerseNumber=`expr $RandomNumber + 1`
        Verse=`cat $List | head -n $VerseNumber | tail -n 1` ;;
        *)  Verse=$@ ;;
    esac
}

printVerse (){

    Verse=$1

    Chapter=`diatheke -b $Module -k $Verse | head -n 1 | cut -d : -f 1`

    # Print book chapter:verse(s)
    echo '${color1}'$Verse'${color0}'

    # Print the verse(s)
    diatheke -b $Module -k $Verse | \
    sed 's/'"$Chapter:"'//' | \
    sed 's/('$Module')//' | \
    sed 's/ ^[ \t]*//' | \
    sed '/./!d' | \
    sed 's/\t/ /g' | \
    sed 's/^/        /' | \
    fold -sw $OutputWidth | \
    sed 's/^ /${color1} /' | \
    sed 's/:/${color0}/'
}

padVerse (){

    Lines=`cat $TempFile | wc -l | cut -d " " -f 1`
    LinesAdd=`expr $OutputHeight - $Lines`

    let i=0
    while [ $i -lt $LinesAdd ]; do
        echo
        let i=$i+1
    done
}

displayVerse (){
    cat $TempFile
}

getVerse "$@"
printVerse "$Verse" > $TempFile

case $AlignBottom in
  true|True)    padVerse
        displayVerse ;;
          *)    displayVerse
        padVerse ;;
esac

exit 0

verse.list

 Exodus 14:14
 Exodus 15:11
 Exodus 20:16
 Leviticus 20:7-8
 Numbers 23:19
 Deuteronomy 6:4-5
 Deuteronomy 7:9
 Deuteronomy 8:17-18
 Deuteronomy 32:4
 Joshua 1:8
 1 Samuel 2:2
 2 Samuel 7:28
 2 Samuel 22:31
 1 Kings 8:27
 1 Kings 8:56
 Job 1:21
 Psalm 1:1-3
 Psalm 3:3
 Psalm 4:8
 Psalm 5:11-12
 Psalm 9:7-8
 Psalm 18:1-2
 Psalm 19:14
 Psalm 23:1
 Psalm 23:4
 Psalm 24:7-8
 Psalm 25:7
 Psalm 27:1
 Psalm 27:14
 Psalm 28:1-2
 Psalm 29:11
 Psalm 30:2
 Psalm 30:4
 Psalm 30:5
 Psalm 30:11-12
 Psalm 31:1-2
 Psalm 31:24
 Psalm 32:1-2
 Psalm 32:8
 Psalm 33:6
 Psalm 34:8
 Psalm 37:4
 Psalm 37:27-29
 Psalm 42:11
 Psalm 46:1-3
 Psalm 50:14-15
 Psalm 51:4
 Psalm 51:10
 Psalm 55:17
 Psalm 55:22
 Psalm 63:3-4
 Psalm 68:19
 Psalm 73:28
 Psalm 84:11
 Psalm 85:2
 Psalm 86:4-5
 Psalm 90:2
 Psalm 91:1-2
 Psalm 94:12-13
 Psalm 94:14-15
 Psalm 99:9
 Psalm 100:4-5
 Psalm 103:2-5
 Psalm 103:11-12
 Psalm 104:1-2
 Psalm 104:24
 Psalm 105:7-8
 Psalm 107:1
 Psalm 115:3
 Psalm 118:24
 Psalm 119:11
 Psalm 119:105
 Psalm 121:5-6
 Psalm 121:7-8
 Psalm 130:5
 Psalm 135:5-7
 Psalm 136:1-3
 Psalm 139:7-10
 Psalm 145:8
 Psalm 145:18-19
 Proverbs 1:7
 Proverbs 3:1-2
 Proverbs 3:3-4
 Proverbs 3:5-6
 Proverbs 3:7-8
 Proverbs 3:9-10
 Proverbs 3:11-12
 Proverbs 3:28-29
 Proverbs 10:4-5
 Proverbs 10:12
 Proverbs 11:28
 Proverbs 12:1
 Proverbs 12:11
 Proverbs 12:18
 Proverbs 12:19
 Proverbs 13:1
 Proverbs 13:20
 Proverbs 14:30
 Proverbs 15:1
 Proverbs 15:9
 Proverbs 15:22
 Proverbs 15:26
 Proverbs 15:29
 Proverbs 15:31-32
 Proverbs 15:33
 Proverbs 16:3
 Proverbs 16:7
 Proverbs 16:8
 Proverbs 16:9
 Proverbs 16:12
 Proverbs 16:19
 Proverbs 16:28
 Proverbs 16:32
 Proverbs 17:17
 Proverbs 17:22
 Proverbs 18:10
 Proverbs 18:12
 Proverbs 18:24
 Proverbs 19:11
 Proverbs 19:20
 Proverbs 19:21
 Proverbs 20:3
 Proverbs 20:9
 Proverbs 20:22
 Proverbs 21:17
 Proverbs 21:21
 Proverbs 22:4
 Proverbs 22:6
 Proverbs 23:4-5
 Proverbs 23:22
 Proverbs 25:15
 Proverbs 25:21-22
 Proverbs 25:28
 Proverbs 26:12
 Proverbs 27:5-6
 Proverbs 28:6
 Proverbs 28:10
 Proverbs 28:22
 Proverbs 29:25
 Ecclesiastes 7:8
 Ecclesiastes 7:9
 Isaiah 1:18
 Isaiah 26:4
 Isaiah 26:8
 Isaiah 30:21
 Isaiah 32:17
 Isaiah 40:26
 Isaiah 40:30-31
 Isaiah 41:10
 Isaiah 43:2
 Isaiah 50:7
 Isaiah 50:10
 Isaiah 52:7
 Isaiah 55:6-7
 Isaiah 55:8-9
 Isaiah 55:10-11
 Isaiah 61:1
 Jeremiah 23:23-24
 Jeremiah 29:11
 Jeremiah 31:3
 Lamentations 3:22-23
 Micah 6:8
 Nahum 1:7
 Zephaniah 3:17
 Zechariah 7:9-10
 Matthew 5:3
 Matthew 5:4
 Matthew 5:5
 Matthew 5:6
 Matthew 5:7
 Matthew 5:8
 Matthew 5:9
 Matthew 5:10
 Matthew 5:11-12
 Matthew 5:14-16
 Matthew 5:18
 Matthew 5:23-24
 Matthew 5:43-45
 Matthew 5:46-48
 Matthew 6:1
 Matthew 6:2-4
 Matthew 6:6
 Matthew 6:14-15
 Matthew 6:19-21
 Matthew 6:24
 Matthew 6:34
 Matthew 7:7-8
 Matthew 11:28-30
 Matthew 12:36-37
 Matthew 12:50
 Matthew 16:24
 Matthew 18:1-4
 Matthew 18:5-6
 Matthew 18:20
 Matthew 18:21-22
 Matthew 22:37-39
 Matthew 23:12
 Matthew 24:42
 Matthew 28:18-20
 Mark 10:43-45
 Mark 11:25
 Mark 12:30-31
 Mark 13:31
 Luke 4:18-19
 Luke 6:27-28
 Luke 6:35-36
 Luke 6:37-38
 Luke 12:6-7
 Luke 12:15
 Luke 12:29-31
 Luke 19:10
 John 1:1-3
 John 1:12
 John 1:14
 John 3:3
 John 3:16-17
 John 3:36
 John 4:13-14
 John 5:24
 John 6:27
 John 6:35
 John 6:37
 John 6:47
 John 6:51
 John 8:32
 John 8:36
 John 10:27-30
 John 11:25-26
 John 13:34-35
 John 14:2-3
 John 14:16-17
 John 14:18
 John 14:21
 John 14:23
 John 14:27
 John 15:9-11
 John 15:12-14
 John 15:16
 John 20:29
 Acts 2:36
 Acts 2:38
 Acts 16:31
 Acts 17:24-25
 Acts 20:32
 Acts 20:35
 Romans 1:16-17
 Romans 5:1
 Romans 5:3-5
 Romans 5:8
 Romans 5:17
 Romans 6:3-4
 Romans 6:14
 Romans 6:22
 Romans 6:23
 Romans 8:2
 Romans 8:6
 Romans 8:15
 Romans 8:18
 Romans 8:26
 Romans 8:28
 Romans 8:29
 Romans 8:31
 Romans 8:32
 Romans 8:37
 Romans 8:38-39
 Romans 10:9-10
 Romans 10:17
 Romans 12:1
 Romans 12:2
 Romans 12:10
 Romans 12:11
 Romans 12:13
 Romans 12:21
 Romans 13:10
 Romans 14:8
 Romans 15:4
 1 Corinthians 2:9
 1 Corinthians 3:19-20
 1 Corinthians 4:20
 1 Corinthians 6:19-20
 1 Corinthians 10:13
 1 Corinthians 11:32
 1 Corinthians 13:1-3
 1 Corinthians 13:4-6
 1 Corinthians 13:7-8
 1 Corinthians 13:13
 1 Corinthians 15:56-57
 1 Corinthians 15:58
 2 Corinthians 1:21-22
 2 Corinthians 3:4-6
 2 Corinthians 3:17
 2 Corinthians 4:7-10
 2 Corinthians 4:11
 2 Corinthians 4:16
 2 Corinthians 5:9-10
 2 Corinthians 5:17
 2 Corinthians 5:21
 2 Corinthians 7:1
 2 Corinthians 7:10
 2 Corinthians 9:7
 2 Corinthians 10:17-18
 2 Corinthians 12:9
 Galatians 1:10
 Galatians 3:24-26
 Galatians 5:1
 Galatians 5:16-17
 Galatians 5:22-23
 Galatians 5:24
 Galatians 6:1
 Galatians 6:2
 311ns 3:12-14
 Colossians 3:15
 Colossians 3:16
 Colossians 3:17
 Colossians 3:23-24
 1 Thessalonians 5:15
 1 Thessalonians 5:16-18
 1 Thessalonians 5:23-24
 2 Thessalonians 3:3
 2 Thessalonians 3:5
 1 Timothy 1:17
 1 Timothy 6:12
 2 Timothy 1:7
 2 Timothy 1:8-9
 2 Timothy 2:2
 2 Timothy 2:15
 2 Timothy 2:22
 2 Timothy 3:16-17
 2 Timothy 4:7
 Titus 3:4-7
 Hebrews 2:18
 Hebrews 4:12
 Hebrews 4:15
 Hebrews 4:16
 Hebrews 6:11-12
 Hebrews 10:23
 Hebrews 10:24-25
 Hebrews 11:1
 Hebrews 11:6
 Hebrews 12:1-2
 Hebrews 12:3
 Hebrews 13:1-2
 Hebrews 13:3
 Hebrews 13:5
 Hebrews 13:6
 Hebrews 13:8
 Hebrews 13:15
 Hebrews 13:16
 James 1:2-4
 James 1:5-6
 James 1:12
 James 1:13-14
 James 1:17-18
 James 1:19-20
 James 1:22-25
 James 3:7-9
 James 4:7
 James 4:8
 James 4:11-12
 James 5:8
 1 Peter 1:3-5
 1 Peter 1:24-25
 1 Peter 2:2-3
 1 Peter 2:9
 1 Peter 2:11
 1 Peter 3:8-9
 1 Peter 3:10-11
 1 Peter 3:12-13
 1 Peter 3:18
 1 Peter 4:12-13
 1 Peter 4:16
 1 Peter 5:8-9
 1 Peter 5:10
 2 Peter 3:8
 2 Peter 3:9
 1 John 1:9
 1 John 2:4-6
 1 John 2:15-17
 1 John 2:24-25
 1 John 2:28
 1 John 3:1
 1 John 3:2
 1 John 4:4
 1 John 4:7-8
 1 John 4:9
 1 John 4:10-11
 1 John 4:12-13
 1 John 4:14
 1 John 4:18
 1 John 4:20-21
 Jude 1:20-21
 Jude 1:24-25
 Revelation 1:8
 Revelation 3:20
 Revelation 4:11
 Revelation 22:20

verse.conkyrc

# Use Xft?
use_xft yes
xftfont monofur:Bold:size=12
xftalpha 0.8
text_buffer_size 4096

# Update interval in seconds
update_interval 10

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 600 300

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color white
own_window_colour black
color1 steelblue

# Text alignment, other possible values are commented
alignment bottom_left

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 5

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

TEXT
${font Lt Oksana Medium:size=12}${execpi 300 ~/bin/bibleverse/verse.sh}

I placed these three files in ~/bin/bibleverse and added conky -c ~/bin/bibleverse/verse.conkyrc to autostart.sh

smile


<'(((><  I am not ashamed of the gospel, because it is the  ><)))'>
<'(((><  power of God, the salvation of everyone who believes.  ><)))'>

EeePC 900a : #! 9.04 : Atom 1.60 GHz : 1 GB RAM : 4 GB SSD

Offline

Be excellent to each other!

#2 2009-08-26 02:11:35

Kyte
#! Junkie
From: midwest usa
Registered: 2009-07-19
Posts: 275

Re: Bible Verses in Conky

So the way that I understand this is that the conky script calls the particular strings in the verse list and then the actual verses are called from Diatheke rand.

If that is correct then then one follow on question is whether the diatheke rand is a preselected set of verses which match the verse list or is it the whole Bible and could one, then, insert one's own call strings

And follwing that, is one to assume that this will only work with Diatheke rand or could it have another set of text strings which would be used to call other items from another database...possibly aphorisms from Sherlock Holmes(merely an example)?

The intent of the questions is not to minimize what you have done it is merely to settle in my mind how it works.

Kyte


Kyte: Always flittin' around with his head in the clouds!

Offline

#3 2009-08-26 02:40:31

hailukahh
#! Member
From: Texas
Registered: 2009-07-27
Posts: 87

Re: Bible Verses in Conky

Diatheke and rand are two seperate packages.  rand just allows spits out a random number.  I'm sure there are other ways to accomplish this, but rand works well for the purpose of this script.

Diatheke on the other hand is a part of the Sword project.  The sword project is, in its most basic sense, a library for developing software to manipulate bible texts.  However sword is used more generally to refer to all of the projects that use the library.  Diatheke uses libsword and when you install it it also installs bibletime which is a graphical frontend to sword.  From bibletime you can download and install many other modules.

The modules comprise all sorts of works.  There are currently dozens of bibles in many languages, books of devotionals, commentaries on the bible, dictionaries, lexicons, concordances, and also many non-biblical works.

As far as for Sherlock Holmes, you would have to search and see if there are any sword modules available, or possibly create your own.  There are instructions for doing so on the web.

And yes, for bible verses you can insert any verse in the verse.list file.  You can also call the script with a verse as an argument, such as:

verse.sh john 3:16

And to see what changes the script makes, just compare that output to the output of:

diatheke -b NETfree -k john 3:16

You will of course need to install the NETfree module first.  I suppose I should have put those instructions in the original post.  But anyways:

Install diatheke and rand

sudo apt-get install diatheke rand

Then run bibletime.  On first run the program will pop up the bookshelf manager.  Click Install/Update Works, then Connect to Library.  Scroll down the list to English and then check the box for NETfree.  Then click Install Works.


<'(((><  I am not ashamed of the gospel, because it is the  ><)))'>
<'(((><  power of God, the salvation of everyone who believes.  ><)))'>

EeePC 900a : #! 9.04 : Atom 1.60 GHz : 1 GB RAM : 4 GB SSD

Offline

#4 2009-08-26 02:43:19

viralnexxus
New Member
From: San Antonio, Texas
Registered: 2009-08-26
Posts: 1
Website

Re: Bible Verses in Conky

"So the way that I understand this is that the conky script calls the particular strings in the verse list and then the actual verses are called from Diatheke rand.

If that is correct then then one follow on question is whether the diatheke rand is a preselected set of verses which match the verse list or is it the whole Bible and could one, then, insert one's own call strings

And follwing that, is one to assume that this will only work with Diatheke rand or could it have another set of text strings which would be used to call other items from another database...possibly aphorisms from Sherlock Holmes(merely an example)?

The intent of the questions is not to minimize what you have done it is merely to settle in my mind how it works.

Kyte"

From what I understand in the script's comments, is that it is designed/coded to work specifically with the "Sword Module," Sword Project, rand, and the "Diatheke FE."  -  "# This script depends on diatheke and rand." - "# Feeding the script any other input will give
# unpredictable results." It would probably be harder and take longer to modify this script to use other libraries and modules other than those given, IMO.  Hmm... Good Question.


"Work hard, millions on welfare depend on you..."
-=ViRaLN3XxUS=-

Offline

#5 2009-08-26 03:47:11

Kyte
#! Junkie
From: midwest usa
Registered: 2009-07-19
Posts: 275

Re: Bible Verses in Conky

Thanks very much for the info both of you.

Kyte


Kyte: Always flittin' around with his head in the clouds!

Offline

#6 2009-08-26 09:23:14

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: Bible Verses in Conky

Thanks for that! In combination with cowsay, zenity and a cronjob, this will be the perfect punishment for filesharing users at the university pc pool network under my co-administration big_smile


I'm so meta, even this acronym

Offline

#7 2009-08-26 10:07:36

hailukahh
#! Member
From: Texas
Registered: 2009-07-27
Posts: 87

Re: Bible Verses in Conky

lol


<'(((><  I am not ashamed of the gospel, because it is the  ><)))'>
<'(((><  power of God, the salvation of everyone who believes.  ><)))'>

EeePC 900a : #! 9.04 : Atom 1.60 GHz : 1 GB RAM : 4 GB SSD

Offline

#8 2009-08-27 07:35:49

illumin8
#! Junkie
From: Seattle
Registered: 2009-05-30
Posts: 407
Website

Re: Bible Verses in Conky

This is really awesome work.
The configurable verse list is a great way to define it.
I set it up today, it looks awesome.

2009082712513593841280x.th.png

Last edited by illumin8 (2009-08-27 07:53:18)


Website    500px     DeviantArt
God never ends anything on a negative; God always ends on a positive. -- Edwin Louis Cole --

Offline

#9 2009-09-04 16:06:21

orlok
Member
Registered: 2009-08-30
Posts: 23

Re: Bible Verses in Conky

lame!!


black eeepc 901 running #! kernel 2.6.27-8-eeepc-lean

Offline

#10 2009-09-04 16:45:12

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: Bible Verses in Conky

orlok wrote:

lame!!

*feeds the troll*

How do you like your eggs?


I'm so meta, even this acronym

Offline

#11 2009-09-04 19:26:53

hailukahh
#! Member
From: Texas
Registered: 2009-07-27
Posts: 87

Re: Bible Verses in Conky

Well, since this thread's been resurrected I'll go ahead and share what I've done with the script:

I've created a bash script front end to diatheke.  I've put the script and some screenshots here


<'(((><  I am not ashamed of the gospel, because it is the  ><)))'>
<'(((><  power of God, the salvation of everyone who believes.  ><)))'>

EeePC 900a : #! 9.04 : Atom 1.60 GHz : 1 GB RAM : 4 GB SSD

Offline

#12 2009-09-04 20:22:34

orlok
Member
Registered: 2009-08-30
Posts: 23

Re: Bible Verses in Conky

Awebb wrote:
orlok wrote:

lame!!

*feeds the troll*

How do you like your eggs?

under the bridge, please!


black eeepc 901 running #! kernel 2.6.27-8-eeepc-lean

Offline

#13 2010-04-07 03:58:21

rippin
#! Member
Registered: 2010-01-26
Posts: 61

Re: Bible Verses in Conky

Just found this thread. I did it differently. I use "verse" and a cron job with this in ~/.conkyrc

from .conkyrc

${color #9CEA1F}DAILY VERSE: ${hr 2}$color
${exec cat daily_verse | fold -s}
${color #9CEA1F}${hr 2}$color

crontab is

0 0  * * * verse > ~/daily_verse

and have in my /home a file called "daily_verse".

If I knew how to attach an image, I'd include a screen shot of my conky. Sorry.


rippin

Offline

#14 2011-04-20 00:35:31

pacifico
Member
From: Venezuela
Registered: 2011-03-02
Posts: 34

Re: Bible Verses in Conky

does some one knows how to install the software needed to run those scrpts?

thanks

Offline

#15 2011-04-20 01:33:02

rippin
#! Member
Registered: 2010-01-26
Posts: 61

Re: Bible Verses in Conky

pacifico wrote:

does some one knows how to install the software needed to run those scrpts?

thanks

Not sure of which scripts you are speaking. Programs in use are conky & verse. cron and fold are a part of the normal installation of Linux. conky is installed by default with CB. verse can be installed in a terminal by typing and executing the following:

sudo apt-get install verse

Is this what you are seeking?


rippin

Offline

#16 2011-04-20 01:56:03

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,418

Re: Bible Verses in Conky

Diatheke is available in the Debian repos

sudo apt-get install diatheke

Rand is not however.

Also FWIW, hailukahh hasn't posted on these forums since late 2009.

Offline

#17 2011-04-20 10:51:19

tranche
#! CrunchBanger
Registered: 2011-02-04
Posts: 111
Website

Re: Bible Verses in Conky

As an alternative, you could get the Bible in fortune format here.

sourceforge.net/projects/fortunebible

Then with a few mods to cb-fortune, you could have Statler himself quoting the Bible. ;}

Offline

#18 2011-04-20 16:42:46

pacifico
Member
From: Venezuela
Registered: 2011-03-02
Posts: 34

Re: Bible Verses in Conky

thanks ripping, tranche & anonymous

rippin wrote:

Not sure of which scripts you are speaking.

I am speaking about the three original scripts, I saw you made differently I could do the two or three ways but I just started with the first one, since I am a newbie I dont understand all the stuff on the first reading and try first to see what happens smile.

until know I did the following:

1 copied the 3 scripts on my home folder

2 installed diatheke

3 installed bibletime and NETfree module (just downloaded the NETfree zip file from crosswire.org and unzipped it under ~/.sword

4 chmod to verse.sh

what I cant still find is rand, is not in the repositories, could be just a random generator function.

I gonna see.
----
ok solved, thanks God!

well rand is now $RANDOM and no need to install anytihng , is an internal bash function.

I found an example to produce a random number of a dice:

echo $[ ( $RANDOM % $DIE_SIDES )  + 1 ]

so (I don't know nothing about scripting) I just replaced variables, on the verse.sh script:

this-> RandomNumber=`rand -M $ListLength -N 1`

by this ->  RandomNumber=$[ ( $RANDOM % $ListLength -N )  + 1 ]

and after commenting this: #border_margin 5 on the verse.conkyrc script, since was giving me error

everything was fine,

But different installed bible versions did not gave me results with diatheke, so

when you install a new bible module, you need to see the exact name to call it on diatheke,

says module sparv is actually called SpaRV, module kjv is actually called KJV. (found this by God's will) fortune for others! smile

run bibletime then menu -> Settings ->bookshelf manager -> search indexes those are the names wich allow diatheke find verses.

Good for this method everything is solved, now going with the fortune teller statler method smile

Regards

Last edited by pacifico (2011-04-21 01:52:20)

Offline

#19 2011-04-22 01:38:36

pacifico
Member
From: Venezuela
Registered: 2011-03-02
Posts: 34

Re: Bible Verses in Conky

Thanks tranche,

I completed the post with this test! smile

I did the small modfication to cb-fortune, and actually is very easy to implement any text we like to:

what I did: downloaded the bible

tranche wrote:

As an alternative, you could get the Bible in fortune format here.

sourceforge.net/projects/fortunebible

Then with a few mods to cb-fortune, you could have Statler himself quoting the Bible. ;}

then unzipped and :

$ sudo cp bible* /usr/share/games/fortunes  (two files bible and bible.dat)

for cb-fortunes I changed the line where says ->   fortune -s     to ->   fortune bible -s

that way all fortune verses will be taken from bible.dat only.

To create a custom fortunes file is also easy:

make a text file with your verses

lieke this say you callit myquotations, then you write:

verse...
%
verse...
%
verse
%

save it and then convert it to dat file with -> 

$ strfile myquotations

copy the source myquotations and the resulting file myquotations.dat to the fortunes folder (as above)

all the files on the /usr/share/games/fortunes are used each time you run fortune unless you tell which one to use

$ fortune -f

will tell you the percentage of using each file.

Regards

Offline

#20 2011-04-22 02:06:58

tranche
#! CrunchBanger
Registered: 2011-02-04
Posts: 111
Website

Re: Bible Verses in Conky

Hey glad you got old Statler quotin' the Bible!

When I saw your post I remembered seeing the Bible in fortune format and thought it would be a real crunchbangey way to do something like what you wanted.

Offline

#21 2011-04-22 07:19:54

axel668
#! Member
Registered: 2009-07-17
Posts: 99

Re: Bible Verses in Conky

+1 on Statler quoting the Bible - this is definitely the most crunchbang -ish way !!

now there's only one thing left to do,
register this at Distrowatch as "Crunchbang Christian Edition" ...
or maybe just "+!"  ??


A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila (Mitch Ratcliffe)

Offline

#22 2011-04-22 11:12:24

slapfish
#! Die Hard
From: Athens, Greece
Registered: 2009-10-22
Posts: 601

Re: Bible Verses in Conky

axel668 wrote:

+1 on Statler quoting the Bible - this is definitely the most crunchbang -ish way !!

now there's only one thing left to do,
register this at Distrowatch as "Crunchbang Christian Edition" ...
or maybe just "+!"  ??

lol

Offline

#23 2011-12-28 03:11:49

herbgeek
New Member
Registered: 2011-12-28
Posts: 3

Re: Bible Verses in Conky

I couldn't get it to work as it is. Error about rand.
So I hunted for a "random" script and found this:

#!/bin/bash
if [ $# -ne 1 ]
  then
    echo "Syntax: $0 FILE"
    echo $0 - display a random line from FILE.
  exit 1
fi
RAND=`cat /proc/sys/kernel/random/uuid | cut -c1-4 | od -d | head -1 | cut -d' ' -f2`
LINES=`cat "$1" | wc -l`
LINE=`expr $RAND % $LINES + 1`
head -$LINE $1 | tail -1

I saved it as random.sh in ~/.sword/ (I saved verse.sh and verse.list here too)

Then I replaced the "getVerse" function from verse.sh with

getVerse (){

    case $1 in
       "")    ListLength=`wc -l $List | cut -d " " -f 1`
        RandomNumber=`rand -M $ListLength -N 1`
        VerseNumber=`expr $RandomNumber + 1`
        Verse=`cat $List | head -n $VerseNumber | tail -n 1` ;;
        *)  Verse=$@ ;;
    esac
}
----------------------
    with
----------------------
getVerse (){
    Verse=`~/.sword/random.sh ~/.sword/verse.list`
    echo $Verse
}

and it works great!!

The random script came from http://www.linuxquestions.org/questions … le-239334/

Last edited by herbgeek (2011-12-28 03:40:31)

Offline

#24 2011-12-28 03:39:33

herbgeek
New Member
Registered: 2011-12-28
Posts: 3

Re: Bible Verses in Conky

Oh Kyte, if you're still listening, you could use random.sh to access a file of one liners and input it to conky like this  ${font somefont:bold:size=14}${execpi 120~/.quotes/random.sh ~/.quotes/quotes.list}
The difference here is that the quotes.list would contain the whole quote rather than a reference to the quote.

You may need to use some of the sed commands from "printVerse" to make it fit your width. Don't forget the "text_buffer_size" in .conkyrc. I put mine to 512

Offline

Be excellent to each other!

#25 2011-12-28 05:45:30

lcafiero
The #! Guy
From: Felton, California, USA
Registered: 2011-07-21
Posts: 2,196
Website

Re: Bible Verses in Conky

axel668 wrote:

, , ,"Crunchbang Christian Edition" ... or maybe just "+!"  ??

Heh. Very funny,


Res publica non dominetur | Larry the CrunchBang Guy speaks of the pompetous of CrunchBang

CrunchBang Forum moderator

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.

Debian Logo