Making productive use of the XScreenSaver to display text instead of Conky

Forum Forums General Tips and Tricks Making productive use of the XScreenSaver to display text instead of Conky

Tagged: ,

  • This topic has 48 replies, 6 voices, and was last updated Jun 13-5:47 pm by BobC.
Viewing 15 posts - 31 through 45 (of 49 total)
  • Author
    Posts
  • #10338
    Member
    sleekmason
      Helpful
      Up
      0
      ::

      I don’t think it can work as one process.

      Yeah, tried that as well.

      Okay, This worked. I reckon I can add as many as I like:

      #!/bin/bash
      #
      if pidof rsstail | grep [0-9] > /dev/null
       then
       touch /tmp/news /tmp/ark
       else
       rsstail -n 10 -i 3600 -d -u http://feeds.nytimes.com/nyt/rss/HomePage > /tmp/news &
       rsstail -n 10 -u https://www.arktimes.com/arkansas/Rss.xml > /tmp/ark &
      fi
      echo "New York Times"
      echo
      cat /tmp/news
      echo
      echo "Arkansas Times"
      echo
      cat /tmp/ark
      exit 1



      I think the -i option will work for extending the time between updates.

      #10352
      Moderator
      BobC
        Helpful
        Up
        0
        ::

        Yes that looks like it should work, although I don’t know the effect of the touch unless its to tell something the files are in use.

        It looks like you have the same problem as mine though, where you start the rsstail processes, which appear to take 15 mb of memory each, but don’t have a way to end those same ones, let alone avoid ending others that some other part of your system might have started.

        The other things I’ll say here is we have a difference of opinion, not that either is right or wrong, but in that our purposes are different. I was creating a system that anyone could run, by just adding a text file or link to one, or copying a very simple script and changing the name to the website url and filename, and it would run with minimal effort.

        Yours is for YOUR system, and in some ways simpler as a result, but with those also being limits in terms of easy portability.

        But we both learned from creating them and created things that work, so congrats on getting it to work, because nothing is as easy as it looks initially.

        I still want to find a way to automatically kill my feeds when the screensaver isn’t running. My thought is that my gen_sst can start a background process that watches for when gen_sst is no longer running, and then checks again a minute, later, in case it was momentarily gone on a screensaver recycle, and if its gone, then it kills the same rssfeeds it started (requiring it to remember somewhere which they were) to shut those and only those down so they aren’t wasting memory or internet bandwidth, and at that point it too can end. I also never did find a good package creation and install method. Maybe I just don’t know how to work spacefm right.

        • This reply was modified 4 years, 11 months ago by BobC.
        • This reply was modified 4 years, 11 months ago by BobC.
        #10355
        Member
        sleekmason
          Helpful
          Up
          0
          ::

          Yes that looks like it should work, although I don’t know the effect of the touch unless its to tell something the files are in use.

          Me either. It wound up being a place holder for me as it worked, but nope! not a clue why.

          It looks like you have the same problem as mine though, where you start the rsstail processes, which appear to take 15 mb of memory each, but don’t have a way to end those same ones, let alone avoid ending others that some other part of your system might have started.


          Exactly! When I tried using conky to remove the /tmp files, the feed wouldn’t pick back up, 15 minutes or not. So, rsstail has to be killed and restarted at the same time as removal of those files. Of course then, you receive the same threads again. Blah. I had thought touch might help with that, but probably not.

          The other things I’ll say here is we have a difference of opinion, not that either is right or wrong, but in that our purposes are different.

          Not as much as you think. Portability based on ease of use is everyone’s concern. I use a /bin in home rather than /usr/local/bin for my private use, but change it for consumption later. My main goal was getting different feeds than the originals in an easy way. Your concept is/was brilliant! I wouldn’t take that lightly. Probably others have done the same, but I haven’t heard of it before now. Of course I wanted to check it out. Worried a bit that you would think I was stepping on your post because I was posting items not directly related to your scripts. Certainly not my intention if it appears so. For me, they are past my current level of knowledge. Like you, sharing gives insight and helps me to learn:)

          I still want to find a way to automatically kill my feeds when the screensaver isn’t running.


          Yep. Working on that as well. creating a small script to kill rsstail upon screensaver exit would do it.

          An alternative would be to create a script that killalls both of them with a spacebar press, and then restarts the xcreensaver daemon automatically after a “wait 2” or something. <—

          #10362
          Moderator
          BobC
            Helpful
            Up
            0
            ::

            Yes, I don’t like using /usr/local/bin, but no choice, as AntiX doesn’t come with anywhere the user can add a program to the path, so its a nightmare to try to use something like that because you end up needing to change too many things unrelated. I was doing that before and gave up.

            No, I’m not upset. Nobody is interested in my idea anyway, so I guess I did it just for my own learning and for my systems. I’ve never had a real computer class that I finished in all the years I’ve been coding, and I basically learn by doing, copying and tweaking, and making systems do cool things.

            I will be taking out the “fluff” and changing it into the learning system I had originally envisioned on my machine, anyway, basically leaving a minimum of feeds type stuff and adding in text file tutorials of things I want to learn or remember, such as bash tutorials, syntax and examples, linux utility examples (like using sed and awk and grep), and python next, maybe leaving the weather conditions and 3 day forecast in the rotation and 1 news feed. I don’t normally watch TV or news anyway.

            #10364
            Anonymous
              Helpful
              Up
              0
              ::

              Different from “not interested”, I just would not choose this presentation mechansism. Xscreensaver is (openGL?) cpu-intensive, and I would not be keen on adding long-running processes (rsstail+xscreensaver). For rss, the QuiteRSS application is my “right tool for the job”. I don’t care what 10 things (titles) the NYT or whatever source wants to shove in front of my attention. QuiteRSS (or Tiny Tiny rss) enables filtering out the items I’m not interested in. Inability to temporarily pause the scrolling would annoy me, and the autoscrolling at any speed would be a headache or at least a distraction.

              “AntiX doesn’t come with anywhere the user can add a program to the path”

              That statement is incorrect, and underscores a problem in arriving at a solution. Some basic linux+bash remedial reading is in order.
              ~/.profile
              ~/.bashrc
              IMO, there’s nothing wrong/bad about placing custom scripts in /usr/local/bin but if “portability” is a worry, place ’em in /bin or /usr/bin
              or… (across all you installations) edit .bashrc+.profile, appending PATH with your chosen custom location.

              A line in one posts above shows “calling sh to exec a #!/bin/bash script”.
              You need to read/learn that’s ill-advised, and why so.
              Besides, on antiX, does your system even have an “sh” command???
              (check it: IIRC, “sh” and “ash” are symlinks to “dash”, which you’ll usually not want to use instead of bash)

              Also multiple consecutive “echo echo” lines (without -ne, are prone to breakage if the material contains backslash character)
              should be replaced by a single printf statement (e.g. printf “NYT \n\n” )
              Could, or should? Partly it’s a matter of coding style. Should, because it helps reduce clutter, better allowing to “see the forest thru the trees”.
              Forest? Yes. So I would strive to replace pidof and killall and who shot the sherriff spread out across mutiple scripts with a single script.
              rsstail is probably NOT the ideal tool for the job. cURL or other rss-retrieving commands can similarly autoparse and strip out the xml tags to leave plain text.
              commands “diff”, “comm”, “sort”, “uniq” are available to handle/discard “old” items from prior runs.

              “I guess I did it just for my own learning and for my systems”

              and I nosed in b/c whatever I’ve learned, if I don’t use it every day, I get rusty. Looking at old scripts, and scripts by other people, jogs the memory {smiley}

              “examples (like using sed and awk and grep), and python”

              Great, because you’ll gain recognition of available tools suited for a broader application scope. Surely retrieving and parsing rss feeds is already a “solved problem” and various tools exists to serve as lego bricks, toward (optionally) sending the output to text-to-speech — personal assistant, instead of scrolling screenreader.

              For this xcreensaver presentation, toward deciding what-should-happen-in-what-order, maybe it would be helpful for you to tinker with using the “expect” command? (websearch “linux expect command”) https://www.lifewire.com/linus-unix-command-expect-2201096

              python: a lot of possibilities are available via use of “scapy” and “beautifulsoup” and “urllib”. Beyond just rss feeds, the news gatherer+presenter would also be able to selectively retrieve from webpages.

              #10374
              Member
              sleekmason
                Helpful
                Up
                0
                ::

                A line in one posts above shows “calling sh to exec a #!/bin/bash script”.
                You need to read/learn that’s ill-advised, and why so.
                Besides, on antiX, does your system even have an “sh” command???
                (check it: IIRC, “sh” and “ash” are symlinks to “dash”, which you’ll usually not want to use instead of bash)

                This is why more people with knowledge like yours should step up instead of letting people flounder, or allow info to spread that shouldn’t. .sh on the end of half the files indicate a usable command. If #!/bin/bash is used at the top of the script, does it not call bash anyway? just wondering. Sounds like I have some cleanup changes to do. Thank you.
                QuiteRSS <— https://quiterss.org/ Appreciate this;)

                @BobC
                ### These are the commands I use to make a directory in home to be read by bash. Maybe useful.
                $ mkdir -p “$HOME/bin”
                $ echo ‘PATH=”$HOME/bin:$PATH”‘ >> “$HOME/.bashrc”
                $ source “$HOME/.bashrc”

                No, I’m not upset. Nobody is interested in my idea anyway


                Obviously people are. There are probably 20 (2000?) or so keeping track of this thread whether you know it or not. I frequently get none to one replies on the stuff I write. Putting yourself out there for ridicule isn’t easy.

                #10377
                Moderator
                BobC
                  Helpful
                  Up
                  0
                  ::

                  736,

                  Thanks for taking the time to read and comment. It was nice of you to spend time looking at something I can tell you wouldn’t want for yourself. Myself, I need feedback, or what’s wrong with what I create will be even uglier with the next code I write, LOL.

                  I’ll look into your path comment. I don’t know enough to be honest, and I know it, and that’s why I was asking for opinions. I think a standard place should be there on the path so I don’t need to wonder where things should go, or try to create a place and need to tell someone how to create it and add it to their path, just to get my program to work.

                  Bash vs Sh. I do know they are different, but couldn’t give you an example of what is ok for one vs the other to save my soul. I was only able to write what I wrote by searching websites and then trying to adapt the syntax I found, and my success rate with that was under 50%. Things like braces or not, testing values, or the inverse didn’t work from one supposedly good answer to the next, and I was actually searching with bash as part of my search string. Luckily at work there is a system that’s much worse, so I’m kinda used to that. I used to use csh and ksh on some system or another back in the 80’s, and the one thing I do remember was that there were not the same.

                  I will say I dislike having everything owned by root, but don’t know how to make things user owned and correctly package it up for easy/safe install.

                  I will try looking at curl again. I didn’t like the run forever nature of rsstail, but wasn’t able to find anything else that worked better than sleekmason’s rsstail suggestion after spending an hour or two trying with newsbeuter, which worked fine for what it is, and not wanting to install anything big to do it, because rss feeds are something I normally only use for 10 lines of recent top story titles on my conky, and that’s about it, which didn’t require anything fancy. I think I figured out a way to get the pid of the rsstail for that url and cancel it after getting the data, and using my timer to not get it again for X minutes like I was doing with curl. I looked again last night for ways to do it with curl, and what I found was like what I had, ie using grep and sed to try to figure out what came on the page that I wanted to display, but again, I was looking for something more black-box, where I give it the URL and it hands me back the text of the title and maybe description, not a book filled with xml gobbelty gook. Maybe I should let rsstail do the work, since it is small and seems capable, and capture its pid and kill it after it grabs the text. I’m not expecting it to filter out the articles I’m not interested in, although it would be nice, but I was just looking for something simple and small.

                  I wanted the text (in general) on the screensaver to get it in front of me when my PC screen wasn’t doing anything else useful anyway. I remember better the things I see often. Having a bit of news and weather mixed in and the fancy text crawl display method seemed like a good way to keep it from being all work.

                  It wouldn’t need to be part of xscreensaver, and could just as well have been something separate, but I wouldn’t have a clue trying to replace xscreensaver. I too would have liked to have been able hit a key and have an RSS link come up in a browser, but it was way beyond the idea of getting things to remember in front of me.

                  I missed things there I’m sure, but I will go back and reread your comments again till I figure it out.

                  I saw sleekmason’s first comment and will remind him that 736 gave us what we needed. He wasn’t here looking because it wasn’t something he was really interested in, so its almost by luck that he came back and saw we needed help, and took his time to try to help.

                  Sleek, the thing was I didn’t want my little program making major changes to someone’s system, when I can barely make things work on mine… Your idea for what you or I could do to ours is fine, assuming we don’t want anything like vanilla systems, but for example, if it was already in the other person’s system’s path, or some other location was there for the same purpose, or maybe a different login method was used (like slim vs lightdm), would it for sure be the same?

                  I don’t know how to see how many people even looked here, but I think there are about 4 maybe that commented total. I still think its a far more useful screensaver since I changed mine, and I almost never go look at the conky anymore because I don’t need to.

                  • This reply was modified 4 years, 11 months ago by BobC.
                  • This reply was modified 4 years, 11 months ago by BobC.
                  • This reply was modified 4 years, 11 months ago by BobC.
                  #10387
                  Member
                  sleekmason
                    Helpful
                    Up
                    0
                    ::

                    I saw sleekmason’s first comment and will remind him that 736 gave us what we needed.

                    You don’t need to remind me of anything, I thanked him for helping. Read it again.

                    #10389
                    Moderator
                    BobC
                      Helpful
                      Up
                      0
                      ::

                      I guess I read it wrong. I didn’t mean to offend anyone.

                      #10390
                      Member
                      sleekmason
                        Helpful
                        Up
                        0
                        ::

                        No worries.

                        #10397
                        Anonymous
                          Helpful
                          Up
                          0
                          ::

                          “sh mybashscript”
                          Hoping you will please read or at least skim the following links, in the order listed.
                          https://askubuntu.com/questions/601055/what-are-the-differences-between-executing-shell-scripts-using-source-file-sh
                          http://wiki.bash-hackers.org/scripting/bashbehaviour
                          http://tldp.org/LDP/Bash-Beginners-Guide/html/Bash-Beginners-Guide.html#AEN7387
                          https://mywiki.wooledge.org/Bashism
                          https://wiki.ubuntu.com/DashAsBinSh

                          No ridicule from here. When I scroll and read again, okay the phrase “remedial reading” although it’s exactly accurate, I could have phrased that more tactfully. Maybe the culture here in this small forum is too intimate, so some posters, or would-be posters, worry that a “probably dumb question” or a “probably not the most efficient solution” post might affect his or her reputation?

                          If this forum had a special area, call it scripting-n-programming or, heck, call it DumbQuestions and we could post anonymous our name and avatar blanked, would that help to increase participation? Instead of waiting for that possibility, I’ll suggest shy posters can go find a bigger pond and freely swim as just yet another voice on the internet. Suggesting that because it Works For Me ™ asking at multiple forums depending on the topic, with different usernames and without worrying about karma points and reputation.

                          bunsenlabs forum » Scripts, Tutorials & Tips https://forums.bunsenlabs.org/viewforum.php?id=9
                          archlinux forum » Community Contributions https://bbs.archlinux.org/viewforum.php?id=27
                          archlinux forum » Programming and Scripting https://bbs.archlinux.org/viewforum.php?id=33
                          Forum : Shell Programming and Scripting https://www.unix.com/shell-programming-and-scripting/
                          Forum : Programming https://www.unix.com/programming/
                          LinuxQuestions.org > Forums > Programming https://www.linuxquestions.org/questions/programming-9/
                          https://python-forum.io/
                          https://www.reddit.com/r/learnpython/

                          On the flip side, when pitching in to answer posted questions, each time you or I can worry about seeming like a wannabe knowitall, and most of the time there’s like 6 “right” answers to a linux howto question. With each trying to help post, we can expect that someone else might undercut ? upstage ? contradict our post by posting a “more correct” or more efficient solution. So I’m agreeing, no worries, and am admitting the worries are real, actual, just need to get past them so we can all win.

                          #10410
                          Moderator
                          BobC
                            Helpful
                            Up
                            0
                            ::

                            Thanks for the links and comments. I will look tonight (I work during the day).

                            Is there anyone that plans to run the code from this thread? If there are people that are going to actually run my code, I’ll do a cleanup round to try to incorporate 736’s suggestions. It will take time, but I don’t mind doing it if there are people that are going to use it. His suggestions are valid, I think, and like I’ve said, I don’t pretend to know things, but can learn or at least try.

                            #10417
                            Forum Admin
                            Dave
                              Helpful
                              Up
                              0
                              ::

                              Is there anyone that plans to run the code from this thread?

                              Probably, or at least parts of it. It is probably best to do the changes for learning so the next project becomes easier.

                              I have written a bunch of things. Some more popular than others and some that may not have been used by multiple people. I cannot say that any of them were a huge waste of time as they all helped to building or updating the next one.

                              Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                              #10515
                              Moderator
                              BobC
                                Helpful
                                Up
                                0
                                ::

                                Its all done and tested. Its quite nice I think.

                                I will post a zipfile in the morning. Very tired tonight. The most difficult part was the rss feeds.

                                #10516
                                Moderator
                                BobC
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Ok, its a .tgz. Hopefully that will be ok.

                                  Nope, the website doesn’t allow that. Now I have to try to figure out how to make a zip file out of a .tgz

                                  MC doesn’t want to do it and neither does spacefm. Oh well, you have to rename it back to .tgz.

                                  If someone could tell me an easy way to create a .zip that do everything correctly, that would be nice. I seem to always need to reinvent wheels, LOL, and that’s sad.

                                  If anyone tries it, please provide feedback

                                  • This reply was modified 4 years, 11 months ago by BobC.
                                  • This reply was modified 4 years, 11 months ago by BobC.
                                Viewing 15 posts - 31 through 45 (of 49 total)
                                • You must be logged in to reply to this topic.