• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Unix Fortune

Scheduled Pinned Locked Moved Requests
6 Posts 4 Posters 921 Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    spblat
    last edited by Sep 23, 2020, 8:59 PM

    We already have the awesome MMM-Fortune module. Are you aware there’s a “fortune” command in unix/linux? You can install it in your pi like so:

    sudo apt install fortune
    

    It was intended to present a little epigram every time you log in to a terminal, but it can also be invoked at the command line.
    Screen Shot 2020-09-23 at 1.47.19 PM.png
    I’d be inclined to replace the “Compliments” module with a module that pulls a short unix fortune using this command, updating on a configurable interval.

    Any takers? :-)

    1 Reply Last reply Reply Quote 0
    • M Offline
      Mykle1 Project Sponsor Module Developer
      last edited by Mykle1 Sep 26, 2020, 2:12 AM Sep 26, 2020, 2:11 AM

      @spblat said in Unix Fortune:

      We already have the awesome MMM-Fortune module.

      Thank you for your kind words

      Are you aware there’s a “fortune” command in unix/linux?

      I was not.

      a module that pulls a short unix fortune using this command, updating on a configurable interval

      I put something together for you based on your request (and your kind words). User @sdetweil got the data over from the terminal to the module for me. (He’s awesome).

      I took the liberty of naming it something unique. UnixFortune wasn’t doing it for me. FortuneUnix was no better but the combination was cool. At least, I think so.

      https://github.com/mykle1/MMM-Fortunix

      Pass along some help to someone that knows less than you

      Create a working config
      How to add modules

      1 Reply Last reply Reply Quote 0
      • S Offline
        spblat
        last edited by spblat Sep 27, 2020, 4:55 PM Sep 27, 2020, 4:53 PM

        Epic! I’ll start playing with this. During my tests I will experiment with the “-s” and “-n” command line flags for adjusting fortune length and propose/submit updates. Thank you for putting this together!

        M C 2 Replies Last reply Sep 28, 2020, 12:06 AM Reply Quote 1
        • M Offline
          Mykle1 Project Sponsor Module Developer @spblat
          last edited by Sep 28, 2020, 12:06 AM

          @spblat said in Unix Fortune:

          Thank you for putting this together!

          Not a big deal. I was looking for something to play with. However, you are welcome. Enjoy the module.

          Peace!

          Create a working config
          How to add modules

          1 Reply Last reply Reply Quote 1
          • C Offline
            cowboysdude Module Developer @spblat
            last edited by Sep 28, 2020, 1:04 AM

            @spblat said in Unix Fortune:

            Epic! I’ll start playing with this. During my tests I will experiment with the “-s” and “-n” command line flags for adjusting fortune length and propose/submit updates. Thank you for putting this together!

            You can just fork the module and do anything you want with it :)

            1 Reply Last reply Reply Quote 0
            • D Offline
              dakarx
              last edited by dakarx Oct 21, 2020, 6:44 PM Oct 21, 2020, 6:43 PM

              @Mykle1

              I found a small bug that causes some issues, at least when running on armbian and starting up via cron . It might be that ‘stock’ armbian isn’t properly setting up the $PATH as X starts. I tested against rasbian and this issue does not appear, and the ‘fix’ to add the full path to fortune (which really should always be done).

              node_helper.js (line 20)

              • exec(‘fortune -s’, (error, stdout, stderr) => {
              • exec(‘/usr/games/fortune -s’, (error, stdout, stderr) => {
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy