Add waybar config from dwl
This commit is contained in:
9
waybar/scripts/dunst.sh
Executable file
9
waybar/scripts/dunst.sh
Executable 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
|
33
waybar/scripts/get-media-playing.sh
Executable file
33
waybar/scripts/get-media-playing.sh
Executable 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//'"'/'\"'}'"}'
|
27
waybar/scripts/get-media-source-icon.sh
Executable file
27
waybar/scripts/get-media-source-icon.sh
Executable 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
|
12
waybar/scripts/get-media-status-icon.sh
Executable file
12
waybar/scripts/get-media-status-icon.sh
Executable 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
|
10
waybar/scripts/get-media-status.sh
Executable file
10
waybar/scripts/get-media-status.sh
Executable 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
|
7
waybar/scripts/system76-power.sh
Executable file
7
waybar/scripts/system76-power.sh
Executable 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'"}'
|
Reference in New Issue
Block a user