mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-23 16:29:42 -04:00
pruned
This commit is contained in:
commit
072951659a
114 changed files with 6922 additions and 0 deletions
BIN
user/modules/gui/wm/hyprland/config/waybar/scripts/getBlock
Executable file
BIN
user/modules/gui/wm/hyprland/config/waybar/scripts/getBlock
Executable file
Binary file not shown.
12
user/modules/gui/wm/hyprland/config/waybar/scripts/getPrice
Executable file
12
user/modules/gui/wm/hyprland/config/waybar/scripts/getPrice
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
response=$(curl -s "https://api.coinbase.com/v2/prices/BTC-USD/spot")
|
||||
price=$(echo "$response" | jq -r .data.amount | awk -F. '{print $1}')
|
||||
|
||||
if [ -z "$price" ]; then
|
||||
echo -e "\033[31mErr\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$price"
|
||||
exit 0
|
||||
24
user/modules/gui/wm/hyprland/config/waybar/scripts/weather.sh
Executable file
24
user/modules/gui/wm/hyprland/config/waybar/scripts/weather.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
BSSIDS="$(nmcli device wifi list |
|
||||
awk 'NR>1 {if ($1 != "*") {print $1}}' |
|
||||
tr -d ":" |
|
||||
tr "\n" ",")"
|
||||
|
||||
LOC=""
|
||||
REQUEST_GEO="$(wget -qO - http://openwifi.su/api/v1/bssids/"$BSSIDS")"
|
||||
if [[ "$(jq ".count_results" <<< "$REQUEST_GEO")" -gt 0 ]] ; then
|
||||
LAT="$(jq ".lat" <<< "$REQUEST_GEO")"
|
||||
LON="$(jq ".lon" <<< "$REQUEST_GEO")"
|
||||
LOC="$LAT,$LON"
|
||||
fi
|
||||
|
||||
text="$(curl -s "https://wttr.in/$LOC?format=1" | sed 's/ //g')"
|
||||
tooltip="$(curl -s "https://wttr.in/$LOC?0QT" |
|
||||
sed 's/\\/\\\\/g' |
|
||||
sed ':a;N;$!ba;s/\n/\\n/g' |
|
||||
sed 's/"/\\"/g')"
|
||||
|
||||
if ! grep -q "Unknown location" <<< "$text"; then
|
||||
echo "{\"text\": \"$text\", \"tooltip\": \"<tt>$tooltip</tt>\", \"class\": \"weather\"}"
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue