Guest User

Untitled

a guest
Mar 24th, 2021
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. command="`basename \"$0\"`"
  4. fluxdir="$HOME/.fluxbox"
  5. startup="$fluxdir/startup"
  6.  
  7. while [ $# -gt 0 ]; do
  8.     case "$1" in
  9.         -c|--config)
  10.             if [ $# -lt 2 ]; then
  11.                 echo "$command:error, missing argument"
  12.                 exit 1
  13.             fi
  14.             shift
  15.             startup=$1
  16.         ;;
  17.         -h|--help) cat <<EOF
  18. Usage: $command [-h] [-c startupfile]
  19. EOF
  20.         exit
  21.         ;;
  22.     esac
  23.     shift
  24. done
  25.  
  26. if [ -x "$startup" ]; then
  27.     exec "$startup"
  28. elif [ -r "$startup" ]; then
  29.     exec sh "$startup"
  30. else
  31.     if [ ! -d $fluxdir ]; then
  32.         mkdir -p "$fluxdir/backgrounds" "$fluxdir/styles" "$fluxdir/pixmaps"
  33.     fi
  34.     if [ ! -r "$startup" ]; then
  35.         ( cat << EOF
  36. #!/bin/sh
  37. #
  38. # fluxbox startup-script:
  39. #
  40. # Lines starting with a '#' are ignored.
  41.  
  42. # Change your keymap:
  43. xmodmap "$HOME/.Xmodmap"
  44.  
  45. # Applications you want to run with fluxbox.
  46. # MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
  47. #
  48. # unclutter -idle 2 &
  49. # wmnd &
  50. # wmsmixer -w &
  51. # idesk &
  52.  
  53. # Start DBUS session bus:
  54. if [ -z "\$DBUS_SESSION_BUS_ADDRESS" ]; then
  55.    eval \$(dbus-launch --sh-syntax --exit-with-session)
  56. fi
  57.  
  58. # And last but not least we start fluxbox.
  59. # Because it is the last app you have to run it with ''exec'' before it.
  60.  
  61. exec fluxbox
  62. # or if you want to keep a log:
  63. # exec fluxbox -log "$fluxdir/log"
  64. EOF
  65.     ) > "$startup"
  66.     fi
  67.     chmod 644 "$startup"
  68.     exec sh "$startup"
  69. fi
  70.  
RAW Paste Data