1
0
Fork 1
mirror of https://github.com/Zerodya/hyprfreeze.git synced 2024-11-09 17:08:49 +01:00

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() {
local Type
local Desktop
eval "$(loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type -p Desktop)"
[ -z "$Type" ] && echo "Could not determine session type via \`loginctl\`." && exit 1
[ -z "$Desktop" ] && echo "Could not determine desktop environment via \`loginctl\`." && exit 1
SESSION=$Type
eval "$(loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Desktop)"
[ -z "$Desktop" ] && echo "Could not determine desktop environment via \`loginctl\`. Assuming Hyprland." && Desktop="hyprland"
DESKTOP=$Desktop
}