refac(prog/xmonad/xmobar): improve cbr script

This commit is contained in:
Dmitriy Pleshevskiy 2022-05-28 13:03:58 +03:00
parent 95a5803b5f
commit df15f52456
2 changed files with 4 additions and 6 deletions

View file

@ -14,12 +14,15 @@ cc=($(curl --no-progress-meter "https://www.cbr.ru/scripts/XML_dynamic.asp?date_
sed -e "s/,/./g")) sed -e "s/,/./g"))
diff=$(echo ${cc[-2]} ${cc[-1]} | awk '{ print $1 - $2 }') diff=$(echo ${cc[-2]} ${cc[-1]} | awk '{ print $1 - $2 }')
arror="↑"
color='#50fa7b' color='#50fa7b'
if [ ${diff:0:1} == '-' ]; then if [ ${diff:0:1} == '-' ]; then
diff=${diff:1}
arror="↓"
color='#ff5555' color='#ff5555'
fi fi
echo "${cc[-1]} (<fc=${color}>$diff</fc>)" echo "${cc[-1]} (<fc=${color}>${arror}<hspace=3/>${diff}</fc>)"
exit 0 exit 0

View file

@ -104,11 +104,6 @@ colorGreen = "#50fa7b"
colorYellow = "#f1fa8c" colorYellow = "#f1fa8c"
colorCyan = "#8be9fd" colorCyan = "#8be9fd"
cyan, green, yellow :: String -> String
cyan = xmobarColor colorCyan ""
green = xmobarColor colorGreen ""
yellow = xmobarColor colorYellow ""
regularFont, boldFont :: Int -> String regularFont, boldFont :: Int -> String
regularFont size = "xft:Fira Code:size=" <> show size <> ":antialias=true" regularFont size = "xft:Fira Code:size=" <> show size <> ":antialias=true"
boldFont size = "xft:Fira Code:bold:size=" <> show size <> ":antialias=true" boldFont size = "xft:Fira Code:bold:size=" <> show size <> ":antialias=true"