Command result desklet

UUID: commandResult@ZimiZones
Last edited:
2 months ago 2020-04-28, 19:30 UTC
Last commit: [0103684a] commandResult@ZimiZones: Fix font selection

A desklet that displays command result.

Log In To Comment!

18 Comments

DarkOwl2
DarkOwl2-1 week 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 week 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-2 months ago
Just updated the desklet enabling now to edit the text alignement in settings.
ZimiZones
ZimiZones-2 months ago
And now font selection should work
Peter
Peter-2 months 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-2 months 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-2 months 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-2 months 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-2 months 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-2 months 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-2 months 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-3 months ago
Style settings added!
Peter
Peter-2 months 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-2 months ago
See my comment above, and the cow will be fine!
Peter
Peter-3 months 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-3 months ago
Will see if I can do that soon ;)
peter-urban
peter-urban-3 months 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-3 months 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