From 8ac0e4b0ea8542fb7063953a4312cba43421e0f4 Mon Sep 17 00:00:00 2001 From: Leaced Date: Sat, 25 Mar 2023 19:19:50 +0100 Subject: [PATCH] Add flag for is_wayland --- .config/sway/status.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.config/sway/status.sh b/.config/sway/status.sh index 594f8f4..8836ebe 100644 --- a/.config/sway/status.sh +++ b/.config/sway/status.sh @@ -3,7 +3,20 @@ # If not, do $mod+Shift+c to reload the configuration. date_formatted=$(date "+%a %d.%m.%Y %H:%M") -audio_muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{ print $2=="yes" ? "πŸ”‡":"πŸ”‰" }') -audio_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | awk '{ print $5 }') -echo $audio_volume $audio_muted "|" $date_formatted +audio_muted=$( + pactl get-sink-mute @DEFAULT_SINK@ | + awk '{ print $2=="yes" ? "πŸ”‡":"πŸ”‰" }') +audio_volume=$( + pactl get-sink-volume @DEFAULT_SINK@ | + awk '{ print $5 }') + +is_wayland=$( + swaymsg -t get_tree | + awk ' + /focused": true/,/shell/ { + if($1 == "\"shell\":") print $2=="\"xdg_shell\"," ? "wayland βœ”":"✘wayland" + } + ') + +echo $is_wayland "|" $audio_volume $audio_muted "|" $date_formatted