Added waybar
This commit is contained in:
Executable
+19
@@ -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\"}"
|
||||
Executable
+27
@@ -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
|
||||
Executable
+18
@@ -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"\"}"
|
||||
Reference in New Issue
Block a user