Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
Fix missing readlink -e option error on FreeBSD (#7)
Browse files Browse the repository at this point in the history
Taken from: PCMan#56
  • Loading branch information
patovm04 authored Dec 4, 2020
1 parent 3b03760 commit c153438
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gtk3-nocsd.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
# program to call as its arguments.
#

OS=$(uname | tr "[:upper:]" "[:lower:]")
RLINK_ARGS=$([ "$OS" = "freebsd" ] && echo "-f" || echo "-fe")

GTK3_NOCSD_NAME=libgtk3-nocsd.so.0

# Determine if this script are installed in the system path
GTK3_NOCSD_BINARY="$(readlink -fe "$(which "$0")")"
GTK3_NOCSD_BINARY="$(readlink ${RLINK_ARGS} "$(which "$0")")"
case "${GTK3_NOCSD_BINARY%/*}" in
/sbin|/bin|/usr/bin|/usr/sbin|/usr/local/bin|/usr/local/sbin) IN_SYSTEM_PATH=1 ;;
*) IN_SYSTEM_PATH=0 ;;
Expand Down Expand Up @@ -73,7 +76,7 @@ fi
# Find the real program (the first one that's not symlinked to get3-nocsd)
APPNAME="$(basename "$0")"
for APPPATH in $(which -a "$APPNAME") /bin/false; do
APPPATH_LINK="$(readlink -fe "$APPPATH")"
APPPATH_LINK="$(readlink ${RLINK_ARGS} "$APPPATH")"
[ x"${APPPATH_LINK##*/}"x = x"gtk3-nocsd"x ] || break
done

Expand Down

0 comments on commit c153438

Please sign in to comment.