Ubunty_daily_tips

Differences between revisions 3 and 4
Revision 3 as of 2006-06-18 19:38:50
Size: 1769
Editor: 84-122-156-174
Comment: comment about i18n
Revision 4 as of 2008-08-06 03:37:35
Size: 1756
Editor: client-82-9-31-225
Comment: Wiki clean. Removed duplicate category 'CategorySpec'.
Deletions are marked like this. Additions are marked like this.
Line 77: Line 77:
CategorySpec CategorySpec CategorySpec

Summary

Display daily tips for helping new (and experienced) users make the most of their Ubuntu system.

Rationale

Use cases

Scope

Design

I have made a bash script using zenity that works. It would, however, be better with a real "Tip of the day" application which could start on first boot and then have the checkbox "Do not display this again" added.

Implementation

Code

#!/bin/bash # # Ubuntu tips # # Displays a random "daily tip" in a dialog box when called # Usage: "sh ubuntutips.sh < inputfilename" # # Author: Dan-Erik Lindberg (Garyu in the Ubuntu forums) # 2006-02-22 #

# Load all lines in an array and count how many rows there are maxrows=0 while read line do

  • number=${line:0:6} content[number]=${line:7} let "maxrows += 1"

done

# Reseed random generator and select tip to display RANDOM=$$ thistip=$RANDOM let "thistip %= maxrows"

# Randomize tip from file and display using zenity for numb in $(seq 0 $maxrows) do

  • if [ $numb = $thistip ] then
    • zenity --title "Ubuntu daily tip" --info --text "${content[numb]}"
    fi

done

exit 0

Data preservation and migration

Outstanding issues

BoF agenda and discussion

  • It would be great to think about using this as a way of including information from: EthicalInfo.

  • i18n, please!

Forum page with sample tips in a textfile

http://www.ubuntuforums.org/showthread.php?p=768965#post768965


CategorySpec

Ubunty_daily_tips (last edited 2008-08-06 16:37:14 by localhost)