Updated red color, updated installer, fixed time based color.

This commit is contained in:
koffeejava
2026-03-12 23:09:13 -06:00
parent 89050146c5
commit 09526f25a5
3 changed files with 54 additions and 12 deletions

View File

@@ -1,5 +1,3 @@
def icon(id) def icon(id)
gray = "\e[38;5;241m" gray = "\e[38;5;241m"
@@ -8,12 +6,20 @@ def icon(id)
reset = "\e[0m" reset = "\e[0m"
bold = "\033[1m" bold = "\033[1m"
time = (Time.local.hour.to_s + Time.local.minute.to_s).to_i if Time.local.minute < 10
time = (Time.local.hour.to_s + 0.to_s + Time.local.minute.to_s).to_i
if time > 1200 if time > 1200
orange = "\e[38;5;235m" orange = "\e[38;5;235m"
else else
orange = "\e[38;5;214m" orange = "\e[38;5;214m"
end
elsif Time.local.minute >= 10
time = (Time.local.hour.to_s + Time.local.minute.to_s).to_i
if time > 1200
orange = "\e[38;5;235m"
else
orange = "\e[38;5;214m"
end
end end
if id == 1000 if id == 1000

View File

@@ -1,15 +1,51 @@
orange = "\e[38;5;214m" orange = "\e[38;5;214m"
red = "\e[38;5;52m" red = "\e[0;31m"
bold = "\033[1m" bold = "\033[1m"
reset = "\e[0m" reset = "\e[0m"
if Process.uid != 0 lib C
fun getuid : UInt32
end
if C.getuid != 0
puts "#{red}#{bold}You must be in root to install wfetch!#{reset}" puts "#{red}#{bold}You must be in root to install wfetch!#{reset}"
exit(0) exit(0)
end end
sudo_user = ENV["SUDO_USER"]?
home = "/home/#{sudo_user}"
puts "#{orange}#{bold}wfetch installer 0.1.0#{reset}" puts "#{orange}#{bold}wfetch installer 0.1.0#{reset}"
File.copy("data/wfetch", "/usr/bin/wfetch") File.copy("data/wfetch", "/usr/bin/wfetch")
puts "Finished" puts "#{orange}#{bold}Finished installing! Let's setup.#{reset}"
puts "Please enter your WeatherApi key (Learn to get one at README.md):"
api = gets
puts "Please enter the (closest) city you live in: "
city = gets
puts "#{orange}#{bold}Config setup finished. Starting disp setup.#{reset}"
File.write("/home/#{sudo_user}/.local/share/Wfetch/config.toml", "api = \"#{api}\"
city = \"#{city}\"")
puts "#{orange}#{bold}Would you like customary (1), metric (2), or both (3)?#{reset}"
choice = gets
if choice == "1"
File.copy("data/1.toml", "/home/#{sudo_user}/.local/share/Wfetch/disp.toml")
elsif choice == "2"
File.copy("data/2.toml", "/home/#{sudo_user}/.local/share/Wfetch/disp.toml")
elsif choice == "3"
File.copy("data/3.toml", "/home/#{sudo_user}/.local/share/Wfetch/disp.toml")
else
File.copy("data/1.toml", "/home/#{sudo_user}/.local/share/Wfetch/disp.toml")
end
puts "#{orange}#{bold}Install finnished. Enjoy!#{reset}"

View File

@@ -7,7 +7,7 @@ require "option_parser"
module Wfetch module Wfetch
VERSION = "0.1.0" VERSION = "0.1.0"
orange = "\e[38;5;214m" orange = "\e[38;5;214m"
red = "\e[38;5;52m" red = "\e[0;31m"
bold = "\033[1m" bold = "\033[1m"
reset = "\e[0m" reset = "\e[0m"