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 47 replies, 10 voices, and was last updated Apr 21-11:50 pm by BobC.
Viewing 15 posts - 1 through 15 (of 48 total)
  • Author
    Posts
  • #32564
    Moderator
    BobC

      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
      manyroads
        Helpful
        Up
        0
        ::

        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
        "For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
        dwm & i3wm ~Reg. Linux User #449130
        20 Jan 2021 ~ "End of an Error"

        #32567
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          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 3 years, 3 months ago by BobC.
          • This reply was modified 3 years, 3 months ago by BobC.
          #32572
          Moderator
          BobC
            Helpful
            Up
            0
            ::

            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
            Brian Masinick
              Helpful
              Up
              0
              ::

              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
              AntixDingo
                Helpful
                Up
                0
                ::

                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
                Moderator
                BobC
                  Helpful
                  Up
                  0
                  ::

                  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
                  ex_Koo
                    Helpful
                    Up
                    0
                    ::

                    @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.

                    #32609
                    Moderator
                    BobC
                      Helpful
                      Up
                      0
                      ::

                      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
                      Moderator
                      christophe
                        Helpful
                        Up
                        0
                        ::

                        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…

                        confirmed antiX frugaler, since 2019

                        #32754
                        Member
                        ex_Koo
                          Helpful
                          Up
                          0
                          ::

                          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 3 years, 2 months ago by ex_Koo.
                          #32774
                          Moderator
                          christophe
                            Helpful
                            Up
                            0
                            ::

                            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 3 years, 2 months ago by christophe.
                            • This reply was modified 3 years, 2 months ago by christophe.

                            confirmed antiX frugaler, since 2019

                            #32793
                            Member
                            ex_Koo
                              Helpful
                              Up
                              0
                              ::

                              @ BobC & christophe
                              Thanks for all the work.

                              #32799
                              Moderator
                              Brian Masinick
                                Helpful
                                Up
                                0
                                ::

                                +100! 😁

                                --
                                Brian Masinick

                                #32844
                                Moderator
                                BobC
                                  Helpful
                                  Up
                                  0
                                  ::

                                  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 48 total)
                                • You must be logged in to reply to this topic.