Results 1 to 10 of 12

Thread: 11.04 timer-applet replacement?

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Beans
    348

    11.04 timer-applet replacement?

    Anyone know of a possible replacement for the Gnome timer applet?

  2. #2
    Join Date
    Dec 2009
    Beans
    36

    Re: 11.04 timer-applet replacement?

    This is a really good app. I am not sure about Unity, but if you switch to ubuntu classic, which uses gnome 2, it's the same timer-applet. You can add timer from "Add to Panel".

    Btw, I don't think you can add applets in Unity since it incorporates menus on top. Correct me if I am wrong. I will stick with classic gnome2 until unity gets more functionality.
    Last edited by wujj123456; May 1st, 2011 at 06:02 PM.

  3. #3
    Join Date
    Oct 2008
    Beans
    3,509

    Re: 11.04 timer-applet replacement?

    I searched for hours and couldn't find anything.
    The only suitable thing I found was a script that outputs a count down to conky.

    I managed to make a launcher, which uses the script, with presets that play a sound and send a notification when the timer is up.
    You have to create a .desktop file and, install/setup conky.
    It's a pretty long winded process to describe so if you can be bothered doing this
    I will post how to.
    Attached Images Attached Images

  4. #4
    Join Date
    Dec 2006
    Beans
    348

    Re: 11.04 timer-applet replacement?

    Hmm. I already tend to use Conky, and have created .desktop files before to make things searchable in Gnome-Do/Dash, so I wouldn't mind so much. If you have the chance I would interested to see how you managed it

  5. #5
    Join Date
    Oct 2008
    Beans
    3,509

    Re: 11.04 timer-applet replacement?

    Quote Originally Posted by pwnedd View Post
    Hmm. I already tend to use Conky, and have created .desktop files before to make things searchable in Gnome-Do/Dash, so I wouldn't mind so much. If you have the chance I would interested to see how you managed it
    I'm just on my way out.
    I'll post the .desktop and countdown script and get back to you.

    ***Note***
    The countdown script requires you have a ~/tmp folder.
    Create a tmp folder in your home directory if you don't have one.
    You need to install libnotify-bin for notify-send to work.
    Remember to change all the paths and make the script executable.


    Save this as countdown.sh and make executable.
    Saving in ~/scripts makes it easier when changing the paths in ConkyTimer.desktop
    Code:
    #!/bin/bash
    #
    # countdown script 
    # usage example: countdown.sh 00:10:00
    # starts a 10min countdown and write the status to $COUNTDOWNFILE 
    # (where conky is listening and displays the content in this setup)
    #
    # timer for teh perfect pizza
    # 
    
      IFS=:
      OUTPUTFILE=$HOME/tmp/countdown
      COUNTDOWNSOUND=$HOME/Sounds/bell.wav
      
      time=$1
      if [ -z "$1" ]; then
        time=$(zenity --entry --text "How long?" --entry-text "00:00:00" --title "zeh countdowwn");
      fi
    
     
     
      if [ -n "$time" ] && [ "$time" != "00:00:00" ]; then
        set -- $time
        secs=$(( ${1#0} * 3600 + ${2#0} * 60 + ${3#0} ))
        while [ $secs -gt 0 ]
        do
          sleep 1 &
          printf "%02d:%02d:%02d\n" $((secs/3600)) $(( (secs/60)%60)) $((secs%60)) > $OUTPUTFILE
          secs=$(( $secs - 1 ))
          wait
        done
        echo "00:00:00" > $OUTPUTFILE
        notify-send -u critical -i /home/glen/Pictures/Bell.png "ConkyTimer" "Times Up" &
        aplay -q $COUNTDOWNSOUND
        rm $OUTPUTFILE  
        echo
      fi

    Save this as ConkyTimer.desktop to your home folder.
    To edit this file to show your own presets and correct paths, enter in the terminal gedit ~/ConkyTimer.desktop
    Once edited drag and drop on the launcher.
    Code:
    #!/usr/bin/env xdg-open
    
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Icon[en_US]=/home/glen/Pictures/Bell.png
    Name[en_US]=ConkyTimer
    Exec=/home/glen/scripts/countdown.sh
    Name=ConkyTimer
    Icon=/home/glen/Pictures/Bell.png
    
    X-Ayatana-Desktop-Shortcuts=3 min;4 min;5 min;7 min;10 min;15 min;25 min;30 min;Stop Timer
    
    [3 min Shortcut Group]
     Name=3 min
     Exec=/home/glen/scripts/countdown.sh 00:03:00
     TargetEnvironment=Unity
    
    [4 min Shortcut Group]
     Name=4 min
     Exec=/home/glen/scripts/countdown.sh 00:04:00
     TargetEnvironment=Unity
    
    [5 min Shortcut Group]
     Name=5 min
     Exec=/home/glen/scripts/countdown.sh 00:05:00
     TargetEnvironment=Unity
    
    [7 min Shortcut Group]
     Name=7 min
     Exec=/home/glen/scripts/countdown.sh 00:07:00
     TargetEnvironment=Unity
    
    [10 min Shortcut Group]
     Name=10 min
     Exec=/home/glen/scripts/countdown.sh 00:10:00
     TargetEnvironment=Unity
    
    [15 min Shortcut Group]
     Name=15 min
     Exec=/home/glen/scripts/countdown.sh 00:15:00
     TargetEnvironment=Unity
    
    [25 min Shortcut Group]
     Name=25 min
     Exec=/home/glen/scripts/countdown.sh 00:25:00
     TargetEnvironment=Unity
    
    [30 min Shortcut Group]
     Name=30 min
     Exec=/home/glen/scripts/countdown.sh 00:30:00
     TargetEnvironment=Unity
    
    [Stop Timer Shortcut Group]
     Name=Stop Timer
     Exec=bash -c "pkill countdown.sh & rm /home/glen/tmp/countdown & pkill aplay"
     TargetEnvironment=Unity
    Clicking the launcher runs countdown.sh and you will get a popup
    to input a countdown in the form of HH:MM:SS

    Right clicking and choosing a preset runs countdown.sh HH:MM:SS
    eg the 3 min preset runs countdown.sh 00:03:00



    The line for conky (The timer only shows when running.ie ~/tmp/countdown exists)
    Code:
    ${if_existing /home/glen/tmp/countdown}${voffset 2}${font StyleBats:size=10}${color2}o${voffset -2}${font LCDMono:bold:size=12} Timer: ${color yellow}${exec tail -n1 ~/tmp/countdown}${endif}
    Goodluck
    Last edited by stinkeye; May 7th, 2011 at 01:54 AM.

  6. #6
    Join Date
    Oct 2008
    Beans
    3,509

    Re: 11.04 timer-applet replacement?

    Something else I just discovered.
    If you use own_window_type override in your conky config
    You can position it in a transparent panel.

    conky config
    Code:
    ####
    ## Use XFT? Required to Force UTF8 (see below).
    #
    use_xft yes
    xftfont GE Inspira:bold:size=10
    xftalpha 0.8
    text_buffer_size 2048
    
    ####
    ## Force UTF8? Requires XFT (see above).
    ## Displays degree symbol, instead of °, etc.
    #
    override_utf8_locale yes
    
    ####
    ## Daemonize Conky, aka 'fork to background'.
    #
    background no
    
    ####
    ## Update interval in seconds.
    #
    update_interval 1.0
    
    ####
    ## 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_colour 0A0C1C
    own_window_title conkytimer
    own_window_type override
    own_window_transparent yes
    own_window_hints undecorated,above,sticky,skip_taskbar,skip_pager
    default_color 2B367C
    #own_window_argb_visual yes
    #own_window_argb_value 180
    
    ####
    ## Use double buffering? Reduces flicker.
    #
    double_buffer yes
    
    ####
    ## Draw shades?
    #
    draw_shades no
    
    ####
    ## Draw outlines?
    #
    draw_outline no
    
    ####
    ## Draw borders around text?
    #
    draw_borders no
    default_outline_color 7E88C4
    ####
    ## Draw borders around graphs?
    #
    draw_graph_borders no
    
    ####
    ## Print text to stdout?
    ## Print text in console?
    #
    out_to_ncurses no
    out_to_console no
    
    ####
    ## Text alignment.
    #
    alignment tr
    
    ####
    ## Minimum size of text area.
    #
    minimum_size 100 0
    maximum_width 250
    
    ####
    ## Gap between text and screen borders.
    #
    gap_x 400
    gap_y 2
    
    ####
    ## Shorten MiB/GiB to M/G in stats.
    #
    short_units yes
    
    ####
    ## Pad % symbol spacing after numbers.
    #
    pad_percents 0
    
    ####
    ## Pad spacing between text and borders.
    #
    border_inner_margin 2
    
    ####
    ## Limit the length of names in "Top Processes".
    #
    top_name_width 10
    
    ####
    ## Subtract file system -/+buffers/cache from used memory?
    ## Set to yes, to produce meaningful physical memory stats.
    #
    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
    
    ####
    ## Add spaces to keep things from moving around?
    ## Only affects certain objects.
    #
    use_spacer right
    
    ####
    ## My colors (suit yourself).
    #
    color0 White
    color1 Ivory
    color2 Ivory2
    color3 Ivory3
    color4 Tan1
    color5 Tan2
    color6 Gray
    color7 AntiqueWhite4
    color8 DarkSlateGray
    color9 Black
    
    
    
    TEXT
    ${if_existing /home/glen/tmp/countdown}${voffset 2}${font StyleBats:bold:size=10}${color2}o${voffset -2}${font LCDMono2:bold:size=12} ${color yellow}${exec tail -n1 ~/tmp/countdown}${endif}
    Change path.

    LCDMono,StyleBats fonts and icon attached.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by stinkeye; May 7th, 2011 at 03:52 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •