Add waybar config from dwl

This commit is contained in:
Sravan Balaji
2025-04-27 08:50:37 -04:00
parent 9ad43ce4f1
commit f2b92f7938
10 changed files with 1384 additions and 1 deletions

9
waybar/scripts/dunst.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
isPaused=$(dunstctl is-paused)
notificationCount=$(dunstctl count history)
if [[ "$isPaused" == "true" ]]; then
echo "󰂛 $notificationCount"
else
echo "󰂚 $notificationCount"
fi

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
mediaSourceIcon=$(`dirname $0`/get-media-source-icon.sh)
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
artist="N/A"
title="N/A"
album="N/A"
status="N/A"
else
artist=$(playerctl --player=playerctld metadata --format '{{ xesam:artist }}')
title=$(playerctl --player=playerctld metadata --format '{{ xesam:title }}')
album=$(playerctl --player=playerctld metadata --format '{{ xesam:album }}')
status=$(playerctl --player=playerctld metadata --format '{{ status }}')
if [[ $artist == "" ]]; then
artist="N/A"
fi
if [[ $title == "" ]]; then
title="N/A"
fi
if [[ $album == "" ]]; then
album="N/A"
fi
if [[ $status == "" ]]; then
status="N/A"
fi
fi
echo '{"text":"'$mediaSourceIcon'","tooltip":"󰝚\t'${title//'"'/'\"'}'\r󰠃\t'${artist//'"'/'\"'}'\r󰀥\t'${album//'"'/'\"'}'\r󰐎\t'${status//'"'/'\"'}'"}'

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
echo "󰡀"
else
trackid=$(playerctl --player=playerctld metadata --format '{{ mpris:trackid }}')
title=$(playerctl --player=playerctld metadata --format '{{ xesam:title }}')
if grep -q -i "netflix" <<< "$title"; then
echo "󰝆"
elif grep -q -i "hulu" <<< "$title"; then
echo "󰠩"
elif grep -q -i "prime video" <<< "$title"; then
echo ""
elif grep -q -i "youtube tv" <<< "$title"; then
echo "󰑈"
elif grep -q -i "chromium" <<< "$trackid"; then
echo ""
elif grep -q -i "vlc" <<< "$trackid"; then
echo "󰕼"
elif grep -q -i "spotify" <<< "$trackid"; then
echo ""
else
echo "󰡀"
fi
fi

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
mediaStatus=$(`dirname $0`/get-media-status.sh)
if [[ "$mediaStatus" == "N/A" ]]; then
echo "󰐎"
else
if [[ "$mediaStatus" == "Playing" ]]; then
echo "󰏤"
elif [[ "$mediaStatus" == "Paused" ]]; then
echo "󰐊"
fi
fi

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
echo "N/A"
else
status=$(playerctl --player=playerctld metadata --format '{{ status }}')
echo $status
fi

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
profile="$(sudo system76-power profile | sed -z '$ s/\n$//' | tr '\n' '\r')"
graphics="$(sudo system76-power graphics)"
graphicsPower="$(sudo system76-power graphics power)"
chargeThresholds="$(sudo system76-power charge-thresholds | sed -z '$ s/\n$//' | tr '\n' '\r')"
echo '{"text":"󰢮 '$graphics'","tooltip":"󰢮\t'$graphics'\r󰐥\t'$graphicsPower'\r\r Profile\r'$profile'\r\r󰚥 Charge Thresholds\r'$chargeThresholds'"}'