class Exfetch::CLI

Defined in:

exfetch/cli.cr

Constant Summary

ASCII_ART = begin ascii = {} of String => Array(String) {% for name in ASCII_FILE_NAMES %} {% key = name.stringify[1..-2].gsub(/\.ascii$/, "") %} ascii[{{ key }}] = ASCIIBlob.get("{{ name.id }}").gets_to_end.lines {% end %} ascii rescue {"Tear" => [" , ", " / \\ ", " / \\ ", "| |", " \\___/ "]} end
ASCII_FILE_NAMES = [] of String
INFOS = [Info.new(:user, "\uF183", "USER", -> do "#{Resource.get_user}@#{Resource.get_host}" end), Info.new(:os, "\uE23A", "OS", -> do Resource.get_platform end), Info.new(:ver, "\uF02B", "VER", -> do Resource.get_release end), Info.new(:dewm, "\uF2D2", "DE/WM", -> do Resource.get_session end), Info.new(:term, "\uF120", "TERM", -> do Resource.get_terminal end), Info.new(:shell, "\uF155", "SHELL", -> do Resource.get_shell end), Info.new(:cpu, "\uEE9C", "CPU", -> do Resource.get_cpu end), Info.new(:load, "\uF0F4", "LOAD", -> do Resource.get_load_avg end), Info.new(:swap, "\uF0A0", "SWAP", -> do "#{Resource.get_swap_usage} / #{Resource.get_swap} MiB" end), Info.new(:mem, "\uEFC5", "MEM", -> do "#{Resource.get_memory_usage} / #{Resource.get_memory} MiB" end)]
NERD_ICONS = INFOS.each_with_object({} of Symbol => String) do |info, hash| hash[info.symbol] = info.nerd_icon end
SYMBOLS = INFOS.map(&.symbol)
TEXT_LABELS = INFOS.each_with_object({} of Symbol => String) do |info, hash| hash[info.symbol] = info.text_label end

Class Method Summary

Class Method Detail

def self.run(options : Options) #