Do you sometimes need to check if your laptop with hybrid graphics is currently using Intel or Nvidia graphics? In GNOME there was an extension for that. Out of boredom I took a look at its code, which resulted in a short script, that can be used in the Tint2 panel.
Save this as ~/scripts/tint2_bbswitch_status.sh
and make executable:
#!/bin/bash
bb_status=$(cat /proc/acpi/bbswitch | awk -F ' ' '{print $2}')
printf '%8s\n%8s ' "Nvidia" "$bb_status "
Then add the executor to the `~/.config/tint2/tint2rc’ file:
#-------------------------------------
# Executor 2
execp = new
execp_command = ~/scripts/tint2_bbswitch_status.sh
execp_interval = 2
execp_has_icon = 0
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 0
execp_tooltip =
execp_lclick_command =
execp_rclick_command =
execp_mclick_command =
execp_uwheel_command =
execp_dwheel_command =
execp_font_color = #ffffff 100
execp_padding = 0 0
execp_background_id = 5
execp_centered = 1
execp_icon_w = 0
execp_icon_h = 0
Here you are: