swapfile manager

Core libraries and systems
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

swapfile manager

#1 Post by jpeps »

Wizard for creating swap files, with user entry for size and name/location. Default is 100M. Management includes swap on/off, and info button which displays free memory. Main window displays status and size of file.

Notes:
Version 1.2.1. Input KB; default set at 100M; edit path.


Version 2.0: Input Megs vs KB, set default at 512M, /mnt/home/swapfile. Make sure you have sufficient space, or change path/size.
Version3.0: Added Swappiness selection (decrease swappiness for computers with lots of ram)
Version 3.5 Added option to save settings; refresh labels to settings; friendlier window management, etc.


Version 4.0 Uses gtimer process widget (if installed)
Version 4.1 Better integration of gtimer
Version 4.2 Defaults to gtkdialog4, but reverts to gtkdialog3 if not present.
Added version name to work with pet uninstaller.
Version 4.5 Save settings to /etc/rc.d/init.d/swapmanager vs /etc/profile.local
Version 4.6 Remove annoyance test bug
Attachments
gtimer-2.0.pet
process widget-- requires gtkdialog =>0.7.21
(1.19 KiB) Downloaded 2301 times
swapfilemanager-4.6.pet
Version 4.6 Input MB
(4.11 KiB) Downloaded 3962 times
swapfilemanager.pet
Version 1.2.1 Input KB
(2.76 KiB) Downloaded 2661 times
swapfilemanager.png
(22.85 KiB) Downloaded 8715 times
Last edited by jpeps on Wed 21 Aug 2013, 05:02, edited 19 times in total.

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

Re: swapfile manager

#2 Post by RetroTechGuy »

jpeps wrote:Wizard for creating swap files, with user entry for size and name/location. Default is 100M. Management includes swap on/off, and info button which displays free memory. Main window displays status and size of file.
Excellent jpeps! I'll give it a try (just the tool we need for newbies!).

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#3 Post by abushcrafter »

Some errors:

Code: Select all

# swapfilemanager
swapoff: can't stat '/mnt/sda2/swapfile': No such file or directory
EXIT="OK"
# swapfilemanager
swapon: can't stat '/mnt/sda2/swapfile': No such file or directory
EXIT="OK"
# swapfilemanager
dd: opening `/mnt/sda1/swapfile': No such file or directory
/mnt/sda1/swapfile: No such file or directory
FILE="/mnt/sda1/swapfile"
KB="102400"
EXIT="OK"
#
Can't switch swap off. Does not remember swap file path.

Good .desktop file:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=Swapfile Manager
Icon=woodendrive.xpm
Comment=
Exec=swapfilemanager
Terminal=false
Type=Application
Categories=X-SystemMemory
Last edited by abushcrafter on Wed 11 Aug 2010, 15:34, edited 1 time in total.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#4 Post by jpeps »

Thanks for the the support and testing. Uploaded Ver 1.1, which should
fix late night coding bloopers.

Edit: Fixed the menu.....

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#5 Post by abushcrafter »

Haven't found any new bugs. Seems that this is a new useful app :). Now for a feature request :). Can you please add the feature for switching on and off a swap partition. Thanks for you work so far.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#6 Post by jpeps »

abushcrafter wrote:Haven't found any new bugs. Seems that this is a new useful app :). Now for a feature request :). Can you please add the feature for switching on and off a swap partition. Thanks for you work so far.
swapon/swapoff -a ?? (I don't have one to test). My original idea was to just handle swap files.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#7 Post by abushcrafter »

jpeps wrote:
abushcrafter wrote:Haven't found any new bugs. Seems that this is a new useful app :). Now for a feature request :). Can you please add the feature for switching on and off a swap partition. Thanks for you work so far.
swapon/swapoff -a ?? (I don't have one to test). My original idea was to just handle swap files.
Ok, never mined it's not a must have. It's your app and I will let that be. I also don't know how to swap on/off just a swap partition any way.

Thanks for the swapon command. Been meaning to find out what command to use to switch swap on.

Now to add this to my puplet, A Powerful Puppy (appup or app).
[Edit] Here is a better menu category: "X-SystemMemory". You also haven't done the "pet.specs" part of the PET properly.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#8 Post by jpeps »

abushcrafter wrote: [Edit] Here is a better menu category: "X-SystemMemory". You also haven't done the "pet.specs" part of the PET properly.
I don't have that category in stardust, and don't see it in petspec either.


For some reason, dir2pet bypassed the petspec gui and I got an empty pet.specs file (although package uninstalls OK). However, I see swapfilemanager appended to .user-installed-packages:

Code: Select all

  swapfilemanager||||System|||swapfilemanager.pet|||
Here's the output if I run petspec manually:

Code: Select all

 swapfilemanager-1.2|swapfilemanager|1.2||System|4.0K|/usr/local/bin|swapfilemanger.pet||Swap File Manger||||
edit: Here's the dir2pet error when attempting to load GUI window:

Code: Select all

** ERROR **: gtkdialog: Error in line 16, near token '</default>': syntax error

aborting...
Strange....GUI loads fine with "petspec"

NOTE: dir2pet issue moved to :
http://murga-linux.com/puppy/viewtopic.php?t=52033

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#9 Post by abushcrafter »

jpeps wrote:
abushcrafter wrote: [Edit] Here is a better menu category: "X-SystemMemory". You also haven't done the "pet.specs" part of the PET properly.
I don't have that category in stardust, and don't see it in petspec either.
You do. A list of category's is at "/etc/xdg/menus/hierarchy".
jpeps wrote:For some reason, dir2pet bypassed the petspec gui and I got an empty pet.specs file (although package uninstalls OK). However, I see swapfilemanager appended to .user-installed-packages:

Code: Select all

  swapfilemanager||||System|||swapfilemanager.pet|||
Here's the output if I run petspec manually:

Code: Select all

 swapfilemanager-1.2|swapfilemanager|1.2||System|4.0K|/usr/local/bin|swapfilemanger.pet||Swap File Manger||||
edit: Here's the dir2pet error when attempting to load GUI window:

Code: Select all

** ERROR **: gtkdialog: Error in line 16, near token '</default>': syntax error

aborting...
Strange....GUI loads fine with "petspec"
I have had that error before. Not sure what I did to fix it. I think I launched the Package Database Entry Creator (petspec). The menu entry is "create pkg db entry" in the "Utility" sub menu btw.I put the generated "pet.specs" into my PET and then the dir2pet script worked. It might have been a newer version of petspec which has a fix for this bug, I think. Which Is the one I have been using currently.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#10 Post by jpeps »

Abushcrafer: Let's move the dir2pet issue over to
http://murga-linux.com/puppy/viewtopic.php?t=52033

I ran the updated version with same issue, and posted petspec result above. Thanks!

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#11 Post by abushcrafter »

jpeps wrote:Abushcrafer: Let's move the dir2pet issue over to
http://murga-linux.com/puppy/viewtopic.php?t=52033

I ran the updated version with same issue, and posted petspec result above. Thanks!
Ok. Just saw you post before you posted here :wink:.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#12 Post by jpeps »

Uploaded version 1.2.1 with fixed pet.specs and category as suggest by abushcrafter (Thanks!)

abushcrafter: I had to run dir2pet with manually generated petspec file inside to create proper pet.spec.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#13 Post by abushcrafter »

jpeps wrote:abushcrafter: I had to run dir2pet with manually generated petspec file inside to create proper pet.spec.
That was it.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#14 Post by jemimah »

I've added this to Puppeee and Fluppy. Thanks!

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#15 Post by sc0ttman »

How does this differ from this one - http://www.murga-linux.com/puppy/viewtopic.php?t=56431?

Everyone seems a lot more interested in this!
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#16 Post by jemimah »

I think it's because I'm not sure why I need a scratch file, but the purpose of a swap file is more obvious.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#17 Post by sc0ttman »

jemimah wrote:I think it's because I'm not sure why I need a scratch file, but the purpose of a swap file is more obvious.
Isn't is just semantics? Don't they create the same kind of file?
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#18 Post by jemimah »

A swap file adds virtual memory. A scratch file is like an additional save file, yes?

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#19 Post by sc0ttman »

jemimah wrote:A swap file adds virtual memory. A scratch file is like an additional save file, yes?
Aha.. that must be it. Very succinct.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#20 Post by RetroTechGuy »

jemimah wrote:A swap file adds virtual memory. A scratch file is like an additional save file, yes?
The one thing I didn't like about the tool was that it, by default, did not name the file pupswap.swp (IIRC that's the default pup swap filename).

Also, I think the default size was a little strange (did I miss read it, or was it 10 MB?) -- and it would probably be better if it used MB as the size measurement (I doubt anyone wants to fine-tune the swap size to kilobytes, or bytes...).

I'm guessing that if someone is adding a swap file, they probably want 256MB or 512 MB, so I would be inclined to make one of those sizes the "default" choice (the user can still change the size manually).

Otherwise, the tool seemed to work fine (a couple weeks back, I converted another Windows user to Puppy -- too little RAM for Windows to run properly, but Puppy did just fine, with a swap file :D )

Post Reply