Comments (14)
You're right, @Ilis , I will take a look, thank you!
from cinnamon-spices-desklets.
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.
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.
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.
By the way, strfile
has option to change delimiter character :)
from cinnamon-spices-desklets.
from cinnamon-spices-desklets.
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.
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.
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.
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.
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.
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.
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.
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)
- [email protected] [@slgobinath] - Google Calendar not displaying on desktop HOT 3
- quoteOfTheDay@tinnu: Have an option to make the quote in a fixed size
- hostcheck@schorschii causes stutter HOT 11
- Desklet Bug HOT 2
- yarr@jtoberling: Stuck at "Loading: feeds", desklet blank as of latest Cinnamon version (6.0.4) on LMDE 6 HOT 3
- Erroneous reporting of failing connection HOT 8
- [email protected]: Feature Request HOT 124
- binaryclock2@euxneks - Desklet Feature Request For Vertical Pips
- [email protected]: Feature Request Open-Meteo API HOT 2
- clock@schorschii: Label not showing up HOT 5
- TimeAndDate@nightflame Feature Request: time and date on one line HOT 2
- hostcheck@schorschii: Accumulation ping process HOT 2
- clock@schorschii: Feature Request HOT 5
- Desklet Bug: Yahoo Finance Quotes disappeared after shutdown HOT 6
- Yahoo Finance Quotes - setting personal font size HOT 4
- Yahoo Finance Quotes - setting stock's purchase values HOT 1
- hostcheck@schorschii
- simple-system-monitor@ariel: curious default width in Cinnamon 5.8+ HOT 4
- Feature Request: battery@schorschii HOT 1
- calendar@deeppradhan : translation problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cinnamon-spices-desklets.