A way to display updates status in the conky

Forum Forums General Software A way to display updates status in the conky

  • This topic has 34 replies, 9 voices, and was last updated Feb 25-3:52 am by male.
Viewing 15 posts - 1 through 15 (of 35 total)
  • Author
    Posts
  • #32564
    Member
    AvatarBobC

    If anyone is interested I can post it (if allowed to), or email it to interested people.

    I don’t want to upset anyone by posting it, and I don’t think creating a respin for minor improvements is rational.

    All I did was to run the apt update via cron hourly, and take the last line of its output, and put it to a text file in /tmp. Then in the conky I run a script once every 60 seconds that displays the one line text file if it exists.

    As I see it, its not much different than displaying the automount status info in the conky, and the only problem I have with it is that the text is too long to fit well. I guess it would be cooler if it did different colors depending on the status, but I never was able to figure that out. It doesn’t require any significant extra memory or code. PPC’s or Brian’s yad-updater stuff could be tweaked to feed it pretty easily.

    #32566
    Member
    manyroadsmanyroads

    Given you like to run skinny @BobC, why are you updating your conky so frequently? Wouldn’t every 12 hours be adequate? You might consider doing similar with other execi commands to reduce CPU use (just a style thing)

    Pax vobiscum,
    Mark Rabideau - http://many-roads.com
    MX-19 kernel: 5.2.21-antix.1-amd64-smp
    "For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
    MX- antiX- bspwm, hlwm, xfce4

    #32567
    Member
    AvatarBobC

    I just wrote it last night, so it’s only been running less than a day at this point. I am not and will not be running the upgrade from it. I am just looking for it to put what’s available on the screen so I can be more aware of if there are updates available. On any given machine I had no idea as it was.

    Typically I only do upgrades after a backup, and maybe once a week, if that, unless there is something critical. Some machines that don’t get used much are months old, I bet.

    I am planning on having it run the update maybe twice a day, will probably just have the conky redisplay the file once per hour, and then run the backup to a snapshot and prompt for the upgrades weekly on the weekend when I might have time.

    PS: Yes, on the slower machines I run things at much wider intervals. On my old machines, I try to make them idle at 2% CPU or less, and I would plan on the update itself daily, for example.

    And, yes, You are right, updating a screen every minute that is only going to change a few times a day is silly…

    • This reply was modified 2 weeks, 3 days ago by BobC.
    • This reply was modified 2 weeks, 3 days ago by BobC.
    #32572
    Member
    AvatarBobC

    I see anti got a package posted that includes a notifier.

    anti cares about his system and the people running it.

    People notice things like that…

    Good Job, anti!

    #32575
    Moderator
    masinickmasinick

    Whether we use every idea, tool, package or not isn’t the point.

    I think that software experimentation and trying diverse ideas is a great way to stumble upon the next interesting technology.

    In this case we are trying various scripts to check (or update) the system status. We know that there are lots of ways to do this and different people prefer different methods and tools.

    I’m encouraged to see this kind of stuff happening. Keep up the good work 👌

    Brian Masinick

    #32579
    Member
    AntixDingoAntixDingo

    FWIW, the repo update site (https://antixlinux.com/mirmon-packages/) is great. Why aren’t other distro-devs doing similar? Given, I’m not able to comment comprehensively, but, to find the equivalent info for Debian Main is like 5 or 6 links deep. So, if you don’t know to look for it, you’ll probably never find it.

    Maybe cron solves most things.

    Thanks again.

    Few things as strong as a well-timed idea.

    #32606
    Member
    AvatarBobC

    Hmmmm, cron is running, but I restarted my system with my check for updates script in /etc/cron.hourly (just to test it), but it didn’t run. Maybe I just need to wait an hour? That’s not very good…

    I am thinking of having it run anytime the machine is rebooted

    #32608
    Member
    KooKoo

    @BobC
    What type computer do you run. You live on the edge with memory.

    But then again you have open
    2 firefox
    4 terminals
    file manager
    geany
    network settings
    conky running

    Does it ever get a bit on the slow side.

    MX-19 4.19.0-6-amd6 (i3) : Debian-10 4.19.67-2+deb10u2 (i3) : anitX-19 runit (5.3.14-antix.1-amd64-smp) (i3)
    2 Laps T430 17.2 X220 17.4

    #32609
    Member
    AvatarBobC

    The one I am using for this is a Dell D620 with 2 gb of memory from 2005 that I won on a bet. There are actually about 30 Firefox tabs open between the two windows. That’s why it is using lots of memory. No, I’m not really having any performance issues.

    My problem is that the cron doesn’t run my script from /etc/cron.hourly automatically as I expected. I also tried running it from ~/.icewm/startup after the network interface is up and that didn’t work at all, either. It does work fine from a terminal when run with sudo. The part that displays it on the conky screen also works fine.

    I admit that I’ve never used cron to run anything before. ps -ef does say that cron is running.

    I will post the zip file, but with the understanding that it needs help, not as something expected to be working.

    bobc@d620:/tmp
    $ sudo aptupdatescheck.sh
    [sudo] password for bobc: 
    bobc@d620:/tmp
    $ ls -l
    total 20
    -rw-r--r-- 1 root root  545 Feb 11 05:39 aptupdatescheck_0.log
    -rw-r--r-- 1 root root   71 Feb 11 05:39 aptupdatescheck_1.log
    -rw-r--r-- 1 root root   71 Feb 11 05:39 aptupdatescheck.txt
    drwx------ 2 bobc bobc 4096 Feb 11 05:39 mc-bobc
    -rw-r--r-- 1 bobc bobc  362 Feb 11 05:37 startup.log
    bobc@d620:/tmp
    $ mc
    
    bobc@d620:/tmp
    $ ls -l /usr/local/bin/apt*
    -rwxr-xr-x 1 root root 447 Feb 10 23:07 /usr/local/bin/aptupdatescheck.sh
    bobc@d620:/tmp
    $ ls -l /etc/cron.hourly/apt*
    -rwxr-xr-x 1 root root 447 Feb 10 23:18 /etc/cron.hourly/aptupdatescheck.sh
    bobc@d620:/tmp
    
    #32719
    Member
    christophechristophe

    I set it up, but I’ve run into the same situation you described, Bob — not outputting anything to conky. That was all I was looking for: conky displaying if anything was available… The scripts are beyond my understanding, at this point. But I’ll keep the scripts, and when I can follow the code better, maybe I can contribute…

    #32754
    Member
    KooKoo

    Try this.
    ${execi 3600 aptupdatesconky.sh | wc -l}

    #BobC
    If you want I can send you a 2gb ddr ram stick for free. As the D620 has two ram slots.

    • This reply was modified 1 week, 5 days ago by Koo.

    MX-19 4.19.0-6-amd6 (i3) : Debian-10 4.19.67-2+deb10u2 (i3) : anitX-19 runit (5.3.14-antix.1-amd64-smp) (i3)
    2 Laps T430 17.2 X220 17.4

    #32774
    Member
    christophechristophe

    I dug around and (eventually) found this to work:

    1. copy aptupdatescheck.sh & aptupdatesconky.sh to /usr/local/bin (ensure they are executable)

    2. run sudo crontab -u root -l which lists root’s cronjobs. I had none.

    3. run sudo crontab -u root -e which edits roots cronjobs

    4. add one, like this: @hourly bash /usr/local/bin/aptupdatescheck.sh which sets the script to run at the top of each hour. It seems to need “bash” in front of the script, and the full path to the script.

    5. add at end of ~/.conkyrc ${color}${alignc}${execi 600 aptupdatesconky.sh} — just my tweak of BobC’s conky line (the original works just fine, though).

    And it worked. I checked that the tmp files were created just to make sure.

    Additional note – I removed all manual edits I made to crontab & /etc/cron.hourly. And it worked without that. (I credit this to the mystery of Linux. Perhaps someone else may know what the point of those files are…)

    Another note – I am running live, and cron was running automatically (NOT using disable=l boot parameter).

    So my setup is only checking if updates are available via cron (at the top of each hour), and displaying this info (refreshing every 10 minutes) in conky. I’ll run the yad-updater or cli-aptiX (or command-line) myself.

    So many thanks to everyone (BobC et al.) for this. I’m really enjoying it!

    Additional info on the crontab command is here:
    https://www.guru99.com/crontab-in-linux-with-examples.html

    • This reply was modified 1 week, 4 days ago by christophe.
    • This reply was modified 1 week, 4 days ago by christophe.
    #32793
    Member
    KooKoo

    @ BobC & christophe
    Thanks for all the work.

    MX-19 4.19.0-6-amd6 (i3) : Debian-10 4.19.67-2+deb10u2 (i3) : anitX-19 runit (5.3.14-antix.1-amd64-smp) (i3)
    2 Laps T430 17.2 X220 17.4

    #32799
    Moderator
    masinickmasinick

    +100! 😁

    Brian Masinick

    #32844
    Member
    AvatarBobC

    I keep learing…

    Next time I need to get it all working somehow as a complete subsystem and figure out a way to provide an install script that will install everything where it belongs, etc. The big issue there is the root authority question. I don’t know any easy way out on that. Maybe it needs to be in a package, etc.

    Thanks to PPC for providing the original code and Christophe for figuring out how to make it work with cron.

Viewing 15 posts - 1 through 15 (of 35 total)
  • You must be logged in to reply to this topic.