class Exfetch::CLI

Defined in:

exfetch/cli.cr

Constant Summary

ASCII_ART = begin art = {} of String => Array(String) ascii_dir = File.join("/srv/crystaldoc.info/codeberg-org-izder456-exfetch-1.3.2/src/exfetch", "ascii") (Dir.glob(File.join(ascii_dir, "*.ascii"))).each do |path| key = File.basename(path, ".ascii") art[key] = File.read_lines(path) end art rescue {"Tear" => [" , ", " / \\ ", " / \\ ", "| |", " \\___/ "]} end
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) #