all repos — fluxbox @ 4167ea790cf96b040a29fab64da720cca3a01908

custom fork of the fluxbox windowmanager

patch from Han
fluxgen fluxgen
commit

4167ea790cf96b040a29fab64da720cca3a01908

parent

1f855e63ac917ff8f15ece1ad3380e7d7559e2ce

1 files changed, 12 insertions(+), 8 deletions(-)

jump to
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.9 2003/07/02 05:42:47 fluxgen Exp $ +# $Id: fbsetbg,v 1.10 2003/07/10 11:10:51 fluxgen Exp $ # # Portability notes:

@@ -116,11 +116,13 @@ xmessage -center "$@"

} remembercommand() { - #if the $wallpaper path is absolute - echo $option > $lastwallpaper + grep -vs "${DISPLAY}$" ${lastwallpaper} > ${lastwallpaper}.tmp + mv -f ${lastwallpaper}.tmp ${lastwallpaper} + # Make dir/../../path/file.jpg work case $wallpaper in - /*) echo $wallpaper >> $lastwallpaper ;; - *) echo $PWD/$wallpaper >> $lastwallpaper ;; + # no spaces allowed between the varname and '|' + /*) echo $option'|'$wallpaper'|'$DISPLAY >> $lastwallpaper ;; + *) echo $option'|'$PWD/$wallpaper'|'$DISPLAY >> $lastwallpaper ;; esac }

@@ -244,11 +246,13 @@ wallpaper=$OPTARG

;; l) if [ -r $lastwallpaper ];then - option=`head -n1 $lastwallpaper` - wallpaper=`tail -n1 $lastwallpaper` + option=`grep "${DISPLAY}$" $lastwallpaper|cut -d'|' -f1` + wallpaper=`grep "${DISPLAY}$" $lastwallpaper|cut -d'|' -f2` else message 'No previous wallpaper recorded. You have never used fbsetbg before.' + exit 1 fi + remember=false ;; h) display_help ; exit 0 ;; T) display_tips ; exit 0 ;;

@@ -282,4 +286,4 @@

$WPSETTER $option "$wallpaper" || message "Something went wrong while setting the wallpaper Run '$WPSETTER $option "$wallpaper"' from an xterm to find out what." #remember previous wallpaper -remembercommand +[ ! "$remember" = false ] && remembercommand