feat: if desktop cannot be auto detected, assume Hyprland

This commit is contained in:
alterNERDtive 2024-02-13 16:43:11 +01:00
parent 73b4073b61
commit 32e32bc6e5
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1

View file

@ -122,12 +122,9 @@ function getPidByProp() {
} }
function detectEnvironment() { function detectEnvironment() {
local Type
local Desktop local Desktop
eval "$(loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type -p Desktop)" eval "$(loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Desktop)"
[ -z "$Type" ] && echo "Could not determine session type via \`loginctl\`." && exit 1 [ -z "$Desktop" ] && echo "Could not determine desktop environment via \`loginctl\`. Assuming Hyprland." && Desktop="hyprland"
[ -z "$Desktop" ] && echo "Could not determine desktop environment via \`loginctl\`." && exit 1
SESSION=$Type
DESKTOP=$Desktop DESKTOP=$Desktop
} }