#!/bin/bash

# Check compositor by XDG_CURRENT_DESKTOP variable
# and choose appropriate method for shutdown the session
case "$XDG_CURRENT_DESKTOP" in
sway)
    swaymsg exit
    ;;
river)
    riverctl exit
    ;;
miracle-wm)
    miraclemsg exit
    ;;
mir)
    miraclemsg exit
    ;;
mir:miracle-wm)
    miraclemsg exit
    ;;
qtile)
    bash -c /usr/share/tileos/scripts/qtile-exit.sh
    ;;
niri)
    niri msg action quit --skip-confirmation
    ;;
esac
