>source : http://crunchbanglinux.org/forums/topic/9770/fbpanel-no-need-for-conky-long-read/
Since Fbpanel is well documented http://fbpanel.sourceforge.net/docs.html, I’m just going right to the customization part:
The linux menu (applications, end session, etc):
Plugin {
type = menu
config {
#Icon for the menu:
image = /home/slug45/.config/fbpanel/icons/start-here.svg
systemmenu {
}
separator {
}
item {
name = Reboot
icon =
action = slug_reboot
}
item {
name = Shutdown
icon =
action = slug_shutdown
}
}
}
slug_reboot is a silly script to reboot the computer using HAL, so no sessions needed:
dbus-send --system --print-reply
--dest="org.freedesktop.Hal"
/org/freedesktop/Hal/devices/computer
org.freedesktop.Hal.Device.SystemPowerManagement.Reboot
You just need to create/copy it to /usr/bin and give it run permission (chmod +x _FILE_) as root.
For shutting down the computer:
(dbus-send --system --print-reply
--dest="org.freedesktop.Hal"
/org/freedesktop/Hal/devices/computer
org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown)
You can use
gdm-control --shutdown && openbox --exit
and
gdm-control --reboot && openbox --exit
instead but you have to run a session for that (I don’t). So hal was the way I found for rebooting/shutting down the computer.
The launcher is just:
Plugin {
type = launchbar
config {
button {
icon = NAME_OF_THE_ICON
tooltip = THE_TOOLTIP_YOU_WANNA_USE_FOR_MOUSE_OVER
action = NAME_ROUTE_OF_THE_PROGRAM_OR_COMMAND_LINE
}
button {
icon = NAME_OF_OTHER_ICON
tooltip = THE_TOOLTIP_YOU_WANNA_USE_FOR_MOUSE_OVER
action = NAME_ROUTE_OF_OTHER_PROGRAM_OR_OTHER_COMMAND_LINE
}
...you keep copy/pasting this for each application and don't forget to add:
}
This is how you get a space between icons:
Plugin {
type = space
config {
size = 13
}
}
The taskbar with only icons, no captions:
Plugin {
type = taskbar
expand = true
config {
ShowIconified = true
ShowMapped = true
ShowAllDesks = true
tooltips = true
IconsOnly = true
MaxTaskWidth = 20
}
}
The System tray:
Plugin {
type = tray
}
The system- updater icon:
Plugin {
type = launchbar
config {
button {
image = /home/slug45/.config/fbpanel/icons/system-upgrade.png
tooltip = update-manager
action = update-manager
}
}
}
This checks fo
r updates and shows the number of available updates to the right of the system-updater icon:
r updates and shows the number of available updates to the right of the system-updater icon:
Plugin {
type = genmon
config {
Command = echo $(aptitude search "~U " | wc -l | tail)
PollingTime = 2
TextSize = large
TextColor = #dd8436
}
}
The Gmail icon:
Plugin {
type = launchbar
config {
button {
image = /home/slug45/.config/fbpanel/icons/gmail.png
tooltip = firefox http://mail.google.com
action = firefox http://mail.google.com
}
}
}
If you click it, it will open firefox with mail.google.com (that’s all).
This will run a script to check for mails at gmail and show if you got new mails or not:
Plugin {
type = genmon
config {
Command = echo $(slug_gmail | grep 'mail' | cut -c8-8)
PollingTime = 2
TextSize = large
TextColor = #dd8436
}
The script it calls to is:
#!/bin/bash
atomlines=`wget -T 3 -t 1 -q --secure-protocol=TLSv1
--no-check-certificate
--user=GMAIL_USERNAME --password=GMAIL_PASSWORD
https://mail.google.com/mail/feed/atom -O -
| wc -l`
echo -e "rc"
[ $atomlines -gt "8" ]
&& echo -e " mail Y c"
|| echo -e " mail - c"
Just change GMAIL_USERNAME and GMAIL_PASSWORD and again, save it to /usr/bin and give it run permission, as root. You can use whatever script/application you want, this just works to me. If you got mail, it will show a “Y” to the right of the gmail icon or a “-” if you don’t have new mail.
This is for the cpu temperature, core 1 (You might need to tweak this.):
Plugin {
type = genmon
config {
Command = echo " "$(sensors | grep 'temp1' | cut -c15-16)"º"
PollingTime = 2
TextSize = small
TextColor = #c8c8c8
}
}
Core 2:
Plugin {
type = genmon
config {
Command = echo $(sensors | grep 'temp3' | cut -c15-16)"º"
PollingTime = 2
TextSize = small
TextColor = #c8c8c8
}
}
The cpu graph:
Plugin {
type = cpu
config {
Color = #c8c8c8
}
}
The mem graph:
Plugin {
type = mem
config {
ShowSwap = false
}
}
The network graph:
Plugin {
type = net
config {
interface = eth0
TxLimit = 600
RxLimit = 1200
TxColor = red
RxColor = #dd8436
}
}
This will show the % of volume of the soundcard, you need to tweak this depending in your hardware or just don’t use it and use another software like volwheel, etc.
Plugin {
type = genmon
config {
Command = echo $(amixer --card 1 sget 'PCM' | grep "Front Left:" | sed "s/^.*[([0-9]*)"%"].*/1/")"%"
PollingTime = 2
TextSize = medium
TextColor = #dd8436
}
}
This will show if the sound card is muted or not [on] = unmuted; [off] = muted:
Plugin {
type = genmon
config {
Command = echo $(amixer --card 1
sget 'PCM' | grep "Front Left:" | sed "s/.* //")
PollingTime = 2
TextSize = large
TextColor = #c8c8c8
}
}
This will show the up time:
Plugin {
type = genmon
config {
Command = echo " "$(uptime | grep 'up' | cut -c14-18)" /"
PollingTime = 2
TextSize = small
TextColor = #dd8436
}
}
And this is for the clock:
Plugin {
type = dclock
config {
ShowSeconds = false
HoursView = 24
Action =
color = #c8c8c8
}
}
Little bonus. This will show the kernel version:
Plugin {
type = genmon
config {
Command = echo " "$(uname -r)"-"
PollingTime = 2
TextSize = small
TextColor = #c8c8c8
}
}
You might need to tweak some of the sections depending on your hardware (like the temps and the volume parts), but the rest should work.
I hope you like it and let me know if you got more ideas!.
PD: Needed dependencies:
Hal
sudo apt-get install hal
Sound
sudo apt-get install alsa-base
Update Manager
sudo apt-get install update-manager
CPU Sensors
sudo apt-get install lm-sensors
Run
sudo sensors-detect
and answer Y to all to install it.