Skip to content

Commit

Permalink
Add additional check in 'x11_session_check' function before push v1.6…
Browse files Browse the repository at this point in the history
….12 release.
  • Loading branch information
itz-me-zappex authored Oct 6, 2024
1 parent 09b525c commit 49f56f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions flux
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,16 @@ option_repeat_check(){

# Required to exit with an error if that is not a X11 session
x11_session_check(){
# Exit with an error if that is not a X11 session
local exit
# Set 'exit' variable if something is wrong with X11 session
if [[ ! "$DISPLAY" =~ ^\:[0-9]+(\.[0-9]+)?$ || "$XDG_SESSION_TYPE" != 'x11' ]]; then
print_error "Flux is not meant to use it with anything but X11!"
exit='1'
elif ! xprop -root > /dev/null 2>&1; then
exit='1'
fi
# Exit with an error if something is wrong with X11 session
if [[ -n "$exit" ]]; then
print_error "Flux is not meant to use it with anything but X11! Make sure everything is fine with your current X11 session."
exit 1
fi
}
Expand Down

0 comments on commit 49f56f6

Please sign in to comment.