Updated Hotpup

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Updated Hotpup

#1 Post by Dougal »

I updated Hotpup to use Barry's hotplug2stdout utility (included), so it
detects devices based on kernel events.
This should make it more reliable and also faster.

UPDATE: now using xwininfo instead of xrandr, so should work with Puppy4
UPDATE2: moved hotplug2stdout into appdir (using old version)

UPDATE: March 2009: added updated version for 4.1(12).
Last edited by Dougal on Sun 12 Apr 2009, 09:30, edited 5 times in total.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

Re: Updated Hotpup

#2 Post by ttuuxxx »

Dougal wrote:I updated Hotpup to use Barry's hotplug2stdout utility (included), so it
detects devices based on kernel events.
This should make it more reliable and also faster.
Hi Dougal I've tried hotpup a few times with different versions and also used the config utility but the problem I always get is the icons all moving to the top left-hand corner of the screen every time I resetX or reboot.
Does this version also do this?
thanks for your time.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
prehistoric
Posts: 1744
Joined: Tue 23 Oct 2007, 17:34

Re: Updated Hotpup

#3 Post by prehistoric »

ttuuxxx wrote:
Dougal wrote:I updated Hotpup to use Barry's hotplug2stdout utility (included), so it
detects devices based on kernel events.
This should make it more reliable and also faster.
Hi Dougal I've tried hotpup a few times with different versions and also used the config utility but the problem I always get is the icons all moving to the top left-hand corner of the screen every time I resetX or reboot.
ttuuxxx, I think you may have issues with fixes found, but not yet applied, in the latest "Chihuahua" alpha 6. Also, Hotpup needs to be run under the control of the wm, not as a completely unrelated process. MU's Muppy 008.3c does this with autostart, and I am not getting the pileups there, with fixes parallelling the ones I've tested in alpha 6. Putting the script that starts Hotpup in Startup may be enough. If not, check on what MU is doing with Muppy.

Edited: I just enabled the old Hotpup daemon and did half a dozen wm restarts in my patched alpha 6 without drive icon pileups. If this version changes for the better I don't expect any problems at all. I've been waiting for tronkel to incorporate my changes into "Chihuahua" before letting them loose on the world. This thread provoked me into explaining the X race condition fixes. I applied the corresponding changes to Muppy and 4.00, but have not tested much. Let me know your experiences.

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

#4 Post by MU »

To solve the issues with the icons in the top left corner:

http://www.murga-linux.com/puppy/viewtopic.php?t=27756

My colleague told me, that fixes it with his Nvidia-card.

xscreensize gets width and height directly using Xlib (the Xserver-API), and does not use external tools like xrandr or /etc/videomode, that might give wrong results depending on the graficscard.

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

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#5 Post by Dougal »

I've updated the package in the original post, so it now uses xwininfo instead of xrandr.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
prehistoric
Posts: 1744
Joined: Tue 23 Oct 2007, 17:34

Works with 3.02 alpha 6

#6 Post by prehistoric »

@Dougal,

This looks like a winner! Just tested with "Chihuahua" alpha 6 and it looks good. The cpu cycles consumed have clearly decreased. I can't tell you about glitches caused by concurrency problems because I had reached the point with patches to "Chihuahua" where I could run the old Hotpup with only rare glitches.

Found a strange behavior which hardly counts as a bug. On my laptop (Dell Latitude D600) I have the option of removing the DVD and putting a second battery in the drive bay. I had configured Hotpup to ignore CD/DVD/floppy drives unless media were inserted. When I power up after installing the second battery, the DVD drive icon appears and remains until forcibly removed. In this case, the media are not present - neither is the drive!

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post by BarryK »

Dougal,
I have modified hotplug2stdout in the latest Puppy4. It now returns a lot more information with each uevent. On a single line, it is something like this:

add@/device<etc> DEVPATH=<devpath> MAJOR=<major> MINOR=<minor> <and more parameters>

The first field is as per my earlier hotplug2stdout, the following fields are all parameters, so you can cut off fields 2 onwards and 'eval' them in your script.

I'll just run it now to give an actual example. I'll plug in a pen drive and show just one uevent here:

# hotplug2stdout
add@/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host2/target2:0:0/2:0:0:0/block/sdb ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host2/target2:0:0/2:0:0:0/block/sdb SUBSYSTEM=block MAJOR=8 MINOR=16 DEVTYPE=disk SEQNUM=1125

There is also now a major difference from before. hotplug2stdout now outputs the string
TWOSECTIMEOUT
every two seconds if no uevent has occurred.
I use this in my pup_eventd for things that have to happen periodically, such as probing the CD/DVD drive.

You will probably have to check that it works in Pup 4.1alpha, as the 2.6.25.4 kernel has some changes to the layout in /sys. Some uevents are also different from those in the 2.6.21.7 kernel.

Of course you can use any version of hotlug2stdout if you are going to bundle it in your hotpup package. My executable is at /sbin.

Executable attached:
Attachments
hotplug2stdout.gz
(1.9 KiB) Downloaded 460 times
[url]https://bkhome.org/news/[/url]

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#8 Post by Dougal »

BarryK wrote:There is also now a major difference from before. hotplug2stdout now outputs the string
TWOSECTIMEOUT
every two seconds if no uevent has occurred.
Hmm, that's pretty bad, as it will just cause it to keep waking up. I'll probably use the older version and place it in the Hotpup directory. (I use a separate loop inside hotpup to monitor cd drives).
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Re: Works with 3.02 alpha 6

#9 Post by Dougal »

prehistoric wrote:Found a strange behavior which hardly counts as a bug. On my laptop (Dell Latitude D600) I have the option of removing the DVD and putting a second battery in the drive bay. I had configured Hotpup to ignore CD/DVD/floppy drives unless media were inserted. When I power up after installing the second battery, the DVD drive icon appears and remains until forcibly removed. In this case, the media are not present - neither is the drive!
That's obviously a bug, but I think it might originate in rc.local0...
When you boot without the dvd drive, does the link /dev/dvd exist?
I think what might happen is that the link stays from the previous boot and hotpup sees it and adds an icon.
I've added a check to make sure the device the link points to appears in /proc/diskstats, I hope it works... (I did it on a machine with no cd drive)
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
dinky
Posts: 699
Joined: Sat 19 Jan 2008, 23:39

HotPup for Xfce

#10 Post by dinky »

Hi dougal, great program, I love Hotpup. Would really like to update my xfce version, which was edited by gray for NOP. I've got an xfce based pupplet called tigerpup, which I'd love to be able to include an updated hotpup with. Could you let me know what I need to edit to make it work under xfce? I've tried, but no luck. Thanks!
~dinky

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Re: HotPup for Xfce

#11 Post by Dougal »

dinky wrote:Hi dougal, great program, I love Hotpup. Would really like to update my xfce version, which was edited by gray for NOP. I've got an xfce based pupplet called tigerpup, which I'd love to be able to include an updated hotpup with. Could you let me know what I need to edit to make it work under xfce? I've tried, but no luck. Thanks!
~dinky
There's no way of adding icons to the xfce-desktop from outside, so the only way to use it with xfce is to run xfce without xfce-desktop (which also means no right-click menu).
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
dinky
Posts: 699
Joined: Sat 19 Jan 2008, 23:39

#12 Post by dinky »

Well, I'm writing this from TigerPup, which is Xfce-based, with 6 hard drive icons on the desktop. They mount when I click them, they unmount when I click them. When I add a cd or usb, more icons appear. I also have the desktop menu when I right click on it. This is all from your original hotpup program which gray edited for xfce and NOP. I haven't changed anything.

So does this mean that you have added changes to this updated version of Hotpup that make it impossible to run in xfce? Can you tell me what those changes are so I can reverse them? I'm happy to put some work into this, but I need to know what to do. Do you need help developing this for xfce? My skills are limited, but I'm happy to help where I can.

It seems to me you are saying something isn't possible when I've been doing and using it for the past 3 months... any thoughts on this? Would you like me to send you the original hotpup Gray edited, so you can tell me what to do for this latest update? Cheers.
~dinky

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#13 Post by Dougal »

dinky wrote:Well, I'm writing this from TigerPup, which is Xfce-based, with 6 hard drive icons on the desktop. They mount when I click them, they unmount when I click them. When I add a cd or usb, more icons appear. I also have the desktop menu when I right click on it. This is all from your original hotpup program which gray edited for xfce and NOP. I haven't changed anything.

So does this mean that you have added changes to this updated version of Hotpup that make it impossible to run in xfce?
I don't know how you have xfce set up so hotpup works with it... maybe xfce-desktop is turned off -- in which case my updated version should work ok -- or maybe Thunar is controlling desktop icons -- which would mean Hotpup was modified to interact with Thunar.

If you package the /etc/Hotpup directory and post it here I can have a look and see what exactly gray did and update it.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
dinky
Posts: 699
Joined: Sat 19 Jan 2008, 23:39

#14 Post by dinky »

Hi Dougal, thanks for your reply. Am away so couldn't reply earlier. Here is my /etc/hotpup directory, as well as the original package from gray. Am pretty sure he altered hotpup for use with Xfce. Really appreciate you taking a look at this, I love using xfce, and wouldn't want to live without hotpup now. Looking forward to using your update. Cheers!
~dinky
Attachments
hotpupx.pet
(49.95 KiB) Downloaded 718 times
etc_hotpup.tar.gz
(48.61 KiB) Downloaded 434 times

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#15 Post by Dougal »

Ok, I updated hotpupx to match the latest hotpup. I also went over the extra scripts in it and updated them a bit to fix some things and make them run faster. I also added my "mount" script, that supports ntfs mounting with fstab.
I hope this works ok... hotplug2sdtout has changed the way hotpup works, so I had to add a special function to periodically update the icons (but do we really need it?? I'm not even sure anymore...).
Last edited by Dougal on Sun 12 Apr 2009, 09:32, edited 1 time in total.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
dinky
Posts: 699
Joined: Sat 19 Jan 2008, 23:39

#16 Post by dinky »

Yay! Thank you so much Dougal, I'm really excited about this. Just got home a little while ago, so after I recover from my trip I'll give it a go. Was driving from 5:30am til about 6pm last night, and sooooo nice to relax. Will let you know how I go.
~dinky

User avatar
dinky
Posts: 699
Joined: Sat 19 Jan 2008, 23:39

#17 Post by dinky »

Hi Dougal, ok, I've tried your updated hotpup. I've used it both as a pet package, and directly replacing each file after uninstalling the original version from gray. The main issue is it doesn't give icons for all of my drives. I have 6 partitions, and I only have icons for 3. The other ones are listed correclty, but are only represented on the desktop by file icons. I click on them and they work fine, but there are no green dots; it seems they are being recognized as text files(which basically means no icons) by xfce.... any thoughts on this? I can give them the correct icons, and then they work perfectly(green dot when mounted), but I need to edit them by hand each time I log into X. The other three partitions are fine, as are any other drives I plug into the computer.

Hotpup is recognizing when I add a disc in the cd/dvd drives, but not whether it is a cd or dvd. They are all dvd's by default. The other query I had was with the menu for the hotpup used in puppy 4, how would I edit this one to get the same features? In puppy 4 there are options for where you would like the hotpup icons to appear... bottom of screen, right of screen, left, etc. I would find this very useful. How would I go about creating this?

Thanks very much for your time, I think hotpup's a great program. Cheers!
~dinky

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#18 Post by Dougal »

dinky wrote:The main issue is it doesn't give icons for all of my drives. I have 6 partitions, and I only have icons for 3. The other ones are listed correclty, but are only represented on the desktop by file icons. I click on them and they work fine, but there are no green dots; it seems they are being recognized as text files(which basically means no icons) by xfce....
any thoughts on this? I can give them the correct icons, and then they work perfectly(green dot when mounted), but I need to edit them by hand each time I log into X. The other three partitions are fine, as are any other drives I plug into the computer.
You mean that the text files in /root/desktop for those devices have no "Icon" entry? Or that it exists only as "Icon="?
Does it happen for some particular type of icon (like a usbpendrive)?
I added some code for detecting usb-floppies, so I might have made a typo somewhere and the icon for some type isn't set...
Hotpup is recognizing when I add a disc in the cd/dvd drives, but not whether it is a cd or dvd. They are all dvd's by default.
What mode do you use it at? Do you have the cd icon permanently on the desktop, or only added when a disc is inserted into the drive?
If the icon is always there, then it is just set to the type of drive you have, but if it's added only on disc insertion, it should check to see what kind of disc it is...
The other query I had was with the menu for the hotpup used in puppy 4, how would I edit this one to get the same features? In puppy 4 there are options for where you would like the hotpup icons to appear... bottom of screen, right of screen, left, etc. I would find this very useful. How would I go about creating this?
Gray ripped all that code out, I assume since it's not applicable.
With xfce, all you do is create a file in /root/desktop and xfdesktop/Thunar takes care of displaying the icon for it -- wherever it decides to (you might be able to set it in the xfce settings, though).
With Rox, I can actually tell it where I want the icon to go...
(you could check the xfce/thunar documentation and see if it might be possible to specify the location for the icon... I don't know.)
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
dinky
Posts: 699
Joined: Sat 19 Jan 2008, 23:39

#19 Post by dinky »

HI Dougal, thanks for your reply. For the dektop entries that have no icons, the icon entryis:

Code: Select all

Icon=/etc/hotpup/icons/harddisk_mount/ed.png
This is for home, hdb3 and hdb5. Neither of the last two are set to be mounted by default.
The other partitions, which are not mounted, are hda1, hda5, and hda6. These are fine.

I've got the mode set to "perm", so an icon appears for cd's and dvd's when they are detected. This is always listed as either "dvd" or "dvd2", depending on which drive I put them in. This is the same for putting in cd's.

Thanks for letting me know why the code for placing the icons on the desktop is missing in xfce. I'm not sure how I'd get efce to do this... I'll look into it. Thanks again,
~dinky

User avatar
prit1
Posts: 542
Joined: Fri 04 Jan 2008, 00:10
Location: Los Angeles

#20 Post by prit1 »

@Dougal:
Firstly thank you for the Hotpup.

We are using the older version that comes with Dingo in Macpup. When someone tries to change the hotpup settings, it gives the error:
Sorry, failed to apply new mode. Restoring old

Can you please help me find out how to prevent this error?

Thanks in advance.
[url=http://macpup.org][b]Macpup - The beauty of linux[/b][/url] [b] | [/b] [url=http://pritlog.com/][b]Pritlog - Simple blog app[/b][/url]

Post Reply