-
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.
Add gpu status; modify vpn status to work with protonvpn community
- Loading branch information
1 parent
a51591f
commit d5b1cd3
Showing
6 changed files
with
97 additions
and
44 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
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,16 @@ | ||
#!/bin/bash | ||
mem_used=$(cat /sys/class/hwmon/hwmon3/device/mem_info_vram_used) | ||
mem_total=$(cat /sys/class/hwmon/hwmon3/device/mem_info_vram_total) | ||
gpu_busy=$(cat /sys/class/hwmon/hwmon3/device/gpu_busy_percent) | ||
|
||
mem_usage=$(bc <<< "scale=2; $mem_used / 1048576") | ||
|
||
if [ "$1" = "m" ]; then | ||
mem_usage=$(bc <<< "scale=2; $mem_used / 1073741824") | ||
printf "%s%% | %.2fGB" "$gpu_busy" "$mem_usage" | ||
else | ||
mem_usage=$(bc <<< "scale=2; ($mem_used * 100) / $mem_total") | ||
printf "%s%% | %.2f%%" "$gpu_busy" "$mem_usage" | ||
fi | ||
|
||
|
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,7 +1,13 @@ | ||
#!/bin/bash | ||
if ip a | grep 'tun' -q;then | ||
printf " $(ps -p $(pgrep -f openvpn) -o cmd --no-headers | cut -d' ' -f3 | rev | cut -d'/' -f1 | rev | cut -d'.' -f1 | tr '[:lower:]' '[:upper:]')" | ||
if ip a | grep -iE 'tun|proton' -q;then | ||
if [ -f /tmp/last_cc ]; then | ||
printf " $(cat /tmp/last_cc)" | ||
else | ||
curl -s 'https://api.myip.com' | jq .cc | sed 's/"//g' > /tmp/last_cc | ||
fi | ||
# printf " $(ps -p $(pgrep -f openvpn) -o cmd --no-headers | cut -d' ' -f3 | rev | cut -d'/' -f1 | rev | cut -d'.' -f1 | tr '[:lower:]' '[:upper:]')" | ||
else | ||
[ -f /tmp/last_cc ] && rm /tmp/lastvpn | ||
printf "" | ||
fi | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
docker-buildx |
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 |
---|---|---|
|
@@ -31,3 +31,4 @@ yt-dlp | |
cronie | ||
bind | ||
7zip | ||
distutils |