Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: cronjob and numlockx

  1. #1
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,386
    Distro
    Xubuntu 13.04 Raring Ringtail

    cronjob and numlockx

    My numlock annoyed me one too many times, so i figured i would add a cronjob so it would stop annoying me, but it does not turn my numlock on...
    Code:
    ~$ crontab -l
    # Edit this file to introduce tasks to be run by cron.
    # 
    # Each task to run has to be defined through a single line
    # indicating with different fields when the task will be run
    # and what command to run for the task
    # 
    # To define the time you can provide concrete values for
    # minute (m), hour (h), day of month (dom), month (mon),
    # and day of week (dow) or use '*' in these fields (for 'any').# 
    # Notice that tasks will be started based on the cron's system
    # daemon's notion of time and timezones.
    # 
    # Output of the crontab jobs (including errors) is sent through
    # email to the user the crontab file belongs to (unless redirected).
    # 
    # For example, you can run a backup of all your user accounts
    # at 5 a.m every week with:
    # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
    # 
    # For more information see the manual pages of crontab(5) and cron(8)
    # 
    # m h  dom mon dow   command
    */5 * * * * numlockx on
    it does not turn my numlock on
    Code:
    ~$ cat /var/log/syslog | tail -8
    Jan  6 14:25:01 ASUS-A54C-NB91 CRON[26629]: (chad) CMD (numlockx on)
    Jan  6 14:25:01 ASUS-A54C-NB91 CRON[26628]: (CRON) info (No MTA installed, discarding output)
    Jan  6 14:28:41 ASUS-A54C-NB91 crontab[29704]: (chad) LIST (chad)
    Jan  6 14:30:01 ASUS-A54C-NB91 CRON[30818]: (chad) CMD (numlockx on)
    Jan  6 14:30:01 ASUS-A54C-NB91 CRON[30817]: (CRON) info (No MTA installed, discarding output)
    Jan  6 14:31:58 ASUS-A54C-NB91 crontab[32449]: (chad) LIST (chad)
    Jan  6 14:35:01 ASUS-A54C-NB91 CRON[2847]: (chad) CMD (numlockx on)
    Jan  6 14:35:01 ASUS-A54C-NB91 CRON[2846]: (CRON) info (No MTA installed, discarding output)
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  2. #2
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: cronjob and numlockx

    I have 5 different ubuntu family OSs running on my desktop machine and none of them has numlockx installed, however they all boot with numlock enabled after shutting down with numlock enabled.

    That is all I have ever had to do; could it be hardware reliant?
    DISTRO: Xubuntu 14.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  3. #3
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,386
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: cronjob and numlockx

    it is not installed by default, the command works when i run it in a terminal
    i am assuming i accidentally hit the key and turned it off, i am just tire of it annoying me, be it human error or not
    Last edited by pqwoerituytrueiwoq; January 6th, 2013 at 10:06 PM.
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  4. #4
    Join Date
    Jul 2006
    Location
    Castrum, Germania Secunda
    Beans
    1,071

    Re: cronjob and numlockx

    On a particular machine, I had to fight quite a battle against numlockx before all was well. This is how I finally succeeded on that machine (your mileage may vary):
    https://sites.google.com/site/easyli...-automatically
    (item 2.6, right column)

    On other machines, there was no need for the "toggle" trick at all. Computers are strange beasts.
    Tips, tweaks and how-to's for Ubuntu and Mint:
    http://sites.google.com/site/easylinuxtipsproject
    In for a pleasant surprise? Give Xubuntu a try:
    http://sites.google.com/site/easylin...roject/xubuntu

  5. #5
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,386
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: cronjob and numlockx

    i was already doing that and it works, but i think i sometimes turn it off when i miss the backspace key, which is where the cronjob comes in handy, but it does not seems to effect numlock
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  6. #6
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: cronjob and numlockx

    This is perhaps another way to do the same thing, by either adding the command you use to /etc/rc.local, just above the "exit 0" line, or making a script with that one command and adding that to your startup applications list so it is run a session logon.
    DISTRO: Xubuntu 14.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  7. #7
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,386
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: cronjob and numlockx

    already did that system wide:
    Code:
    ~$ cat /etc/xdg/autostart/numlockx.desktop 
    [Desktop Entry]
    Encoding=UTF-8
    Version=0.9.4
    Type=Application
    Name=Num Lock ON
    Comment=Turns NumLock on
    Exec=numlockx on
    OnlyShowIn=XFCE;
    StartupNotify=false
    Terminal=false
    Hidden=false
    i suppose i could make it run a while loop, by does it not work as a cron job?
    Code:
    sh -c 'while [ 1 -eq 1 ];do numlockx on;sleep 300;done
    '
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  8. #8
    Join Date
    Apr 2012
    Beans
    6,043

    Re: cronjob and numlockx

    are you doing it as a user crontab or as root? I don't know how numlockx works, but it sounds like it needs to talk to the Xserver (rather than doing stuff down at the keyboard hardware level) - usually cron doesn't have the correct environment to do that (DISPLAY, XAUTHORITY and so on not set)

  9. #9
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,386
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: cronjob and numlockx

    Quote Originally Posted by steeldriver View Post
    are you doing it as a user crontab or as root? I don't know how numlockx works, but it sounds like it needs to talk to the Xserver (rather than doing stuff down at the keyboard hardware level) - usually cron doesn't have the correct environment to do that (DISPLAY, XAUTHORITY and so on not set)
    as the regular user, note the lack of sudo in the 1st post for crontab -l
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  10. #10
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: cronjob and numlockx

    Quote Originally Posted by steeldriver View Post
    are you doing it as a user crontab or as root? I don't know how numlockx works, but it sounds like it needs to talk to the Xserver (rather than doing stuff down at the keyboard hardware level) - usually cron doesn't have the correct environment to do that (DISPLAY, XAUTHORITY and so on not set)
    hi
    steeldriver answer is ok - see man numlockx:
    numlockx is a program to control the NumLock key inside X11 session scripts.
    and cron isn't running inside X !
    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

Page 1 of 2 12 LastLast

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
  •