diff --git a/Makefile b/Makefile index 5810917..62caca3 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,6 @@ install: all cp -f docs/example.* ${DESTDIR}${PREFIX}/share/speedwm/ cp -f scripts/speedwm* ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/speedwm* cp -f status ${DESTDIR}${PREFIX}/bin ; chmod +x ${DESTDIR}${PREFIX}/bin/status - echo "${DESTDIR}${PREFIX}/bin/" > ${DESTDIR}${PREFIX}/share/speedwm/bindir chmod +x ./scripts/speedwm-compatcheck chmod +x ./scripts/speedwm-dm chmod 755 ${DESTDIR}${PREFIX}/bin/speedwm diff --git a/scripts/speedwm-audioctrl b/scripts/speedwm-audioctrl index 790e899..6cc4e34 100755 --- a/scripts/speedwm-audioctrl +++ b/scripts/speedwm-audioctrl @@ -4,7 +4,7 @@ # Run speedwm-audioctrl -help for more information! # License: GPLv3. -BINDIR=$(cat /usr/share/speedwm/bindir) +BINDIR="$(dirname $(command -v status))/" MUTE() { # Mute for pulseaudio/pipewire diff --git a/scripts/speedwm-btctrl b/scripts/speedwm-btctrl index 3f7ea7f..56504b0 100755 --- a/scripts/speedwm-btctrl +++ b/scripts/speedwm-btctrl @@ -9,7 +9,7 @@ CHECK() { "") RUNLAUNCHER=dmenu ;; esac - BINDIR=$(cat /usr/share/speedwm/bindir) # Set binary directory to the contents of this file for NixOS support + BINDIR="$(dirname $(command -v status))/" } HAVE_GRID="true" diff --git a/scripts/speedwm-compatcheck b/scripts/speedwm-compatcheck index e4a8889..48da4ae 100755 --- a/scripts/speedwm-compatcheck +++ b/scripts/speedwm-compatcheck @@ -2,7 +2,7 @@ # speedwm-compatcheck # compatibility checker used by 'make' when compiling speedwm. -BINDIR=$(cat /usr/share/speedwm/bindir) +BINDIR="$(dirname $(command -v status))/" # Check if xrdb exists if [ -e "${BINDIR}xrdb" ]; then diff --git a/scripts/speedwm-core b/scripts/speedwm-core index 8f352ce..af0f5a5 100755 --- a/scripts/speedwm-core +++ b/scripts/speedwm-core @@ -2,12 +2,7 @@ # speedwm-core # This script handles the updating and other things necessary for keybinds. -# Set binary directory if not set already. -if [ -e "/usr/share/speedwm/bindir" ]; then - BINDIR=$(cat /usr/share/speedwm/bindir) # Set binary directory to the contents of this variable. -else - BINDIR="/usr/bin/" -fi +BINDIR="$(dirname $(command -v status))/" # update UPDATE_SPEEDWM() { diff --git a/scripts/speedwm-netctrl b/scripts/speedwm-netctrl index 2f2d9b3..ca4c776 100755 --- a/scripts/speedwm-netctrl +++ b/scripts/speedwm-netctrl @@ -7,7 +7,7 @@ case "$RUNLAUNCHER" in "") RUNLAUNCHER=dmenu ;; esac -BINDIR=$(cat /usr/share/speedwm/bindir) +BINDIR="$(dirname $(command -v status))/" command -v iwctl > /dev/null || exit 1 diff --git a/scripts/speedwm-screenshotutil b/scripts/speedwm-screenshotutil index 1126b05..fbcf19a 100755 --- a/scripts/speedwm-screenshotutil +++ b/scripts/speedwm-screenshotutil @@ -11,11 +11,7 @@ case "$RUNLAUNCHER" in "") RUNLAUNCHER=dmenu ;; esac -if [ -e "/usr/share/speedwm/bindir" ]; then - BINDIR=$(cat /usr/share/speedwm/bindir) -else - BINDIR="/usr/bin/" -fi +BINDIR="$(dirname $(command -v status))/" HAVE_GRID="true" if [ -e "$HOME/.config/speedwm-de/global/config" ]; then diff --git a/scripts/speedwm-shutdown b/scripts/speedwm-shutdown index c2a8ff0..16003f0 100755 --- a/scripts/speedwm-shutdown +++ b/scripts/speedwm-shutdown @@ -28,11 +28,7 @@ if [ "$HAVE_GRID" = "true" ]; then GRIDARG="-g" fi -if [ -e "/usr/share/speedwm/bindir" ]; then - BINDIR=$(cat /usr/share/speedwm/bindir) -else - BINDIR="/usr/bin/" -fi +BINDIR="$(dirname $(command -v status))/" EXPORTDIR=$HOME/.config/speedwm-de/powermenu mkdir -p $EXPORTDIR diff --git a/scripts/speedwm-swal b/scripts/speedwm-swal index 0831ffe..d4ed1e7 100755 --- a/scripts/speedwm-swal +++ b/scripts/speedwm-swal @@ -115,7 +115,7 @@ SWAL_SOLIDCOLOR() { } # Binary directory -BINDIR=$(cat /usr/share/speedwm/bindir) +BINDIR="$(dirname $(command -v status))/" SWAL_OLDWALLPAPERDIR=$SWAL_WALLPAPERDIR # Source things diff --git a/scripts/speedwm-utils b/scripts/speedwm-utils index 3f7ed5c..3aaab6a 100755 --- a/scripts/speedwm-utils +++ b/scripts/speedwm-utils @@ -24,7 +24,7 @@ if [ "$HAVE_GRID" = "true" ]; then fi VARS() { - BINDIR=$(cat /usr/share/speedwm/bindir) + BINDIR="$(dirname $(command -v status))/" } VARS diff --git a/scripts/speedwm-virtualkeyboard b/scripts/speedwm-virtualkeyboard index d6ce00b..9e7303f 100755 --- a/scripts/speedwm-virtualkeyboard +++ b/scripts/speedwm-virtualkeyboard @@ -23,7 +23,7 @@ if [ "$HAVE_GRID" = "true" ]; then GRIDARG="-g" fi -BINDIR=$(cat /usr/share/speedwm-bindir) +BINDIR="$(dirname $(command -v status))/" EMOJILIST() { diff --git a/scripts/speedwm-winnav b/scripts/speedwm-winnav index 24ada11..0e589e2 100755 --- a/scripts/speedwm-winnav +++ b/scripts/speedwm-winnav @@ -43,7 +43,7 @@ case "$RUNLAUNCHER" in "") RUNLAUNCHER=dmenu ;; esac -BINDIR=$(cat /usr/share/speedwm/bindir) +BINDIR="$(dirname $(command -v status))/" DOTDIR=$HOME/.config/speedwm-de/winnav POSITION="bottom" # top, bottom, center (your $RUNLAUNCHER must support center for this to work) diff --git a/scripts/speedwm_run b/scripts/speedwm_run index 4f402d8..a0b4dd9 100755 --- a/scripts/speedwm_run +++ b/scripts/speedwm_run @@ -3,7 +3,7 @@ # External script which starts speedwm! # https://speedie.gq/speedwm for instructions and usage! -BINDIR=$(cat /usr/share/speedwm/bindir) +BINDIR="$(dirname $(command -v status))/" ARGS=$1 # No second argument is supported diff --git a/status b/status index 0c56e35..73fbded 100755 --- a/status +++ b/status @@ -238,7 +238,7 @@ fi # Set it to /usr/bin if it was not possible to get it through /usr/share/speedwm-bindir case "$BINDIR" in -"") BINDIR="/usr/bin" ;; +"") BINDIR="$(dirname $(command -v status))/" ;; esac # Systray stuff