Results 1 to 5 of 5

Thread: How to make a Hot Key for Displaying Time?

  1. #1
    Join Date
    Mar 2009
    Location
    Bay Area
    Beans
    78
    Distro
    Ubuntu 12.04 Precise Pangolin

    How to make a Hot Key for Displaying Time?

    Hello all,

    I'd like to make a hot key (say <FN>T or something of the sort) that toggles the time display in the upper right hand corner. I've never written a script for my daily tasks before and am not even sure if this is the direction I should be looking. Any ideas? Your help is appreciated.

    max
    Last edited by gibxam; March 14th, 2013 at 06:25 AM.

  2. #2
    Join Date
    Feb 2010
    Location
    Summerwind
    Beans
    11,238
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: How to make a Hot Key for Displaying Time?

    Do you want something independent of the existing applet ? There is software in the sw center for daily scheduling of tasks also.
    Last edited by Frogs Hair; March 14th, 2013 at 01:25 AM.
    “ Diversity: The art of thinking independently together ”

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Manual

  3. #3
    Join Date
    Mar 2009
    Location
    Bay Area
    Beans
    78
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to make a Hot Key for Displaying Time?

    I'd like to be able to hot key the checking and unchecking of the box that says "show a clock in the menu bar"
    Last edited by gibxam; March 14th, 2013 at 06:25 AM.

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

    Re: How to make a Hot Key for Displaying Time?

    Save as toggle-clock.sh
    Code:
    #!/bin/bash 
    #
    # Script to toggle visibilty of clock in Unity Panel
    # Tested in Ubuntu 13.04
    #
    
    hide="gsettings set com.canonical.indicator.datetime show-clock false"
    show="gsettings set com.canonical.indicator.datetime show-clock true"
    test=$( gsettings get com.canonical.indicator.datetime show-clock )
    
    if [ $test = "true" ]; then
    	eval $hide
    else
    	eval $show
    fi
    Right click on toggle-clock.sh.... Properties > permissions and tick execute.
    While your there, also right click on toggle-clock.sh and choose copy.

    Open keyboard in the dash.
    Add a custom shortcut using the path to toggle-clock.sh as the command.
    The path should be in your clipboard ready for pasting in the command box.
    Attached Images Attached Images
    Last edited by stinkeye; March 14th, 2013 at 05:59 AM.

  5. #5
    Join Date
    Mar 2009
    Location
    Bay Area
    Beans
    78
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to make a Hot Key for Displaying Time?

    Thank you for your time stinkeye. Perfect directions and result.

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
  •