Added waybar

This commit is contained in:
Trianta
2024-01-16 18:33:53 -06:00
parent f0e13819fb
commit 1a39ddde49
7 changed files with 321 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# get_weather.sh
for i in {1..5}
do
text=$(curl -s "https://wttr.in/$1?format=1")
if [[ $? == 0 ]]
then
text=$(echo "$text" | sed -E "s/\s+/ /g")
tooltip=$(curl -s "https://wttr.in/$1?format=4")
if [[ $? == 0 ]]
then
tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g")
echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}"
exit
fi
fi
sleep 2
done
echo "{\"text\":\"error\", \"tooltip\":\"error\"}"
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
case $(wofi -d -L 6 -l 3 -W 100 -x -100 -y 10 \
-D dynamic_lines=true << EOF | sed 's/^ *//'
Shutdown
Reboot
Log off
Sleep
Lock
Cancel
EOF
) in
"Shutdown")
systemctl poweroff
;;
"Reboot")
systemctl reboot
;;
"Sleep")
systemctl suspend
;;
"Lock")
loginctl lock-session
;;
"Log off")
hyprctl dispatch exit
;;
esac
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
class=$(playerctl metadata --player=spotify --format '{{lc(status)}}')
icon=""
if [[ $class == "playing" ]]; then
info=$(playerctl metadata --player=spotify --format '{{artist}} - {{title}}')
if [[ ${#info} > 40 ]]; then
info=$(echo $info | cut -c1-40)"..."
fi
text=$info" "$icon
elif [[ $class == "paused" ]]; then
text=$icon
elif [[ $class == "stopped" ]]; then
text=""
fi
echo -e "{\"text\":\""$text"\", \"class\":\""$class"\"}"