summaryrefslogtreecommitdiffstats
path: root/.config/fish/functions/sessiontype.fish
blob: 33830ca0882094f71ebf3a9e5a55009ea8d7a354 (plain)
1
2
3
4
5
6
7
8
# https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972

function sessiontype
    # https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972
    # have to run it first?
    loginctl > /dev/null
    loginctl show-session (loginctl | awk '/tty/ {print $1}') -p Type | awk -F= '{print $2}'
end