diff --git a/configs/shell/zsh/.zsh/aliases/helpers/dir.zsh b/configs/shell/zsh/.zsh/aliases/dir/main.zsh similarity index 100% rename from configs/shell/zsh/.zsh/aliases/helpers/dir.zsh rename to configs/shell/zsh/.zsh/aliases/dir/main.zsh diff --git a/configs/shell/zsh/.zsh/aliases/export.zsh b/configs/shell/zsh/.zsh/aliases/export.zsh new file mode 100644 index 0000000..8945075 --- /dev/null +++ b/configs/shell/zsh/.zsh/aliases/export.zsh @@ -0,0 +1,4 @@ +source ~/.zsh/aliases/global/main.zsh +source ~/.zsh/aliases/dir/main.zsh +source ~/.zsh/aliases/git/main.zsh +source ~/.zsh/aliases/net/main.zsh diff --git a/configs/shell/zsh/.zsh/aliases/helpers/git.zsh b/configs/shell/zsh/.zsh/aliases/git/main.zsh similarity index 100% rename from configs/shell/zsh/.zsh/aliases/helpers/git.zsh rename to configs/shell/zsh/.zsh/aliases/git/main.zsh diff --git a/configs/shell/zsh/.zsh/aliases/main.zsh b/configs/shell/zsh/.zsh/aliases/global/main.zsh similarity index 89% rename from configs/shell/zsh/.zsh/aliases/main.zsh rename to configs/shell/zsh/.zsh/aliases/global/main.zsh index 714d124..cfa6763 100644 --- a/configs/shell/zsh/.zsh/aliases/main.zsh +++ b/configs/shell/zsh/.zsh/aliases/global/main.zsh @@ -1,7 +1,3 @@ -source ~/.zsh/aliases/helpers/dir.zsh -source ~/.zsh/aliases/helpers/git.zsh -source ~/.zsh/aliases/helpers/nmcli.zsh - alias alist="alias" alias fclean="flatpak uninstall --unused --delete-data" diff --git a/configs/shell/zsh/.zsh/aliases/helpers/nmcli.zsh b/configs/shell/zsh/.zsh/aliases/net/main.zsh similarity index 100% rename from configs/shell/zsh/.zsh/aliases/helpers/nmcli.zsh rename to configs/shell/zsh/.zsh/aliases/net/main.zsh diff --git a/configs/shell/zsh/.zsh/functions/helpers/speedtest.zsh b/configs/shell/zsh/.zsh/functions/helpers/net.zsh similarity index 78% rename from configs/shell/zsh/.zsh/functions/helpers/speedtest.zsh rename to configs/shell/zsh/.zsh/functions/helpers/net.zsh index 98d1b91..0ba6b9d 100644 --- a/configs/shell/zsh/.zsh/functions/helpers/speedtest.zsh +++ b/configs/shell/zsh/.zsh/functions/helpers/net.zsh @@ -1,4 +1,5 @@ SPEEDTEST_DOWNLOAD_URL="http://37.32.15.80/assets/12mb.png?_=1711896914991" +WIFI_IP="192.168.1.1" wget_speed() { check_command wget @@ -11,5 +12,11 @@ wget_speed() { curl_speed() { check_command curl + log "Curl Speedtest" + curl $SPEEDTEST_DOWNLOAD_URL >/dev/null } + +ping_wifi() { + ping $WIFI_IP +} diff --git a/configs/shell/zsh/.zsh/functions/main.zsh b/configs/shell/zsh/.zsh/functions/main.zsh index a9ea719..b7b37df 100644 --- a/configs/shell/zsh/.zsh/functions/main.zsh +++ b/configs/shell/zsh/.zsh/functions/main.zsh @@ -1,5 +1,5 @@ source ~/.zsh/functions/helpers/main.zsh -source ~/.zsh/functions/helpers/speedtest.zsh +source ~/.zsh/functions/helpers/net.zsh convert_video_to_gif() { local fps=60 diff --git a/configs/shell/zsh/.zsh/os/debian.zsh b/configs/shell/zsh/.zsh/os/debian/main.zsh similarity index 100% rename from configs/shell/zsh/.zsh/os/debian.zsh rename to configs/shell/zsh/.zsh/os/debian/main.zsh diff --git a/configs/shell/zsh/.zsh/os/export.zsh b/configs/shell/zsh/.zsh/os/export.zsh new file mode 100644 index 0000000..8774301 --- /dev/null +++ b/configs/shell/zsh/.zsh/os/export.zsh @@ -0,0 +1,7 @@ +if [[ "$OS" = void ]]; then + source ~/.zsh/os/void/main.zsh +elif [[ "$OS" = debian ]]; then + source ~/.zsh/os/debian/main.zsh +else + echo "Unsupported operating system: $OS" +fi diff --git a/configs/shell/zsh/.zsh/os/void.zsh b/configs/shell/zsh/.zsh/os/void/main.zsh similarity index 96% rename from configs/shell/zsh/.zsh/os/void.zsh rename to configs/shell/zsh/.zsh/os/void/main.zsh index b7308f1..a1bbed5 100644 --- a/configs/shell/zsh/.zsh/os/void.zsh +++ b/configs/shell/zsh/.zsh/os/void/main.zsh @@ -1,4 +1,4 @@ -alias void-packages="cd $VOID_PACKAGES_PATH" +alias void-pkgs="cd $VOID_PACKAGES_PATH" alias vshutdown="sudo shutdown -h now" alias vreboot="sudo reboot" alias vrepos="xbps-query -L" @@ -15,15 +15,6 @@ alias vunhold="sudo xbps-pkgdb -m unhold" alias vmirror="sudo xmirror" alias killall="pkill -f" -alias rmhyprland="vrm hyprland hyprland-protocols hyprlang xdg-desktop-portal-hyprland" -installhyprland() { - if [ -z "$1" ]; then - echo "Error: Please provide the path of packages" - return 1 - fi - sudo xbps-install -R $1 hyprland hyprland-protocols hyprlang xdg-desktop-portal-hyprland -} - alias svservices="ls /etc/sv/" alias svlist="ls -la /var/service/" alias svreset="sudo sv restart" @@ -46,3 +37,13 @@ svdisable() { fi sudo rm -rf "/var/service/$1" } + +alias rmhyprland="vrm hyprland hyprland-protocols hyprlang xdg-desktop-portal-hyprland" + +installhyprland() { + if [ -z "$1" ]; then + echo "Error: Please provide the path of packages" + return 1 + fi + sudo xbps-install -R $1 hyprland hyprland-protocols hyprlang xdg-desktop-portal-hyprland +} diff --git a/configs/shell/zsh/.zshrc b/configs/shell/zsh/.zshrc index 523d6a8..03c45ff 100644 --- a/configs/shell/zsh/.zshrc +++ b/configs/shell/zsh/.zshrc @@ -7,14 +7,7 @@ plugins=(zsh-syntax-highlighting zsh-autosuggestions git themes jsontools) source $ZSH/oh-my-zsh.sh source ~/.zsh/functions/main.zsh -source ~/.zsh/aliases/main.zsh - -if [[ "$OS" = void ]]; then - source ~/.zsh/os/void.zsh -elif [[ "$OS" = debian ]]; then - source ~/.zsh/os/debian.zsh -else - echo "Unsupported operating system: $OS" -fi +source ~/.zsh/aliases/export.zsh +source ~/.zsh/os/export.zsh eval "$(atuin init zsh)"