Command result desklet

UUID: commandResult@ZimiZones
Last edited:
6 days ago 2024-04-18, 08:01
Last commit: [0690b629] commandResult@ZimiZones: Add Dutch translation (#1112)

A desklet that displays command result.

Log In To Comment!

26 Comments

Jopp-gh
Jopp-gh-5 days ago
Excellent Desklet. But a key feature is missing: multiple instances. commands don't run all in exact same intervals. Example, cpu load or download speed need a relative high refresh rate. But a refresh rate of 1 second for disk / ram size is just useless and overkill. Also I don't like to put all my snippets in one, monolithic instance as most pc screens are wider than higher, so stacked queries don't have much space or you get very tiny fonts, hard and awkward to read. Previously I was able to add multiple instances by adding "max-instances": "10" to metadata.json. With the update from yesterday night (2024-04-19) multiple instances have been broken. Now you can't edit multiple instances anymore, even if you add "max-instances": "10" to metadata.json. Wasted potential! If Mint did some changes and not this desklet, please add multiple instances to this desklet by default, please.
clriis
clriis-1 month ago
SUGGESTION: It would be great to have access to colour coded output like this: https://i.stack.imgur.com/LemTa.png That way I can check the availability of remote nodes and get a return value of the IP coloured in green for available or red for fail
clriis
clriis-1 month ago
The absolute no. 1 Desklet. Versatile and sleek, with a huge potential. Here is a couple of commands for inspiration: SSID: iwgetid -r External IP: dig +short myip.opendns.com @resolver1.opendns.com Free Disk Space (GB & %): inxi -p | awk 'NR==2' | awk '{ printf "%d GB (%.0f%%)\n", $4-$7, ($4-$7)/$4*100 }' Free Memory (GB & %): free -k | awk 'NR==2' | awk '{ printf "%.2f GB (%.2f%%)\n", $7/1024/1024, $7/$2*100 }' Free Swap (GB & %): free -k | awk 'NR==3' | awk '{ printf "%.1f GB (%.0f%%)\n", $4/1024/1024, $4/$2*100 }' The scope is endless...
montedison
montedison-6 months ago
Could we use commands that get refreshed like intel_gpu_top or gotop?
phoenix-d-ace
phoenix-d-ace-2 years ago
Excellent desklet, congratulations. I would like to suggest the possibility of adding other instances with ADD button (I would use cowsay for example elsewhere on the desktop). Thanks.
Gustavo Santos
Gustavo Santos-3 years 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-3 years 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-3 years 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-3 years 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-3 years 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-4 years ago
Just updated the desklet enabling now to edit the text alignement in settings.
ZimiZones
ZimiZones-3 years ago
And now font selection should work
Peter
Peter-3 years 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-4 years 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-4 years 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-4 years 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-4 years 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-3 years 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-4 years 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-4 years ago
Style settings added!
Peter
Peter-4 years 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-4 years ago
See my comment above, and the cow will be fine!
Peter
Peter-4 years 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-4 years ago
Will see if I can do that soon ;)
peter-urban
peter-urban-4 years 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-4 years 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