Fatdog64 Contributed Packages and SFS

Talk about and post software packages known to work or packaged for Puppy.
Message
Author
step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#381 Post by step »

[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
dr. Dan
Posts: 96
Joined: Mon 20 Apr 2015, 17:45
Location: Oregon, U.S.A.

Battery info applet

#382 Post by dr. Dan »

Greetings all,
I've wanted to get more information from the battery icon in the tray for a long time, so I started adding to the fatdog-battery-applet.sh script to make it more to my liking. I don't know that much about shell scripting, but I know more now than before. The script attached below seems to work fairly well. I've tried it on Dell, Gateway/Acer, HP, and Toshiba laptops. I'd appreciate any additional brand-based evaluation.

The script wants configuration files lowbatt, criticalbatt and shutdown in ~/.config/battery_level/, and refers to an as-yet-nonexistant fatdog-power-settings.sh which I envision as being able to set a variety of battery and power usage parameters. Since it doesn't yet exist, sit ignores it.

The code could be more elegant, and I plan to improve it, or incorporate any suggestions I receive, over time. For example, I'll eventually want to simplify the tooltip section, perhaps use a single configuration file, and improve the battery health presentation.

If it is successful and practical, it could be packaged with preset parameters in the appropriate locations, but I haven't figured that bit out yet.

Any feedback is appreciated.

Dan
Attachments
draining.png
(11.73 KiB) Downloaded 240 times
Charging.png
(14.3 KiB) Downloaded 238 times
fatdog-battery-applet-2.sh.tar.gz
(2.53 KiB) Downloaded 132 times

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#383 Post by step »

Dan, you have a good plan in mind. I can give you some feedback and hopefully someone else will add more.
In the interest of keeping this long thread right on its topic please consider opening a new thread focused on discussing the battery script.

I would change your modifications between the lines that start with ACTION= and BATTERY_SVG= as follows

Code: Select all

 LOWBATT=15 CRITICALBATT=5 SHUTDOWN=2
 LOWBATT_ACTION='batt-low.sh low'
 CRITICALBATT_ACTION='batt-low.sh critical'  # dr. Dan
 CLICK_ACTION="Xdialog --left --title \"Battery Info\" --msgbox \"\$(cat $POWER_PATH/*/uevent | sed 's/=/:    /')\" 0 0"
 RIGHT_CLICK_ACTION="fatdog-power-settings.sh" # configuration GUI
 [ -e /etc/battery.conf ] && . /etc/battery.conf # configuration
 [ -e $FATDOG_STATE_DIR/battery.conf ] && . $FATDOG_STATE_DIR/battery.conf # user overrides --dr. Dan
 
This is a "standard" way to add user overrides to the system configuration.
1) Provide in-script defaults. That's LOWBATT=15 ...
2) Read system configuration. . /etc/battery.conf
3) Read user overrides to the system configuration. . $FATDOG_STATE_DIR/battery.conf
I replaced ~/.config/battery_level/ with $FATDOG_STATE_DIR/ because $FATDOG_STATE_DIR is guaranteed to exist and it's where fatdog-bla-bla.sh (system) scripts normally expect to find user configuration files. This is preferred Fatdog64 usage, not policy. You can use ~/.config/some_dir even in this case, if you prefer. And you should for non-Fatdog64-system scripts. In that case I would write this stanza:

Code: Select all

 USER_CONFIG=${XDG_CONFIG_HOME:-$HOME/.config}/battery_level
 mkdir -p "${USER_CONFIG%/*}"
 
which ensures Desktop.org (XDG) compliance and creates the path if needed. On well-configured systems, you can simplify to

Code: Select all

 USER_CONFIG=$HOME/.config/battery_level/battery.conf
 mkdir -p "${USER_CONFIG%/*}"
 
I noticed several lines that follow this pattern:

Code: Select all

 variable=$(cat /path/to/file | head -n 1 2>/dev/null)
 
This can almost always be improved to another pattern:

Code: Select all

 unset variable  # or set it to a default value
 [ -s /path/to/file ] && read variable < /path/to/file
 
This code runs entirely inside the shell without starting external programs. It's faster and less error-prone.
Last edited by step on Thu 21 May 2020, 15:44, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
dr. Dan
Posts: 96
Joined: Mon 20 Apr 2015, 17:45
Location: Oregon, U.S.A.

#384 Post by dr. Dan »

Thank you step, I'll look into all of that. If you compare this to the original, you'll see how dependent I have been of the original. :oops: The technical details will help in other efforts as well.

Dan

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#385 Post by step »

dr. Dan wrote:Thank you step, I'll look into all of that. If you compare this to the original, you'll see how dependent I have been of the original.
That's a good thing. After all, the original script is battle-tested, something to leverage.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#386 Post by don570 »

designed for recording a radio broadcast...
rewritten to kill arecord properly

download
23k
baconrecorder-5.0-x86_64.txz


https://drive.google.com/open?id=1-SGyO ... 4jLqbgR92r
--------------------------------------------

jake29
Posts: 253
Joined: Fri 24 Jul 2015, 17:47

Nvidia Proprietary Driver (440.82)

#387 Post by jake29 »

Here is the latest Nvidia Proprietary Driver (440.82), compatible with Kernel 4.19.92. Seems to work fine for me.

Filename: nvidia-440.82-810.sfs
File Size: 167mb
Download: google drive

Post Reply