-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Don't do this at home * one more * errors now display * local usage and production * error file * trying more methods * Source method * source display * source help * Weather command * bump version 0.0.4 * usd-ars pair * paths * postinst * bump to 0.0.5
- Loading branch information
1 parent
ebd2293
commit d5cfc34
Showing
9 changed files
with
100 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Package: dbn-tools | ||
Version: 0.0.4 | ||
Version: 0.0.5 | ||
Section: utils | ||
Priority: optional | ||
Architecture: all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
export menu_options_spanish=("1) Analizar uso del disco" "2) Eliminar archivos temporales" "3) Vaciar la papelera de reciclaje" "4) Desinstalar programa" "5) Información del sistema" "6) Uso de memoria" "7) Tiempo de actividad del sistema" "8) Puertos abiertos" "9) Clima actual" "10) Buscar archivo" "11) Salir") | ||
export menu_options_spanish=( | ||
"1) Analizar uso del disco" | ||
"2) Eliminar archivos temporales" | ||
"3) Vaciar la papelera de reciclaje" | ||
"4) Desinstalar programa" | ||
"5) Información del sistema" | ||
"6) Uso de memoria" | ||
"7) Tiempo de actividad del sistema" | ||
"8) Puertos abiertos" | ||
"9) Clima actual" | ||
"10) Buscar archivo" | ||
"11) Dolar a pesos" | ||
"12) Salir" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
export menu_options=("1) Analyze disk usage" "2) Delete temporary files" "3) Empty recycle bin" "4) Uninstall program" "5) System information" "6) Memory usage" "7) System uptime" "8) Open ports" "9) Get current weather" "10) Search for a file" "11) Exit") | ||
export menu_options=( | ||
"1) Analyze disk usage" | ||
"2) Delete temporary files" | ||
"3) Empty recycle bin" | ||
"4) Uninstall program" | ||
"5) System information" | ||
"6) Memory usage" | ||
"7) System uptime" | ||
"8) Open ports" | ||
"9) Get current weather" | ||
"10) Search for a file" | ||
"11) USD-ARS Pair" | ||
"12) Exit" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,18 @@ | ||
#!bin/bash | ||
|
||
function ReadPrompt() { | ||
# Order is based on usr/bin/constants/menu.sh file, if you are going to edit something from here, edit it there too | ||
options=(DiskUsage DeleteTemporary EmptyRecycleBin UninstallPackage SystemInfo MemoryUsage Uptime OpenPorts GetWeather FindFile "usr/bin/functions/usd-ars.py" exit) | ||
|
||
# Read the user's option | ||
read -p "$prompt" option | ||
|
||
# Perform the action corresponding to the chosen option | ||
case $option in | ||
1) | ||
|
||
DiskUsage | ||
;; | ||
2) | ||
|
||
DeleteTemporary | ||
;; | ||
3) | ||
|
||
EmptyRecycleBin | ||
;; | ||
4) | ||
|
||
UninstallPackage | ||
;; | ||
5) | ||
|
||
SystemInfo | ||
;; | ||
6) | ||
|
||
MemoryUsage | ||
;; | ||
7) | ||
|
||
Uptime | ||
;; | ||
8) | ||
|
||
OpenPorts | ||
;; | ||
9) | ||
|
||
GetWeather | ||
;; | ||
10) | ||
|
||
FindFile | ||
;; | ||
11) | ||
|
||
# Exit the application | ||
exit | ||
;; | ||
*) | ||
|
||
# Invalid argument | ||
if [[ $option -le ${#options[@]} && $option -gt 0 ]]; then | ||
${options[$option-1]} | ||
else | ||
echo "Invalid option" | ||
;; | ||
esac | ||
fi | ||
} | ||
|
||
export -f ReadPrompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Imports | ||
import requests | ||
|
||
# Constants | ||
arrData = [] | ||
dolarAPI = "https://api.bluelytics.com.ar/v2/latest" | ||
sackEmoji = "💰 " | ||
arsLabel = " ARS" | ||
|
||
# Get data from the api | ||
def getData(url): | ||
response = requests.get(url) | ||
data = response.json() | ||
arrData.append(data["oficial"]) | ||
arrData.append(data["blue"]) | ||
arrData.append(data["oficial_euro"]) | ||
arrData.append(data["blue_euro"]) | ||
|
||
# Function to print the table | ||
def print_table(data): | ||
col_widths = [max(len(str(item)) for item in col) for col in zip(*data)] | ||
for row in data: | ||
print(" ".join(str(item).ljust(col_widths[i]) for i, item in enumerate(row))) | ||
|
||
# Main function | ||
def main(): | ||
getData(dolarAPI) | ||
table_data = [["💱 Currency", "💸 Value"], | ||
["💵 Official", sackEmoji + str(arrData[0]["value_avg"]) + arsLabel], | ||
["💵 Blue", sackEmoji + str(arrData[1]["value_avg"]) + arsLabel], | ||
["💶 Official_Euro", sackEmoji + str(arrData[2]["value_avg"]) + arsLabel], | ||
["💶 Blue_Euro", sackEmoji + str(arrData[3]["value_avg"]) + arsLabel]] | ||
print_table(table_data) | ||
|
||
# Init application | ||
main() |
Empty file.