all repos — fluxbox @ 52869773937f18146f60b617e6c0618bbf40d751

custom fork of the fluxbox windowmanager

patch from Han, minor fixes and fbsetbg random background
fluxgen fluxgen
commit

52869773937f18146f60b617e6c0618bbf40d751

parent

ea184b3566bfee3f720763edf4e11cd27e9cd1d0

4 files changed, 64 insertions(+), 18 deletions(-)

jump to
M data/Makefile.amdata/Makefile.am

@@ -19,4 +19,4 @@ INSTALL=Yes \

../util/fluxbox-generate_menu ../util/fluxbox-generate_menu: - cd ../util && make fluxbox-generate_menu + cd ../util && ${MAKE} fluxbox-generate_menu
M util/Makefile.amutil/Makefile.am

@@ -32,8 +32,8 @@ > fluxbox-generate_menu

-chmod 755 fluxbox-generate_menu ../src/FbRootWindow.o: - cd ../src && make FbRootWindow.o + cd ../src && ${MAKE} FbRootWindow.o ../src/I18n.o: - cd ../src && make I18n.o + cd ../src && ${MAKE} I18n.o ../src/FbAtoms.o: - cd ../src && make FbAtoms.o + cd ../src && ${MAKE} FbAtoms.o
M util/fbsetbgutil/fbsetbg

@@ -23,7 +23,7 @@ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,

# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# $Id: fbsetbg,v 1.25 2003/12/12 13:07:47 fluxgen Exp $ +# $Id: fbsetbg,v 1.26 2003/12/28 23:59:57 fluxgen Exp $ # Portability notes: # To guarantee this script works on all platforms that support fluxbox

@@ -59,7 +59,9 @@

# Functions display_usage() { cat << EOF -Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA /path/to/wallpaper] [-bB bsetrootoptions] [-l] [-h] [-i] [-p] +Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA /path/to/wallpaper] + [-r/-R /path/to/wallpaperdirectory] + [-b/-B bsetrootoptions] [-l] [-h] [-i] [-p] Use \`\`$command -h'' for a complete help message. EOF

@@ -79,8 +81,9 @@ ( if your bgsetter doesn't support this

we fall back to -f ) -u Use specified wallpapersetter, use no argument to forget. -b Forward the options to bsetroot. + -r set random wallpaper from a directory - -F,-C,-T,-A,-U,-B same as uncapsed but without remembering. + -F,-C,-T,-A,-U,-B,-R same as uncapsed but without remembering. -h Display this help.

@@ -259,7 +262,14 @@ -B) option=bsetroot

shift wallpaper=$* remember=false - break;; + break ;; + -r) option=random + wallpaper=$2 # in this case it's a dir + break ;; + -R) option=random + wallpaper=$2 # in this case it's a dir + remember=false + break ;; -l) if [ -r "$lastwallpaper" ]; then option=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f1`

@@ -270,8 +280,7 @@ exit 1

fi fi remember=false - break - ;; + break ;; -p) display_tips ; exit 0 ;; -h) display_help ; exit 0 ;; --)

@@ -282,10 +291,11 @@ exit 1 ;;

-*) message "unrecognized option "\`"$1'" display_usage - exit 1 - ;; + exit 1 ;; *) - if [ ! -r "$1" ]; then + if [ "$option" = random ]; then + option='$aspect' + elif [ ! -r "$1" ]; then message "$1 isn't an existing wallpaper or a valid option." display_usage exit 1

@@ -296,8 +306,7 @@ exit 1

else wallpaper=$1 break - fi - ;; + fi ;; esac done

@@ -410,7 +419,7 @@ exit 1

;; esac -if [ "$debug" = true ];then +if [ "$debug" = true ]; then debugfbsetbg exit 0 fi

@@ -419,10 +428,11 @@ option=${option:='$full'}

-if [ -z "$DISPLAY" ];then +if [ -z "$DISPLAY" ]; then message "You are not connected to an X session\nPerhaps you should set the DISPLAY environment variable?" exit 1 fi + if [ "$option" = bsetroot ]; then bsetroot $wallpaper

@@ -432,17 +442,52 @@ fi

exit 0 fi + +# random wallpaper code +if [ "$option" = random ]; then + # Lets make one thing clear... + wallpaperdir=$wallpaper + if [ -z "$wallpaperdir" ]; then + message "No random wallpaper directory specified." + exit 1 + fi + if [ -d "$wallpaperdir" ]; then + number_of_wallpapers=`ls $wallpaperdir|wc -l` + # some shells don't support $RANDOM + if [ -z $RANDOM ]; then + randomnumber=`(echo $$ ;time ps; w ; date )2>&1 | cksum | cut -f1 -d' '` + else + randomnumber=$RANDOM + fi + wallpapernumber=`expr $randomnumber % $number_of_wallpapers + 1` + #remember previous wallpaper + if [ ! "$remember" = false ]; then + remembercommand + fi + remember=false + #set -x + wallpaper="$wallpaperdir/`ls $wallpaperdir|sed -n ${wallpapernumber}p`" + option='$aspect' # have to choose something... + else + message "Invalid random wallpaper directory specified." + exit 1 + fi +fi + + if [ ! -r "$wallpaper" ]; then message "Can't find wallpaper $wallpaper" exit 1 fi + $WPSETTER `eval echo $option` "$wallpaper" if [ $? -ne 0 ]; then message "Something went wrong while setting the wallpaper. Run '$WPSETTER "`eval echo $option` $wallpaper"' from an xterm to find out what." exit 1 fi + #remember previous wallpaper if [ ! "$remember" = false ]; then
M util/fluxbox-generate_menu.inutil/fluxbox-generate_menu.in

@@ -22,7 +22,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # -# $Id: fluxbox-generate_menu.in,v 1.5 2003/12/22 01:19:02 fluxgen Exp $ +# $Id: fluxbox-generate_menu.in,v 1.6 2003/12/28 23:59:57 fluxgen Exp $ # # Portability notes:

@@ -1014,6 +1014,7 @@ IFS=: # set delimetor for find

NUMBER_OF_BACKGROUNDS=`find $BACKGROUND_DIRS -follow -type f 2> /dev/null|wc -l` if [ "$NUMBER_OF_BACKGROUNDS" -gt 0 ]; then append_menu "[submenu] (${BACKGROUNDMENU}) {${BACKGROUNDMENUTITLE}}" + append "[exec] (random background) {fbsetbg -r ${HOME}/.fluxbox/backgrounds}" if [ "$NUMBER_OF_BACKGROUNDS" -gt 30 ]; then menucounter=1 ; counter=1 append_menu "[submenu] (${BACKGROUNDMENU} $menucounter) {${BACKGROUNDMENUTITLE}}"