Reorganize Fedora dotfiles and remove legacy profile
This commit is contained in:
11
fedora/quickshell/scripts/gpu.sh
Normal file
11
fedora/quickshell/scripts/gpu.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
data=$(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,noheader,nounits 2>/dev/null)
|
||||
if [ -z "$data" ]; then
|
||||
printf '%s\n' '{"text":"N/A"}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
usage=$(printf '%s\n' "$data" | cut -d',' -f1 | tr -d ' ')
|
||||
temp=$(printf '%s\n' "$data" | cut -d',' -f2 | tr -d ' ')
|
||||
printf '{"text":"%s%% %sC"}\n' "$usage" "$temp"
|
||||
9
fedora/quickshell/scripts/weather.sh
Normal file
9
fedora/quickshell/scripts/weather.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
weather=$(curl -4 -sS --connect-timeout 3 --max-time 8 "https://wttr.in/?format=%c%t" 2>/dev/null)
|
||||
if [ -z "$weather" ] || printf '%s' "$weather" | grep -q "Unknown"; then
|
||||
printf '%s\n' '{"text":"N/A"}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf '{"text":"%s"}\n' "$weather"
|
||||
Reference in New Issue
Block a user