Giter Site home page Giter Site logo

Comments (14)

JessW avatar JessW commented on July 21, 2024

You're right, @Ilis , I will take a look, thank you!

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 21, 2024

I found out that quotes extracted from file by counting delimiters and parsing it.

Maybe it's easier and better to call fortune with file name as a parameter?

from cinnamon-spices-desklets.

JessW avatar JessW commented on July 21, 2024

Yes, that's how it works now, it's not very neat. That sounds like a great suggestion. Doing it that way would also solve the problem of the scary red exclamation mark that is displayed for this desklet in the Desklets window, because it currently reads the file with get_file_contents_utf8_sync. I will give it a try as soon as I get a chance.

I think I initially wanted to allow for a different separator than '%', but that is perhaps not necessary (and currently not implemented).

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 21, 2024

Well, I tried to use my own file, copied from fortune package and edited to fix some typos, but get error message:

ilis@deore ~ $ fortune ~/mygen 
fortune:/home/ilis/mygen not a fortune file or directory
fortune:/home/ilis/mygen not a fortune file or directory
No fortunes found

But I found that file must be prepared:

ilis@deore ~ $ strfile mygen mygen.dat
"mygen.dat" created
There were 109 strings
Longest string: 666 bytes
Shortest string: 75 bytes

Then it works:

ilis@deore ~ $ fortune ~/mygen 
Клевета равнодушна к ничтожествам.
		— О. Бальзак

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 21, 2024

By the way, strfile has option to change delimiter character :)

from cinnamon-spices-desklets.

JessW avatar JessW commented on July 21, 2024

from cinnamon-spices-desklets.

JessW avatar JessW commented on July 21, 2024

Hi @Ilis ! I submitted a fix for this issue that uses your idea of just calling fortune (thank you!) a couple of days ago. When you get a chance, could you see if it solves your issue? You should just be able to update the desklet the regular way, through the Desklets dialog. Thanks!

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 21, 2024

Well, @JessW !

Great job!

I clicked desklet 500 times and got fortune with “%” sign :) So, call to fortune works. One more thing is to check fortune installed when desklet start. I. e. check error code for fortune -v. If not zero, then warn user about to install appropriate packages (program and localized fortunes).

And maybe some instructions for using fortunes in user language and custom file?

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 21, 2024

I've just noticed the number of fortune variants become much more. I saw a lot of fortunes from the same file I didn't seen before. Maybe it was a bug of previous version, or maybe I was unlucky :)

from cinnamon-spices-desklets.

JessW avatar JessW commented on July 21, 2024

I'm glad to hear it works for you too! It did cross my mind to check if fortune is installed, but then I thought since it's installed by default I wouldn't check. But maybe that isn't even true for some localizations, and I think you are right, it would just be a better practice to check if it's installed, so I will add it.

Yes! I have been meaning to add instructions for installing additional fortune-* packages for other languages.

I do have some instructions for custom files in the readme, do you think they are insufficient? I added info about strfile with this latest update.

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 21, 2024

Hi, @JessW

I do have some instructions for custom files in the readme, do you think they are insufficient? I added info about strfile with this latest update.

Yes, I did see it after I wrote my comment :)

Fortune game can show fortunes from set of files or even all files from given directory. Desklet can show fortunes only from one file, and fortunes becomes a bit annoying. So, my suggestion is give instruction about how to get fortunes from many files. Something like this:

If you want to make your own set of fortunes, copy your favourite fortunes (i. e. literature, love and humour) from /usr/share/games/fortunes to home directory, then open terminal and execute following command:

cat literature love humour > myfortunes && strfile myfortunes

This will create files myfortunes and myfortunes.dat in your home directory. Then go to desklet settings and choose file myfortunes from home directory.

My English is ugly, sorry :)

And all above assumes that somebody read readme and instructions in common :)

from cinnamon-spices-desklets.

JessW avatar JessW commented on July 21, 2024

I do remember you mentioning earlier that allowing multiple input files would be a nice feature, @Ilis :) I like your instructions, I will work them in to the readme in the next update. Your English is very understandable, really!

from cinnamon-spices-desklets.

Ilis avatar Ilis commented on July 21, 2024

Formally, this issue is closed, bug doesn't exists now. I have button “Close and comment“, but I'm not sure about who should close the issue: issue starter, desklet author, repository owner or whoever?

from cinnamon-spices-desklets.

JessW avatar JessW commented on July 21, 2024

I don't have the button, I think you can close it, or tag one of the repo owners?

from cinnamon-spices-desklets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.