macchina icon indicating copy to clipboard operation
macchina copied to clipboard

Custom informations

Open eoli3n opened this issue 3 years ago • 9 comments

I would like to be able to wrap some custom commands to display information I chose. Like

# Show available upgrade in Voidlinux
custom_info:
  - name: XBPS
    command: xbps-query -Mnu | wc -l

I would use your fetcher on remote hosts, and run it at each login to get some useful informations, and display it prettily.

eoli3n avatar Jun 16 '21 20:06 eoli3n

Oh, lovely idea.

Although this could be used in an improper way and may slow the program down, it's entirely dependent on the use case and the user probably knows this as well.

I can't promise this'll come out any time soon, though, because I'm not able to gauge how much time is required to deliver such a feature. And, it's not exactly top priority as there are bugs within the program I need to hunt and fix.

grtcdr avatar Jun 16 '21 20:06 grtcdr

Yep, it's a bit hacking your tool, but I think this ability would please many users and open to different use cases. Thanks for your anwser ;)

eoli3n avatar Jun 16 '21 20:06 eoli3n

but I think this ability would please many users and open to different use cases.

Yeah I can see how helpful this might be to someone who may want to fetch something like their public IP or packages that need to upgraded like you mentioned.

grtcdr avatar Jun 16 '21 20:06 grtcdr

Hey :smiley: I'm back,

I'm thinking we do this in a separate file, specifically a JSON file.

I'm not sure how I'd be able to do this using JSON.

grtcdr avatar Jun 27 '21 19:06 grtcdr

I would prefer YAML, if a human edit this manually. JSON is better to transfer data and not really human readable.

eoli3n avatar Jun 27 '21 19:06 eoli3n

anything about this one ?

eoli3n avatar Dec 12 '21 10:12 eoli3n

I haven't had the chance to work on this, but I did mess around with a few implementations (nothing serious, though). Something like this would require the codebase to be refactored in a way that allows custom readouts to be merged with the built-in ones.

grtcdr avatar Dec 12 '21 10:12 grtcdr

For a basic implementation, you could maybe do something like this, and reserve custom_XX keys for custom user data.

[keys]
host            = "Host"
kernel          = "Kernel"
custom_01       = "Some Title"

[custom_01]
command         = "xbps-query -Mnu | wc -l"
if_empty        = "No data to show"
show_if_empty   = true

ghost avatar Jul 29 '22 18:07 ghost

Hey @0x199x,

That's one fine way we could go about it, but I unfortunately don't have the time to work on this - I just have too much going on at the moment, as my focus has been slowly shifting towards working on entirely different personal projects.

I'm open to accepting a PR that extends macchina with this feature, whilst simultaneously considering its integration with user-created themes.

grtcdr avatar Aug 02 '22 11:08 grtcdr