3

I'm trying to figure out how to automate the setup of a raspberry pi 3B / 3B+ from its default settings to my customized needs via a bash file on a flash drive. I'm using the standard desktop version. Kernel version: 4.19, Version: February 2020

What I cannot find any help with is how to control and change the Panel Preference (i.e. wifi, bluetooth, date & time, cpu usage, etc.) from the terminal. All of the articles I've found show how to complete this task by selecting the taskbar, Selecting "Add / Remove Panel Items", and then manually make the changes. How can this be automated?

For context of what I have automated thus far for the setup, I've added the code below. If there are improvements to be made or if I'm going to narrow of a direction, feel free to point them out.

#!/bin/bash

# Ensuring there is an internet connection
sensible-browser https://www.google.com

# Update Raspberry Pi software
sudo apt update; sudo apt full-upgrade -y; sudo apt autoremove -y

# Installing Libre Office and auto updates
sudo apt install libreoffice -y; sudo apt install libreoffice -y
sudo apt install unattended-upgrades -y;
echo 'Unattended-Upgrade::Origins-Pattern{
    // Fix missing Raspbian sources.
    "origin=Debian,codename=${distro_codename},label=Debian";
    "origin=Debian,codename=${distro_codename},label=Debian-Security";
    "origin=Raspbian,codename=${distro_codename},label=Raspbian";
    "origin=Raspberry Pi Foundation,codename=${distro_codename},label=Raspberry Pi Foundation";
};' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-raspbian

# Setting up Panel Applets <<<----------------- Need help here
# [Add cpu monitor usage with percent used]
# [Update clock format from "%r" to "%h %d, %Y | %I:%M %p"]

# Adding Background Pictures
sudo cp -r ./Pictures/. /usr/share/rpd-wallpaper

# Setting Default Background Picture - Visual signal the setup is complete.
pcmanfm --set-wallpaper /usr/share/rpd-wallpaper/OfficalBG.png

# Restarting the system to fully apply changes
reboot

1 Answer 1

2

Well, it took me a while to find the it, but the file I was looking for is called panel, located under ~/.config/lxpanel/LXDE-pi/panels. It also looks like this file should be treated with care as this file controls the taskbar as well as everything on it.

# lxpanel <profile> config file. Manually editing is not recommended.
# User preference dialog in lxpanel to adjust config when you can. 

Global {
  ...
}
Plugin {
  ...
}
...
Plugin {
  type=dclock
  Config {
    ClockFmt=%R
    TooltipFmt=%A %x
    ...
  }
}
...
Plugin {
  type=ptbatt
  Config {
  }
}
....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.