refactor(speedtest): speedtest functions moved to functions folder

This commit is contained in:
hesam-init 2024-04-10 23:53:28 +03:30
parent 0e607bd9ec
commit 1db22fc6a6
5 changed files with 27 additions and 26 deletions

View file

@ -4,7 +4,7 @@ alias gb="git branch"
alias gc="git checkout"
alias gl="git log --oneline --decorate --color"
alias amend="git add . && git commit --amend --no-edit"
alias commit="git add . && git commit -m"
alias ct="git add . && git commit -m"
alias diff="git diff"
alias force="git push --force"
alias nuke="git clean -df && git reset --hard"
@ -14,4 +14,4 @@ alias push="git push"
alias resolve="git add . && git commit --no-edit"
alias stash="git stash -u"
alias unstage="git restore --staged ."
alias wip="commit wip"
alias wip="ct wip"

View file

@ -1,26 +1,3 @@
wget_speed() {
check_command wget
log "Wget Speedtest"
wget -q --show-progress --progress=bar -O /dev/null $SPEEDTEST_DOWNLOAD_URL
}
curl_speed() {
check_command curl
log "Curl Speedtest"
curl $SPEEDTEST_DOWNLOAD_URL >/dev/null
}
alias wp="wget_speed"
list_wifi_networks() {
echo "Available Wi-Fi Networks:"
nmcli dev wifi list
}
connect_to_wifi() {
echo "Enter the name (SSID) of the Wi-Fi network you want to connect to:"
read ssid
@ -31,5 +8,10 @@ connect_to_wifi() {
sudo nmcli dev wifi connect "$ssid" password "$password"
}
list_wifi_networks() {
echo "Available Wi-Fi Networks:"
nmcli dev wifi list
}
alias wlist="list_wifi_networks"
alias wconnect="connect_to_wifi"

View file

@ -2,7 +2,7 @@ log() {
local timestamp=$(date +"%T")
local message="======> $1 : $timestamp"
echo -e "\n$message\n"
echo -e "$message\n"
}
params_required() {

View file

@ -1,4 +1,5 @@
source ~/.zsh/functions/helpers/main.zsh
source ~/.zsh/functions/speed-test/main.zsh
convert_video_to_gif() {
local fps=60

View file

@ -0,0 +1,18 @@
wget_speed() {
check_command wget
log "WGET Speedtest"
log "URL $SPEEDTEST_DOWNLOAD_URL"
wget -q --show-progress --progress=bar -O /dev/null $SPEEDTEST_DOWNLOAD_URL
}
curl_speed() {
check_command curl
log "Curl Speedtest"
curl $SPEEDTEST_DOWNLOAD_URL >/dev/null
}
alias wp="wget_speed"