To circumvent the problem, ", Countryname" is blanked out on the screen with this code: # Depending on length of your city name and country name you will: Worse yet when terminal is set for default 80 characters wide: When terminal is set for 92 characters wide, the weather displays as "Edmonton, Canada." which is too long for my liking: Airport letters are supported such as YEG for Edmonton. Unicode is supported for city names like /Москва (Moscow). You'll want to modify this section of code and change Edmonton to your city name: # Replace Edmonton with your city name, GPS, etc. In your terminal use: curl wttr.in/:help for additional details. Weather is provided by the curl wttr.in/cityname?0 command. Otherwise the time will be displayed in "normal" font. Tput cuf $TimeColumn # Move 49 columns rightįor the fancy time display you need to install toilet: sudo apt install toiletįor another fancy time display (but not quite as fancy) install figlet: sudo apt install figlet Toilet -f future -filter border > /tmp/terminalĮcho $(date +"%I:%M %P") | figlet > /tmp/terminal # See if today is on current line & invert background # Prefix with space when length 2 ]] then #tput cuf $DateColumn # Position to column 27 for date display Printf " " # Blank out ", country" with x spaces Change subtraction value and set number of print spaces to match # Depending on length of your city name and country name you will: # calendar current month with today highlighted. Increase for slow connection-^Įcho " " # Pad with blank lines for calendar & time to fit See: curl wttr.in/:helpĬurl wttr.in/Edmonton?0 -silent -max-time 3 # Replace Edmonton with your city name, GPS, etc. # Current weather, already in color so no need to override TimeColumn=61 # Default is 49 for " " " " 61 " " " " # for i in $" doneĭateColumn=34 # Default is 27 for 80 character line, 34 for 92 character line # NOTE: To display all available toilet fonts use this one-liner: # CALL: Called from terminal or ~/.bashrc # DESC: Display current weather, calendar and time A good time to spend the long-weekend inside playing the newly arrived Tomb Raider 2013! Maybe brush up on that Resume to move to Vancouver or Montreal. Yes it really is -14 in Edmonton and feels like -23. The heavy lifting is the splash component that shows this: $ now Check the Ask Ubuntu link above for comments and possibly new answers from other users.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |