2 commands for 1 icon


Forum: X and Fluxbox
Topic: 2 commands for 1 icon
started by: nibznik

Posted by nibznik on Nov. 20 2004,03:06
hey guys, im trying to make an icon that will open up emelfm for my winXP and have it automatically mounted, i tried

Code Sample

table Icon
 Type: Program
 Caption: Windows Partition
 Command: sudo mount /dev/hda2, sudo emelfm /mnt/hda2
 Icon: .xtdesktop/exec_wine.png
 X: 184
 Y: 103
end



on my .ink for the windows partition icon
but it just didn't work any suggestions?

Posted by mikshaw on Nov. 20 2004,04:02
Command: sudo mount /dev/hda2; sudo emelfm /mnt/hda2
or
Command: sudo mount /dev/hda2 && sudo emelfm /mnt/hda2

I really don't know if this works in xtdesktop, but if the commands are passed to bash it should work.
The first one runs both commands in sequence.  The second one runs the second command only if the first is successful.

Posted by nibznik on Nov. 20 2004,17:02
i just added sudo mount /dev/hda2 to my fluxinitrc (im using flux 0.9) so when i start up it is connected. And then i just emelfm to it when i need it
Posted by ico2 on Nov. 20 2004,23:59
try putting a semicolon (;) after the first command and before the second, keep it all on one line, should work
Posted by mikshaw on Nov. 21 2004,18:07
Another option (the recommended option) to adding the command to a startup file is to edit /etc/fstab.  Look for the the line concerning hda2 and change "noauto" to "auto".  If there's no "noauto" you should be able to just add "auto" to the options.
This will automatically mount the drive at boot time.
Note: this is pointless if you're not using HD install.

Posted by henk1955 on Nov. 21 2004,19:50
Code Sample
#!/bin/bash


FSTAB=/etc/fstab
TMPDIR=/home/dsl

# change noauto, to auto, mount for use of mount -a

sed 's/ noauto,/ auto,/g' $FSTAB >$TMPDIR/fstab.1


# double mount of /cdrom will make filetool.sh backup fail
# to prevent the double mount of the /cdrom
# find the device for mointpoint /cdrom

MOUNTPOINT="$(grep -i /cdrom\   /etc/mtab|awk '{print $1}')"

#this is the line we will remove

REMLINE="$(grep -i $MOUNTPOINT $TMPDIR/fstab.1)"

# copy all lines we want to keep

grep -v $MOUNTPOINT $TMPDIR/fstab.1 >$TMPDIR/fstab.2

# tell wich line we removed
echo "#Removed by HENK1955" >>$TMPDIR/fstab.2
echo "#$REMLINE" >>$TMPDIR/fstab.2

cp -f $TMPDIR/fstab.2 $FSTAB



i call this script in bootlocal.sh and add a line
sudo mount -a

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.