uzbek-plus/b13/run/sway-down.sh

4 lines
440 B
Bash

#!/bin/sh
. /usr/local/lib/b13/run/wl-common.sh
pidof sway >/dev/null && { WAYLAND_DISPLAY=$(cat $S/wayland-display 2>/dev/null) SWAYSOCK=$(ls /run/user/0/sway-ipc.* 2>/dev/null | head -1) swaymsg exit >/dev/null 2>&1; i=0; while pidof sway >/dev/null && [ $i -lt 50 ]; do sleep 0.1; i=$((i+1)); done; pidof sway >/dev/null && kill $(pidof sway); }
rm -f $S/sway.pid $S/wayland-display; log "SWAY DOWN vt=$(cat /sys/class/tty/tty0/active)"