Merge branch 'main' of git.zander.im:Zander671/dwmblocks

This commit is contained in:
Alexander Rosenberg 2023-02-23 09:23:04 -08:00
commit b88de94327
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 8 additions and 3 deletions

View File

@ -14,8 +14,9 @@ typedef struct {
static void sink_info_callback(pa_context *ctx, const pa_sink_info *info, static void sink_info_callback(pa_context *ctx, const pa_sink_info *info,
int eol, TargetData *target) { int eol, TargetData *target) {
if (info) { if (info && kill(target->pid, target->signum) < 0) {
kill(target->pid, target->signum); ERROR("terget process died\n");
exit(1);
} }
} }
@ -62,7 +63,10 @@ static void state_callback(pa_context *ctx, TargetData *target) {
pa_operation_unref(op); pa_operation_unref(op);
break; break;
case PA_CONTEXT_FAILED: case PA_CONTEXT_FAILED:
kill(target->pid, target->signum); if (kill(target->pid, target->signum) < 0) {
ERROR("terget process died\n");
exit(1);
}
break; break;
default: default:
break; break;

View File

@ -4,6 +4,7 @@ if [[ "$(uname)" = 'Linux' ]]; then
local active_networks="$(nmcli c s --active)" local active_networks="$(nmcli c s --active)"
local output='' local output=''
[[ "${active_networks}" = *' wifi '* ]] && output="${output}直 " [[ "${active_networks}" = *' wifi '* ]] && output="${output}直 "
[[ "${active_networks}" = *' ethernet '* ]] && output="${output}"
[[ "${active_networks}" = *' wireguard '* ]] && output="${output}嬨 " [[ "${active_networks}" = *' wireguard '* ]] && output="${output}嬨 "
(( ${#output} == 0 )) && output='' (( ${#output} == 0 )) && output=''
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output} " bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output} "