Command result desklet

UUID: commandResult@ZimiZones
Last edited:
5 months ago 2021-02-06, 10:15
Last commit: [09a694ff] All desklets: Icon relocation & minor fixes (#602)

A desklet that displays command result.

Log In To Comment!

21 Comments

Gustavo Santos
Gustavo Santos-3 months ago
Hi, I've found this desklet very useful! I have also made some changes in my local copy. Here is a suggestion: 1) changing the time factor to seconds, instead of minutes: this.updateId = Mainloop.timeout_add_seconds(this.delay * 1, Lang.bind(this, this._update)); 2) commenting this line, so the update runs more smoothly: //command.labels.result.set_text("Loading..."); So setting the interval to 1 second (and also using a lot of emojis) here is the final result: https://i.postimg.cc/6TsVqvCq/Peek-2021-04-15-23-43.gif
Nik
Nik-6 months ago
Darn.. I was REALLY hoping to use this to display the ascii-weather output from "wttr.in", But it doesn't seem to be capable of displaying the special characters that uses.. Is there any way to make that work? Cause that'd look incredible with the theme I'm trying to setup.. ;)
cptSmok
cptSmok-6 months ago
I like this desklet very much but is it possible to update commands in seconds? In 2010 I still use a MacBook Pro with GeekTool and there this was possible. Maybe it could be an inspiration. Also shadows in fonts would be nice. Another thing I noticed is that the desklet flickers when it updates. An update would be mega cool :-)
DarkOwl2
DarkOwl2-1 year ago
For users, here's a command line which displays the current version of your OS: grep 'PRETTY_NAME="' /etc/os-release | sed 's/PRETTY_NAME="//' | sed 's/"//' Hint: the label field in the Command Result Desklet settings can be blank!
DarkOwl2
DarkOwl2-1 year ago
Hi, new to Linux and wanted to float the Linux version onto my desktop - got pointed here. Love this desklet (but wouldn't have been so keen without font options). Problem with the font selection box though - I have installed the formintelegance.ttf font, and selected it in Command result desklet, but the font appears to be replaced with something else. Is the desklet perhaps unable to use .ttf? Minor niggle: why is this "Command result desklet" not "Command Result Desklet"? Is it not customary to use initial capitals in titles?
ZimiZones
ZimiZones-1 year ago
Just updated the desklet enabling now to edit the text alignement in settings.
ZimiZones
ZimiZones-1 year ago
And now font selection should work
Peter
Peter-1 year ago
The cow is alive! Thanks a lot! Finally I am able to have an ascii style cow to tell me things on my desktop :-) [ cowsay $(fortune) or cowsay $(date +"%A %B %d, %I:%M %p") ] I still noticed a small bug though ;-) When selecting a regular mono font everything works fine. But when selecting a bold mono font, the font is not monospaced anymore (e.g. Noto Mono Bold)
Fromax
Fromax-1 year ago
Nice desklet! But the font-option doesn't seem to work: I had to "hack" the stylesheet at `~/.local/share/cinnamon/desklets/commandResult@ZimiZones/4.0/stylesheet.css` to get a monospaced font. I also changed the `text-align` property, as I prefer left-aligned text (I don't use the label option). Would be nice to be able to choose that from the UI...
Peter
Peter-1 year ago
Hi Fromax, thanks a lot for the tip. Unfortunately, I can't get it to work. Could you post your stylesheet.css? My css is a little bit rusty... Cheers
Fromax
Fromax-1 year ago
Hi Peter, Here it is. You may want to change font, font-size , etc. to your liking: .command-result-result-label-container { text-align: left; font-family: 'Noto Sans Mono'; font-size: 11px; }
Fromax
Fromax-1 year ago
Be aware that the stylesheet will be overwritten by the desklet's default stylesheet after every update. So keep a backup! Here's a picture showing the result of my setup. It's only one script, about 45 lines long. https://imgur.com/vpc0pYS
Peter
Peter-1 year ago
Hi Fromax, thanks for posting! I was just about to try it when the app was updated. It now works without the Hack.
ZimiZones
ZimiZones-1 year ago
Thanks for your feedback! It looks like font family property doesn't work as I thought.. It seem you can't change it dynamically through JS.. So I don't know how to solve that... But I can still add a property to edit the text-align property
ZimiZones
ZimiZones-1 year ago
Style settings added!
Peter
Peter-1 year ago
I better understand the problem now: The mono spaced fonts don't seem to be mono spaced. Do you have an idea what could cause this problem?
Fromax
Fromax-1 year ago
See my comment above, and the cow will be fine!
Peter
Peter-1 year ago
Thanks a lot! I love it! (Also the new option for command time outs) This is just if you have time: I wanted a cow to tell me the current time on my desktop. So I tried this as a command: cowsay $(date +"%A %B %d, %I:%M %p") ... Don't try it! It will kill the cow! ... Is it possible to add an option to preserve the formatting of the command output? (seems like the desklet automatically deletes white spaces)
ZimiZones
ZimiZones-1 year ago
Will see if I can do that soon ;)
peter-urban
peter-urban-1 year ago
I really like the idea and it works fine so far. Some theming options would be nice. e.g. Transperancy, backgroundcolor, maybe font/font color For me the background is gray (like my mint menu) with no transparency. And that does not really fit. Thanks for sharing!
Hyperion
Hyperion-1 year ago
Nice desklet! I just had to adjust the default hostname -I as it displays awfully long IPv6 addresses. May I suggest a background transparency slider? The background seems to be completely gone on my Cinnamon 4.4.8