ROX desktop utility to add & remove icons.### Beta 4

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

ROX desktop utility to add & remove icons.### Beta 4

#1 Post by sunburnt »

This was an old utility app. I rewrote to make it easy to add and remove desktop icons.
It has Help, in rxvt or Xtem just type: roxDTicon -h

I may write a GUI for it: DtIcon-Manager.

### Beta 2: Added a command MU gave me to refresh the desktop.
........... Unfortunately it makes the desktop blink, I`ll look for a better way.

### Beta 3: Changed the apps. name to: roxDTicon. (makes more sense...)
Using MU`s new command to refresh the desktop. Now it works GREAT !!!.
Now it: Adds an icon, Removes an icon, and Sets (changes) an icon pix.
For help with command usage type: roxDTicon -h

### Beta 4: Rewrote the help section as ecomoney asked.
Be sure to look at the Help, as the command line has changed.
Change is due to the fact it will now auto. place the icons.
Best to get any changes done before apps. are written that use it.

It starts at the bottom of the right column of icons on the left half of the screen.
If that position is filled then it starts a new column at the top of the screen.

>>> Post any Qs or comments...
Attachments
roxDTicon_b4.gz
Gunzip the file and put it into: /usr/bin
(1.64 KiB) Downloaded 662 times
Last edited by sunburnt on Fri 02 Oct 2009, 18:23, edited 6 times in total.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2 Post by sunburnt »

I got a command from MU to refresh the desktop but it makes it blink.
So I haven`t included it in the app. as it`s an unacceptable effect.
I don`t know if I`ll be able to find another way to do it that`s acceptable.

sidders
Posts: 464
Joined: Wed 23 Jul 2008, 18:47
Location: Bolton, uk

#3 Post by sidders »

I havnt found a way apart from restartwm

I have just experimented with inserting the icon code in RC.local. The wm runs after so no need to restart the wm. Thats after the conventional way of loading and SFS.

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#4 Post by ecomoney »

The desktop "Blinking" would be fine if it meant no further manual intervention was necessary if thats what it takes. Perhaps putting up an "xmessage" for a second befroe the blink saying "Refreshing desktop..." would be enough to alleviate any user anxiety.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#5 Post by sunburnt »

I`ve seen other apps. put icons on the desktop without the blink.
And when you drag a folder or file to the desktop it just appears also...
A popup message... Hummmm Maybe...

I made a desktop USB flash drive icon for usb-auto to turn it on and off.
The icon`s red, click & it turns green & runs usb-auto, click again & off.
Sometimes it works great, and other times it doesn`t change the icon.

sidders; Here`s the command to refresh the desktop ( ROX`s pinboard ):

Code: Select all

rox -p /root/Choices/ROX-Filer/PuppyPin

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#6 Post by MU »

look at /sbin/pup_event_frontend_d
It adds the hotplug drive-icons using SOAP.

SOAP is a XML string that you can send to rox.

Code: Select all

 echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
  <PinboardAdd>
   <Path>/root/.pup_event/drive_${ONEDRVNAME}</Path>
   <X>${COORD_X}</X>
   <Y>${COORD_Y}</Y>
   <Label>${ONEDRVNAME}</Label>
   <Args>${DRV_CATEGORY} ${FSTYPE}</Args>
  </PinboardAdd>
 </env:Body>
</env:Envelope>"  | rox -R
So the whole XML code is sent via "echo" using a pipe "|" to rox.

It seems that the Path is including files like:
/root/.pup_event/drive_sda1/AppInfo.xml
This file then has informations to create a rightclick menu.

It also should be able, to define the icon directly in the XML-Code.

Maybe so (untested):

Via google I find:
http://209.85.135.132/search?q=cache:ek ... ient=opera

This is one of the older hotplug scripts.
Maybe this works after looking at it:

Add "rxvt" to the desktop:

Code: Select all

 echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
  <PinboardAdd>
   <Path>/usr/bin/rxvt</Path>
   <X>500</X>
   <Y>500</Y>
   <Label>Consolewindow</Label>
   <Args></Args>
  </PinboardAdd>
 </env:Body>
</env:Envelope>"  | rox -R
To assign an icon:

Code: Select all

 echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
  <SetIcon>
    <Path>rxvt</Path>
    <Icon>/usr/local/lib/X11/pixmaps/console48.png</Icon>
  </SetIcon>
 </env:Body>
</env:Envelope>"  | rox -R
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#7 Post by sunburnt »

Mark finds it again! He never fails to impress....
# First, I don`t see how the XML code changes the globicons file.
......... I can only guess that ROX is using the info. to change the file.
# Second, what the 2 web addresses are in it for is confusing too.
......... The SetIcon section looks the same as gtkDialog.

The code below is to change an existing icon red/green/red/green etc.
It changes the file: globicons, but the desktop isn`t refreshed with it.
The apps. icon changed to the standard script icon and stays that way.
To see if I could fix it, I tried: rox -p /root/Choices/ROX-Filer/PuppyPin
It stays the script icon even though the globicons file tells it otherwise.
I really thought running the ROX command would at least bring it back.
I run SeaMonkey400, it doesn`t have hotplug in it, is this the problem?

Code: Select all

echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
  <SetIcon>
    <Path>/mnt/home/apps/bin/auto-mnt</Path>
    <Icon>`cat /tmp/auto-mnt_icon`</Icon>
  </SetIcon>
 </env:Body></env:Envelope>" | rox -R
My code had also changed the globicons file, still the refresh problem.

Code: Select all

sed -i "s#$iconOFF#$iconON#" $orgGI
It seems that a command to refresh the desktop icons is still needed...

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#8 Post by amigo »

'rox -x APP_DIR' will refresh the icon, where APP_DIR is the path to the appdir.

I wrote a Trash appdir which changes it's icon depending on how full the trash is. I'll post the code for the AppRun here:

Code: Select all

#!/bin/sh
# RecycleBin-0.4
# copyright 2006 Gilbert Ashley <amigo@ibiblio.org>
# See the documentation
EXEC_NAME=`basename "$0"`
# Set the name of the main executable here.
PROG=Trash
# This is needed for CHOICES_DIR -set to EXEC_NAME for version specific
APP_NAME=RecycleBin
#
DEFAULT_OPTIONS="
TRASH_DIR=${HOME}/Desktop/Trash
TRASH_WARN=20
TRASH_FULL=50
"

COUNT=0
for OPTION in $DEFAULT_OPTIONS ; do
(( COUNT++ ))
declare DEFAULT_OPTION_TAG[$COUNT]="$(echo $OPTION |cut -f1 -d=)"
declare DEFAULT_OPTION_VALUE[$COUNT]="$(echo $OPTION |cut -f2- -d=)"
done

# Check for links and get APP_DIR
if [ ! -L "$0" ] ; then
	APP_DIR=`dirname "$0"`
	APP_DIR=`cd "$APP_DIR";pwd`
elif [ ! -z `which readlink 2> /dev/null` ] ; then
	APP_DIR=`readlink -f "$0"`
	APP_DIR=`dirname "$APP_DIR"`
else
	echo "$PROG: Can't get real path to AppRun!" 1>&2
fi
export APP_DIR
# EXEC_NAME=`basename "$0"`
# Add APP_DIR/Resources to the path and read in FUNCTIONS
PATH="$APP_DIR":"$APP_DIR/Resources":$PATH
source "$APP_DIR/Resources/AppFunctions"

# Option: Detect the PLATFORM
PLATFORM=`get_platform`
# Or specify a simple local binary path(wrapped binary or shell):
PLATFORM=bin

# Add the BIN_DIR to the path
BIN_DIR="$APP_DIR/$PLATFORM"
PATH="$APP_DIR/$PLATFORM":$PATH
export PATH

# Use CHOICES dir if needed -be sure you have set APP_NAME above
get_choices_dir ;

# Here is where we put the default choices. $HOME/Choices/$APP_DIR
# Uncomment this if we need to set or retrieve any options.
if [[ $CHOICES_DIR != '' ]] && [[ ! -e $CHOICES_DIR/Settings ]] ; then
	mkdir -p $CHOICES_DIR
	cat /dev/null > $CHOICES_DIR/Settings
	COUNT=0
	IFS=$'\n'
	for OPTION in $DEFAULT_OPTIONS ; do
		(( COUNT++ ))
		echo ${DEFAULT_OPTION_TAG[$COUNT]}=${DEFAULT_OPTION_VALUE[$COUNT]} >> $CHOICES_DIR/Settings
	done
fi
#
if [[ -e $CHOICES_DIR ]] ; then
	if [[ -e $CHOICES_DIR/Settings ]] ; then
		source $CHOICES_DIR/Settings
	else
		COUNT=0
		IFS=$'\n'
		for OPTION in $DEFAULT_OPTIONS ; do
			(( COUNT++ ))
			declare ${DEFAULT_OPTION_TAG[$COUNT]}=${DEFAULT_OPTION_VALUE[$COUNT]}
		done
	fi
fi
#cd $APP_DIR ;

# Simply changing the icon image doesn't cause the display to update
# This is a nice trick to update the display without waiting for a mouse-over
function update_icon() {
# update the display
( UPDATE_ICON=1 ; rox -x ${APP_DIR} )
}

function calculate_usage() {
cd $TRASH_DIR ;

SIZE=$(expr $(du -s --exclude=.Trash.data |cut -f1) / 1024)
#xterm -hold -e echo "$SIZE $TRASH_FULL"

	if [[ $SIZE -gt $TRASH_FULL ]] ; then
	 cp -f "$APP_DIR/Full.png" "$APP_DIR/.DirIcon"
	#elif [[ $(eval du -s --exclude=.Trash.data |cut -f1) -gt $TRASH_WARN ]] ; then
	elif [[ $SIZE -gt $TRASH_WARN ]] ; then
	 #xterm -hold -e echo "$SIZE $TRASH_WARN"
	 cp -f "$APP_DIR/Warn.png" "$APP_DIR/.DirIcon"
	else
	 cp -f "$APP_DIR/Empty.png" "$APP_DIR/.DirIcon"
	fi

	ignore() {
	if [[ $(eval du -s --exclude=.Trash.data |cut -f1) -gt $TRASH_FULL ]] ; then
	 cp -f "$APP_DIR/Full.png" "$APP_DIR/.DirIcon"
	elif [[ $(eval du -s --exclude=.Trash.data |cut -f1) -gt $TRASH_WARN ]] ; then
	 cp -f "$APP_DIR/Warn.png" "$APP_DIR/.DirIcon"
	else
	 cp -f "$APP_DIR/Empty.png" "$APP_DIR/.DirIcon"
	fi
	}
}

#
if [[ $# = 0 ]] ; then
	# What to do if icon is simply clicked.
	# don't do anything if we are just updating the icon
	if [[ $UPDATE_ICON ]] ; then
	exit 0
	# or insert a routine here to select a PROG
	# xterm -hold -e echo "What to do if the icon is simply clicked. See line 55"
	# Then exit if needed
	# exit 0
	else
		# If the TRASH_DIR doesn't exist we need to setup
		if [[ -d $TRASH_DIR ]] ; then
			# open the Trash
			rox $TRASH_DIR ; exit 0
		else
		 xterm -hold -geometry 40x5 -e echo "No TRASH_DIR found. Configure Me!"
		fi
	fi
elif [[ $1 == '--help' ]] ; then
	# Put menu options here that you have added to AppInfo.xml 
	xterm -hold -e cat $APP_DIR/Help/README
	exit 0
elif [[ $1 == '--showvolume' ]] ; then
	# Put menu options here that you have added to AppInfo.xml 
	if [[ -d $TRASH_DIR ]] ; then
		if [[ $TRASH_FULL ]] ; then
		#calculate_usage
		cd $TRASH_DIR ;
		SIZE=$(expr $(du -s --exclude=.Trash.data |cut -f1) / 1024)
		#xterm -hold -e echo "Trash is $( expr $SIZE/$TRASH_FULL) full"
		xterm -hold -geometry 60x5 -e echo "$SIZE MB of $TRASH_FULL MB used for $TRASH_DIR"
		fi
	exit 0
	
	fi
elif [[ $1 == '--showdata' ]] ; then
	if [[ -e $TRASH_DIR/.Trash.data ]] ; then
	  xterm -hold -geometry 110x10 -e cat $TRASH_DIR/.Trash.data
	fi
elif [[ $1 == '--restoreitems' ]] ; then
 cd $TRASH_DIR ;
 cat > /tmp/FILELIST <<EOF
Xdialog --title "Restore Items" --backtitle "Select items to restore" \\
		--stdout --separator "\n" \\
		--checklist "hello, this is a --checklist..." 0 0 0 \\
EOF

IFS='
' 
	for item in $(cat /root/Trash/.Trash.data) ; do
	name=$(echo $item |cut -f1 -d ' ')
	loc=$(echo $item |cut -f2 -d ' ')
	echo -n $(basename $name)" " >> /tmp/FILELIST
	echo -n $(dirname $loc)" " >> /tmp/FILELIST
	echo "no \\" >> /tmp/FILELIST
	done
	echo "1> /tmp/builtlist" >> /tmp/FILELIST
	
	. /tmp/FILELIST
	
	cd $TRASH_DIR ;
	
	for file in $(cat /tmp/builtlist) ; do
		/usr/apps/RecycleBin/AppRun $TRASH_DIR/$file
	done
elif [[ $1 == '--configure' ]] ; then
	# Put configure options interface here if needed
	if [[ -d  $CHOICES_DIR ]] ; then
	   
	   if [[ -e $CHOICES_DIR/Settings ]] ; then
	     MYOPTIONS=$(Xdialog --stdout --title "Hello" --inputbox "Set Trash Directory" 0 0 ${TRASH_DIR} \
	     --title TrashMan --spinbox "Set Trash Warn Size" 0 0 1 1000 "${TRASH_WARN}" "Show yellow when ${TRASH_WARN}MB full" \
	     --title TrashMan --spinbox "Set Trash Full Size" 0 0 1 1000 "${TRASH_FULL}" "Show red when ${TRASH_FULL}MB full")
	   else
	     MYOPTIONS=$(Xdialog --stdout --title "Hello" --inputbox "Set Trash Directory" 0 0 ${DEFAULT_OPTION_VALUE[1]} \
	     --title TrashMan --spinbox "Set Trash Warn Size" 0 0 1 1000 ${DEFAULT_OPTION_VALUE[2]} warn \
	     --title TrashMan --spinbox "Set Trash Full Size" 0 0 1 1000 ${DEFAULT_OPTION_VALUE[3]} full)
	   fi
	   
	   case $? in
		0)
			cat /dev/null > $CHOICES_DIR/Settings
			COUNT=0
			IFS=$'\n'
			for MYOPTION in $MYOPTIONS ; do
			(( COUNT++ ))
			declare MYOPTION[$COUNT]=${DEFAULT_OPTION_TAG[$COUNT]}=$MYOPTION
			echo ${MYOPTION[$COUNT]} >> $CHOICES_DIR/Settings
			done
			#
			if ! [[ -d $TRASH_DIR ]] ; then
				Xdialog --wrap --title "Create Directory?" --yesno "The TRASH_DIR doesn't \
				exist yet. Would you like me to create it?" 0 0
				case $? in
					0)
						mkdir -p $TRASH_DIR
						if [[ $? = 0 ]] ; then
						  Xdialog --center --title "RecycleBin" --msgbox "$TRASH_DIR created" 0 0
						fi
						;;
				esac
			 
			fi
		;;
		1|255)
			exit
		;;
	   esac
	   
	else
	  rox $CHOICES_DIR ; exit 0 
	fi
elif [[ $1 == '--view' ]] ; then
	rox $TRASH_DIR ; exit 0
elif [[ $1 == '--empty' ]] ; then
	# Use Xdialog, gtk-shell or greq for a simple interface
	Xdialog --under-mouse --title "Empty TrashCan" --yesno "Delete all files from trash?" --default-no 0 
	#gtk-shell -t "Empty Recycle Bin" -l "Delete all files from trash?" -b OK -ec 1 -eol 
	#greq -t "Empty TrashCan" -p "Delete all files from trash?" -oOK -aCancel ; echo $?  
	if [[ $? = 1 ]] ; then
	 exit 0
	else
		cd $TRASH_DIR;
		for OBJ_NAME in $(ls -1d * | grep -v '.Trash.data') ; do
		rm -r $OBJ_NAME
		if [[ $? = 0 ]] ; then
			cat $TRASH_DIR/.Trash.data |grep -v "$OBJ_NAME" > $TRASH_DIR/.Trash.tmp
			rm -f $TRASH_DIR/.Trash.data &> /dev/null
			cp $TRASH_DIR/.Trash.tmp $TRASH_DIR/.Trash.data &> /dev/null
			rm -f $TRASH_DIR/.Trash.tmp &> /dev/null
		fi
		done
		calculate_usage
		update_icon
	 exit 0
	fi
elif [[ $1 == '--compile' ]] ; then
	shift
	standard_compile || exit 1
elif [[ $# > 0 ]] ; then
	# What to do if a file or files is dropped on the AppDir
	# This loop will handle multiple file selections
	for f in "$@" ; do
	 #xterm -hold -e echo "File Operations for: $f. See line 76"
	 # usually: 
	 OBJECT=${f%/}
	 OBJ_NAME=$(basename $OBJECT)
	 OBJ_LOC=$(dirname $OBJECT)
	
	 if [[ "$OBJECT" = "$TRASH_DIR/$OBJ_NAME" ]] ;then 
		if [[ "$(cat $TRASH_DIR/.Trash.data |grep "$OBJ_NAME")" != "" ]] ;then
		# OBJ_NAME=$(cat $TRASH_DIR/.Trash.data |grep "$f")
		ORIG_FILE="$(cat $TRASH_DIR/.Trash.data |grep $OBJ_NAME |cut -f2 -d' ')"
		ORIG_LOC=$(dirname $ORIG_FILE)
		
			# if the item exists in the TRASH_DIR recycle it
			if [[ -z $(ls -1d -- $f |egrep '^${TRASH_DIR}' 2> /dev/null) ]] ; then
			cd $TRASH_DIR;
			cp -R $OBJ_NAME $ORIG_FILE &> /dev/null
				if [[ $? = 0 ]] ; then
				 rm -rf $OBJ_NAME &> /dev/null
				fi
				if [[ $? = 0 ]] ; then
				 cat $TRASH_DIR/.Trash.data |grep -v "$OBJ_NAME" > $TRASH_DIR/.Trash.tmp
				 rm -f $TRASH_DIR/.Trash.data &> /dev/null
				 cp $TRASH_DIR/.Trash.tmp $TRASH_DIR/.Trash.data &> /dev/null
				 rm -f $TRASH_DIR/.Trash.tmp &> /dev/null
				fi
			fi
		fi
	 else
		#xterm -hold -e echo "$OBJ_NAME $OBJ_LOC $f"
		#ft=tar.bz ; echo ${ft#*.}
		#if [[ "$(echo)" ]]
		TIME_STAMP=$(date +%Y%m%d%H%M%S)
		RIGHT_OF_LAST_PERIOD="${OBJ_NAME##*.}"
		LEFT_OF_LAST_PERIOD=$(basename $OBJ_NAME ".$RIGHT_OF_LAST_PERIOD")
		if [[ "$LEFT_OF_LAST_PERIOD" = "$RIGHT_OF_LAST_PERIOD" ]] ; then
			# name has no extension
			NEW_NAME=$OBJ_NAME.$TIME_STAMP
		else
			NEW_NAME=$LEFT_OF_LAST_PERIOD.$TIME_STAMP.$RIGHT_OF_LAST_PERIOD
		fi
		# xterm -hold -e echo "$OBJ_NAME $OBJ_LOC $f $NEW_NAME $LEFT_OF_LAST_PERIOD $RIGHT_OF_LAST_PERIOD"
		cp -R $f $TRASH_DIR/$NEW_NAME
		if [[ $? = 0 ]] ; then
		 rm -rf $f
		fi
		if [[ $? = 0 ]] ; then
		 echo $NEW_NAME $f >> $TRASH_DIR/.Trash.data
		else
		 rm -rf $TRASH_DIR/$NEW_NAME &> /dev/null
		fi
	 fi
	done
	# check how much stuff is in the trash and set the icon accordingly
	calculate_usage
	# Then update the display
	update_icon
fi

exit 0

# This is useful if you make symlinks of the program binary names in 
# your path and then link them to the AppRun.
EXEC_FILE_PATH="$APP_DIR/$PLATFORM/$EXEC_NAME"
if [[ -x "$EXEC_FILE_PATH" && $EXEC_NAME != 'AppRun' ]] ; then
	exec "$EXEC_FILE_PATH" "$@"
elif [ $EXEC_NAME != 'AppRun' ] ; then
	echo "Unable to find $EXEC_NAME in binary directory." 
fi

BIN=$BIN_DIR/$PROG

if [ -x "$BIN" ]; then
  exec $DEBUGGER "$BIN" "$@"
  
  else
  echo "ERROR from $0:" >&2
  echo "I cannot find an executable file for your host type ($PLATFORM)." >&2
  echo "Trying to compile..." >&2
  if [ -n "$DISPLAY" ]; then
    xterm -e "$0" --compile
  else
    "$0" --compile
  fi
  if [ -x "$BIN" ]; then
    exec Trash -r "$@"
  fi
  exit 1
fi
I've attached an archive of the complete app. Note that it refreshes itself, so it has a trap which checks to see if it is refreshing and exits without 'doing' anything else -see line 118 of AppRun
Attachments
RecycleBin.tar.gz
Recycling trash can
(37.71 KiB) Downloaded 616 times

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#9 Post by sunburnt »

Hi amigo; I tried and it didn`t change the icon either...
At the bottom you can see all the lines I tried.

Code: Select all

iconPATH=/usr/local/lib/X11/pixmaps/						# set path & icons
iconON='usbflash_green-48'
iconOFF='usbflash_red-48'

if [ -n "$1" ];then						# if argument
 orgGI=$1
else									# if no argument
 orgGI=/root/Choices/ROX-Filer/globicons
fi
PID=`ps -C auto-drive | grep -v PID`			# get app. process

if [ -z "$PID" ];then						# if app. not running, run
 auto-drive &
 if [ $? -eq 0 ];then							# if app. started
  sed -i "s#$iconOFF#$iconON#" $orgGI				# on icon
 fi
else										# if app. running, kill it
 kill `echo $PID | awk '{print $1}'`
 if [ $? -eq 0 ];then							# if app. killed
  sed -i "s#$iconON#$iconOFF#" $orgGI				# off icon
 fi
fi

#rox -x /initrd/mnt/dev_save/apps/bin/auto-mnt
rox -x /initrd/mnt/dev_save/apps/bin
#rox -x /root/Choices/ROX-Filer
#rox -x $orgGI
#rox -x globicons
It seems it should be the globicons file in the command, FILE has changed.
ROX --help

Code: Select all

  -x, --examine=FILE    FILE has changed - re-examine it

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#10 Post by amigo »

I think this:
/initrd/mnt/dev_save/apps/bin/auto-mnt
would have to be an AppDir for that to work.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#11 Post by MU »

my example above was correct, just one error, the <Path> was different in both examples.
One was "/usr/bin/rxvt", the other just "rxvt". Iff you correct that, it works.

Here are two small scripts:

addicon

Code: Select all

#!/bin/bash

 echo "<?xml version=\"1.0\"?> 
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\"> 
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\"> 
  <PinboardAdd> 
   <Path>$1</Path> 
   <X>$2</X> 
   <Y>$3</Y> 
   <Label>$4</Label> 
   <Args>$5</Args> 
  </PinboardAdd> 
 </env:Body> 
</env:Envelope>"  | rox -R

addiconpicture

Code: Select all

#!/bin/bash

 echo "<?xml version=\"1.0\"?> 
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\"> 
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\"> 
  <SetIcon> 
    <Path>$1</Path> 
    <Icon>$2</Icon> 
  </SetIcon> 
 </env:Body> 
</env:Envelope>"  | rox -R
Usage:
Create a new icon (for rxvt without scrollbar):
addicon /usr/bin/rxvt 200 500 "Console Window" +sb

Add a picture:
addiconpicture /usr/bin/rxvt /usr/local/lib/X11/pixmaps/archive48.png
Set a different picture:
addiconpicture /usr/bin/rxvt /usr/local/lib/X11/pixmaps/console48.png

The changes are visible immedeatly on the desktop without performing further steps.
Tested in Newyearspup rc10.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#12 Post by sunburnt »

amigo; the app. exec. is auto-mnt, so the path to it is: /root/apps
Is this what you ment by "AppDir"?

Mark; I tried using the code and it makes the icon, but it won`t change it.
I`ve tried it many different ways... This really should work:

Code: Select all

#!/bin/sh
if [ -n "$3" ];then										### Make DT icon
 echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
  <PinboardAdd>
   <Path>$1</Path>
   <X>$2</X>
   <Y>$3</Y>
   <Label>$4</Label>
   <Args>$5</Args>
  </PinboardAdd>
 </env:Body>
</env:Envelope>"  | rox -R

 if [ -z "$6" ];then exit ;fi
 icon=$6
else
 icon=$2
fi
																	### Change Icon
 echo "<?xml version=\"1.0\"?>
<env:Envelope xmlns:env=\"http://www.w3.org/2001/12/soap-envelope\">
 <env:Body xmlns=\"http://rox.sourceforge.net/SOAP/ROX-Filer\">
  <SetIcon>
    <Path>$1</Path>
    <Icon>$icon</Icon>
  </SetIcon>
 </env:Body>
</env:Envelope>"  | rox -R

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#13 Post by MU »

yes, your example works here.
./sunburnttest /usr/bin/rxvt /usr/local/lib/X11/pixmaps/console48.png

So you have a different rox?
Which Puppy do you use?
What do you get from
rox --version
?

I get:
# rox --version
ROX-Filer 2.6.1
Copyright (C) 2005 Thomas Leonard.
ROX-Filer comes with ABSOLUTELY NO WARRANTY,
to the extent permitted by law.
You may redistribute copies of ROX-Filer
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Compiled with GTK version 2.12.1
Running with GTK version 2.14.4

-- features set at compile time --

Large File Support... Yes
Dnotify support... Yes
Binary compatibility... No (apsymbols.h not found)
Extended attribute support... Yes
#
Do your hotplug icons work? Those drive icons at the bottom of the screen.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#14 Post by sunburnt »

Mark; I use Puppy 400 SeaMonkey with no hotplug in it, is that the problem?
It will create the icon, but the setting the icon pix doesn`t work.

Code: Select all

# rox --version
ROX-Filer 2.6.1
Copyright (C) 2005 Thomas Leonard.
ROX-Filer comes with ABSOLUTELY NO WARRANTY,
to the extent permitted by law.
You may redistribute copies of ROX-Filer
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Compiled with GTK version 2.12.1
Running with GTK version 2.12.1

-- features set at compile time --

Large File Support... Yes
Dnotify support... Yes
Binary compatibility... No (apsymbols.h not found)
Extended attribute support... Yes
The GTK version is older than yours...

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#15 Post by MU »

I have no idea unfortunately, why it will not work on your system :(

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#16 Post by sunburnt »

Thanks Mark; I`ll try it on a different Puppy version, going out awhile now.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#17 Post by disciple »

amigo, how else does your Trash roxapp compare with the one in Puppy?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

My apologies Mark, my bad code writing and I left ".png" off of the icon.
Your code works beautifully now that I`ve overcome my stupidity.
Many thanks for once again for your help. I doubt I`d have found this.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#19 Post by amigo »

I'm not sure how my trash app compares with any final version included in puppy. For a long time I followed a thread here where a trash app was being develeoped. But about half way trhough, it had already truned into a back-up system with versioning.
Mine allows you to restore items to their original location. I was following the desktop.org standard for a trash app, except I never implemented the separate-trashdir-for-separate-drive concept.
My app is mcuh cleaner in operation as it doesn't create a new AppDir for each item you put in the trash. It simply keeps a single-file database of what is in the trash -this is also different from the desktop.org standard which calls for an individual file for each item.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#20 Post by disciple »

Ah, right. Thanks for that explanation.
The thread you're referring to will be the one I started just to discuss possible improvements to Puppy's Trash. So far no one has cared enough about any of the suggestions to implement them.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply