Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update_Wheather #92

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/color
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
#!/usr/bin/env bash

# TODO (Run this script as): color magenta && echo hello && color reset

#The sequence \033[35m sets the color to magenta
#and the sequence \033[0m resets the color to default
echo -ne "\033[35mhello\033[0m"
color() {
echo -ne "\033[$1;$2m"
}

declare -A color_mapping=(
# TODO: Add more color values
# Refer bash color codes
['black']=30
['red']=31
['green']=32
['yellow']=33
['blue']=34
['magenta']=35
['white']=37

)

if [[ $1 == 'reset' ]]; then
Expand Down
6 changes: 6 additions & 0 deletions scripts/weather
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@

# TODO: Display weather of IIIT, Lucknow
# For more information see: https://wttr.in/:help
location="$1"
if [[ -z "$location" ]]; then
echo "Usage: $0 <location>"
exit 1
fi
curl -s wttr.in/"$location" | tr -d '\r'
9 changes: 9 additions & 0 deletions scripts/wifi-ssid
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@

# Extract the wifi username (SSID)
# Refer: "iw dev wlan0 link" command output for this

ssid=$(iw dev wlan0 link | grep "ssid" | awk '{print $2}')

if [[ -z "$ssid" ]]; then
echo "Could not find SSID"
exit 1
fi

echo "Your WiFi username (SSID): $ssid"