various public domain hacks

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
nosystemdthanks
Posts: 703
Joined: Thu 03 May 2018, 16:13
Contact:

various public domain hacks

#1 Post by nosystemdthanks »

[note that im not the one that said this makes puppy "better", but i suppose that will help people figure out what the topic is.] i got a laptop without a working ethernet port. when i got it, it was running windows 10 and had endless os installed-- but that was tied into the windows installation.

having tried endless os, an android-like "appliance" distribution, i wanted to put a more traditional distro on there which wouldnt make me jump through so many hoops (one i could play with and tinker with freely.)

i have a bootable trisquel 9 usb which id modified to replace systemd with upstart, but that was an experiment and i didnt want to install that. so i copied the puppy tahr iso to the usb, used trisquel to dd puppy onto the hard drive, booted from the hard drive to ram and did a frugal installation onto the same machine. thanks to frugal ive also got puppy xenial and the latest refracta on there-- all without making a bootable usb of anything now running on there.

but im not a fan of save files, and i am a fan of "remastering" the sfs from livecds. until ive got that up and running, here are some hacks ive put in a single script so that when puppy loads, i can have it the way i want. ill use this thread when there is stuff like this i want to add, a lot of this stuff isnt copyrightable but just to be sure this is all licensed creative commons cc0 1.0 (public domain) so you can use it freely in a script or a howto or whatever.

for a lot of this stuff, there is a better or cleaner way to do it. my objective here is simply to change a setting or remove, alter or add something in a quick and dirty way.


suspend

Code: Select all

sync ; sleep 2 ; echo mem > /sys/power/state
works on the only machine im using puppy on, sleep 2 gives me time to minimise all applications, i usually run sync before using any suspend tool.


moving the taskbar to the top

the setting for this is in /root/.jwmrc-tray so i just changed it using jwmdesk manager, copied .jwmrc-tray to a partition and when i run my reconfigure script, it copies .jwmrc-tray to /root and (later) runs jwm -restart to let the change take effect.

some changes like this can be accomplished with nothing but grep or sed, but for this setting i thought it was more trivial to just make a copy of the modified file.


changing the brightness

because i dont use desktop environments, opting for simple window managers like jwm or icewm, i find the brightness keys on a laptop often dont work.

xbacklight has served me well when its available, but its not in puppy. xrandr has a --brightness feature but if your backlight is very bright, it will usually only change the colours in front of it which has limited usefulness.

since xbacklight was not installed, and copying a modern version of it to an older pup like tahr is likely to be tedious and even fail due to dependencies, i decided it was less trouble to run find /sys | grep for "rightnes" and try to find an option that would be specific to the laptop. i found one:

Code: Select all

echo 700 > $(find /sys/devices/ -type f | grep intel_backlight/brightness | tail -1)
so that turns the ridiculously bright backlight down, without any programs compiled against dependencies that arent present. save your work before you play with these settings.


stop barking

Code: Select all

rm $(find / | grep 2barks)
this is only useful if you remaster the puppy sfs, or if (like with tahr) your version of puppy waits until after you close the first dialog before the sound plays (in older versions of puppy, it barks before the user does anything.)


change the wallpaper

here i just copy a file to /usr/share/backgrounds/default.png and restart the rox pinboard. to stop it:

Code: Select all

kill $(pidof ROX-Filer)
to restart:

Code: Select all

/usr/local/apps/ROX-Filer/ROX-Filer -p /root/Choices/ROX-Filer/PuppyPin

remove the puppy icon from the menu

i dont typically like any icon for this, but i prefer a generic one. so i just rm /usr/share/pixmaps/puppy/puppy.svg and then run:

Code: Select all

jwm -restart

remove the clock

it is necessary to restart jwm after this, but i dont like a clock on the taskbar. also without an internet connection, the clock is often set wrong. setting it is an option of course, but since i have enough clocks and i can "meta-t date [enter]" whenever it pleases me:

Code: Select all

cp /root/.jwmrc-tray jwmrctray 
cat jwmrctray | -v lock > /root/.jwmrc-tray
often i use sed for this instead of a second file, but on puppy (and only puppy, perhaps because busybox) ive had very rare instances where sed was unreliable. so i dont rely on it on puppy. this was faster and it works.


remove xlock

im picky about what screen lock i use, and the touchscreen doesnt play nicely with puppy tahr (or xenial) so i just removed the program like this: rm /usr/local/apps/Xlock/AppRun


remove the top row of icons from the pinboard (desktop)

icon locations are stored in /root/Choices/ROX-Filer/PuppyPin and the top row in tahr consists of only lines where y="32" or y="36" so to remove those:

Code: Select all

cp /root/Choices/ROX-Filer/PuppyPin /root/Choices/ROX-Filer/PuppyPin2 ; cat /root/Choices/ROX-Filer/PuppyPin2 | grep -v 'y="32"' | grep -v 'y="36"' > /root/Choices/ROX-Filer/PuppyPin
it is necessary to restart the pinboard after making this change, as was done when changing the wallpaper.


adding some programs

as long as im doing this other stuff, i copy fig, figplus and the alex shell to /usr/bin and chmod +x them so theyre available when i use puppy.


getting rid of the dialogs

Code: Select all

kill $(pidof gtkdialog)

jwm -restart
you want to put jwm -restart near the end of the script so that it doesnt restart it more than it has to.


poweroff without prompts

"busybox poweroff" works.

if you want to make it permanent and dont plan to use savefiles in the future, this should work:

Code: Select all

echo busybox poweroff > /sbin/poweroff
[color=green]The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.[/color]

Post Reply